Confirmed users
138
edits
(Improve WebRender documentation) |
(Fix outdated references to OMTC) |
||
| Line 677: | Line 677: | ||
* Batching (TODO) | * Batching (TODO) | ||
* Picture-caching (TODO) | * Picture-caching (TODO) | ||
The WebRender code path reuses the layers IPC infrastructure for sharing textures between the content process and the renderer. For example The ImageBridge protocol described in the Compositing section is also used to transfer video frames when WebRender is enabled. | |||
==== Painting/Rasterizing (Layers aka Non-WebRender) ==== | ==== Painting/Rasterizing (Layers aka Non-WebRender) ==== | ||
| Line 692: | Line 694: | ||
Compositing is the action of flattening the layers into the final image that is shown on the screen. | Compositing is the action of flattening the layers into the final image that is shown on the screen. | ||
We paint and composite on separate threads (it is called Off-main-thread compositing, or OMTC, and a long time ago Firefox did not have this separation). | |||
The Layers architecture is built on the following notions: | The Layers architecture is built on the following notions: | ||
| Line 702: | Line 704: | ||
[[File:LayersRefactoring.png|thumb|650px|New layers architecture, with OGL backend]] | [[File:LayersRefactoring.png|thumb|650px|New layers architecture, with OGL backend]] | ||
Since painting and compositing are performed on different threads/processes, we need a mechanism to synchronize a client layer tree that is constructed on the content thread, and a host layer tree that is used for compositing on the compositor thread. | |||
This synchronization process must ensure that the host layer tree reflects the state of the current layer tree while remaining in a consistent state, and must transfer texture data from a thread to the other. Moreover, on some platforms the content and compositor threads may live in separate processes. | This synchronization process must ensure that the host layer tree reflects the state of the current layer tree while remaining in a consistent state, and must transfer texture data from a thread to the other. Moreover, on some platforms the content and compositor threads may live in separate processes. | ||
| Line 721: | Line 723: | ||
* [http://dxr.mozilla.org/mozilla-central/source/gfx/layers/client/CompositableClient.h gfx/layers/client/CompositableClient.h] | * [http://dxr.mozilla.org/mozilla-central/source/gfx/layers/client/CompositableClient.h gfx/layers/client/CompositableClient.h] | ||
To visualize how a web page is layered, turn on the pref "layers.draw-borders" in about:config. When this pref is on, the borders of layers and tiles are displayed on top of the content. This only works when using the | To visualize how a web page is layered, turn on the pref "layers.draw-borders" in about:config. When this pref is on, the borders of layers and tiles are displayed on top of the content. This only works when using the Compositor API, that is when WebRender is disabled, since WebRender does not have the same concept of layers. | ||
Blog posts with information on Layers that should be integrated here: | Blog posts with information on Layers that should be integrated here: | ||