3 ms·
We actually aren't doing any path rendering yet; CSS as used on the Web is all boxes and triangles, aside from glyphs. One of the neat things about WebRender is
by pcwalton 11y ago
We actually aren't doing any path rendering yet; CSS as used on the Web is all boxes and triangles, aside from glyphs. One of the neat things about WebRender is the observation that triangles are pretty much all you need for CSS.
A future extension to support SVG and glyphs on the GPU would be pretty interesting though!
- vanderZwan 11y agoI just got through the part of the talk where you mentioned all of this :) BTW, are you aware of the Halide language? Might be useful for writing those CPU fallbacks. http://halide-lang.org/ http://halide-lang.org/
- crzwdjk 11y agoOn Linux at least, NVIDIA's drivers do support some acceleration for glyph rendering and other 2D operations through the X RENDER extension. It's not really going to help with SVG rendering, but it's great for boxes, triangles, and glyphs, as well as blitting and compositing which covers most of what browsers do with HTML and CSS
- pcwalton 11y agoXRENDER basically provides a subset of OpenGL which is insufficient to describe all of CSS and not particularly tailored to modern GPUs. The extra features it has, like trapezoids and blend modes, are easy to implement in regular old OpenGL. Additionally, it's effectively Linux-only and has spotty driver support. I don't see any reason to use it.
- slavik81 11y agoIt seems like a waste to tie new software to X when Wayland is just around the corner.
- phaylon 11y agoI'm actually very glad to hear that. I've been working on (read: designing, not yet implementing) a GUI framework for Rust, and was hoping to get away without an external 2D rendering library like cairo. And if CSS can be reduced to those, my comparatively limited system (no overlapping areas, only rectangular widgets, only inherited data is position and base color) should be able to handle it. The drawing abstraction is actually my current big hurdle, and I hadn't thought of looking at how CSS is rendered yet. So, thanks for that hint!