Painting in Chromium (Linux)

395 views
Skip to first unread message

Ben Rockefeller

unread,
Oct 22, 2011, 1:23:32 AM10/22/11
to Chromium-dev
Hi,

There are a few callflows (in design documents) on rendering in
Chromium. But no details about painting...I am really curious how
painting in Webkit/Chromium works in Linux. What libraries are used
(Skia, Cairo, GTK, OpenGL ES, XLib, EGL???). Are 2D pages which don't
have special elements such as canvas, etc. all painted using software
Skia in a buffer surface?

How do the callflows look for 2D and 3D painting with and without GPU
acceleration. Are there any documents, or could someone who is
familiar with this please be so kind to explain it...

thanks

Ben Rockefeller

unread,
Oct 22, 2011, 1:23:32 AM10/22/11
to Chromium-dev

yongsheng zhu

unread,
Oct 27, 2011, 3:59:34 AM10/27/11
to Chromium-dev
Hi, Ben
I'm also studying related topics. Chromium uses Skia, GTK,
openGL(&GLX), openGL-es(&EGL) in different paths.
Here share with some my findings, some may not be accurate:
1) Chromium GTK+ path:
software rendering: use Skia(SkiaCanvas?) to paint, browser and
render processes use share memory to transfer rendered results.
Browser stores it in XPixmap.
accelerated rendering: GPU process creates GL context and renders to
the window browser process creates for it. don't see EGL support for
this path.

2) Chromium views path:
software rendering: use Skia to paint in render process, and share
memory between render and browser process. Browser finally uses
SkiaCanvas to draw the paint results into SkiaBitmap.
accelerated rendering: there are two branches:
EGL: GPU process uses FBOs to render content to XPixmap backed
EGLImages. Browser gets the id and create texture from it and
composite with its browser UI.
GLX: GPU process renders to an off-screen X Window. Browser process
uses XComposite the window(XWindow->XPixmap->GLXPixmap->Texture).

For 2D pages, generally, the solution is using software rendering. but
i believe you could enable GPU accelerated by opening "chrome://flags"
and enable "GPU compositing on all pages".

On Oct 22, 1:23 pm, Ben Rockefeller <benrockefell...@gmail.com> wrote:
> Hi,
>
> There are a few callflows (in design documents) on rendering inChromium. But no details aboutpainting...I am really curious howpaintingin Webkit/Chromiumworks inLinux. What libraries are used
> (Skia, Cairo, GTK, OpenGL ES, XLib, EGL???). Are 2D pages which don't
> have special elements such as canvas, etc. all painted using software
> Skia in a buffer surface?
>
> How do the callflows look for 2D and 3Dpaintingwith and without GPU
Reply all
Reply to author
Forward
0 new messages