Platform/GFX/X11GLLayers: Difference between revisions

From MozillaWiki
< Platform‎ | GFX
Jump to navigation Jump to search
(mentioned performance differences)
Line 6: Line 6:


Getting rid of X-specific APIs have several other advantages:
Getting rid of X-specific APIs have several other advantages:
* It is a step forward in the direction of supporting Wayland.
* It is a step forward in the direction of supporting Wayland.
* It reduces the number of platform specific APIs (Mac, Fennec and B2G use OpenGL), and make it easier for us to write new features that work on several platform out of the box (or almost), including Linux.
* It reduces the number of platform specific APIs (Mac, Fennec and B2G use OpenGL), and make it easier for us to write new features that work on several platform out of the box (or almost), including Linux.
 
Removing use of RENDER acceleration for drawing will cost in performance in some situations.  Expected areas include:
* Compositing of glyphs for text.
* Compositing of images in canvas.
GL layers should benefit performance where subpixel aa text in a translucent layer is scrolled over a fixed background.  (Black-white component-alpha extraction is not possible with RENDER API and full component-alpha 2D rendering for basic layers would require major changes deep into cairo.)
It is hoped that the benefits for subpixel aa text in translucent layers outweigh the cost of compositing glyphs in software.  There may also be benefits in client-side CPU rendering with complex paths.  An OpenGL canvas implementation is required also for other platforms, so that will save us from removing gpu acceleration of canvas.


Some known limitations:
Some known limitations:
* We cannot have GTK2 and GTK3 symbols in the same address-space.
* We cannot have GTK2 and GTK3 symbols in the same address-space.
* plugins like Flash need GTK2.
* plugins like Flash need GTK2.
* GTK2 needs XLib surfaces for native widget rendering (GTK3 relaxes this constraint by decoupling the gtkStyleContext from the widget, meaning that you can render a native widget into a cairo surface rather than an XLib surface).
* GTK2 needs XLib surfaces for native widget rendering (GTK3 relaxes this constraint by decoupling the gtkStyleContext from the widget, meaning that you can render a native widget into a cairo surface rather than an XLib surface).


So a prerequisite for getting rid of X surfaces is to use GTK3 instead of GTK2.
So a prerequisite for getting rid of X surfaces is to use GTK3 instead of GTK2.

Revision as of 10:24, 17 July 2012

Overview

GL Layers are not enabled by default on X11. The primary problem is that we are still using X11 rendering APIs (XRender) that render into X pixmaps, which have poor interoperability with OpenGL (the texture_from_pixmap extension is buggy).

So we want to stop using XRender, stop using X pixmaps, and then we'll be in a place to easily enable GL layers by default.

Getting rid of X-specific APIs have several other advantages:

  • It is a step forward in the direction of supporting Wayland.
  • It reduces the number of platform specific APIs (Mac, Fennec and B2G use OpenGL), and make it easier for us to write new features that work on several platform out of the box (or almost), including Linux.

Removing use of RENDER acceleration for drawing will cost in performance in some situations. Expected areas include:

  • Compositing of glyphs for text.
  • Compositing of images in canvas.

GL layers should benefit performance where subpixel aa text in a translucent layer is scrolled over a fixed background. (Black-white component-alpha extraction is not possible with RENDER API and full component-alpha 2D rendering for basic layers would require major changes deep into cairo.) It is hoped that the benefits for subpixel aa text in translucent layers outweigh the cost of compositing glyphs in software. There may also be benefits in client-side CPU rendering with complex paths. An OpenGL canvas implementation is required also for other platforms, so that will save us from removing gpu acceleration of canvas.

Some known limitations:

  • We cannot have GTK2 and GTK3 symbols in the same address-space.
  • plugins like Flash need GTK2.
  • GTK2 needs XLib surfaces for native widget rendering (GTK3 relaxes this constraint by decoupling the gtkStyleContext from the widget, meaning that you can render a native widget into a cairo surface rather than an XLib surface).

So a prerequisite for getting rid of X surfaces is to use GTK3 instead of GTK2.

Action plan

This section is a stub. You can help wikipedia by improving it. Especially if your name is karlt or ebassi.

  • 1. Switch to GTK3
  • 2. ???
  • 3. profit!