mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Page:
Workweek rasterization
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
1
Workweek rasterization
jdm edited this page 2014-11-11 06:52:11 -08:00
Table of Contents
Servo workweek - rasterization
- zwarich: Currently using Skia (or SkiaGL). We used to use the Skia GPU backend via Azure. We've had the fascade that we supported different backends, but they all crash.
- gw: Removed the option.
- jack: Used to work with Cairo, but now do Skia and SkiaGL.
- zwarich: Still use Azure, but hardcode to Skia. We're in a situation where we're using an abstract API but using a specific rasterizer under the hood. We're also using Skia in a really bad way - every time we go to draw, we create a DrawTarget. We still do that on the CPU, but it's not as bad as the behavior on the GPU where those allocations are really expensive.
- jack: Created DepthBuffer, StencilBuffer, etc. on every DrawTarget creation
- zwarich: We might not even need those. Couple of things to decide. 1) Do we want to keep using CPU rasterization or switch back to a GPU rasterizer? 2) Do we want to keep using Moz2D and Skia through it, use Skia directly, or some other rasterizer directly? We talked about writing our own rasterizer, which makes sense because web pages only render solid colored rectangles, image, and display text. That's very similar to our DisplayList, and enticing to write our own. But, if you need the full Canvas API surface, it gets complicated (e.g., curved rendering), and even CSS features need blend modes, etc. Feeling we had the last time was that it was not worth going down this path, since we will have to support Canvas, and probably soon. Implementing all of that ourselves is probably not the best idea. But periodically new 2D rasterizer projects are brought up, including a) a new effort by nical, b) EFL...
- larsberg: Not EFL, after our discussions at the EFL dev days. I believe the new effort by nical is still nascent.
- zwarich: Anyway, those are the questions. Thoughts?
- kmc: On keeping CPU rendering at all - yes.
- zwarich: More of which should be the default? Now that GPU is not...
- gw: If power management is the goal, GPU is important.
- matt: Chrome makes a tile by tile decision to choose between Skia and Ganesh.
- jack: What are the heuristics?
- matt: No; Interested in looking at it.
- jack: Intuition the last time I looked was that rendering text should be fast. But, SkiaGL was incredily slow.
- mrobinson: The version of Skia in Servo? For performance decisions, the Servo version is not accurate. It's old.
- gw: I think pcwalton found that Skia's slowness in font rendering was due to blowing the font cache.
- jack: We've talked about dropping Azure a few times before. Having multiple backends was the bonus - having D3D, etc. But when I've talked to the gfx team, they were in favor of the stateless API approach. They thought that was an important abstraction because each of the backends have a different way of approaching it.
- kmc: This is an abstraction that doesn't exist?
- jack: No, it's what Moz2d gives us - a stateless API. Unlike Cairo.
- kmc: But if we're using Skia's API...
- matt: Skia does not have an API. They implement whatever Chrome/Blink need. We had discussions at a recent workweek to encourage people to use Moz2D over Skia...
- zwarich: Skia's native API is C++.
- matt: Two years ago ARM started working with Szeged on 2D rendering on top of OpenGLES. Took WebKit and ripped out the graphics context backend so that we could run the browser without rendering anything. Then slowly started implementing the APIs in GLES. The project evolved with some people in Samsung Research UK. Szeged has been approved to open source it; should appear soon. Project was to show we could do efficient 2D rasterization on top of purely 3D APIs. Goal was because the Khronos APIs are falling behind and the GPU vendors are not interested in driving those. There's NVPath, but that's Nvidia. I think the conclusion is that we can do 2D rasterization well. You can get up to 12x perf improvement by doing 2D rendering using the 3D APIs wikipedia, falling leaves, etc. Pushing to get Google to use it in Ganesh; love to get Servo to pick it up; going to push hard on WebKit in China.
- zwarich: Issue in OpenGL APIs with 2D rendering is partial texture updates. So, when you issue commands, choosing between immediate update vs. when you do the next draw calls is hard. Looking at the Skia pages online, it appears they have a lot of issues with partial texture updates as well. Not a problem on ARM GPUs?
- matt: It is a problem on embedded GPUs. I don't have an answer to that specific question, but can put you in touch with people who do. There are some issues here.
- zwarich: Issue is that they're problems with the API, not with the hardware.
- gw: Can you not use pixel buffer objects?
- zwarich: AFAIK, there isn't anything. There are vendor-specific extensions, so you could poke at individual vendor settings.
- gw: I have used pixel buffers for streaming updates of video.
- matt: 5x faster render time on scrolling wikipedia. It removed checkerboards significantly.
- zwarich: In the past, CPU vs. GPU rasterization, it's been within 2x.
- mrobinson: Probably depends on CPU and GPus?
- matt: On Chromebook with a recent ARM. Cortex A15.
- zwarich: Interesting!
- jack: Should be open source soon!
- matt: I can get you in touch with the tech lead.
- mrobinson: As far as we're concerned in Servo on our rasterizer, if these techniques are a lot faster, I assume they'll just be integrated piecemeal into Skia. Or are they separate?
- zwarich: There's just options of basically: 1) Skia directly; 2) Moz2D to Skia (primarily to isolate the C++ changes); 3) use these techniques from ARM
- jack: How is using Moz2D different from using Skia directly? We'd have to wrap it anyway?
- zwarich: Because when we want to use some Skia features, we have to also tweak Moz2D.
- jack: Oh, so basically Moz2D is strictly more complicated?
- zwarich: Moz2D is annoying because it's another wrapper, but it's also kinda nice if the Skia C++ wrapper is changing because they might provide us a stable C API.
- jack: If Moz2D changes slowly?
- zwarich: That would be my hope.
- kmc: Since we haven't been updating Skia, we also don't know how much it hurts.
- jack: Last time I updated Skia, I just pulled master on Skia and Moz2D and it "just" worked. But AFAIK, the Skia backend is not even actively used from Moz2D.
- kmc: Why is it there?
- jack: GPU rasterization on Linux. Which is not on by default. I think Andreas suggested using Skia directly and ANGLE.
- kmc: The ARM work does suggest that would be practical.
- jack: Is that what Chrome does? Just use Skia directly?
- zwarich: Yes. So, Skia directly is an option. Anyway, a lot of the reasons we were blocked from using GPU by default was that we didn't have a level of control over the GPU buffers that we want. The render task should not be allocating and deallocating render targets, as it prevents us from sharing them between page. And it introduces a second caching layer. This design means we cannot use Moz2D because we cannot use their surfaces in a platform-independent way of managing buffers. There are some specific APIs for D3D that might work...
- jack: That's why I added those specific APIs.
- kmc: We've already made a fair number of modifications to those APIs to make this work, right?
- jack: Not a fair amount; just a function to Azure that calls a new file in Skia.
- zwarich: There was something that didn't work correctly for allocating the buffers in the compositor and passing it over...
- jack: Skia wants to create a framebuffer with all those things created. When you want to pass that to the compositor, it just wants the pixel data, so we detach the FBO, etc. from it and pass the render buffer to the compositor. But then if you want to reuse that, you have to recreate it all...
- mrobinson: On Linux (with pixmaps) you can just pass it, so you don't need to attach all the stuff. You just need modes to lock/unlock the pixmap.
- jack: We were just trying to get something working.
- mrobinson: The choice seems to be between using Azure and modifying it for our use case vs. using Skia directly and rebuilding the abstractions we use in Azure.
- jack: What are we using in Azure?
- mrobinson: There are some Azure DrawTarget abstractions and primitives that we use, which have different names in Skia. So we'd need an abstraction.
- jack: AFAIK, it's just terminology changes.
- kmc: Stateful vs. stateless API, too, right? Canvas 2D is stateful, right?
- jack: Yes.
- kmc: Our displaylist drawing code is still really small. Boxes, gradients, images. So it might not be a big deal to switch everything to the stateful API.
- jack: Why didn't Firefox want to support stateful APIs?
- kmc: And Coregraphics.
- larsberg: Firefox moved away from stateful APIs due to them being a bugfest, according to the notes from gfx.
- zwarich: Skia is closer to Canvas-style than to the Moz2D style. Also hard to decide on those. But I'd like to have GPU rendering supported and working as well as possible. Even if we use CPU rendering for the time being, have to make sure GPU rasterization works with them.
- gw: I agree; maybe the plan should be to update Skia + azure, benchmark on SkiaGL vs. our CPU code.
- matt: Also a blackberry GLES-enabled backend. GENTL (it's on github). That's been live since Blackberry 10 was released.
- Simon: Have done tests of GPU rasterization on Chrome. Looked at Alexa50, etc. on the Note3. Found that for the Alexa sites, there was a 4% regression for GPU vs. CPU. But for the smoothness/jank tests, GPU was much better.
- mrobinson: The goals with the Chrome team is about smoothness.
- jack: How do you handle scheduling the GPU rasterization? Couldn't you starve it?
- zwarich: But couldn't the CPU preempt the work for issues with interactivity? It's surprising that the GPU was beating it. I'd expect the CPU to show white/checkboard, but keep scrolling and for the GPU to run out of resources and be unable to composite.
- matt: This question came up in the graphics workweek, too. My understanding is that the pipeline can be preempted based on task priorities. So, if you have a higher priority (e.g., the compositor), then even if there's a bunch of rendering tasks in the queue, you can drop those.
- jack: The graphics driver knows this?
- matt: The process can interrupt. When there are commands on the GPU already, another process can interrupt.
- kmc: Hard to do.
- matt: Supported by all embedded GPUs.
- gw: GLES3 has fences
- matt: Still 4 years before Android will mandate GLES3. Until that happens, GLES2 is a safer bet.
- zwarich: Trying to figure out what we can do using the standard APIs.
- larsberg: Isn't matt saying there is a standard?
- zwarich: Vendor extension?
- matt: No.
- Simon: Khronos at SIGGRAPH this year announced an aggressive timetable for standardizing a bunch of new APIs.
- kmc: Need to keep the door open to CPU and GPU rasterization.
- zwarich: I'd like the default, at least on OSX, to move to GPU rasterization, because if we can't make that work, there's an architectural problem.
- gw: The OSX build machines should run and pass the GPU ref tests.
- larsberg: Looks like I have my work cut out for me...
- jack: Have to have a logged-in user anyway, so it's not a big deal. The Linux builders, though, crash on the GPU issues.
- zwarich: Related to our toolkit discussions, the reason you need to be logged in is because of GLFW. If we didn't do that, we could do headless GPU reftests.
- jack: Nothing like that for X on Linux.
- kmc: Desktop EGL on some drivers.
- jack: Want to update Skia to the newest version. Want GPU rendering the default on OSX. Get GPU reftests passing..
- zwarich: And headless!
- jack: And benchmark how close we can get this. Anything else?
- larsberg: Mixed CPU/GPU rendering.
- pcwalton: Culled display lists.
- mrobinson: Chrome gave up on per-tiles because pixel perfection would miss on seams between those tiles.
- kmc: So we couldn't have CPU and GPU rendering match.
- jack: Couldn't get highest-quality text rendering on the GPU anyway.
- zwarich: Two issues: 1) gamma-correct with the background. That works out well - shadows, etc. look great. 2) Subpixel AA (per-channel alpha) has been dying out anyway as browser have been more GPU accelerated because there's no GPU that gives you efficient alpha per color channel. So, it's been dropped further and further. Still the question of whether you want to do gamma-correct text compositing. GPUs have specific functionality for gamma, and there are also pretty good fallbacks, though not as good as subpixel AA. Don't know if anyone is doing that, though I know Chrome+Skia abandoned subpixel. They do some tricks with the APIs on various platforms to fake it. I think we don't need to worry about subpixel.
- mrobinson: And HIDPI doesn't change it much.
- kmc: Is subpixel AA used on mobile?
- zwarich: No. And you rotate the device. There are some subpixel AA that are rotation-agnostic, but the standard ones do not.
- kmc: So, since mobile doesn't use it and HIDPI becoming more high-level...
- zwarich: You don't even know during rendering what orientation you are in.
- mrobinson: Does subpixel AA interact correctly with subpixel positioning?
- zwarich: In CoreGraphics you have to re-render at each quantized position.
- larsberg: Can we do one layer on GPU and one on CPU?
- zwarich: On OSX, if you use IOSurface, you can render into it on CPU (though it might create a copy). Shouldn't be too hard if we architect for making GPU rasterization and CPU rasterization work well, we should be able to change the architect to make it work.
- mrobinson: If we do CPU rasterization, would it be better to use shared memory until the last possible minute and upload at the last possible minute instead of having a backing shared memory buffer?
- zwarich: Depends on the hardware. On NVidia, the DMA memory-shared textures, unless it's a video frame, if you read from it repeatedly, you will saturate the PCI bus. If you're on an Intel integrated, it all works great because you eliminate a copy. OpenGL sort of assume you're copying all your data.
- jack: Also need a mixed CPU + GPU rendering test. And a call with the folks from ARM about the new API work that they've been doing on 2D rasteration on top of 3D APIs.
- gw: Was there any conclusion to whether we should use azure or skia directly?
- jack: Send an RFC to the list + chat with the Gecko GFX folks to make sure we want to remove Moz2D. There doesn't seem to be much of a reason to have Moz2D around. It's not hard to remove, but will we regret it? Just updating Skia will help us investigate things, though.
- zwarich: This discussion has made me strongly in favor of ripping out Moz2D.