Gecko:Layers: Difference between revisions

Jump to navigation Jump to search
Line 133: Line 133:
   void endDraw();
   void endDraw();
   
   
   void copyFrom(RenderedLayer, const nsTArray<nsIntRect>& aRegion,
   void copyFrom(RenderedLayer, const nsIntRegion& aRegion,
                 nsIntPoint aDelta);
                 nsIntPoint aDelta);
  }
  }
Line 145: Line 145:
It is possible for aRegionToDraw to return empty, e.g. when nothing changed and the entire visible area is still buffered. The caller should optimize by skipping painting in this case.
It is possible for aRegionToDraw to return empty, e.g. when nothing changed and the entire visible area is still buffered. The caller should optimize by skipping painting in this case.


For scrolling and to enable intelligent salvaging of parts of RenderedLayers by other layers, there is the copyFrom method. The source RenderedLayer must have the same LayerManager. Self-copies are allowed and must be supported somehow, they will be common. The rectangles do not intersect and are copied in order (the order only matters if the source is the same as the destination).
For scrolling and to enable intelligent salvaging of parts of RenderedLayers by other layers, there is the copyFrom method. The source RenderedLayer must have the same LayerManager. Self-copies are allowed and must be supported somehow, they will be common. The part of aRegion that is valid in the source layer is offset by aDelta and becomes valid in the destination layer. The part of aRegion that is invalid in the source layer becomes invalid in the destination layer.


=== ContainerLayer ===
=== ContainerLayer ===
1,295

edits

Navigation menu