Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_COMPOSITOR_LAYER_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_H_ |
| 6 #define UI_COMPOSITOR_LAYER_H_ | 6 #define UI_COMPOSITOR_LAYER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 void SetBackgroundZoom(float zoom, int inset); | 189 void SetBackgroundZoom(float zoom, int inset); |
| 190 | 190 |
| 191 // Invert the layer. | 191 // Invert the layer. |
| 192 bool layer_inverted() const { return layer_inverted_; } | 192 bool layer_inverted() const { return layer_inverted_; } |
| 193 void SetLayerInverted(bool inverted); | 193 void SetLayerInverted(bool inverted); |
| 194 | 194 |
| 195 // Return the target opacity if animator is running, or the current opacity | 195 // Return the target opacity if animator is running, or the current opacity |
| 196 // otherwise. | 196 // otherwise. |
| 197 float GetTargetOpacity() const; | 197 float GetTargetOpacity() const; |
| 198 | 198 |
| 199 // Set a layer mask for a layer. | 199 // Set a layer mask for a layer. This transfers the ownership of |layer_mask|; |
| 200 // a mask layer can only be transferred to one layer. | |
| 200 // Note the provided layer mask can neither have a layer mask itself nor can | 201 // Note the provided layer mask can neither have a layer mask itself nor can |
| 201 // it have any children. The ownership of |layer_mask| will not be | 202 // it have any children. |
| 202 // transferred with this call. | |
| 203 // Furthermore: A mask layer can only be set to one layer. | |
| 204 void SetMaskLayer(Layer* layer_mask); | 203 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.
| |
| 205 Layer* layer_mask_layer() { return layer_mask_; } | 204 Layer* layer_mask_layer() { return layer_mask_.get(); } |
| 206 | 205 |
| 207 // Sets the visibility of the Layer. A Layer may be visible but not | 206 // 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. | 207 // drawn. This happens if any ancestor of a Layer is not visible. |
| 209 void SetVisible(bool visible); | 208 void SetVisible(bool visible); |
| 210 bool visible() const { return visible_; } | 209 bool visible() const { return visible_; } |
| 211 | 210 |
| 212 // Returns the target visibility if the animator is running. Otherwise, it | 211 // Returns the target visibility if the animator is running. Otherwise, it |
| 213 // returns the current visibility. | 212 // returns the current visibility. |
| 214 bool GetTargetVisibility() const; | 213 bool GetTargetVisibility() const; |
| 215 | 214 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 | 441 |
| 443 int background_blur_radius_; | 442 int background_blur_radius_; |
| 444 | 443 |
| 445 // Several variables which will change the visible representation of | 444 // Several variables which will change the visible representation of |
| 446 // the layer. | 445 // the layer. |
| 447 float layer_saturation_; | 446 float layer_saturation_; |
| 448 float layer_brightness_; | 447 float layer_brightness_; |
| 449 float layer_grayscale_; | 448 float layer_grayscale_; |
| 450 bool layer_inverted_; | 449 bool layer_inverted_; |
| 451 | 450 |
| 452 // The associated mask layer with this layer. | 451 // The mask layer associated with this layer. |
| 453 Layer* layer_mask_; | 452 scoped_ptr<Layer> layer_mask_; |
| 454 // The back link from the mask layer to it's associated masked layer. | 453 // 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 | 454 // 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. | 455 // while attached to the main layer before the main layer is deleted. |
| 457 Layer* layer_mask_back_link_; | 456 Layer* layer_mask_back_link_; |
| 458 | 457 |
| 459 // The zoom factor to scale the layer by. Zooming is disabled when this is | 458 // The zoom factor to scale the layer by. Zooming is disabled when this is |
| 460 // set to 1. | 459 // set to 1. |
| 461 float zoom_; | 460 float zoom_; |
| 462 | 461 |
| 463 // Width of the border in pixels, where the scaling is blended. | 462 // Width of the border in pixels, where the scaling is blended. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 497 // The size of the delegated frame in DIP, set when SetDelegatedFrame was | 496 // The size of the delegated frame in DIP, set when SetDelegatedFrame was |
| 498 // called. | 497 // called. |
| 499 gfx::Size delegated_frame_size_in_dip_; | 498 gfx::Size delegated_frame_size_in_dip_; |
| 500 | 499 |
| 501 DISALLOW_COPY_AND_ASSIGN(Layer); | 500 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 502 }; | 501 }; |
| 503 | 502 |
| 504 } // namespace ui | 503 } // namespace ui |
| 505 | 504 |
| 506 #endif // UI_COMPOSITOR_LAYER_H_ | 505 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |