Gecko:Layers: Difference between revisions

194 bytes removed ,  7 October 2009
Line 24: Line 24:
  class LayerBuilder {
  class LayerBuilder {
   // Indicate that the given layer is related to this one, e.g., the new layer
   // Indicate that the given layer is related to this one, e.g., the new layer
   // corresponds to the same element as the given layer. This adopts the
   // corresponds to the same element as the given layer.
  // caller's reference to the given layer. If the LayerBuilder is now the only
   // We can use this to predict that the new layer will be used in the
  // thing holding a reference to the given Layer, we can recycle the Layer's
  // resources here (even the Layer object itself).
   // We can also use this to predict that the new layer will be used in the
   // same way as the given layer, for example, the eventual rendering
   // same way as the given layer, for example, the eventual rendering
   // destination(s) of the new layer can be predicted to be whatever the old
   // destination(s) of the new layer can be predicted to be whatever the old
Line 94: Line 91:
   RenderedLayerBuilder(size, format);
   RenderedLayerBuilder(size, format);
   
   
   // create a (conceptual) copy of the given RenderedLayer so we can modify it
   // create a (conceptual) copy of the given RenderedLayer so we can modify its
   // or draw into it. This adopts the caller's reference, so if this is the
   // parameters or draw into it. The underlying buffer can be managed with
   // only reference we can just take over the Layer.
  // copy on write so if we don't ever call getContext, the buffer need not
   // be copied.
   RenderedLayerBuilder(Layer layer);
   RenderedLayerBuilder(Layer layer);
   
   
1,295

edits