| 1 | = AGC - or Accelerated Graphics Context = |
| 2 | AGC is an initiative to support hardware acceleration in WebKit, at a lower level than today's accelerated compositing. |
| 3 | |
| 4 | Right now the architecture looks something like the following: |
| 5 | Document -> Renderer -> Compositor -> Platform-specific layer system (QGraphicsView, CoreAnimations, Chromium layers...) |
| 6 | |
| 7 | ... where the compositor is invoked for CSS opacity/transform animations and 3D transforms. |
| 8 | |
| 9 | The idea is to share the layer system across platforms, with a common GLES2 implementation, and to have the following as platform specific parts: |
| 10 | |
| 11 | 1. '''Content rasterizer''': each layer's content is still handled in software by the platform. |
| 12 | 2. '''Setting up the GL context''': The web-view has to initiate a GL context and make it current before letting WebCore render into it |
| 13 | 3. Optionally, a platform-specific implementation of AGC. |
| 14 | |
| 15 | == The purpose == |
| 16 | The purpose for this is to make it easy for ports to use the accelerated-compositing feature of webkit, without having to write a whole scene-graph library. The theory is that WebCore already retains the scene-graph, so there's no need for an additional scene-graph library underneath it, and what's needed is simple translation from the model to a paint sequence. |
| 17 | |
| 18 | == The API == |
| 19 | AGC is a low level API tuned to what GPU and blitter hardware can actually accelerate, unlike the GraphicsContext API which is more of a classic 2D software API. The only primitives available to AGC are '''Texture''', '''Surface''' and '''Quad'''. The idea is that the backend for AGC would know how to draw a texture on a surface in a given quad (which is usually represented as a rectangle + matrix), and the frontend, which is GraphicsLayerAGC, would translate the retainable-scenegraph model it gets from WebCore into a paint sequence that includes almost exclusively mapping textures between surfaces (other functions may include rudimentary clipping). |
| 20 | This allows, for example, accelerated reflections and accelerated masks with multi-texturing. |
| 21 | |
| 22 | |
| 23 | == Files == |
| 24 | Currently in [http://gitorious.org/~noamr/webkit/noamrs-webkit/commits/AGC] |
| 25 | See: |
| 26 | |
| 27 | {{{ |
| 28 | platform/graphics/AcceleratedGraphicsContext.h |
| 29 | platform/graphics/GraphicsLayerAGC.h |
| 30 | platform/graphics/GraphicsLayerAGC.cpp |
| 31 | platform/graphics/AGCOpenGL.h |
| 32 | platform/graphics/AGCOpenGL.cpp |
| 33 | platform/graphics/qt/AGCQt.h |
| 34 | platform/graphics/qt/AGCQt.cpp |
| 35 | }}} |
| 36 | |
| 37 | |