Gecko:Layers: Difference between revisions

Line 131: Line 131:
   // Only managed layers can be drawn to directly from software.
   // Only managed layers can be drawn to directly from software.
   // Any created layer can contain other layers inside, places anywhere
   // Any created layer can contain other layers inside, places anywhere
   // on its surface.
   // on its surface. The layer is initially locked, meaning it's not
  // shown until unlocked.
   Layer *CreateLayer(size, format, type);
   Layer *CreateLayer(size, format, type);
  };
  };
Line 141: Line 142:
   // This contains an alpha value so opacity can implicitly
   // This contains an alpha value so opacity can implicitly
   // be controlled.
   // be controlled.
   SetColor(color);  
   void SetColor(color);  
   
   
   // Sets an affine transformation to place the layer with.
   // Sets an affine transformation to place the layer with.
   SetTransform(matrix);
   void SetTransform(matrix);
   
   
   // Add a layer to this layer. This layer may be blitted onto
   // Add a layer to this layer. This layer may be blitted onto
   // this layer's hardware surface.
   // this layer's hardware surface.
   AddLayer(ILayer);
   void AddLayer(ILayer);
   
   
   // Optional pixel shader program to run on this layer. This can be
   // Optional pixel shader program to run on this layer. This can be
   // used to apply a variety of effects to the layer when rendered.
   // used to apply a variety of effects to the layer when rendered.
   SetShader(shader);
   void SetShader(shader);
  // Lock the layer, this makes no changes take effect while in the
  // locked state.
  void Lock();
  // Unlock the layer, this will cause the compositor to traverse
  // passed this frame in the tree when compositing.
  void Unlock();
  // Clone an instance of this layer, it will contain a copy-on-write
  // reference to the contents of this layer. This layer will initially
  // be locked.
  ILayer *Clone();
  };
  };


Line 166: Line 180:
   // Unlock the surface, this means we're done. And will signal the
   // Unlock the surface, this means we're done. And will signal the
   // compositor to update the associated texture and redraw.
   // compositor to update the associated texture and redraw.
   Unlock();
   void Unlock();
  };
  };


Confirmed users
138

edits