mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Page:
Mozlandia gfx
Pages
Adding a new WebIDL binding
Alternative Logo Proposals and Related Swag
Asynchronous WebAssembly compilation project
Austin Oxidation
Autogeneration of style structs
Basic SVG support project
Beginner's guide to rebasing and squashing
Benchmarking
Benchmarks
Bots
Browser Engine Research
Build Errors FAQ
Buildbot administration
Building for Android
Building for Magic Leap
Building for UWP
Building on ARM desktop Linux
Building
CI Services we use
CSS parse error reporting
CSSOM student project
Canvas rendering project
Cargo upgrade service project
Code rust concurrency
Code Review
Code of Conduct
Coding standards
Compiler upgrade recipes
Compositor Layer Design
Contributing
Control Servo using WebDriver
Creating and viewing WARC web archives in Servo
Creating new OpenSSL Windows binary distributions
Cross compiling from linux to mac
Crowbot
Css selector matching meeting 2013 07 19
DOM Design
DOM documentation
DOM missing pieces
Debugging JS web compat issues
Debugging and editing tools
Debugging
Design
Developer tools student project
Devtools CSS errors
Devtools plans
Devtools
Diagnosing SpiderMonkey JIT issues
Eric Atkinson visit 2013 09 10
Events and sundry
Expand HTTP request response monitoring
Fetch improvement project
Firefox Reality release notes
FirefoxReality build
Firewall setup for servo master1
Focus student project
Form validation student project
GSoC project brainstorming
Garbage collected DOM
Getting started with layout
GitHub Labels
Github & Critic PR handling 101
Github workflow
Glossary
Governance
Graphics toolkit integration
HTML parser improvement project
HTMLElement binding conversion
HTTP archive support project
HTTP library requirements
Hawaii Rooting
High priority content for layout
Highfive
HoloLens 2 test plan
Home
How to generate GStreamer binaries for CI
Image load conformance student project
Image maps project
Implement HTML charset parsing project
Implement ImageBitmap project
Implement missing WebAudio automation student project
Implement support for missing XMLHttpRequest APIs
Implement worker modules
Implementing a web standard (RGSoC)
Improve specification conformance of unicode bidi library
Incremental flow tree construction
Infrastructure
Integrate xml5ever
Intern project brainstorming
Intern projects
JS objects, wrappers, and cross origin concerns 2013 08 07
Layout 2020
Layout Overview
Layout resources
Layout revamp ideas
Leo meyerovich visit 2013 07 22
Linux sandboxing
London Oxidation
London Security
Meeting 2014 10 27
Meeting 2014 12 08
Meeting 2012 02 08
Meeting 2012 02 16
Meeting 2012 07 20
Meeting 2013 04 01
Meeting 2013 04 15
Meeting 2013 04 22
Meeting 2013 04 29
Meeting 2013 05 06
Meeting 2013 05 13
Meeting 2013 05 20
Meeting 2013 06 03
Meeting 2013 06 10
Meeting 2013 06 14
Meeting 2013 06 17
Meeting 2013 06 24
Meeting 2013 07 01
Meeting 2013 07 15
Meeting 2013 07 22
Meeting 2013 07 29
Meeting 2013 08 05
Meeting 2013 08 12
Meeting 2013 08 19
Meeting 2013 09 09
Meeting 2013 09 16
Meeting 2013 09 23
Meeting 2013 09 30
Meeting 2013 10 14
Meeting 2013 10 21
Meeting 2013 10 28
Meeting 2013 11 04
Meeting 2013 11 18
Meeting 2013 11 25
Meeting 2013 12 02
Meeting 2013 12 09
Meeting 2013 12 16
Meeting 2014 01 06
Meeting 2014 01 13
Meeting 2014 01 21
Meeting 2014 01 27
Meeting 2014 02 03
Meeting 2014 02 10
Meeting 2014 02 24
Meeting 2014 03 10
Meeting 2014 03 17
Meeting 2014 03 24
Meeting 2014 03 31
Meeting 2014 04 07
Meeting 2014 04 14
Meeting 2014 04 21
Meeting 2014 04 28
Meeting 2014 05 05
Meeting 2014 05 13
Meeting 2014 05 19
Meeting 2014 06 09
Meeting 2014 06 17
Meeting 2014 06 23
Meeting 2014 06 30
Meeting 2014 07 07
Meeting 2014 07 14
Meeting 2014 07 21
Meeting 2014 07 29
Meeting 2014 08 04
Meeting 2014 08 11
Meeting 2014 08 12
Meeting 2014 08 18
Meeting 2014 08 25
Meeting 2014 09 08
Meeting 2014 09 15
Meeting 2014 09 22
Meeting 2014 09 29
Meeting 2014 10 06
Meeting 2014 10 13
Meeting 2014 10 20
Meeting 2014 11 10
Meeting 2014 11 17
Meeting 2014 11 24
Meeting 2014 12 15
Meeting 2015 01 05
Meeting 2015 01 12
Meeting 2015 01 26
Meeting 2015 02 09
Meeting 2015 02 23
Meeting 2015 03 02
Meeting 2015 03 16
Meeting 2015 03 30
Meeting 2015 04 06
Meeting 2015 04 13
Meeting 2015 04 27
Meeting 2015 05 04
Meeting 2015 05 11
Meeting 2015 05 18
Meeting 2015 06 01
Meeting 2015 06 08
Meeting 2015 06 15
Meeting 2015 07 06
Meeting 2015 07 13
Meeting 2015 07 27
Meeting 2015 08 10
Meeting 2015 08 17
Meeting 2015 08 24
Meeting 2015 08 31
Meeting 2015 09 14
Meeting 2015 09 21
Meeting 2015 09 28
Meeting 2015 10 05
Meeting 2015 10 12
Meeting 2015 10 19
Meeting 2015 10 26
Meeting 2015 11 02
Meeting 2015 11 09
Meeting 2015 11 16
Meeting 2015 11 30
Meeting 2016 01 04
Meeting 2016 01 11
Meeting 2016 01 25
Meeting 2016 02 01
Meeting 2016 02 08
Meeting 2016 02 22
Meeting 2016 03 07
Meeting 2016 03 21
Meeting Devtools Servo 2
Meetings
Microdata project
Minutes Hackathon 2012 03 27
Missing DOM features project
More ServiceWorker support project
More developer tools student project
Mozlandia Automation
Mozlandia B2S
Mozlandia JS
Mozlandia Rust In Gecko
Mozlandia WPT
Mozlandia gfx
Mozlando Devtools Servo
Mozlando Oxidation
Mozlando SM Servo
Mozlando Servo Bluetooth
Mozlando Servo MagicDOM
Mozlando Servo SMStrings
Mutation observer project
Mutation testing project
NCSU student projects
Network security project
Off main thread HTML parsing project
Offscreen canvas improvements project
Offscreen canvas project
Orlando Oxidation 2018
Oxidation 2015 11 05
Persistent sessions student project
Preparing ARM libraries for CI
Priority of CSS properties
Priority of DOM implementation
Priority of dom bindings
Private browsing student project
Profiling
Project proposal deadlines
Prototype JS form controls student project
Prototype ways of splitting the script crate
Publishing a new ANGLE NuGet version
Publishing a new app store release
Push vs Pull for caching
Random web content project
Refactor GLES2 student project
Refactor bluetooth support student project
Remaining work
Removing push notifications from IRC hooks
Replace C libraries student project
Report new contributors project
Representation of computed style
Research
Reviewer
Roadmap
Running Web Platform Tests on Servo
Rust HTML parser
Rust SpiderMonkey debugger API
Rust cssparser code walk 2013 08 02
SaltStack Administration
San Francisco Oxidation
Servo Benchmarking Report (December 2024)
Servo Benchmarking Report (November 2024)
Servo Benchmarking Report (October 2024)
Servo Layout Engines Report
Servo and SpiderMonkey Report
Servo for Gecko Developers
Specification Links
SpiderMonkey related tasks
SpiderMonkey infodump
SpiderMonkey upgrade details
Storage student project
Streaming webassembly student project
Strings
Student project brainstorm
Student projects
Styling overview
Stylo hacking guide
Summer of Code 2014: Implement XMLHttpRequest
Summer of Code 2016: Fetch API
Summer of Code 2016: File support
Summer of Code 2016: ServiceWorker infrastructure
Summer of Code projects
Summit meeting 2013 09 09
Support WebDriver based tests project
Syncing web platform tests (WPT)
TaskCluster
Testing
Tools
Tracking intermittent failures over time project
Transcription Notes from Servo Architecture talk in Suwon
Transcription notes from rust patterns talk in suwon
Transcription parallelism
Transcription rust concurrency
Transcription rust runtime
Transription layout and acid2
Trinity College Dublin student projects
UPenn student projects
Updating the Rust compiler used by Servo
Upgrading non taskcluster linux CI machines
Upgrading the UWP gstreamer binaries
Upgrading the windows LLVM binaries
Upgrading wptrunner
Using DOM types
Using Rust Spidermonkey Prototype
Using WebWorker Prototype
Version 0.1
Videos and presentations
WebAudio JS interfaces student project
WebAudio nodes student project
WebCompatBug
WebSocket student project
Webdriver student project
Webdriver tests student project
Webrender Overview
Whistler 2019 notes
Whistler Bugzilla
Whistler FFOS
Whistler GFX
Whistler Houdini1
Whistler Houdini2
Whistler Necko
Whistler Oxidation 2019
Work items for new contributors
Workweek COW DOM
Workweek alt js
Workweek android arm
Workweek boot 2 servo
Workweek compiler lints
Workweek displaylist
Workweek dogfooding
Workweek encoding
Workweek generated content
Workweek governance
Workweek graphics stack
Workweek graphics toolkit
Workweek incremental layout
Workweek js bindings status
Workweek layers
Workweek layers2
Workweek pixels
Workweek rasterization
Workweek reftests
Workweek roadmap
Workweek script crate
Workweek security
Workweek string interning
Workweek tables
Workweek writing modes
XML parser student project
infra triage notes
jQuery status
webxr.today support
Clone
3
Mozlandia gfx
sanxiyn edited this page 2014-12-07 19:50:35 -08:00
Servo + gfx discussion
- Current plan: Use Moz2d + SkiaGL
- What is causing the huge work backlog for the GFX team? Is it the multiple Moz2d backends across the various hardware, or it something we will hit even if we stick with just SkiaGL?L?
- Long-term, should we be building our own rasterization library?
Azure/Moz2d
- jack: Do we get benefit from using azure with one backend?
- gfx: no.
- jack: We were thinking of using azure to let us work on Windows.
- gfx: Just use Skia on Windows.
- nical: Not sure about direct-mode rendering
SkiaGL
- jgilbert: Not sure you're getting a lot of benefit from SkiaGL. With OpenGL, you're not going to be able to do parallel rendering.
- zwarich: Yeah, have to use something other than OpenGL, because the driver takes a global lock.
- jack: We have problems with Skia creating waing way too many resources, particularly with GL rendering.
- jgilbert: Try to drive CPU rendering as far as you can.
- gfx: Being Skia-only is not a bad place; I wish gecko was there.
- nical: Trying to move away from immediate-mode APIs. Retained-mode might be nice to avoid streaming geometry all the time. Be able to do more batching to reduce the number of draw calls. But, can't do it with an API that doesn't have have a scene graph. We're having this discussion now, and it won't happen soon, but hopefully eventually. Instead of a backend at the drawtarget boundary, instead have a displaylist/graph and pass that to an optimizing backend.. One of the backends would probably be Azure inside for doing Canvas (since it can't use a scene graph anyway). If you want to go crazy & be in the best place, about half of the gfx team would advise you to create a retained mode API.
- jack: Not just display list, but also...
- jgilbert: A scene graph out of layers content.
- nical: Go through the display list. Build up batbatches. SkiaGL uses a huge amount of memory because it has this gigantic texture cache because it doesn't know what it will have to use the next frame. So you're using all sorts o fheuristics to avoid using SkiaGL when it will use too much memory. But, that's a lot of people + engineer time. So I'd understand if you want to just stick with Skia.
- zwarich: One of the reasons you want to do it is incremental update. Seemed from roc's notes that he wanted to go from a graph of layers to instead of a unified fied scene graph for the 2D layer content and then the hierarchy. With incremental updates, doing them on the level of layers / stacking contexts is straightforward. But, if it's the 100x200 px rectangle, the incremental patching of display lists has been, in practice, less efficient than the WebKit approach of just updating the 100x200px buffer, traverse the frame tree with aggressive clipping in place. That's also much simpler than building a whole scene graph, how do we know if the scene graph approach is a good one?
- nical: WEll, nobody's tried implementing a whole browser using a scene graph. nvidia has a demo SVG rendering engine using a scene graph.
- gfx: The whole page is laid out and rendered on the GPu.
- jack: nvpath?
- nical: Yeah. It's hard to have a benchmark for Skia vs. scene graph to see the difference.
- zwarich: It would just be nice to come up with an idea of a benchmark that we think the scene graph will be better on so that we have a dummy check check against an optimized retained mode implementation. Easy to get tied in the idea of creating a newa new library and get lost in the weeds.
- nical: Something with lots of restyling and page changes? Something where shre sharing the layer with the compositor is going to be very expensive and chatty. Browsers aren't that differentferent from games except for transparency / anti-aliasing. Otherwise, not that different, and game engines have done their 2d rendering very differently. Plus, the more we do things differently than game engines, the more we hit driver bugs. Off main thread compositing on Windows is not very stable, but we released it. Anything we do that is more gamey is likely to hit less drivdriver bugs. The google guys put all their rendering in one process, and pay overhead for proxying their opengl stuff to it, but with all the rendering in one place, there are less issues like surface sharing where we run into n into
- jgilbert: Dependency tracking is a huge pain point.
- nical: We have a huge lock for synchronizing our textures. And it turns out that on some drivers, we end up with racing during compositing.
- zwarich: So you don't even get a guarantee that submit order is repsected?
- jglilbert: Definitely not guaranteed.
- nical: Only window managers use them, and window managers are much simpler. As soon as we don't do exactly what they do, drivers break.
- jgilbert: It's also hard to falsify. Because a lot of the of the time, you can drop all the locks and the OpenGL will still work!
- jack: i.e., Servo has no synchronization and it basically works... we're just getting lucky.
- zwarich: Also, OSX gives you a submit order guarantee.
- jgilbert:: That flush primitive is great, and I wish we had it elsewhere!
- zwarich: Tradeoff between batching and immediate mode is due to overhead from state changes in OpenGL driv drivers? Would being on Mantle/DX12/etc. be better?
- jgilbert: My sense is not the state changes, but all of the synchronous upload stuff.
- gfxgfx: Modern GPU APIs let you do streaming APIs.
- pcwalton: We do it well on the Mac, but don't kno wbaout others.
- jgilbert: Lock an IOSurface and just do it?
- pcwalton: Yeah. Was easy on Mac; for Android I spent a month and never really got it working well.
- zwarich: Most of the machines we're targeting int he next five years will have shared-memory graphics on mobile (sometimes programmer-managed coherence, but increasingly automatic) with a similar situation on Intel integrated graphics.
- pcwalton: You can on Android, but have to be root!
- nical: Was just added recently. SurfaceTexture.
- pcwalton: Chromium doesn't use it, though...
- gfx: Android browser does.
- nical: this also depends on if you want to render on the cpu and upload textures or render everything on the gpu. If you think yhink you can render everything on the gpu, it's s aiddferent problem. That's all about setting up buffers, states, uploading patches, trashing those caches as little as possible. The scenegraph thing is that if you have the info about more than just a rectanglele, you can be better about updating those states. Immediate mode backends with a GL backend throw away a lot of what they could reuse because they don't know. They don't know that stuff from prem previous frames can be reused...
Planning
- pcwalton: Most interested in how we get from where we are today to move to where we'd like to be tomorrow without a full stack rewrite / incrementally. Maybe lots of new kinds of layers until it becomes a scene graph? e.g., textlayer, cssborderlayer, etc. Right now, we don't have lots of displaylist types right now. Could imagine having layers for each of them, and then you're a scenegraph.
- nical: For each layer, want to have info about the surrounding layers with minimal draw calls.
- gw: When I moved nokia's 2d immediate mode renderer and make it batched, I took their scene graph, flattened it into a list, worked out the z-order/transparency, and then in multi-thread categorized by rectangle overlaps. Took us down by a factor of five or so on the rendering time. Looking at what we have in Servo today, we could do that and it'd be a big win. But I'm not sure what we're not doing in Servo yet (especially more primitives) that would ruin that approach.
- pcwalton: In Servo, each frame has a stacking context that may or may not have a layer. If you don't have a layer, you're rendered with your parent. If you do, then you get your own. Each stacking context has a flat list of display items. Each display item has bounds, cliprect, and other display item stuff. Also can have an opacity and transform (no transforms on display items). Tricky thing is multiple flat lists because of stacking contexts, which has to happen becasue of clips/transforms.
- gw: That looks almost identical to the original Nokia renderer I worked on and we got lots of wins on it. The question is, are their massive item counts or things we don't handle yet?
- pcwalton: SVG.
- nical: It's complicated, but if we end up with an th a slower SVG renderer and faster web content, that's a big win.
- pcwalton: Definitely cutting SVG content corners. I'd love to polyfill with a canvas backend :-)
- gfx: It's becoming more come common...
- pcwalton: But canvas is where we are putting our optimizaiton effort.
- zwarich: Global scene graphs (flattened or not), every time you are doing way more work when you're scrolling on the GPU than when you're just scrolling flat tiles. When you think of low power, you don't think "game engine."
- jgilbert: You could do the rendering, build a flat layer, build the tiles, and treat the tiles as a cache. So do the scene graph, but keep the layers.
- nical: Definitely, not saying we shouldn't retain layers.
- zwarich: Just mentioning we might enight end up burning a lot more power if we work like a game engine.
- nical: Also, if you're doing it more in the way that the GPU expects, you might do way better. Especially with GPU rendering.
- zwarich: I'm assuing you'd do GPU rasterization.
- pcwalton: If you're doing retained layers, you're sort of recreating the same system we have now. you have to retain them somewhere; you have to have tiling... and then you have layers again!
- nical: One thing that differentiates native and web platforms is starting an animation fast. Right now, starting a border-radius animation is slow because we have to go through a bunch of architectural stuff to kick it off.
- gfx: Does that work poorly in IE?
- pcwalton: Start wanting to do incremental display list construction, which is really hard...
- nical: With DLBI, we have the infra to get a list of rendering items that are incrementally updated. Hardest part aside from the rendering code itself. Need to talk with roc; he thinks it's doable.
- pcwalton: I'll have to talk with roc. You can retain at the level of stacking contexts easily.
- zwarich: That's basically our current model... but it doesn't give much incrementality.
- pcwalton: Yeah, that's the nut that's hard to crack. Maybe use DLBI to prove that two display items are identical and then avoid creating the display items?
- gfx: I think that's what roc was thinking.
- zwarich: Also one slightly different one for Servo. Otherwise, could walk the tiles; grab a lock on the frame tree, and emit the frames. But in Servo, we try to not lock the frame tree - we build a display list and try to render that.
- pcwalton: In the traditional model, we'd just have the display items render immediately. Instead of creating them, perform the operation...
- jack: But layout and rendering are in separate tasks!
- pcwalton: Have to merge them. Oh, and you have to respect painting order, so walk the tree multiple times.
- nical: Need roc around to talk more about stacking contexts and rendering orders.
- zwarich: Servo's default for parallelism is different from other browsers that requires us to already have layout produce some retained-mode result. Ones that aren't built that way can cheat.
- nical: Having the retained thing outside of layout does make it easier to experiment with a scene graph, since you already have it.
- zwarich: Definitely would be easier to experiment with it here than WebKit or Gecko. We have less stuff and we already have the separate items.
- nical: We should have looked more carefully at what we do that's different from what normal applications do with graphics hardware.
- jgilbert: We used to do some external combination t testing to get some light coverage of strange configurations.
- nical: Yeah, it's just hard to know because it's easy to break 10% of your Windows users since we don't have the hardware to test on. Should keep in mind: are we adding something that's a new trick that is unlikely to work on every version of hardware that every user has? Or is it something that everybody does? Surface sharing is not used as heavily in other apps as Firefox, so it breaks.
- pcwalton: Yeah, we gave up on surface sharing on linux. We need Wayland.
- jgilbert: But, you're gonna be stuck with Mir :-(
- gfx: It is sort of interesting about how having sane graphics APIs help with this problem.
- zwarich: It's not clear if our question should be what should the right web graphics platform be for writing a browser? Or is it how do we engineer a graphics platform that works for the widest range of hardware. Clearly not on a single piece of Android hardware; but also don't want to support every Linux/WinXP configuration.
- gfx: Lots of the retained mode stuff is because the draw calls are expensive. If you're on hardware that can do lots of draw calls, all this work on the CPU is saving you nothing because you didn't need to batch.
- zwarich: Most of the time when CPU rendering shows up faster than GPU rendering, it leads me to suspect that there's a ton of CPU overhead calling into the GPU...
What's causing the gfx backlog and how do we avoid it?
- nical: Driver bugs. Five years ago, FF was a single event loop; everything on the CPU; everything we need now to go to a great place we didn't think we needed years ago. Plumbing the infrastructure for this is hard. Just off main thread compositing is a ton of work in Gecko! All of what I've been doing has just been getting OMTC features on. It's not hard for you guys because you started with it.
- jgilbert: Our "legacy" is that everything was done on the CPU. You can always just re-render to the same thing; refcount everything and it works; etc. Now have to have crazy cross-process refcounted surfaces...
- pcwalton: Everybody's had to deal with this - WebKit; Blink.
- nical: Just takes a lot of time.
- pcwalton: A lot of the Servo pipeline is just based on the Android Fennec reboot graphics API strategy.
- nical: Another thing is that the layer stuff had to be refactored... but it turned into a six month rewrite.
- pcwalton: My fault!
- nical: Fennec made everything opengl. Then B2G was big and made everything opengl. Then, suddenly needed Windows layers, and we had to replace a ton of OpenGL stuff by D3D. That took like another 6 months.
- pcwalton: When we go to Windows, should we do ANGLE or go to layers?
- jgilbert: D3D is really easy.
- pcwalton: Already using Azure, so can just use D3D backend.
- nical: Don't use azure for compositing.
- pcwalton: We don't.
- nical: Good, don't use Azure for it.
- pcwalton: We have rust-layers that we use for compositing. Just does layers and tiled layers and has an azure backend.
- gw: Only a couple hundred lines of code; easy to port.
- pcwalton: CSS 3d transforms might hurt; having to do something with depth... the shooter demo runs badly on Chrome and Firefox but great on Safari I think they just kick it to CoreAnimation.
- gfx: Depth doesn't work because of transparency. Have to get the ordering right. So unless you're sorting
- gfx2: Need order independent transforms.
- nical: Looking at the video game approaches, they do crazy things we don't want to...
- pcwalton: Not super concerned about 3d transforms for building shooters, but want to handle things correctly and be simpler. Simple tends to help because static layerization is much easier than frame layerization, which has some terrible performance cliffs that are hard to understand.
- nical: Gotta be flexible in how you layerize. Most of the perf work on B2G for interactivity was getting applications to have exactly thtly the right layer tree.
- gfx: Much easier as a web dev if we have static layerization. Know from CSS what will vs. what will not be a layer. In gecko, you have to hope everybody does the right things...
- jack: is there inspection for layer building? Can web devs see it?
- nical: Layer borders.
- gfx: Layer scope, too.
- jgilbert: Layerization paltform-independent?
- gfx: No? Mostly no. Scroll bars are special.
- pcwalton: At least on Servo we can always do overlay scrollbars, because we can't really use native widgets on Servo anyway.
- nical: Not sure how static layerization will work out, but you will definitely have to be able to tune it well for hardware like B2G. Still have some bad things where we have to tell the Gaia people that if they have a background and text there they should put the color on the div with the text rather than the background. Easy for us to tell Gaia devs, but it's really bad for external devs.
- jgilbert: Cases like a background image with text scrolling on top of it is unusual...
- gfx: But it's the natural way to write these things with CSS!
- nical: It's hard to tell web developers that they should do these weird things...
- jgilbert: To be fair, people will fix it if you tell them!
- pcwalton: Not really; animating top/left/right on position:absolute or margins in general are just terrible ways.
- nical: Common cases are sometimes not that straightforward.
- zwarich: Lots of horrific mobile layout problems come from bad layerization problems. Lots of your memory is spent on graphics, and it's easy to accidentally double your memory usage.
- nical: Not even counting drivers that keep a second copy of the texture, like Intel.
console-style APIs
- zwarich: Lots of things are in flux - Metal, etc. Should we be abstracting over all those instead?
- nical: If you subscribe to the Khronos API with your mozilla address, you can look at the GL next API discussions.