[email protected] | 036e6c97 | 2012-01-03 18:48:05 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 116302fc | 2012-05-05 21:45:41 | [diff] [blame] | 5 | #ifndef UI_COMPOSITOR_LAYER_H_ |
| 6 | #define UI_COMPOSITOR_LAYER_H_ |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 7 | |
avi | 87b8b58 | 2015-12-24 21:35:25 | [diff] [blame] | 8 | #include <stddef.h> |
| 9 | |
[email protected] | 33699e62 | 2011-11-17 18:29:30 | [diff] [blame] | 10 | #include <string> |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 11 | #include <vector> |
| 12 | |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 13 | #include "base/compiler_specific.h" |
avi | 87b8b58 | 2015-12-24 21:35:25 | [diff] [blame] | 14 | #include "base/macros.h" |
[email protected] | 51f1b48 | 2011-06-23 16:52:12 | [diff] [blame] | 15 | #include "base/memory/ref_counted.h" |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 16 | #include "base/memory/scoped_ptr.h" |
[email protected] | 4e2d03e2 | 2013-07-18 04:19:54 | [diff] [blame] | 17 | #include "base/message_loop/message_loop.h" |
danakj | 0b5eae6c | 2015-04-24 22:35:11 | [diff] [blame] | 18 | #include "cc/base/region.h" |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 19 | #include "cc/layers/content_layer_client.h" |
[email protected] | 29e17b0 | 2013-08-30 02:13:33 | [diff] [blame] | 20 | #include "cc/layers/layer_client.h" |
jbauman | dbccae1ab | 2014-11-06 23:26:44 | [diff] [blame] | 21 | #include "cc/layers/surface_layer.h" |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 22 | #include "cc/layers/texture_layer_client.h" |
[email protected] | 42f40a5 | 2013-06-08 04:38:51 | [diff] [blame] | 23 | #include "cc/resources/texture_mailbox.h" |
[email protected] | ca2c3ea | 2014-07-26 19:35:30 | [diff] [blame] | 24 | #include "cc/surfaces/surface_id.h" |
[email protected] | 116302fc | 2012-05-05 21:45:41 | [diff] [blame] | 25 | #include "third_party/skia/include/core/SkColor.h" |
| 26 | #include "third_party/skia/include/core/SkRegion.h" |
| 27 | #include "ui/compositor/compositor.h" |
| 28 | #include "ui/compositor/layer_animation_delegate.h" |
| 29 | #include "ui/compositor/layer_delegate.h" |
loyso | 1fe980f | 2016-01-18 23:58:15 | [diff] [blame] | 30 | #include "ui/compositor/layer_threaded_animation_delegate.h" |
[email protected] | 116302fc | 2012-05-05 21:45:41 | [diff] [blame] | 31 | #include "ui/compositor/layer_type.h" |
tfarina | 3b0452d | 2014-12-31 15:20:09 | [diff] [blame] | 32 | #include "ui/gfx/geometry/rect.h" |
hshi | 270f622 | 2015-03-17 21:18:34 | [diff] [blame] | 33 | #include "ui/gfx/image/image_skia.h" |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 34 | #include "ui/gfx/transform.h" |
| 35 | |
[email protected] | 892ad8a | 2011-07-27 02:47:22 | [diff] [blame] | 36 | class SkCanvas; |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 37 | |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 38 | namespace cc { |
| 39 | class ContentLayer; |
[email protected] | a7fcdda3 | 2013-07-04 02:23:07 | [diff] [blame] | 40 | class CopyOutputRequest; |
[email protected] | 09f6738 | 2013-10-09 21:03:45 | [diff] [blame] | 41 | class DelegatedFrameProvider; |
[email protected] | b14d40d | 2013-03-06 03:53:27 | [diff] [blame] | 42 | class DelegatedRendererLayer; |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 43 | class Layer; |
[email protected] | 98a5913 | 2014-07-16 22:49:52 | [diff] [blame] | 44 | class NinePatchLayer; |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 45 | class ResourceUpdateQueue; |
| 46 | class SolidColorLayer; |
[email protected] | ca2c3ea | 2014-07-26 19:35:30 | [diff] [blame] | 47 | class SurfaceLayer; |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 48 | class TextureLayer; |
[email protected] | e00bab02 | 2013-08-19 00:42:45 | [diff] [blame] | 49 | struct ReturnedResource; |
| 50 | typedef std::vector<ReturnedResource> ReturnedResourceArray; |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 51 | } |
| 52 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 53 | namespace ui { |
| 54 | |
| 55 | class Compositor; |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 56 | class LayerAnimator; |
[email protected] | 07ae973e | 2014-03-05 18:51:10 | [diff] [blame] | 57 | class LayerOwner; |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 58 | |
| 59 | // Layer manages a texture, transform and a set of child Layers. Any View that |
| 60 | // has enabled layers ends up creating a Layer to manage the texture. |
[email protected] | 28cd2bb | 2011-09-19 21:04:19 | [diff] [blame] | 61 | // A Layer can also be created without a texture, in which case it renders |
| 62 | // nothing and is simply used as a node in a hierarchy of layers. |
[email protected] | cd9a61c7 | 2012-05-08 19:16:59 | [diff] [blame] | 63 | // Coordinate system used in layers is DIP (Density Independent Pixel) |
| 64 | // coordinates unless explicitly mentioned as pixel coordinates. |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 65 | // |
[email protected] | ae2202a | 2014-01-07 11:11:10 | [diff] [blame] | 66 | // NOTE: Unlike Views, each Layer does *not* own its child Layers. If you |
| 67 | // delete a Layer and it has children, the parent of each child Layer is set to |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 68 | // NULL, but the children are not deleted. |
[email protected] | 2700daddd | 2012-07-13 19:35:37 | [diff] [blame] | 69 | class COMPOSITOR_EXPORT Layer |
| 70 | : public LayerAnimationDelegate, |
loyso | 1fe980f | 2016-01-18 23:58:15 | [diff] [blame] | 71 | public LayerThreadedAnimationDelegate, |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 72 | NON_EXPORTED_BASE(public cc::ContentLayerClient), |
[email protected] | bf91227 | 2013-02-23 01:54:16 | [diff] [blame] | 73 | NON_EXPORTED_BASE(public cc::TextureLayerClient), |
loyso | 1fbd9f9 | 2015-12-17 07:43:13 | [diff] [blame] | 74 | NON_EXPORTED_BASE(public cc::LayerClient) { |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 75 | public: |
[email protected] | 7ab3f27 | 2011-11-16 00:51:56 | [diff] [blame] | 76 | Layer(); |
| 77 | explicit Layer(LayerType type); |
dcheng | 0803879 | 2014-10-21 10:53:26 | [diff] [blame] | 78 | ~Layer() override; |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 79 | |
loyso | a6edaaff | 2015-05-25 03:26:44 | [diff] [blame] | 80 | static const cc::LayerSettings& UILayerSettings(); |
| 81 | static void InitializeUILayerSettings(); |
| 82 | |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 83 | // Retrieves the Layer's compositor. The Layer will walk up its parent chain |
| 84 | // to locate it. Returns NULL if the Layer is not attached to a compositor. |
sky | 6dd20609 | 2014-10-29 17:26:16 | [diff] [blame] | 85 | Compositor* GetCompositor() { |
| 86 | return const_cast<Compositor*>( |
| 87 | const_cast<const Layer*>(this)->GetCompositor()); |
| 88 | } |
| 89 | const Compositor* GetCompositor() const; |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 90 | |
| 91 | // Called by the compositor when the Layer is set as its root Layer. This can |
| 92 | // only ever be called on the root layer. |
loyso | ac00846 | 2015-05-27 01:05:50 | [diff] [blame] | 93 | void SetCompositor(Compositor* compositor, |
| 94 | scoped_refptr<cc::Layer> root_layer); |
| 95 | void ResetCompositor(); |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 96 | |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 97 | LayerDelegate* delegate() { return delegate_; } |
| 98 | void set_delegate(LayerDelegate* delegate) { delegate_ = delegate; } |
| 99 | |
[email protected] | 07ae973e | 2014-03-05 18:51:10 | [diff] [blame] | 100 | LayerOwner* owner() { return owner_; } |
| 101 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 102 | // Adds a new Layer to this Layer. |
| 103 | void Add(Layer* child); |
| 104 | |
| 105 | // Removes a Layer from this Layer. |
| 106 | void Remove(Layer* child); |
| 107 | |
[email protected] | 5e4e61f | 2011-11-22 16:55:24 | [diff] [blame] | 108 | // Stacks |child| above all other children. |
| 109 | void StackAtTop(Layer* child); |
[email protected] | 18dab37 | 2011-10-03 21:21:44 | [diff] [blame] | 110 | |
[email protected] | ebc335f | 2011-11-23 00:43:51 | [diff] [blame] | 111 | // Stacks |child| directly above |other|. Both must be children of this |
| 112 | // layer. Note that if |child| is initially stacked even higher, calling this |
| 113 | // method will result in |child| being lowered in the stacking order. |
[email protected] | 5e4e61f | 2011-11-22 16:55:24 | [diff] [blame] | 114 | void StackAbove(Layer* child, Layer* other); |
[email protected] | 62dd7ea | 2011-11-08 15:51:47 | [diff] [blame] | 115 | |
[email protected] | 44c6f8d | 2011-12-27 23:49:04 | [diff] [blame] | 116 | // Stacks |child| below all other children. |
| 117 | void StackAtBottom(Layer* child); |
| 118 | |
| 119 | // Stacks |child| directly below |other|. Both must be children of this |
| 120 | // layer. |
| 121 | void StackBelow(Layer* child, Layer* other); |
| 122 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 123 | // Returns the child Layers. |
[email protected] | 25ae9a1 | 2011-10-12 14:55:22 | [diff] [blame] | 124 | const std::vector<Layer*>& children() const { return children_; } |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 125 | |
| 126 | // The parent. |
| 127 | const Layer* parent() const { return parent_; } |
| 128 | Layer* parent() { return parent_; } |
| 129 | |
[email protected] | 036e6c97 | 2012-01-03 18:48:05 | [diff] [blame] | 130 | LayerType type() const { return type_; } |
| 131 | |
[email protected] | ad725891 | 2011-08-29 20:33:53 | [diff] [blame] | 132 | // Returns true if this Layer contains |other| somewhere in its children. |
| 133 | bool Contains(const Layer* other) const; |
| 134 | |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 135 | // The layer's animator is responsible for causing automatic animations when |
| 136 | // properties are set. It also manages a queue of pending animations and |
| 137 | // handles blending of animations. The layer takes ownership of the animator. |
| 138 | void SetAnimator(LayerAnimator* animator); |
| 139 | |
| 140 | // Returns the layer's animator. Creates a default animator of one has not |
| 141 | // been set. Will not return NULL. |
| 142 | LayerAnimator* GetAnimator(); |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 143 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 144 | // The transform, relative to the parent. |
[email protected] | 0f0453e | 2012-10-14 18:15:35 | [diff] [blame] | 145 | void SetTransform(const gfx::Transform& transform); |
[email protected] | 712f4b64 | 2013-03-14 07:09:15 | [diff] [blame] | 146 | gfx::Transform transform() const; |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 147 | |
loyso | ac00846 | 2015-05-27 01:05:50 | [diff] [blame] | 148 | gfx::PointF position() const { return cc_layer_->position(); } |
| 149 | |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 150 | // Return the target transform if animator is running, or the current |
| 151 | // transform otherwise. |
[email protected] | 0f0453e | 2012-10-14 18:15:35 | [diff] [blame] | 152 | gfx::Transform GetTargetTransform() const; |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 153 | |
| 154 | // The bounds, relative to the parent. |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 155 | void SetBounds(const gfx::Rect& bounds); |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 156 | const gfx::Rect& bounds() const { return bounds_; } |
weiliangc | a032f93b | 2015-07-13 22:39:47 | [diff] [blame] | 157 | const gfx::Size& size() const { return bounds_.size(); } |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 158 | |
[email protected] | ea291015 | 2014-06-10 12:32:35 | [diff] [blame] | 159 | // The offset from our parent (stored in bounds.origin()) is an integer but we |
| 160 | // may need to be at a fractional pixel offset to align properly on screen. |
a.berwal | b98996a | 2015-05-04 08:28:37 | [diff] [blame] | 161 | void SetSubpixelPositionOffset(const gfx::Vector2dF& offset); |
[email protected] | e09c592ff | 2014-07-17 06:55:07 | [diff] [blame] | 162 | const gfx::Vector2dF& subpixel_position_offset() const { |
| 163 | return subpixel_position_offset_; |
| 164 | } |
[email protected] | ea291015 | 2014-06-10 12:32:35 | [diff] [blame] | 165 | |
[email protected] | 5ba9d5f | 2011-10-20 01:58:33 | [diff] [blame] | 166 | // Return the target bounds if animator is running, or the current bounds |
| 167 | // otherwise. |
| 168 | gfx::Rect GetTargetBounds() const; |
| 169 | |
[email protected] | 7adee63 | 2012-03-15 19:15:08 | [diff] [blame] | 170 | // Sets/gets whether or not drawing of child layers should be clipped to the |
| 171 | // bounds of this layer. |
| 172 | void SetMasksToBounds(bool masks_to_bounds); |
| 173 | bool GetMasksToBounds() const; |
| 174 | |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 175 | // The opacity of the layer. The opacity is applied to each pixel of the |
| 176 | // texture (resulting alpha = opacity * alpha). |
[email protected] | bf91227 | 2013-02-23 01:54:16 | [diff] [blame] | 177 | float opacity() const; |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 178 | void SetOpacity(float opacity); |
| 179 | |
[email protected] | fb4d9d1 | 2012-08-24 00:44:54 | [diff] [blame] | 180 | // Returns the actual opacity, which the opacity of this layer multipled by |
| 181 | // the combined opacity of the parent. |
| 182 | float GetCombinedOpacity() const; |
| 183 | |
[email protected] | 2a6c567 | 2012-04-23 19:37:09 | [diff] [blame] | 184 | // Blur pixels by this amount in anything below the layer and visible through |
| 185 | // the layer. |
| 186 | int background_blur() const { return background_blur_radius_; } |
| 187 | void SetBackgroundBlur(int blur_radius); |
| 188 | |
[email protected] | e5da662 | 2012-05-30 19:58:16 | [diff] [blame] | 189 | // Saturate all pixels of this layer by this amount. |
[email protected] | 815d0c38 | 2012-07-21 08:13:44 | [diff] [blame] | 190 | // This effect will get "combined" with the inverted, |
| 191 | // brightness and grayscale setting. |
[email protected] | e5da662 | 2012-05-30 19:58:16 | [diff] [blame] | 192 | float layer_saturation() const { return layer_saturation_; } |
| 193 | void SetLayerSaturation(float saturation); |
| 194 | |
| 195 | // Change the brightness of all pixels from this layer by this amount. |
[email protected] | 815d0c38 | 2012-07-21 08:13:44 | [diff] [blame] | 196 | // This effect will get "combined" with the inverted, saturate |
| 197 | // and grayscale setting. |
[email protected] | e5da662 | 2012-05-30 19:58:16 | [diff] [blame] | 198 | float layer_brightness() const { return layer_brightness_; } |
| 199 | void SetLayerBrightness(float brightness); |
| 200 | |
[email protected] | 815d0c38 | 2012-07-21 08:13:44 | [diff] [blame] | 201 | // Return the target brightness if animator is running, or the current |
| 202 | // brightness otherwise. |
| 203 | float GetTargetBrightness() const; |
| 204 | |
| 205 | // Change the grayscale of all pixels from this layer by this amount. |
| 206 | // This effect will get "combined" with the inverted, saturate |
| 207 | // and brightness setting. |
| 208 | float layer_grayscale() const { return layer_grayscale_; } |
| 209 | void SetLayerGrayscale(float grayscale); |
| 210 | |
| 211 | // Return the target grayscale if animator is running, or the current |
| 212 | // grayscale otherwise. |
| 213 | float GetTargetGrayscale() const; |
| 214 | |
[email protected] | 56322be | 2013-03-13 18:27:37 | [diff] [blame] | 215 | // Zoom the background by a factor of |zoom|. The effect is blended along the |
| 216 | // edge across |inset| pixels. |
| 217 | void SetBackgroundZoom(float zoom, int inset); |
[email protected] | 77f7c13 | 2012-11-15 06:52:54 | [diff] [blame] | 218 | |
[email protected] | fbb145c | 2014-04-16 19:21:28 | [diff] [blame] | 219 | // Set the shape of this layer. |
jackhou | 1d1fa23 | 2014-09-11 01:18:41 | [diff] [blame] | 220 | SkRegion* alpha_shape() const { return alpha_shape_.get(); } |
[email protected] | fbb145c | 2014-04-16 19:21:28 | [diff] [blame] | 221 | void SetAlphaShape(scoped_ptr<SkRegion> region); |
| 222 | |
[email protected] | f48075d | 2012-05-24 11:06:51 | [diff] [blame] | 223 | // Invert the layer. |
[email protected] | e5da662 | 2012-05-30 19:58:16 | [diff] [blame] | 224 | bool layer_inverted() const { return layer_inverted_; } |
| 225 | void SetLayerInverted(bool inverted); |
[email protected] | f48075d | 2012-05-24 11:06:51 | [diff] [blame] | 226 | |
[email protected] | 3f1f5e6a | 2011-11-11 15:09:02 | [diff] [blame] | 227 | // Return the target opacity if animator is running, or the current opacity |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 228 | // otherwise. |
| 229 | float GetTargetOpacity() const; |
| 230 | |
[email protected] | 498e623c | 2012-07-12 21:12:42 | [diff] [blame] | 231 | // Set a layer mask for a layer. |
| 232 | // Note the provided layer mask can neither have a layer mask itself nor can |
[email protected] | c0dc4b17 | 2014-01-07 11:24:09 | [diff] [blame] | 233 | // it have any children. The ownership of |layer_mask| will not be |
| 234 | // transferred with this call. |
[email protected] | 498e623c | 2012-07-12 21:12:42 | [diff] [blame] | 235 | // Furthermore: A mask layer can only be set to one layer. |
[email protected] | c0dc4b17 | 2014-01-07 11:24:09 | [diff] [blame] | 236 | void SetMaskLayer(Layer* layer_mask); |
| 237 | Layer* layer_mask_layer() { return layer_mask_; } |
[email protected] | 498e623c | 2012-07-12 21:12:42 | [diff] [blame] | 238 | |
[email protected] | e4e8afef | 2011-10-05 13:58:33 | [diff] [blame] | 239 | // Sets the visibility of the Layer. A Layer may be visible but not |
| 240 | // drawn. This happens if any ancestor of a Layer is not visible. |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 241 | void SetVisible(bool visible); |
[email protected] | f941f47a | 2011-10-15 18:44:51 | [diff] [blame] | 242 | bool visible() const { return visible_; } |
[email protected] | 3aa4394 | 2011-09-13 20:59:53 | [diff] [blame] | 243 | |
[email protected] | a67935f | 2012-02-10 14:26:24 | [diff] [blame] | 244 | // Returns the target visibility if the animator is running. Otherwise, it |
| 245 | // returns the current visibility. |
| 246 | bool GetTargetVisibility() const; |
| 247 | |
[email protected] | e4e8afef | 2011-10-05 13:58:33 | [diff] [blame] | 248 | // Returns true if this Layer is drawn. A Layer is drawn only if all ancestors |
| 249 | // are visible. |
| 250 | bool IsDrawn() const; |
| 251 | |
[email protected] | c1f6730 | 2011-09-27 14:18:09 | [diff] [blame] | 252 | // Returns true if this layer can have a texture (has_texture_ is true) |
| 253 | // and is not completely obscured by a child. |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 254 | bool ShouldDraw() const; |
[email protected] | c1f6730 | 2011-09-27 14:18:09 | [diff] [blame] | 255 | |
[email protected] | ad725891 | 2011-08-29 20:33:53 | [diff] [blame] | 256 | // Converts a point from the coordinates of |source| to the coordinates of |
| 257 | // |target|. Necessarily, |source| and |target| must inhabit the same Layer |
| 258 | // tree. |
| 259 | static void ConvertPointToLayer(const Layer* source, |
| 260 | const Layer* target, |
| 261 | gfx::Point* point); |
| 262 | |
[email protected] | bdcf3bbf | 2013-03-25 18:39:03 | [diff] [blame] | 263 | // Converts a transform to be relative to the given |ancestor|. Returns |
| 264 | // whether success (that is, whether the given ancestor was really an |
| 265 | // ancestor of this layer). |
| 266 | bool GetTargetTransformRelativeTo(const Layer* ancestor, |
| 267 | gfx::Transform* transform) const; |
| 268 | |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 269 | // See description in View for details |
| 270 | void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); |
| 271 | bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } |
| 272 | |
[email protected] | 1d96e03 | 2014-03-25 05:59:08 | [diff] [blame] | 273 | // Set to true if this layer always paints completely within its bounds. If so |
| 274 | // we can omit an unnecessary clear, even if the layer is transparent. |
| 275 | void SetFillsBoundsCompletely(bool fills_bounds_completely); |
| 276 | |
[email protected] | 33699e62 | 2011-11-17 18:29:30 | [diff] [blame] | 277 | const std::string& name() const { return name_; } |
| 278 | void set_name(const std::string& name) { name_ = name; } |
| 279 | |
[email protected] | 42f40a5 | 2013-06-08 04:38:51 | [diff] [blame] | 280 | // Set new TextureMailbox for this layer. Note that |mailbox| may hold a |
| 281 | // shared memory resource or an actual mailbox for a texture. |
[email protected] | 9260757f | 2013-09-17 01:24:16 | [diff] [blame] | 282 | void SetTextureMailbox(const cc::TextureMailbox& mailbox, |
| 283 | scoped_ptr<cc::SingleReleaseCallback> release_callback, |
[email protected] | 4508b15 | 2014-04-09 22:14:17 | [diff] [blame] | 284 | gfx::Size texture_size_in_dip); |
| 285 | void SetTextureSize(gfx::Size texture_size_in_dip); |
achaulk | 01137b8 | 2015-01-30 01:03:05 | [diff] [blame] | 286 | void SetTextureFlipped(bool flipped); |
| 287 | bool TextureFlipped() const; |
[email protected] | 42f40a5 | 2013-06-08 04:38:51 | [diff] [blame] | 288 | |
[email protected] | 09f6738 | 2013-10-09 21:03:45 | [diff] [blame] | 289 | // Begins showing delegated frames from the |frame_provider|. |
| 290 | void SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, |
| 291 | gfx::Size frame_size_in_dip); |
[email protected] | b14d40d | 2013-03-06 03:53:27 | [diff] [blame] | 292 | |
[email protected] | ca2c3ea | 2014-07-26 19:35:30 | [diff] [blame] | 293 | // Begins showing content from a surface with a particular id. |
jbauman | dbccae1ab | 2014-11-06 23:26:44 | [diff] [blame] | 294 | void SetShowSurface(cc::SurfaceId surface_id, |
| 295 | const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, |
| 296 | const cc::SurfaceLayer::RequireCallback& require_callback, |
jbauman | 5a8f0ab | 2014-11-07 01:41:16 | [diff] [blame] | 297 | gfx::Size surface_size, |
jbauman | b71b07c2 | 2014-11-13 01:10:34 | [diff] [blame] | 298 | float scale, |
jbauman | dbccae1ab | 2014-11-06 23:26:44 | [diff] [blame] | 299 | gfx::Size frame_size_in_dip); |
[email protected] | ca2c3ea | 2014-07-26 19:35:30 | [diff] [blame] | 300 | |
[email protected] | a7fcdda3 | 2013-07-04 02:23:07 | [diff] [blame] | 301 | bool has_external_content() { |
[email protected] | ca2c3ea | 2014-07-26 19:35:30 | [diff] [blame] | 302 | return texture_layer_.get() || delegated_renderer_layer_.get() || |
| 303 | surface_layer_.get(); |
[email protected] | a7fcdda3 | 2013-07-04 02:23:07 | [diff] [blame] | 304 | } |
| 305 | |
jbauman | f472c687 | 2014-10-13 20:06:43 | [diff] [blame] | 306 | // Show a solid color instead of delegated or surface contents. |
| 307 | void SetShowSolidColorContent(); |
[email protected] | 785b0af | 2013-10-02 18:08:41 | [diff] [blame] | 308 | |
[email protected] | da7584c | 2012-01-28 03:19:12 | [diff] [blame] | 309 | // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. |
| 310 | void SetColor(SkColor color); |
jbauman | de1a409 | 2015-04-29 23:32:26 | [diff] [blame] | 311 | SkColor GetTargetColor(); |
| 312 | SkColor background_color() const; |
[email protected] | da7584c | 2012-01-28 03:19:12 | [diff] [blame] | 313 | |
hshi | 270f622 | 2015-03-17 21:18:34 | [diff] [blame] | 314 | // Updates the nine patch layer's image, aperture and border. May only be |
hshi | d89c83ac | 2014-09-19 17:39:28 | [diff] [blame] | 315 | // called for LAYER_NINE_PATCH. |
hshi | 270f622 | 2015-03-17 21:18:34 | [diff] [blame] | 316 | void UpdateNinePatchLayerImage(const gfx::ImageSkia& image); |
| 317 | void UpdateNinePatchLayerAperture(const gfx::Rect& aperture_in_dip); |
[email protected] | 98a5913 | 2014-07-16 22:49:52 | [diff] [blame] | 318 | void UpdateNinePatchLayerBorder(const gfx::Rect& border); |
| 319 | |
[email protected] | 870119a | 2011-09-30 18:13:22 | [diff] [blame] | 320 | // Adds |invalid_rect| to the Layer's pending invalid rect and calls |
[email protected] | f78649ea | 2012-02-23 18:39:04 | [diff] [blame] | 321 | // ScheduleDraw(). Returns false if the paint request is ignored. |
| 322 | bool SchedulePaint(const gfx::Rect& invalid_rect); |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 323 | |
[email protected] | 870119a | 2011-09-30 18:13:22 | [diff] [blame] | 324 | // Schedules a redraw of the layer tree at the compositor. |
[email protected] | 35470cc | 2012-02-23 23:04:31 | [diff] [blame] | 325 | // Note that this _does not_ invalidate any region of this layer; use |
| 326 | // SchedulePaint() for that. |
[email protected] | 870119a | 2011-09-30 18:13:22 | [diff] [blame] | 327 | void ScheduleDraw(); |
| 328 | |
[email protected] | 1e5da63d | 2014-01-16 22:44:00 | [diff] [blame] | 329 | // Uses damaged rectangles recorded in |damaged_region_| to invalidate the |
| 330 | // |cc_layer_|. |
[email protected] | cedc395 | 2012-03-06 06:15:55 | [diff] [blame] | 331 | void SendDamagedRects(); |
danakj | 0b5eae6c | 2015-04-24 22:35:11 | [diff] [blame] | 332 | void ClearDamagedRects(); |
[email protected] | f78649ea | 2012-02-23 18:39:04 | [diff] [blame] | 333 | |
danakj | 0b5eae6c | 2015-04-24 22:35:11 | [diff] [blame] | 334 | const cc::Region& damaged_region() const { return damaged_region_; } |
[email protected] | 88fa18e8 | 2013-12-03 16:29:37 | [diff] [blame] | 335 | |
[email protected] | 9034a28 | 2014-06-05 03:11:47 | [diff] [blame] | 336 | void CompleteAllAnimations(); |
| 337 | |
[email protected] | 1e5da63d | 2014-01-16 22:44:00 | [diff] [blame] | 338 | // Suppresses painting the content by disconnecting |delegate_|. |
[email protected] | f78649ea | 2012-02-23 18:39:04 | [diff] [blame] | 339 | void SuppressPaint(); |
| 340 | |
[email protected] | cd9a61c7 | 2012-05-08 19:16:59 | [diff] [blame] | 341 | // Notifies the layer that the device scale factor has changed. |
| 342 | void OnDeviceScaleFactorChanged(float device_scale_factor); |
| 343 | |
enne | 9a3ddb3 | 2014-08-23 21:27:46 | [diff] [blame] | 344 | // Notifies the layer that one of its children has received a new |
| 345 | // delegated frame. |
| 346 | void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip); |
| 347 | |
[email protected] | a7fcdda3 | 2013-07-04 02:23:07 | [diff] [blame] | 348 | // Requets a copy of the layer's output as a texture or bitmap. |
| 349 | void RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request); |
| 350 | |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 351 | // ContentLayerClient |
chrishtr | 01539b80 | 2015-11-24 08:11:32 | [diff] [blame] | 352 | gfx::Rect PaintableRegion() override; |
jbroman | 16d628c | 2015-05-29 20:11:59 | [diff] [blame] | 353 | scoped_refptr<cc::DisplayItemList> PaintContentsToDisplayList( |
schenney | 0154bfa | 2015-02-05 19:46:49 | [diff] [blame] | 354 | ContentLayerClient::PaintingControlSetting painting_control) override; |
dcheng | 0803879 | 2014-10-21 10:53:26 | [diff] [blame] | 355 | bool FillsBoundsCompletely() const override; |
jbroman | 9f60f1a | 2015-07-16 21:40:32 | [diff] [blame] | 356 | size_t GetApproximateUnsharedMemoryUsage() const override; |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 357 | |
loyso | ac00846 | 2015-05-27 01:05:50 | [diff] [blame] | 358 | cc::Layer* cc_layer_for_testing() { return cc_layer_; } |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 359 | |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 360 | // TextureLayerClient |
dcheng | 0803879 | 2014-10-21 10:53:26 | [diff] [blame] | 361 | bool PrepareTextureMailbox( |
[email protected] | 9260757f | 2013-09-17 01:24:16 | [diff] [blame] | 362 | cc::TextureMailbox* mailbox, |
| 363 | scoped_ptr<cc::SingleReleaseCallback>* release_callback, |
mostynb | 3b3d52b | 2014-10-09 10:54:27 | [diff] [blame] | 364 | bool use_shared_memory) override; |
[email protected] | 7ba5f4b6 | 2012-08-25 01:19:36 | [diff] [blame] | 365 | |
[email protected] | cd9a61c7 | 2012-05-08 19:16:59 | [diff] [blame] | 366 | float device_scale_factor() const { return device_scale_factor_; } |
| 367 | |
[email protected] | 09c01c1 | 2012-05-26 00:07:19 | [diff] [blame] | 368 | // Forces a render surface to be used on this layer. This has no positive |
| 369 | // impact, and is only used for benchmarking/testing purpose. |
| 370 | void SetForceRenderSurface(bool force); |
| 371 | bool force_render_surface() const { return force_render_surface_; } |
| 372 | |
[email protected] | 29e17b0 | 2013-08-30 02:13:33 | [diff] [blame] | 373 | // LayerClient |
jbroman | 60b29f0 | 2015-11-23 21:51:25 | [diff] [blame] | 374 | scoped_refptr<base::trace_event::ConvertableToTraceFormat> TakeDebugInfo( |
| 375 | cc::Layer* layer) override; |
[email protected] | 9f3be43 | 2013-12-03 03:53:22 | [diff] [blame] | 376 | |
[email protected] | f289146 | 2013-03-11 23:26:51 | [diff] [blame] | 377 | // Whether this layer has animations waiting to get sent to its cc::Layer. |
loyso | 1fe980f | 2016-01-18 23:58:15 | [diff] [blame] | 378 | bool HasPendingThreadedAnimationsForTesting() const; |
[email protected] | f289146 | 2013-03-11 23:26:51 | [diff] [blame] | 379 | |
[email protected] | ffd1ccb | 2013-03-15 07:48:24 | [diff] [blame] | 380 | // Triggers a call to SwitchToLayer. |
| 381 | void SwitchCCLayerForTest(); |
| 382 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 383 | private: |
[email protected] | 07ae973e | 2014-03-05 18:51:10 | [diff] [blame] | 384 | friend class LayerOwner; |
| 385 | |
[email protected] | 9034a28 | 2014-06-05 03:11:47 | [diff] [blame] | 386 | void CollectAnimators(std::vector<scoped_refptr<LayerAnimator> >* animators); |
| 387 | |
[email protected] | 44c6f8d | 2011-12-27 23:49:04 | [diff] [blame] | 388 | // Stacks |child| above or below |other|. Helper method for StackAbove() and |
| 389 | // StackBelow(). |
| 390 | void StackRelativeTo(Layer* child, Layer* other, bool above); |
| 391 | |
[email protected] | ad725891 | 2011-08-29 20:33:53 | [diff] [blame] | 392 | bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const; |
| 393 | bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const; |
| 394 | |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 395 | // Implementation of LayerAnimatorDelegate |
dcheng | 0803879 | 2014-10-21 10:53:26 | [diff] [blame] | 396 | void SetBoundsFromAnimation(const gfx::Rect& bounds) override; |
| 397 | void SetTransformFromAnimation(const gfx::Transform& transform) override; |
| 398 | void SetOpacityFromAnimation(float opacity) override; |
| 399 | void SetVisibilityFromAnimation(bool visibility) override; |
| 400 | void SetBrightnessFromAnimation(float brightness) override; |
| 401 | void SetGrayscaleFromAnimation(float grayscale) override; |
| 402 | void SetColorFromAnimation(SkColor color) override; |
| 403 | void ScheduleDrawForAnimation() override; |
| 404 | const gfx::Rect& GetBoundsForAnimation() const override; |
| 405 | gfx::Transform GetTransformForAnimation() const override; |
| 406 | float GetOpacityForAnimation() const override; |
| 407 | bool GetVisibilityForAnimation() const override; |
| 408 | float GetBrightnessForAnimation() const override; |
| 409 | float GetGrayscaleForAnimation() const override; |
| 410 | SkColor GetColorForAnimation() const override; |
| 411 | float GetDeviceScaleFactor() const override; |
loyso | 1fe980f | 2016-01-18 23:58:15 | [diff] [blame] | 412 | cc::Layer* GetCcLayer() const override; |
| 413 | LayerThreadedAnimationDelegate* GetThreadedAnimationDelegate() override; |
| 414 | LayerAnimatorCollection* GetLayerAnimatorCollection() override; |
| 415 | |
| 416 | // Implementation of LayerThreadedAnimationDelegate. |
dcheng | 0803879 | 2014-10-21 10:53:26 | [diff] [blame] | 417 | void AddThreadedAnimation(scoped_ptr<cc::Animation> animation) override; |
| 418 | void RemoveThreadedAnimation(int animation_id) override; |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 419 | |
[email protected] | 1e5da63d | 2014-01-16 22:44:00 | [diff] [blame] | 420 | // Creates a corresponding composited layer for |type_|. |
jbauman | f472c687 | 2014-10-13 20:06:43 | [diff] [blame] | 421 | void CreateCcLayer(); |
[email protected] | 1e5da63d | 2014-01-16 22:44:00 | [diff] [blame] | 422 | |
| 423 | // Recomputes and sets to |cc_layer_|. |
[email protected] | b9616d59 | 2011-11-14 20:04:42 | [diff] [blame] | 424 | void RecomputeDrawsContentAndUVRect(); |
[email protected] | b9cff56 | 2013-04-06 00:04:42 | [diff] [blame] | 425 | void RecomputePosition(); |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 426 | |
[email protected] | e5da662 | 2012-05-30 19:58:16 | [diff] [blame] | 427 | // Set all filters which got applied to the layer. |
| 428 | void SetLayerFilters(); |
| 429 | |
[email protected] | 77f7c13 | 2012-11-15 06:52:54 | [diff] [blame] | 430 | // Set all filters which got applied to the layer background. |
| 431 | void SetLayerBackgroundFilters(); |
| 432 | |
[email protected] | 1e5da63d | 2014-01-16 22:44:00 | [diff] [blame] | 433 | // Cleanup |cc_layer_| and replaces it with |new_layer|. |
[email protected] | b14d40d | 2013-03-06 03:53:27 | [diff] [blame] | 434 | void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); |
| 435 | |
[email protected] | f289146 | 2013-03-11 23:26:51 | [diff] [blame] | 436 | // We cannot send animations to our cc_layer_ until we have been added to a |
| 437 | // layer tree. Instead, we hold on to these animations in |
| 438 | // pending_threaded_animations_, and expect SendPendingThreadedAnimations to |
| 439 | // be called once we have been added to a tree. |
| 440 | void SendPendingThreadedAnimations(); |
| 441 | |
loyso | 84122900 | 2015-12-21 10:03:24 | [diff] [blame] | 442 | void SetCompositorForAnimatorsInTree(Compositor* compositor); |
| 443 | void ResetCompositorForAnimatorsInTree(Compositor* compositor); |
[email protected] | 9034a28 | 2014-06-05 03:11:47 | [diff] [blame] | 444 | |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 445 | const LayerType type_; |
| 446 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 447 | Compositor* compositor_; |
| 448 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 449 | Layer* parent_; |
| 450 | |
[email protected] | ebc335f | 2011-11-23 00:43:51 | [diff] [blame] | 451 | // This layer's children, in bottom-to-top stacking order. |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 452 | std::vector<Layer*> children_; |
| 453 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 454 | gfx::Rect bounds_; |
[email protected] | ea291015 | 2014-06-10 12:32:35 | [diff] [blame] | 455 | gfx::Vector2dF subpixel_position_offset_; |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 456 | |
[email protected] | e4e8afef | 2011-10-05 13:58:33 | [diff] [blame] | 457 | // Visibility of this layer. See SetVisible/IsDrawn for more details. |
[email protected] | 3aa4394 | 2011-09-13 20:59:53 | [diff] [blame] | 458 | bool visible_; |
| 459 | |
[email protected] | 09c01c1 | 2012-05-26 00:07:19 | [diff] [blame] | 460 | bool force_render_surface_; |
| 461 | |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 462 | bool fills_bounds_opaquely_; |
[email protected] | 1d96e03 | 2014-03-25 05:59:08 | [diff] [blame] | 463 | bool fills_bounds_completely_; |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 464 | |
danakj | 0b5eae6c | 2015-04-24 22:35:11 | [diff] [blame] | 465 | // Union of damaged rects, in layer space, to be used when compositor is ready |
| 466 | // to paint the content. |
| 467 | cc::Region damaged_region_; |
[email protected] | f78649ea | 2012-02-23 18:39:04 | [diff] [blame] | 468 | |
[email protected] | 2a6c567 | 2012-04-23 19:37:09 | [diff] [blame] | 469 | int background_blur_radius_; |
[email protected] | e5da662 | 2012-05-30 19:58:16 | [diff] [blame] | 470 | |
| 471 | // Several variables which will change the visible representation of |
| 472 | // the layer. |
| 473 | float layer_saturation_; |
| 474 | float layer_brightness_; |
[email protected] | 815d0c38 | 2012-07-21 08:13:44 | [diff] [blame] | 475 | float layer_grayscale_; |
[email protected] | e5da662 | 2012-05-30 19:58:16 | [diff] [blame] | 476 | bool layer_inverted_; |
[email protected] | b4bb9ca | 2011-09-23 20:53:14 | [diff] [blame] | 477 | |
[email protected] | c0dc4b17 | 2014-01-07 11:24:09 | [diff] [blame] | 478 | // The associated mask layer with this layer. |
| 479 | Layer* layer_mask_; |
| 480 | // The back link from the mask layer to it's associated masked layer. |
| 481 | // We keep this reference for the case that if the mask layer gets deleted |
| 482 | // while attached to the main layer before the main layer is deleted. |
| 483 | Layer* layer_mask_back_link_; |
[email protected] | 498e623c | 2012-07-12 21:12:42 | [diff] [blame] | 484 | |
[email protected] | 77f7c13 | 2012-11-15 06:52:54 | [diff] [blame] | 485 | // The zoom factor to scale the layer by. Zooming is disabled when this is |
| 486 | // set to 1. |
| 487 | float zoom_; |
| 488 | |
| 489 | // Width of the border in pixels, where the scaling is blended. |
| 490 | int zoom_inset_; |
| 491 | |
[email protected] | fbb145c | 2014-04-16 19:21:28 | [diff] [blame] | 492 | // Shape of the window. |
| 493 | scoped_ptr<SkRegion> alpha_shape_; |
| 494 | |
[email protected] | 33699e62 | 2011-11-17 18:29:30 | [diff] [blame] | 495 | std::string name_; |
| 496 | |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 497 | LayerDelegate* delegate_; |
| 498 | |
[email protected] | 07ae973e | 2014-03-05 18:51:10 | [diff] [blame] | 499 | LayerOwner* owner_; |
| 500 | |
[email protected] | 5d86a11 | 2012-09-23 00:21:58 | [diff] [blame] | 501 | scoped_refptr<LayerAnimator> animator_; |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 502 | |
[email protected] | f289146 | 2013-03-11 23:26:51 | [diff] [blame] | 503 | // Animations that are passed to AddThreadedAnimation before this layer is |
| 504 | // added to a tree. |
vmpstr | a370ef5 | 2015-11-18 10:41:28 | [diff] [blame] | 505 | std::vector<scoped_ptr<cc::Animation>> pending_threaded_animations_; |
[email protected] | f289146 | 2013-03-11 23:26:51 | [diff] [blame] | 506 | |
[email protected] | 66efabe | 2012-08-18 03:06:06 | [diff] [blame] | 507 | // Ownership of the layer is held through one of the strongly typed layer |
| 508 | // pointers, depending on which sort of layer this is. |
[email protected] | dafdf505 | 2014-03-13 17:02:57 | [diff] [blame] | 509 | scoped_refptr<cc::Layer> content_layer_; |
[email protected] | 98a5913 | 2014-07-16 22:49:52 | [diff] [blame] | 510 | scoped_refptr<cc::NinePatchLayer> nine_patch_layer_; |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 511 | scoped_refptr<cc::TextureLayer> texture_layer_; |
| 512 | scoped_refptr<cc::SolidColorLayer> solid_color_layer_; |
[email protected] | b14d40d | 2013-03-06 03:53:27 | [diff] [blame] | 513 | scoped_refptr<cc::DelegatedRendererLayer> delegated_renderer_layer_; |
[email protected] | ca2c3ea | 2014-07-26 19:35:30 | [diff] [blame] | 514 | scoped_refptr<cc::SurfaceLayer> surface_layer_; |
[email protected] | ec05af5 | 2012-11-21 23:07:00 | [diff] [blame] | 515 | cc::Layer* cc_layer_; |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 516 | |
[email protected] | cd9a61c7 | 2012-05-08 19:16:59 | [diff] [blame] | 517 | // A cached copy of |Compositor::device_scale_factor()|. |
| 518 | float device_scale_factor_; |
| 519 | |
hshi | 270f622 | 2015-03-17 21:18:34 | [diff] [blame] | 520 | // A cached copy of the nine patch layer's image and aperture. |
| 521 | // These are required for device scale factor change. |
| 522 | gfx::ImageSkia nine_patch_layer_image_; |
| 523 | gfx::Rect nine_patch_layer_aperture_; |
| 524 | |
[email protected] | 4508b15 | 2014-04-09 22:14:17 | [diff] [blame] | 525 | // The mailbox used by texture_layer_. |
[email protected] | 42f40a5 | 2013-06-08 04:38:51 | [diff] [blame] | 526 | cc::TextureMailbox mailbox_; |
| 527 | |
[email protected] | 4508b15 | 2014-04-09 22:14:17 | [diff] [blame] | 528 | // The callback to release the mailbox. This is only set after |
| 529 | // SetTextureMailbox is called, before we give it to the TextureLayer. |
| 530 | scoped_ptr<cc::SingleReleaseCallback> mailbox_release_callback_; |
[email protected] | 42f40a5 | 2013-06-08 04:38:51 | [diff] [blame] | 531 | |
[email protected] | 4508b15 | 2014-04-09 22:14:17 | [diff] [blame] | 532 | // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
| 533 | // or SetTextureMailbox was called. |
| 534 | gfx::Size frame_size_in_dip_; |
[email protected] | b14d40d | 2013-03-06 03:53:27 | [diff] [blame] | 535 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 536 | DISALLOW_COPY_AND_ASSIGN(Layer); |
| 537 | }; |
| 538 | |
| 539 | } // namespace ui |
| 540 | |
[email protected] | 116302fc | 2012-05-05 21:45:41 | [diff] [blame] | 541 | #endif // UI_COMPOSITOR_LAYER_H_ |