Changes between Version 16 and Version 17 of CoordinatedGraphicsSystem
- Timestamp:
- Aug 4, 2012, 11:24:09 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CoordinatedGraphicsSystem
v16 v17 76 76 77 77 '''[/browser/trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp TextureMapperGL]''' is the GPU-accelerated implementation of the drawing primitives. It is currently used by Qt-WebKit2, GTK+ and EFL(?). TextureMapperGL uses shaders compatible with GL ES 2.0, though we’re in the process of converting it to use the WebGL infrastructure directly, which would help with shader compatibility. 78 79 === Comments ===80 78 81 79 TextureMapperGL tries to use scissors for clipping whenever it can, though if the clipping is not rectangular stencil is used. … … 100 98 101 99 '''[/browser/trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp TextureMapperBackingStore]''' is what glues TextureMapperLayer with different backing stores. 102 It allows the type of backing store to be abstracted away from TextureMapperLayer, allowing TextureMapperLayer to be used both with a standard tiled backing store for WebKit1 (TextureMapperTiledBackingStore), a GraphicsSurface-backed backing store for WebGL (TextureMapperSurfaceBackingStore) or a backing store for WebKit2 (WebKit:: LayerBackingStore).100 It allows the type of backing store to be abstracted away from TextureMapperLayer, allowing TextureMapperLayer to be used both with a standard tiled backing store for WebKit1 (TextureMapperTiledBackingStore), a GraphicsSurface-backed backing store for WebGL (TextureMapperSurfaceBackingStore) or a backing store for WebKit2 (WebKit::CoordinatedBackingStore). 103 101 104 102 The implementation in TextureMapperTiledBackingStore is pretty simple, and is used only to work around the 2000x2000 texture size limitation in OpenGL. It is very different from the dynamic tiled backing store, discussed later. … … 133 131 134 132 === Classes === 135 '''[/browser/trunk/Source/WebKit2/WebProcess/WebPage/ LayerTreeCoordinator/WebGraphicsLayer.cpp WebGraphicsLayer]''' is what glues together the composited content which WebCore creates as GraphicsLayers, and the coordinated graphics system.136 WebGraphicsLayer does not deal with IPC directly. Instead, it saves the information gathered from the compositor, and prepares it for serialization. It maintains an ID for each layer, which allows naming each layer, links a layer ID with its backing store, and deals with directly composited images and how they are serialized.137 138 '''[/browser/trunk/Source/WebKit2/WebProcess/WebPage/ LayerTreeCoordinator/LayerTreeCoordinator.cpp LayerTreeCoordinator]''' is the “boss” for synchronizing the content changes and the viewport changes. It acts on a frame-by-frame basis. For each frame it retrieves the up-to-date layer information from the different WebGraphicsLayers, makes sure the backing-store content is ready to be serialized, prepares the information needed for scroll adjustment, and passes all that info to the UI process in a series of messages for each frame.133 '''[/browser/trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp CoordinatedGraphicsLayer]''' is what glues together the composited content which WebCore creates as GraphicsLayers, and the coordinated graphics system. 134 CoordinatedGraphicsLayer does not deal with IPC directly. Instead, it saves the information gathered from the compositor, and prepares it for serialization. It maintains an ID for each layer, which allows naming each layer, links a layer ID with its backing store, and deals with directly composited images and how they are serialized. 135 136 '''[/browser/trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp LayerTreeCoordinator]''' is the “boss” for synchronizing the content changes and the viewport changes. It acts on a frame-by-frame basis. For each frame it retrieves the up-to-date layer information from the different CoordinatedGraphicsLayers, makes sure the backing-store content is ready to be serialized, prepares the information needed for scroll adjustment, and passes all that info to the UI process in a series of messages for each frame. 139 137 140 138 LayerTreeCoordinator maintains a map of “directly composited images” - images that are rendered once and used multiple times in the same texture. LayerTreeCoordinator maintains the ref-counted lifecycle of such an image, signaling to the UI process when an image is no longer in use and its backing texture can be destroyed. … … 144 142 Another important role of LayerTreeCoordinator is to receive the viewport information from the UI process, and to propagate that information to the different tiled backing-stores so that they can prepare to create/destroy tiles. 145 143 146 '''[/browser/trunk/Source/WebKit2/UIProcess/ LayerTreeCoordinatorProxy.cpp LayerTreeCoordinatorProxy]''' is what binds together the viewport, the GPU renderer and the contents. It doesn't have functionality of its own, instead it acts as a message hub between those components.147 148 '''[/browser/trunk/Source/WebKit2/UIProcess/ WebLayerTreeRenderer.cpp WebLayerTreeRenderer]''' is the class that knows how to turn serialized information from the web process and viewport information from the view classes into a GPU-renderable tree of TextureMapperLayers. It maintains a map of layer IDs to layers,144 '''[/browser/trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp LayerTreeCoordinatorProxy]''' is what binds together the viewport, the GPU renderer and the contents. It doesn't have functionality of its own, instead it acts as a message hub between those components. 145 146 '''[/browser/trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp LayerTreeRenderer]''' is the class that knows how to turn serialized information from the web process and viewport information from the view classes into a GPU-renderable tree of TextureMapperLayers. It maintains a map of layer IDs to layers, 149 147 150 148 … … 170 168 TiledBackingStore relies on an abstract WebCore::Tile implementation, allowing for different decisions around drawing the tiles synchronously or asynchronously. 171 169 172 '''[/browser/trunk/Source/WebKit2/WebProcess/WebPage/ TiledBackingStoreRemoteTile.cpp TiledBackingStoreRemoteTile]''' is a web-process backend for WebCore::Tile, allowing software rendering of tiles into the coordinated graphics system. It's the tile-equivalent of WebGraphicsLayer, maintaining a tile-ID map. It uses a special client (a superclass of LayerTreeCoordinator) to allocate content surfaces and send the messages to the UI process.170 '''[/browser/trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedTile.cpp CoordinatedTile]''' is a web-process backend for WebCore::Tile, allowing software rendering of tiles into the coordinated graphics system. It's the tile-equivalent of CoordinatedGraphicsLayer, maintaining a tile-ID map. It uses a special client (a superclass of LayerTreeCoordinator) to allocate content surfaces and send the messages to the UI process. 173 171 174 172 '''[/browser/trunk/Source/WebKit2/Shared/ShareableBitmap.cpp ShareableBitmap]''' is used by Apple and other ports, but in this context it is used as a software backing-store for content updates. When there is no platform-specific GraphicsSurface implementation, ShareableBitmap acts as a fallback that uses standard shared memory as a backing store for the update, and then updates the TextureMapper GPU backing-stores (BitmapTextures) with the contents from that shared memory. … … 184 182 '''[/browser/trunk/Source/WebKit2/Shared/ShareableSurface.cpp ShareableSurface]''' is a glue class that abstracts away the differences between GraphicsSurface and ShareableBitmap for the purposes of serialization. This is a convenience, to allow us to avoid adding #ifdefs or special code-paths for GraphicsSurface in too many places in WebKit2. 185 183 186 '''[/browser/trunk/Source/WebKit2/UIProcess/ LayerBackingStore.cpp LayerBackingStore]''' synchronizes remote tiles and ShareableSurfaces with TextureMapper in the UI process. It is responsible for copying or swapping the data in the BitmapTexture with new data or updates from ShareableSurface. It also knows how to paint the different tiles with relation to the parameters received from TextureMapperLayer.184 '''[/browser/trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp CoordinatedBackingStore]''' synchronizes remote tiles and ShareableSurfaces with TextureMapper in the UI process. It is responsible for copying or swapping the data in the BitmapTexture with new data or updates from ShareableSurface. It also knows how to paint the different tiles with relation to the parameters received from TextureMapperLayer. 187 185 188 186 '''[/browser/trunk/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp UpdateAtlas]''' is a graphics-memory optimization, designed to avoid fragmented allocations of small update buffers. Instead of allocating small buffers as it goes along, UpdateAtlas allocates large graphics buffers, and manages the update-patch allocations by itself, using square shapes inside the large buffers as sub-images to store temporary pixel data. … … 197 195 == [#=QtScenegraph QtScenegraph integration] == 198 196 To integrate WebKit coordinated graphics with the QtScenegraph, the following main things were necessary: 199 1. Making WebLayerTreeRenderer thread-safe, so it can run in QtScenegraph's rendering thread.197 1. Making LayerTreeRenderer thread-safe, so it can run in QtScenegraph's rendering thread. 200 198 1. Use a private API from QtScenegraph (QSGRenderNode) which allows us to render WebKit's layer tree without rendering into an intermediate FBO. 201 199 1. Synchronize the remote content coming from the UI process at a time that is right for QtScenegraph. 202 1. Propagate the clipping, transform and opacity attributes from QtScenegraph to WebLayerTreeRenderer.200 1. Propagate the clipping, transform and opacity attributes from QtScenegraph to LayerTreeRenderer. 203 201 1. Render the view's background. 204 202 205 The class that handles most of this is [/browser/trunk/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp QtWebPageSGNode]. Its main function, “render”, is used to translate QtScenegraph parameters to WebLayerTreeRenderer parameters. The SG node contains 3 nodes - a root node that controls the viewport transform, a background node, and a custom contents node which renders the actual web contents using WebLayerTreeRenderer.203 The class that handles most of this is [/browser/trunk/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp QtWebPageSGNode]. Its main function, “render”, is used to translate QtScenegraph parameters to LayerTreeRenderer parameters. The SG node contains 3 nodes - a root node that controls the viewport transform, a background node, and a custom contents node which renders the actual web contents using LayerTreeRenderer. 206 204 Some other functionality is in QQuickWebPage::updatePaintNode. 207 205