

On a hefty desktop device with a ton of video memory (VRAM) you’ll likely be able to create a lot of newly backed layers without problems.
#CSS GOOGLE CHROME HACK FREE#
A major benefit of this is on subsequent frames, where if all you do is move layers around or change their opacity, the GPU can handle all the work directly, leaving the CPU side of things free to do something else. Compositing is the process where each of the individual textures uploaded to the GPU is drawn out in turn, and results in one final picture: your page. Where things get really messy is on mobile devices, because they have comparatively limited VRAM, and it becomes easy to exhaust that and end up with excruciatingly poor rendering performance.Įach backing surface is essentially a texture that needs to be uploaded to, and composited by, the GPU.

But in certain circumstances, like when you apply a 3D transform to an element, it gets one of its own.

To the second point, not all newly created layers get a new backing surface (a graphics context into which layers are drawn), some layers happily share a backing surface. Hardware compositing is generally a good thing because it means the GPU will assist Chrome in putting together the page rather than everything happening on the CPU. It creates a new layer with its own backing surface in Chrome.It switches on the hardware compositing mode in Chrome, assuming it's supported for the platform you're on and isn't on already.The translate3d hack, then, does two things: A lot of developers apply it to their elements to give their pages a speed boost so I wanted to take a quick peek behind the scenes (from a Chrome perspective) and see why it works. So you know that magic bullet hack for Chrome (and other WebKit ports) that makes things really zippy? You know, -webkit-transform: translateZ(0) or its good friend -webkit-transform: translate3d(0,0,0) ? Sometimes it’s called the null transform hack.
