Accelerated compositing and 3D CSS transforms

844 views
Skip to first unread message

Vangelis Kokkevis

unread,
Jun 15, 2010, 9:04:21 PM6/15/10
to chromi...@chromium.org
Starting with the most recent builds, chromium now supports gpu-accelerated compositing and webkit's 3D CSS transforms. The code has been under development for a little while but until yesterday it was hidden behind a compile time flag. It's now being compiled in by default on Windows and gets activated when you supply:

--enable-accelerated-compositing

at the command line when starting chrome. Give it a try and see how it works for you.  Here's a couple of links to convince yourself that it works:

http://webkit.org/blog/386/3d-transforms/  (try out all the individual demos linked from the page)


If you really want to be sure you're activating the accelerated compositing path, also use the:

--show-composited-layer-borders

flag which will add red and yellow borders around layers that are composited on the gpu.

A couple of caveats:
1. The code is still pretty fresh so you will find some rough edges. Please file bugs.
2. It only works on windows (the other two platforms are coming soon).
3. You need a gpu and drivers that support at least OpenGL 2.0 . If you have a fairly recent graphics card and up-to-date drivers you should be ok. The eventual plan for Windows is to run this with D3D9 via ANGLE (http://code.google.com/p/angleproject/).
4. WebGL and video don't currently work when accelerated compositing is enabled.

It's worth noting that gpu acceleration kicks in under a fairly restricted set of conditions (as defined in common webkit code inside RenderLayerCompositor::requiresCompositingLayer()). 3D transforms and animated opacity are the most common ways to flip the switch so a quick and dirty way to force compositing on is to add a:

-webkit-transform: translateZ(0)

CSS property to an element. YMMV.

Give it a whirl and see how it works for you. 

Cheers,
Vangelis

Kenneth Russell

unread,
Aug 12, 2010, 7:44:29 PM8/12/10
to vang...@google.com, chromi...@chromium.org

Brief note to mention that support for accelerated compositing is now
compiled in to the Chromium Mac continuous builds. This includes
support for 3D CSS as well as fully accelerated WebGL. It works on
10.6 only. (Linux support for the accelerated compositor was added
recently as well, thanks to Antoine Labour.)

Run with the command-line option --enable-accelerated-compositing to
try it. Add --enable-webgl to test WebGL in combination with the
compositor. Note the performance improvement on large content such as
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/demos/google/nvidia-vertex-buffer-object/index.html
.

The port is currently crashier than on other platforms and has
significant bugs like garbage during and after window resizing. These
are being worked on next. Please feel free to file bugs and assign
them to me. Reproducible test cases appreciated.

-Ken

Reply all
Reply to author
Forward
0 new messages