3 ms·
What about if a tiny thing changes? Perhaps animated avatars totaling 1% of the page. Is that a scenario where the new method might use more power, because it
by Dylan16807 9y ago
What about if a tiny thing changes? Perhaps animated avatars totaling 1% of the page. Is that a scenario where the new method might use more power, because it redraws too much?
- pcwalton 9y agoA compositor is already repainting the whole window on the GPU. WR doesn't change anything here.
- Dylan16807 9y agoIn this use case the "painting" a compositor does from layers is copying one big rectangle. That takes next to zero time. That's not at all similar to "painting" where you actually re-render the entire visible portion of the page.
- pcwalton 9y ago> That's not at all similar to "painting" where you actually re-render the entire visible portion of the page. Why not? Painting a page is mostly just copying pixels from textures too.
- Dylan16807 9y agoYou don't see a notable difference between [tens of] thousands of glyphs and bits being layered on top of each other and processed through a display list, versus copying over one single rectangle from A to B?
- pcwalton 9y agoNo, I don't. It adds a small amount of vertex shading time. The GPU primitive rasterization machinery is extremely good. Benchmark it yourself if you don't believe me!
- nicalsilva 9y agoActually, Gecko's compositor knows the screen space invalid region and scissors out the rest when compositing. The invalid region is passed to the window manager. Chromium also does that although they settle for an invalid rect instead of region which is fair. There is an issue on file to do the same with webrender.
- nicalsilva 9y agoAs pcwalton said, there is a whole lot of things on the web that are very cheap to render on a GPU if done right. For these things, a well tuned gpu renderer can easily outperform a naive compositor like what you can see in most browsers. All of the caching optimizations that one gets from a compositor can be incorporated in something like webrender (and some are, like glyphs and a bunch of other stuff). Right now webrender doesn't have all of the tweaks to avoid rendering the whole page when there is a small spinning throbber, but that will be implemented eventually (there is still a lot of work going into rendering the long tail of weird and specific things right).