Chromium Code Reviews| Index: ui/compositor/layer.h |
| diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h |
| index d308f607716629d1d0c2ea0cb6f74b39652bc062..be8bbb98f8e0130f97c403968592b082f947c2ea 100644 |
| --- a/ui/compositor/layer.h |
| +++ b/ui/compositor/layer.h |
| @@ -196,13 +196,12 @@ class COMPOSITOR_EXPORT Layer |
| // otherwise. |
| float GetTargetOpacity() const; |
| - // Set a layer mask for a layer. |
| + // Set a layer mask for a layer. This transfers the ownership of |layer_mask|; |
| + // a mask layer can only be transferred to one layer. |
| // Note the provided layer mask can neither have a layer mask itself nor can |
| - // it have any children. The ownership of |layer_mask| will not be |
| - // transferred with this call. |
| - // Furthermore: A mask layer can only be set to one layer. |
| + // it have any children. |
| void SetMaskLayer(Layer* layer_mask); |
|
piman
2013/10/04 03:44:39
Make this take a scoped_ptr<Layer>, to indicate it
michaelpg
2013/10/04 05:56:41
Done.
|
| - Layer* layer_mask_layer() { return layer_mask_; } |
| + Layer* layer_mask_layer() { return layer_mask_.get(); } |
| // Sets the visibility of the Layer. A Layer may be visible but not |
| // drawn. This happens if any ancestor of a Layer is not visible. |
| @@ -449,8 +448,8 @@ class COMPOSITOR_EXPORT Layer |
| float layer_grayscale_; |
| bool layer_inverted_; |
| - // The associated mask layer with this layer. |
| - Layer* layer_mask_; |
| + // The mask layer associated with this layer. |
| + scoped_ptr<Layer> layer_mask_; |
| // The back link from the mask layer to it's associated masked layer. |
| // We keep this reference for the case that if the mask layer gets deleted |
| // while attached to the main layer before the main layer is deleted. |