|
|
|
|
|
by dmazzoni
704 days ago
|
|
I think it's more complex than that. While web browsers do use GPU rendering, they're not game engines. They don't draw every single object on the screen every frame, that could easily cause lag on a large complex page. Chromium in particular tries to minimize the total number of layers. It renders each layer into a pixel map, then for each frame it composites all of the visible layers into the final image. That works really well in practice because you often have lots of layers that move around but don't actually change their pixels. So those don't need to be rendered (rasterized) every frame, just composited. If you have a bunch of box shadows without transparency, Chromium will rasterize the whole thing once as a single layer. If you have a bunch of box shadows with transparency, Chromium might create a separate layer for each one. That's probably suboptimal in this particular case, but imagine if your partially transparent box shadows had to also slide around the page independently. |
|
Games draw every single object on the screen every frame. They don't lag, quite the opposite in fact!