Gecko:Layers: Difference between revisions

Jump to navigation Jump to search
Line 202: Line 202:


Note that rule 1 means you must add all children to a ContainerLayer before rendering into any of them, and in particular you must add a RenderedLayer to its parent before rendering into it. These constraints are easy enough for the display list subsystem to satisfy.
Note that rule 1 means you must add all children to a ContainerLayer before rendering into any of them, and in particular you must add a RenderedLayer to its parent before rendering into it. These constraints are easy enough for the display list subsystem to satisfy.
=== Additional Implementation Notes ===
To implement off-main-thread compositing with animation, you need to retain the contents of the visible regions of all RenderedLayers, plus the layer client (layout) must provide visible regions that include all the areas that will become visible over time.
One way to implement begin/endTransaction is for the compositing thread to retain a "lazy copy" of the layer tree. When a layer is modified by the main thread for the first time during a given transaction, it makes a copy of the layer to be used by the compositing thread if compositing must happen during the transaction. As far as the compositing thread is concerned, its copy is immutable. This means that RenderedLayer::beginDraw must make a copy of at least aDrawRegion for the compositing thread to use. On endTransaction, the compositing thread's copy can be thrown away (as long as compositing isn't currently happening), and it can get a new lazy copy of the layer tree.


=== Rendering Layers To Arbitrary Cairo Targets ===
=== Rendering Layers To Arbitrary Cairo Targets ===
1,295

edits

Navigation menu