[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_GFX_COMPOSITOR_LAYER_H_ |
| 6 | #define UI_GFX_COMPOSITOR_LAYER_H_ |
| 7 | #pragma once |
| 8 | |
| 9 | #include <vector> |
| 10 | |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 11 | #include "base/compiler_specific.h" |
[email protected] | 51f1b48 | 2011-06-23 16:52:12 | [diff] [blame] | 12 | #include "base/memory/ref_counted.h" |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 13 | #include "base/memory/scoped_ptr.h" |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 14 | #include "base/message_loop.h" |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 15 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebContentLayerClient.h" |
[email protected] | 4b58d55 | 2011-10-26 00:54:46 | [diff] [blame] | 16 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebLayer.h" |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 17 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebLayerClient.h" |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 18 | #include "ui/gfx/rect.h" |
| 19 | #include "ui/gfx/transform.h" |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 20 | #include "ui/gfx/compositor/compositor.h" |
[email protected] | e876c27 | 2011-11-02 16:42:45 | [diff] [blame] | 21 | #include "ui/gfx/compositor/layer_animation_delegate.h" |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 22 | #include "ui/gfx/compositor/layer_delegate.h" |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 23 | |
[email protected] | 892ad8a | 2011-07-27 02:47:22 | [diff] [blame] | 24 | class SkCanvas; |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 25 | |
| 26 | namespace ui { |
| 27 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 28 | class Compositor; |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 29 | class LayerAnimator; |
| 30 | class LayerAnimationSequence; |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 31 | class Texture; |
| 32 | |
| 33 | // Layer manages a texture, transform and a set of child Layers. Any View that |
| 34 | // has enabled layers ends up creating a Layer to manage the texture. |
[email protected] | 28cd2bb | 2011-09-19 21:04:19 | [diff] [blame] | 35 | // A Layer can also be created without a texture, in which case it renders |
| 36 | // nothing and is simply used as a node in a hierarchy of layers. |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 37 | // |
| 38 | // NOTE: unlike Views, each Layer does *not* own its children views. If you |
| 39 | // delete a Layer and it has children, the parent of each child layer is set to |
| 40 | // NULL, but the children are not deleted. |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 41 | class COMPOSITOR_EXPORT Layer : |
[email protected] | e876c27 | 2011-11-02 16:42:45 | [diff] [blame] | 42 | public LayerAnimationDelegate, |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 43 | NON_EXPORTED_BASE(public WebKit::WebLayerClient), |
| 44 | NON_EXPORTED_BASE(public WebKit::WebContentLayerClient) { |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 45 | public: |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 46 | enum LayerType { |
[email protected] | 28cd2bb | 2011-09-19 21:04:19 | [diff] [blame] | 47 | LAYER_HAS_NO_TEXTURE = 0, |
| 48 | LAYER_HAS_TEXTURE = 1 |
| 49 | }; |
| 50 | |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 51 | // |compositor| can be NULL, and will be set later when the Layer is added to |
| 52 | // a Compositor. |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 53 | explicit Layer(Compositor* compositor); |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 54 | Layer(Compositor* compositor, LayerType type); |
[email protected] | 8f2a15d | 2011-09-29 15:50:59 | [diff] [blame] | 55 | virtual ~Layer(); |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 56 | |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 57 | // Retrieves the Layer's compositor. The Layer will walk up its parent chain |
| 58 | // to locate it. Returns NULL if the Layer is not attached to a compositor. |
| 59 | Compositor* GetCompositor(); |
| 60 | |
| 61 | // Called by the compositor when the Layer is set as its root Layer. This can |
| 62 | // only ever be called on the root layer. |
| 63 | void SetCompositor(Compositor* compositor); |
| 64 | |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 65 | LayerDelegate* delegate() { return delegate_; } |
| 66 | void set_delegate(LayerDelegate* delegate) { delegate_ = delegate; } |
| 67 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 68 | // Adds a new Layer to this Layer. |
| 69 | void Add(Layer* child); |
| 70 | |
| 71 | // Removes a Layer from this Layer. |
| 72 | void Remove(Layer* child); |
| 73 | |
[email protected] | 18dab37 | 2011-10-03 21:21:44 | [diff] [blame] | 74 | // Moves a child to the end of the child list. |
| 75 | void MoveToFront(Layer* child); |
| 76 | |
[email protected] | 62dd7ea | 2011-11-08 15:51:47 | [diff] [blame] | 77 | // Moves |child| to be above |other|. Does nothing if |other| is already above |
| 78 | // |child|. |
| 79 | void MoveAbove(Layer* child, Layer* other); |
| 80 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 81 | // Returns the child Layers. |
[email protected] | 25ae9a1 | 2011-10-12 14:55:22 | [diff] [blame] | 82 | const std::vector<Layer*>& children() const { return children_; } |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 83 | |
| 84 | // The parent. |
| 85 | const Layer* parent() const { return parent_; } |
| 86 | Layer* parent() { return parent_; } |
| 87 | |
[email protected] | ad725891 | 2011-08-29 20:33:53 | [diff] [blame] | 88 | // Returns true if this Layer contains |other| somewhere in its children. |
| 89 | bool Contains(const Layer* other) const; |
| 90 | |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 91 | // The layer's animator is responsible for causing automatic animations when |
| 92 | // properties are set. It also manages a queue of pending animations and |
| 93 | // handles blending of animations. The layer takes ownership of the animator. |
| 94 | void SetAnimator(LayerAnimator* animator); |
| 95 | |
| 96 | // Returns the layer's animator. Creates a default animator of one has not |
| 97 | // been set. Will not return NULL. |
| 98 | LayerAnimator* GetAnimator(); |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 99 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 100 | // The transform, relative to the parent. |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 101 | void SetTransform(const Transform& transform); |
| 102 | const Transform& transform() const { return transform_; } |
| 103 | |
| 104 | // Return the target transform if animator is running, or the current |
| 105 | // transform otherwise. |
| 106 | Transform GetTargetTransform() const; |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 107 | |
| 108 | // The bounds, relative to the parent. |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 109 | void SetBounds(const gfx::Rect& bounds); |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 110 | const gfx::Rect& bounds() const { return bounds_; } |
| 111 | |
[email protected] | 5ba9d5f | 2011-10-20 01:58:33 | [diff] [blame] | 112 | // Return the target bounds if animator is running, or the current bounds |
| 113 | // otherwise. |
| 114 | gfx::Rect GetTargetBounds() const; |
| 115 | |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 116 | // The opacity of the layer. The opacity is applied to each pixel of the |
| 117 | // texture (resulting alpha = opacity * alpha). |
| 118 | float opacity() const { return opacity_; } |
| 119 | void SetOpacity(float opacity); |
| 120 | |
[email protected] | 3f1f5e6a | 2011-11-11 15:09:02 | [diff] [blame] | 121 | // Return the target opacity if animator is running, or the current opacity |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 122 | // otherwise. |
| 123 | float GetTargetOpacity() const; |
| 124 | |
[email protected] | e4e8afef | 2011-10-05 13:58:33 | [diff] [blame] | 125 | // Sets the visibility of the Layer. A Layer may be visible but not |
| 126 | // drawn. This happens if any ancestor of a Layer is not visible. |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 127 | void SetVisible(bool visible); |
[email protected] | f941f47a | 2011-10-15 18:44:51 | [diff] [blame] | 128 | bool visible() const { return visible_; } |
[email protected] | 3aa4394 | 2011-09-13 20:59:53 | [diff] [blame] | 129 | |
[email protected] | e4e8afef | 2011-10-05 13:58:33 | [diff] [blame] | 130 | // Returns true if this Layer is drawn. A Layer is drawn only if all ancestors |
| 131 | // are visible. |
| 132 | bool IsDrawn() const; |
| 133 | |
[email protected] | c1f6730 | 2011-09-27 14:18:09 | [diff] [blame] | 134 | // Returns true if this layer can have a texture (has_texture_ is true) |
| 135 | // and is not completely obscured by a child. |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 136 | bool ShouldDraw() const; |
[email protected] | c1f6730 | 2011-09-27 14:18:09 | [diff] [blame] | 137 | |
[email protected] | ad725891 | 2011-08-29 20:33:53 | [diff] [blame] | 138 | // Converts a point from the coordinates of |source| to the coordinates of |
| 139 | // |target|. Necessarily, |source| and |target| must inhabit the same Layer |
| 140 | // tree. |
| 141 | static void ConvertPointToLayer(const Layer* source, |
| 142 | const Layer* target, |
| 143 | gfx::Point* point); |
| 144 | |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 145 | // See description in View for details |
| 146 | void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); |
| 147 | bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } |
| 148 | |
[email protected] | a50ff37 | 2011-11-03 16:06:28 | [diff] [blame] | 149 | // Returns the invalid rectangle. That is, the region of the layer that needs |
| 150 | // to be repainted. This is exposed for testing and isn't generally useful. |
| 151 | const gfx::Rect& invalid_rect() const { return invalid_rect_; } |
| 152 | |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 153 | const gfx::Rect& hole_rect() const { return hole_rect_; } |
| 154 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 155 | // The compositor. |
| 156 | const Compositor* compositor() const { return compositor_; } |
| 157 | Compositor* compositor() { return compositor_; } |
| 158 | |
[email protected] | 536987c8 | 2011-06-28 03:46:08 | [diff] [blame] | 159 | const ui::Texture* texture() const { return texture_.get(); } |
[email protected] | 1cbbee3c | 2011-06-24 12:32:19 | [diff] [blame] | 160 | |
[email protected] | 28cd2bb | 2011-09-19 21:04:19 | [diff] [blame] | 161 | // |texture| cannot be NULL, and this function cannot be called more than |
| 162 | // once. |
| 163 | // TODO(beng): This can be removed from the API when we are in a |
| 164 | // single-compositor world. |
| 165 | void SetExternalTexture(ui::Texture* texture); |
| 166 | |
[email protected] | 892ad8a | 2011-07-27 02:47:22 | [diff] [blame] | 167 | // Resets the canvas of the texture. |
| 168 | void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 169 | |
[email protected] | 870119a | 2011-09-30 18:13:22 | [diff] [blame] | 170 | // Adds |invalid_rect| to the Layer's pending invalid rect and calls |
| 171 | // ScheduleDraw(). |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 172 | void SchedulePaint(const gfx::Rect& invalid_rect); |
| 173 | |
[email protected] | 870119a | 2011-09-30 18:13:22 | [diff] [blame] | 174 | // Schedules a redraw of the layer tree at the compositor. |
| 175 | void ScheduleDraw(); |
| 176 | |
[email protected] | 6b29ebb | 2011-09-29 17:41:20 | [diff] [blame] | 177 | // Does drawing for the layer. |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 178 | void Draw(); |
| 179 | |
[email protected] | 3aa4394 | 2011-09-13 20:59:53 | [diff] [blame] | 180 | // Draws a tree of Layers, by calling Draw() on each in the hierarchy starting |
| 181 | // with the receiver. |
| 182 | void DrawTree(); |
| 183 | |
[email protected] | a97527b | 2011-09-14 15:44:38 | [diff] [blame] | 184 | // Sometimes the Layer is being updated by something other than SetCanvas |
| 185 | // (e.g. the GPU process on TOUCH_UI). |
| 186 | bool layer_updated_externally() const { return layer_updated_externally_; } |
| 187 | |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 188 | // WebLayerClient |
| 189 | virtual void notifyNeedsComposite(); |
| 190 | |
| 191 | // WebContentLayerClient |
| 192 | virtual void paintContents(WebKit::WebCanvas*, const WebKit::WebRect& clip); |
| 193 | |
| 194 | #if defined(USE_WEBKIT_COMPOSITOR) |
[email protected] | 4b58d55 | 2011-10-26 00:54:46 | [diff] [blame] | 195 | WebKit::WebLayer web_layer() { return web_layer_; } |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 196 | #endif |
| 197 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 198 | private: |
[email protected] | 714e3843 | 2011-11-15 17:10:39 | [diff] [blame^] | 199 | struct LayerProperties { |
| 200 | public: |
| 201 | ui::Layer* layer; |
| 202 | ui::Transform transform_relative_to_root; |
| 203 | }; |
| 204 | |
[email protected] | b4bb9ca | 2011-09-23 20:53:14 | [diff] [blame] | 205 | // TODO(vollick): Eventually, if a non-leaf node has an opacity of less than |
| 206 | // 1.0, we'll render to a separate texture, and then apply the alpha. |
| 207 | // Currently, we multiply our opacity by all our ancestor's opacities and |
| 208 | // use the combined result, but this is only temporary. |
| 209 | float GetCombinedOpacity() const; |
| 210 | |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 211 | // Called during the Draw() pass to freshen the Layer's contents from the |
| 212 | // delegate. |
| 213 | void UpdateLayerCanvas(); |
| 214 | |
[email protected] | 714e3843 | 2011-11-15 17:10:39 | [diff] [blame^] | 215 | // Called to indicate that a layer's properties have changed and that the |
| 216 | // holes for the layers must be recomputed. |
| 217 | void SetNeedsToRecomputeHole(); |
| 218 | |
| 219 | // Resets |hole_rect_| to the empty rect for all layers below and |
| 220 | // including this one. |
| 221 | void ClearHoleRects(); |
| 222 | |
| 223 | // Does a preorder traversal of layers starting with this layer. Omits layers |
| 224 | // which cannot punch a hole in another layer such as non visible layers |
| 225 | // and layers which don't fill their bounds opaquely. |
| 226 | void GetLayerProperties(const ui::Transform& current_transform, |
| 227 | std::vector<LayerProperties>* traverasal); |
| 228 | |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 229 | // A hole in a layer is an area in the layer that does not get drawn |
| 230 | // because this area is covered up with another layer which is known to be |
| 231 | // opaque. |
| 232 | // This method computes the dimension of the hole (if there is one) |
| 233 | // based on whether one of its child nodes is always opaque. |
[email protected] | 714e3843 | 2011-11-15 17:10:39 | [diff] [blame^] | 234 | // Note: This method should only be called from the root. |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 235 | void RecomputeHole(); |
| 236 | |
[email protected] | 714e3843 | 2011-11-15 17:10:39 | [diff] [blame^] | 237 | void set_hole_rect(const gfx::Rect& hole_rect) { |
| 238 | hole_rect_ = hole_rect; |
| 239 | } |
[email protected] | 6b29ebb | 2011-09-29 17:41:20 | [diff] [blame] | 240 | |
| 241 | // Determines the regions that don't intersect |rect| and places the |
| 242 | // result in |sides|. |
| 243 | // |
| 244 | // rect_____________________________ |
| 245 | // |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |
| 246 | // |xxxxxxxxxxxxx top xxxxxxxxxxxxxx| |
| 247 | // |________________________________| |
| 248 | // |xxxxx| |xxxxx| |
| 249 | // |xxxxx|region_to_punch_out |xxxxx| |
| 250 | // |left | |right| |
| 251 | // |_____|____________________|_____| |
| 252 | // |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |
| 253 | // |xxxxxxxxxx bottom xxxxxxxxxxxxxx| |
| 254 | // |________________________________| |
| 255 | static void PunchHole(const gfx::Rect& rect, |
| 256 | const gfx::Rect& region_to_punch_out, |
| 257 | std::vector<gfx::Rect>* sides); |
| 258 | |
[email protected] | 714e3843 | 2011-11-15 17:10:39 | [diff] [blame^] | 259 | // Drops texture just for this layer. |
| 260 | void DropTexture(); |
| 261 | |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 262 | // Drop all textures for layers below and including this one. Called when |
| 263 | // the layer is removed from a hierarchy. Textures will be re-generated if |
| 264 | // the layer is subsequently re-attached and needs to be drawn. |
| 265 | void DropTextures(); |
| 266 | |
[email protected] | ad725891 | 2011-08-29 20:33:53 | [diff] [blame] | 267 | bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const; |
| 268 | bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const; |
| 269 | |
| 270 | bool GetTransformRelativeTo(const Layer* ancestor, |
| 271 | Transform* transform) const; |
| 272 | |
[email protected] | b4bb9ca | 2011-09-23 20:53:14 | [diff] [blame] | 273 | // The only externally updated layers are ones that get their pixels from |
| 274 | // WebKit and WebKit does not produce valid alpha values. All other layers |
| 275 | // should have valid alpha. |
| 276 | bool has_valid_alpha_channel() const { return !layer_updated_externally_; } |
| 277 | |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 278 | // Following are invoked from the animation or if no animation exists to |
| 279 | // update the values immediately. |
| 280 | void SetBoundsImmediately(const gfx::Rect& bounds); |
| 281 | void SetTransformImmediately(const ui::Transform& transform); |
| 282 | void SetOpacityImmediately(float opacity); |
| 283 | |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 284 | // Implementation of LayerAnimatorDelegate |
| 285 | virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) OVERRIDE; |
| 286 | virtual void SetTransformFromAnimation(const Transform& transform) OVERRIDE; |
| 287 | virtual void SetOpacityFromAnimation(float opacity) OVERRIDE; |
| 288 | virtual void ScheduleDrawForAnimation() OVERRIDE; |
| 289 | virtual const gfx::Rect& GetBoundsForAnimation() const OVERRIDE; |
| 290 | virtual const Transform& GetTransformForAnimation() const OVERRIDE; |
| 291 | virtual float GetOpacityForAnimation() const OVERRIDE; |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 292 | |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 293 | #if defined(USE_WEBKIT_COMPOSITOR) |
| 294 | void CreateWebLayer(); |
| 295 | void RecomputeTransform(); |
[email protected] | b9616d59 | 2011-11-14 20:04:42 | [diff] [blame] | 296 | void RecomputeDrawsContentAndUVRect(); |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 297 | #endif |
| 298 | |
[email protected] | 993d6b32 | 2011-09-27 19:14:38 | [diff] [blame] | 299 | const LayerType type_; |
| 300 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 301 | Compositor* compositor_; |
| 302 | |
[email protected] | 51f1b48 | 2011-06-23 16:52:12 | [diff] [blame] | 303 | scoped_refptr<ui::Texture> texture_; |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 304 | |
| 305 | Layer* parent_; |
| 306 | |
| 307 | std::vector<Layer*> children_; |
| 308 | |
| 309 | ui::Transform transform_; |
| 310 | |
| 311 | gfx::Rect bounds_; |
| 312 | |
[email protected] | e4e8afef | 2011-10-05 13:58:33 | [diff] [blame] | 313 | // Visibility of this layer. See SetVisible/IsDrawn for more details. |
[email protected] | 3aa4394 | 2011-09-13 20:59:53 | [diff] [blame] | 314 | bool visible_; |
| 315 | |
[email protected] | c155c25 | 2011-07-29 16:17:55 | [diff] [blame] | 316 | bool fills_bounds_opaquely_; |
| 317 | |
| 318 | gfx::Rect hole_rect_; |
| 319 | |
[email protected] | 714e3843 | 2011-11-15 17:10:39 | [diff] [blame^] | 320 | bool recompute_hole_; |
| 321 | |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 322 | gfx::Rect invalid_rect_; |
| 323 | |
[email protected] | a97527b | 2011-09-14 15:44:38 | [diff] [blame] | 324 | // If true the layer is always up to date. |
| 325 | bool layer_updated_externally_; |
| 326 | |
[email protected] | b4bb9ca | 2011-09-23 20:53:14 | [diff] [blame] | 327 | float opacity_; |
| 328 | |
[email protected] | 00b8698 | 2011-09-01 00:02:09 | [diff] [blame] | 329 | LayerDelegate* delegate_; |
| 330 | |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 331 | scoped_ptr<LayerAnimator> animator_; |
[email protected] | 7fca53d4 | 2011-09-29 15:38:12 | [diff] [blame] | 332 | |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 333 | #if defined(USE_WEBKIT_COMPOSITOR) |
[email protected] | 4b58d55 | 2011-10-26 00:54:46 | [diff] [blame] | 334 | WebKit::WebLayer web_layer_; |
| 335 | bool web_layer_is_accelerated_; |
[email protected] | 33274903 | 2011-10-22 00:32:46 | [diff] [blame] | 336 | #endif |
| 337 | |
[email protected] | adc93fa7 | 2011-06-21 19:47:39 | [diff] [blame] | 338 | DISALLOW_COPY_AND_ASSIGN(Layer); |
| 339 | }; |
| 340 | |
| 341 | } // namespace ui |
| 342 | |
| 343 | #endif // UI_GFX_COMPOSITOR_LAYER_H_ |