Lines Matching refs:Layer
38 class Layer;
52 // Layer manages a texture, transform and a set of child Layers. Any View that
53 // has enabled layers ends up creating a Layer to manage the texture.
54 // A Layer can also be created without a texture, in which case it renders
59 // NOTE: unlike Views, each Layer does *not* own its children views. If you
60 // delete a Layer and it has children, the parent of each child layer is set to
62 class COMPOSITOR_EXPORT Layer
69 Layer();
70 explicit Layer(LayerType type);
71 virtual ~Layer();
73 // Retrieves the Layer's compositor. The Layer will walk up its parent chain
74 // to locate it. Returns NULL if the Layer is not attached to a compositor.
77 // Called by the compositor when the Layer is set as its root Layer. This can
78 // only ever be called on the root layer.
84 // Adds a new Layer to this Layer.
85 void Add(Layer* child);
87 // Removes a Layer from this Layer.
88 void Remove(Layer* child);
91 void StackAtTop(Layer* child);
94 // layer. Note that if |child| is initially stacked even higher, calling this
96 void StackAbove(Layer* child, Layer* other);
99 void StackAtBottom(Layer* child);
102 // layer.
103 void StackBelow(Layer* child, Layer* other);
106 const std::vector<Layer*>& children() const { return children_; }
109 const Layer* parent() const { return parent_; }
110 Layer* parent() { return parent_; }
114 // Returns true if this Layer contains |other| somewhere in its children.
115 bool Contains(const Layer* other) const;
117 // The layer's animator is responsible for causing automatic animations when
119 // handles blending of animations. The layer takes ownership of the animator.
122 // Returns the layer's animator. Creates a default animator of one has not
143 // bounds of this layer.
147 // The opacity of the layer. The opacity is applied to each pixel of the
152 // Returns the actual opacity, which the opacity of this layer multipled by
156 // Blur pixels by this amount in anything below the layer and visible through
157 // the layer.
161 // Saturate all pixels of this layer by this amount.
167 // Change the brightness of all pixels from this layer by this amount.
177 // Change the grayscale of all pixels from this layer by this amount.
191 // Invert the layer.
199 // Set a layer mask for a layer.
200 // Note the provided layer mask can neither have a layer mask itself nor can
203 // Furthermore: A mask layer can only be set to one layer.
204 void SetMaskLayer(Layer* layer_mask);
205 Layer* layer_mask_layer() { return layer_mask_; }
207 // Sets the visibility of the Layer. A Layer may be visible but not
208 // drawn. This happens if any ancestor of a Layer is not visible.
216 // Returns true if this Layer is drawn. A Layer is drawn only if all ancestors
220 // Returns true if this layer can have a texture (has_texture_ is true)
225 // |target|. Necessarily, |source| and |target| must inhabit the same Layer
227 static void ConvertPointToLayer(const Layer* source,
228 const Layer* target,
233 // ancestor of this layer).
234 bool GetTargetTransformRelativeTo(const Layer* ancestor,
237 // Converts a ui::Layer's transform to the transform on the corresponding
238 // cc::Layer.
257 // Set new TextureMailbox for this layer. Note that |mailbox| may hold a
274 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR.
277 // Adds |invalid_rect| to the Layer's pending invalid rect and calls
281 // Schedules a redraw of the layer tree at the compositor.
282 // Note that this _does not_ invalidate any region of this layer; use
296 // Notifies the layer that the device scale factor has changed.
299 // Sets whether the layer should scale its content. If true, the canvas will
307 // Returns true if the layer scales its content.
310 // Sometimes the Layer is being updated by something other than SetCanvas
314 // Requets a copy of the layer's output as a texture or bitmap.
322 cc::Layer* cc_layer() { return cc_layer_; }
333 // Forces a render surface to be used on this layer. This has no positive
347 // Whether this layer has animations waiting to get sent to its cc::Layer.
358 void StackRelativeTo(Layer* child, Layer* other, bool above);
360 bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const;
361 bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const;
400 // Set all filters which got applied to the layer.
403 // Set all filters which got applied to the layer background.
408 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer);
411 // layer tree. Instead, we hold on to these animations in
422 Layer* parent_;
424 // This layer's children, in bottom-to-top stacking order.
425 std::vector<Layer*> children_;
429 // Visibility of this layer. See SetVisible/IsDrawn for more details.
436 // If true the layer is always up to date.
446 // the layer.
452 // The associated mask layer with this layer.
453 Layer* layer_mask_;
454 // The back link from the mask layer to it's associated masked layer.
455 // We keep this reference for the case that if the mask layer gets deleted
456 // while attached to the main layer before the main layer is deleted.
457 Layer* layer_mask_back_link_;
459 // The zoom factor to scale the layer by. Zooming is disabled when this is
472 // Animations that are passed to AddThreadedAnimation before this layer is
476 // Ownership of the layer is held through one of the strongly typed layer
477 // pointers, depending on which sort of layer this is.
482 cc::Layer* cc_layer_;
484 // If true, the layer scales the canvas and the texture with the device scale
501 DISALLOW_COPY_AND_ASSIGN(Layer);