Accelerated Compositing with Clutter!

I have been working on a new hardware acceleration backend for WebKitGtk+ with Clutter. This is an experimental feature, but after I added Clutter, Cogl, Clutter-gtk to WebKit jhbuild module file, you can try to test it more easily wth WebKit upstream.

Building WebKitGtk+ with Clutter

First thing you have to do is to set WEBKIT_EXTRA_MODULES environment variable as follows:

export WEBKIT_EXTRA_MODULES=webkitgtk-clutter-dependencies,libsecret

If you are using Ubuntu12.04, you should also add libsecret.

Before running build-webkkt script, you need to update all dependent libraries of WebKitGtk+ by running update-webkitgtk-libs script.

$ Tools/Scripts/update-webkitgtk-libs

Then, run build-webkit script as follows:

./Tools/Scripts/build-webkit --gtk --with-acceleration-backend=clutter --no-webgl

You can run the WebKitGtk+ launcher with enabling accelerated compositing as follows:

$ ./Tools/Scripts/run-launcher --gtk --enable-accelerated-compositing

Currently, basic features of CSS 3D transforms, and animations are working, but there are many missing features. Actually, the Clutter backend is already working well in WebKit-Clutter port. I worked on this port before, so the WebKit-Clutter development team(Kov, Changseok) and I are porting accelerated composting code of WebKit-Clutter to WebKitGtk+.

Anyway, the Clutter backend is very important because GTK+4.0 is planing to use Clutter or Cogl as a GDK backend. I expect that the Clutter backend may be able to work better with GTK+4.0

Building Wayland with Jhbuild

“Wayland is a computer display server protocol and a library for Linux implementing that protocol” This could be used to implement a window & compositing manager for Linux desktop. Weston is the reference implementation of a Wayland compositor.

There is a good instruction to build Wayland, but building Wayland is not easy because it may cause problems on your Linux system if you install Wayland and its dependencies on you system folder (/usr).

Therefore, I recommend that you will install Wayland on a separated environment using Jhbuild. Fortunately, a Jhbuild module file for building Wayland was included in Jhbuild, so we can build Wayland by just running a Jhbuild command.

First thing we need to do is build and install jhbuild from Jhbuild git respository.
Then, follows the below steps. You may need to install several dependencies such as libpciaccess-dev, libxcb-dri2.0-dev, libxcb-xfixes0-dev, libmtdev-dev, and libpam0g-dev.

$ cd ~/git/jhbuild/examples/
$ jhbuild --file wayland.jhbuildrc build
$ jhbuild --file wayland.jhbuildrc shell
$ sudo su -
$ export LD_LIBRARY_PATH=/home/joone/wayland/lib64
$ ./weston

I tried to run Western under X, but it didn’t. Instead, I could run Western outside X. I’m not sure if I set up Wayland environment correctly, but I could run sample applications for Wayland. There is a build script for Wayland so you can also try this.