5 ms·
The title on HN is very editorialized and I can't overemphasize how preliminary and experimental this work is. Take all numbers with a huge grain of salt. That
by pcwalton 11y ago
The title on HN is very editorialized and I can't overemphasize how preliminary and experimental this work is. Take all numbers with a huge grain of salt.
That said, I'm obviously really excited about this project. :) I feel strongly that it's the right from-scratch, modern approach for painting Web content. Happy to answer any questions.
- eridius 11y agoWow this looks very cool. Kudos!
- pcwalton 11y agoGlenn Watson deserves nearly all the credit here. My role has been limited to a little bit of high-level design input and messing around with signed distance fields and goofy stencil buffer tricks. :)
- trishume 11y agoOoooh signed distance fields, if you ever get a good Rust implementation going make sure to publish it and add a readme that at least says what the code is so that it can be found. It could be great for other rust libraries, apps and games. None of them have subpixel rendering at the moment AFAIK and that's super easy with distance fields and real important for appearance.
- TD-Linux 11y ago>None of them have subpixel rendering at the moment AFAIK Actually, most Rust projects end up using Freetype for glyph rendering, which does support subpixel rendering. Signed distance fields are great for animated text, but they also have a couple of disadvantages - they generally produce lower quality output than Freetype at small glyph sizes, and the signed distance field is more complex to generate at start, which slows down initial page rendering. Given that 99% of web pages are static, it's a harder sell. Maybe some sort of heuristic based switching would work.
- constexpr 11y agoI'm surprised to hear they produce lower quality output at small glyph sizes. Fragment shaders can do multiple texture samples and I've gotten very high quality results. You can even do ClearType-style subpixel rendering with a handful of samples. The case where signed distance fields don't work is for large glyph sizes. They often end up chopping off corners or not having the density to represent thin calligraphic strokes.
- CyberDildonics 11y agoWhat does the GPU accelerate? I actually pretty surprised that there is anything that can be parallelized to that level. Edit: signed distance field font rendering? Nice
- pcwalton 11y ago> What does the GPU accelerate? I actually pretty surprised that there is anything that can be parallelized to that level. Essentially everything but font rasterization (assuming you don't count image decode as part of painting). The major trick here is to avoid vector graphics, since you don't need a full-blown vector graphics library to paint common CSS. > signed distance field font rendering? Nice Note that this isn't integrated yet; it's a pile of experimental code, and I have some lingering doubts about its performance. But I would love it if we (or someone else!) can make it work!
- zbraniecki 11y agoThere's a lot of reasonable argument put behind the concept that we will use SVG more and more on the web. You're saying that WebRenderer should work for faster for anything but vector graphics. Is there a risk that it's optimizing for todays/yesterdays use cases?
- pcwalton 11y agoEh, I'm skeptical. :) IMO, SVG has serious ergonomic and performance issues that make it unlikely that we'll see a large-scale transition to it anytime soon. Not to mention that vector graphics are not really what you want for mobile apps: the proven framework is something like Core Animation, which CSS is much closer to than SVG. But I don't really want to debate this here, as it's somewhat off-topic. And there are only so many ways to draw a button, SVG or not. WebRender is really good at drawing buttons. So there's a possibility that we could use the same technique, just extended, for SVG.
- trishume 11y agoDo you have any good comparison numbers from Firefox or Chrome? The numbers sure seem impressive when compared to Servo but I know that Chrome has some pretty awesome rendering infrastructure and I'm wondering how this compares. There was one screenshot of Firefox included but it seemed to cherry pick the longest paint and didn't offer any explanation of how to compare it or which Servo+Webrender numbers to compare it to.
- pcwalton 11y agoThere have been some really back-of-the-envelope comparisons with Skia-GL, but nothing rigorous enough to write up. That's one major reason why the numbers should be taken with a grain of salt. Servo uses the same painting backend as Firefox does: Moz2D (also known as Azure). Moz2D is itself an abstraction layer over Cairo, Skia, Core Graphics, and Direct2D. So comparing against current Servo is actually a good way to compare against Firefox and Chrome in CPU painting mode: it's using the same painting backend as both of those browsers and eliminates any noise that results from layout differences. The most important thing to note is that the overall approach is quite different from Skia-GL (Ganesh). Skia is largely an immediate mode API (with a few retained-mode-style optimizations available with SkPictures, but the overall approach is immediate). WebRender (preliminary name), however, is a fully retained mode API and has no immediate mode at all, allowing it to focus on aggressive optimizations like "strength-reducing" clipping regions and Z-buffering opaque content for improved batching. This is a tradeoff, and it'd be easy to construct pathological cases in which one API or the other performs better. What we need to find out is which wins on real-world content, and while our early results are promising (and intuitively it seems highly probable that a retained mode API will win for CSS and the DOM), there's a lot more investigation that needs to happen before it'll be a slam-dunk case.
- JoshTriplett 11y ago> Moz2D is itself an abstraction layer over Cairo, Skia, Core Graphics, and Direct2D. Out of curiosity, given that both Cairo and Skia run on all platforms Firefox does and have GPU-accelerated backends, why abstract over more than one of them rather than picking one and optimizing it for all platforms?
- bjwbell 11y agoIt's amazing work. The big question is keep two renderers, CPU & GPU, or switch to just GPU? Switching to only GPU I think implies the need for at least a reference GPU backend such as mesa.
- pcwalton 11y agoWe're already OpenGL-dependent in the compositor. All this does is expand the set of GL features we use a bit.
- bjwbell 11y agoI was thinking more about passing the reference test suites. Or in the case this case failing since GPUs won't all render identically.
- pcwalton 11y agoWe still need a headless GL compositor even today to pass the reftests. The only way to composite layers together is GL. (This will probably change when we support printing though.)
- JoshTriplett 11y ago> The only way to composite layers together is GL. (This will probably change when we support printing though.) If not for the (very reasonable) expectation that things like "print to PDF" should produce vectors and selectable text rather than raster images of pages, you could render pages for printing using GL, too.
- pcwalton 11y agoYeah, I mainly mean PDF output here.
- dang 11y ago> The title on HN is very editorialized Indeed. Care to suggest one that's accurate and neutral? (In the meantime we'll take out the word "impressive".) Congratulations on the ongoing work, too!
- pcwalton 11y agoHmm, maybe something along the lines of "Servo WebRender overview". Thanks!
- dang 11y agoOk, we'll use that.
- deleted 11y ago[deleted]
- Flenser 11y agoSomeone should propose a new element to the w3c <nonsensationaltitleforhn>
- wging 11y agoWhat was the title before it was changed? Right now it says " Servo WebRender Overview".
- dang 11y ago
- mtgx 11y agoSo will we see Servo in either the mobile browser or the desktop one next year?