[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 1 | // Copyright 2010 The Chromium Authors. All rights reserved. |
[email protected] | 0fb2500 | 2012-10-12 07:20:02 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 4 | |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 5 | #ifndef CC_LAYERS_LAYER_H_ |
| 6 | #define CC_LAYERS_LAYER_H_ |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 7 | |
[email protected] | 0e98cdd | 2013-08-23 00:44:30 | [diff] [blame] | 8 | #include <set> |
[email protected] | c8686a0 | 2012-11-27 08:29:00 | [diff] [blame] | 9 | #include <string> |
[email protected] | c8686a0 | 2012-11-27 08:29:00 | [diff] [blame] | 10 | |
[email protected] | 18a7019 | 2013-04-26 16:18:25 | [diff] [blame] | 11 | #include "base/callback.h" |
[email protected] | a8461d8 | 2012-10-16 21:11:14 | [diff] [blame] | 12 | #include "base/memory/ref_counted.h" |
[email protected] | e10cd02 | 2012-12-18 00:32:26 | [diff] [blame] | 13 | #include "base/observer_list.h" |
[email protected] | 95e4e1a0 | 2013-03-18 07:09:09 | [diff] [blame] | 14 | #include "cc/animation/layer_animation_controller.h" |
[email protected] | 95e4e1a0 | 2013-03-18 07:09:09 | [diff] [blame] | 15 | #include "cc/animation/layer_animation_value_observer.h" |
[email protected] | 681ccff | 2013-03-18 06:13:52 | [diff] [blame] | 16 | #include "cc/base/cc_export.h" |
| 17 | #include "cc/base/region.h" |
[email protected] | 0e5f714 | 2013-05-24 06:45:36 | [diff] [blame] | 18 | #include "cc/base/scoped_ptr_vector.h" |
[email protected] | 666d7cf | 2013-10-12 01:30:29 | [diff] [blame^] | 19 | #include "cc/debug/micro_benchmark.h" |
[email protected] | 2a9d2c1d | 2013-05-29 11:48:49 | [diff] [blame] | 20 | #include "cc/layers/compositing_reasons.h" |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 21 | #include "cc/layers/draw_properties.h" |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 22 | #include "cc/layers/layer_lists.h" |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 23 | #include "cc/layers/layer_position_constraint.h" |
[email protected] | 445881f | 2013-04-16 01:11:59 | [diff] [blame] | 24 | #include "cc/layers/paint_properties.h" |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 25 | #include "cc/layers/render_surface.h" |
[email protected] | ae6b1a7 | 2013-06-25 18:49:29 | [diff] [blame] | 26 | #include "cc/output/filter_operations.h" |
[email protected] | 556fd29 | 2013-03-18 08:03:04 | [diff] [blame] | 27 | #include "cc/trees/occlusion_tracker.h" |
[email protected] | 1940c4e | 2012-12-04 05:08:15 | [diff] [blame] | 28 | #include "skia/ext/refptr.h" |
[email protected] | ddf9df8 | 2012-10-16 06:52:46 | [diff] [blame] | 29 | #include "third_party/skia/include/core/SkColor.h" |
[email protected] | 1940c4e | 2012-12-04 05:08:15 | [diff] [blame] | 30 | #include "third_party/skia/include/core/SkImageFilter.h" |
[email protected] | f7837a9 | 2013-08-21 03:00:05 | [diff] [blame] | 31 | #include "third_party/skia/include/core/SkPicture.h" |
[email protected] | aad0a007 | 2012-11-01 18:15:58 | [diff] [blame] | 32 | #include "ui/gfx/rect.h" |
| 33 | #include "ui/gfx/rect_f.h" |
[email protected] | c8686a0 | 2012-11-27 08:29:00 | [diff] [blame] | 34 | #include "ui/gfx/transform.h" |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 35 | |
[email protected] | db2586f | 2013-08-15 22:03:14 | [diff] [blame] | 36 | namespace gfx { |
| 37 | class BoxF; |
| 38 | } |
| 39 | |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 40 | namespace cc { |
| 41 | |
[email protected] | 4d0786a | 2013-01-07 16:21:20 | [diff] [blame] | 42 | class Animation; |
[email protected] | 3cae03e | 2013-06-26 22:13:52 | [diff] [blame] | 43 | class AnimationDelegate; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 44 | struct AnimationEvent; |
[email protected] | 0e5f714 | 2013-05-24 06:45:36 | [diff] [blame] | 45 | class CopyOutputRequest; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 46 | class LayerAnimationDelegate; |
[email protected] | 7f5605c | 2013-04-08 18:08:35 | [diff] [blame] | 47 | class LayerAnimationEventObserver; |
[email protected] | ae716ce | 2013-08-16 13:04:24 | [diff] [blame] | 48 | class LayerClient; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 49 | class LayerImpl; |
| 50 | class LayerTreeHost; |
[email protected] | 8bef4057 | 2012-12-11 21:38:08 | [diff] [blame] | 51 | class LayerTreeImpl; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 52 | class PriorityCalculator; |
[email protected] | d8411661 | 2013-03-29 05:32:49 | [diff] [blame] | 53 | class RenderingStatsInstrumentation; |
[email protected] | b4da203 | 2012-10-25 21:22:55 | [diff] [blame] | 54 | class ResourceUpdateQueue; |
[email protected] | 80413d7 | 2013-08-30 20:25:33 | [diff] [blame] | 55 | class ScrollbarLayerInterface; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 56 | struct AnimationEvent; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 57 | |
| 58 | // Base class for composited layers. Special layer types are derived from |
| 59 | // this class. |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 60 | class CC_EXPORT Layer : public base::RefCounted<Layer>, |
| 61 | public LayerAnimationValueObserver { |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 62 | public: |
[email protected] | b7c4783f | 2013-03-15 23:11:42 | [diff] [blame] | 63 | enum LayerIdLabels { |
[email protected] | b7c4783f | 2013-03-15 23:11:42 | [diff] [blame] | 64 | INVALID_ID = -1, |
| 65 | }; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 66 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 67 | static scoped_refptr<Layer> Create(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 68 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 69 | int id() const { return layer_id_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 70 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 71 | Layer* RootLayer(); |
| 72 | Layer* parent() { return parent_; } |
| 73 | const Layer* parent() const { return parent_; } |
| 74 | void AddChild(scoped_refptr<Layer> child); |
| 75 | void InsertChild(scoped_refptr<Layer> child, size_t index); |
| 76 | void ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer); |
| 77 | void RemoveFromParent(); |
| 78 | void RemoveAllChildren(); |
| 79 | void SetChildren(const LayerList& children); |
[email protected] | f659521e | 2013-07-26 00:27:06 | [diff] [blame] | 80 | bool HasAncestor(const Layer* ancestor) const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 81 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 82 | const LayerList& children() const { return children_; } |
| 83 | Layer* child_at(size_t index) { return children_[index].get(); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 84 | |
[email protected] | 0e5f714 | 2013-05-24 06:45:36 | [diff] [blame] | 85 | // This requests the layer and its subtree be rendered and given to the |
| 86 | // callback. If the copy is unable to be produced (the layer is destroyed |
| 87 | // first), then the callback is called with a NULL/empty result. |
| 88 | void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> request); |
| 89 | bool HasCopyRequest() const { |
| 90 | return !copy_requests_.empty(); |
[email protected] | 18a7019 | 2013-04-26 16:18:25 | [diff] [blame] | 91 | } |
| 92 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 93 | void SetAnchorPoint(gfx::PointF anchor_point); |
| 94 | gfx::PointF anchor_point() const { return anchor_point_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 95 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 96 | void SetAnchorPointZ(float anchor_point_z); |
| 97 | float anchor_point_z() const { return anchor_point_z_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 98 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 99 | virtual void SetBackgroundColor(SkColor background_color); |
| 100 | SkColor background_color() const { return background_color_; } |
[email protected] | 2c4cbec | 2013-06-04 21:14:50 | [diff] [blame] | 101 | // If contents_opaque(), return an opaque color else return a |
| 102 | // non-opaque color. Tries to return background_color(), if possible. |
| 103 | SkColor SafeOpaqueBackgroundColor() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 104 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 105 | // A layer's bounds are in logical, non-page-scaled pixels (however, the |
| 106 | // root layer's bounds are in physical pixels). |
| 107 | void SetBounds(gfx::Size bounds); |
| 108 | gfx::Size bounds() const { return bounds_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 109 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 110 | void SetMasksToBounds(bool masks_to_bounds); |
| 111 | bool masks_to_bounds() const { return masks_to_bounds_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 112 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 113 | void SetMaskLayer(Layer* mask_layer); |
| 114 | Layer* mask_layer() { return mask_layer_.get(); } |
| 115 | const Layer* mask_layer() const { return mask_layer_.get(); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 116 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 117 | virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect); |
| 118 | void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::RectF(bounds())); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 119 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 120 | void SetOpacity(float opacity); |
| 121 | float opacity() const { return opacity_; } |
| 122 | bool OpacityIsAnimating() const; |
[email protected] | b7c4783f | 2013-03-15 23:11:42 | [diff] [blame] | 123 | virtual bool OpacityCanAnimateOnImplThread() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 124 | |
[email protected] | ae6b1a7 | 2013-06-25 18:49:29 | [diff] [blame] | 125 | void SetFilters(const FilterOperations& filters); |
| 126 | const FilterOperations& filters() const { return filters_; } |
[email protected] | b4c6d81 | 2013-10-03 15:48:56 | [diff] [blame] | 127 | bool FilterIsAnimating() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 128 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 129 | // Background filters are filters applied to what is behind this layer, when |
| 130 | // they are viewed through non-opaque regions in this layer. They are used |
| 131 | // through the WebLayer interface, and are not exposed to HTML. |
[email protected] | ae6b1a7 | 2013-06-25 18:49:29 | [diff] [blame] | 132 | void SetBackgroundFilters(const FilterOperations& filters); |
| 133 | const FilterOperations& background_filters() const { |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 134 | return background_filters_; |
| 135 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 136 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 137 | virtual void SetContentsOpaque(bool opaque); |
| 138 | bool contents_opaque() const { return contents_opaque_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 139 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 140 | void SetPosition(gfx::PointF position); |
| 141 | gfx::PointF position() const { return position_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 142 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 143 | void SetIsContainerForFixedPositionLayers(bool container); |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 144 | bool IsContainerForFixedPositionLayers() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 145 | |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 146 | void SetPositionConstraint(const LayerPositionConstraint& constraint); |
| 147 | const LayerPositionConstraint& position_constraint() const { |
| 148 | return position_constraint_; |
| 149 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 150 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 151 | void SetSublayerTransform(const gfx::Transform& sublayer_transform); |
| 152 | const gfx::Transform& sublayer_transform() const { |
| 153 | return sublayer_transform_; |
| 154 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 155 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 156 | void SetTransform(const gfx::Transform& transform); |
| 157 | const gfx::Transform& transform() const { return transform_; } |
| 158 | bool TransformIsAnimating() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 159 | |
[email protected] | 0e98cdd | 2013-08-23 00:44:30 | [diff] [blame] | 160 | void SetScrollParent(Layer* parent); |
| 161 | |
| 162 | Layer* scroll_parent() { return scroll_parent_; } |
| 163 | const Layer* scroll_parent() const { return scroll_parent_; } |
| 164 | |
| 165 | void AddScrollChild(Layer* child); |
| 166 | void RemoveScrollChild(Layer* child); |
| 167 | |
| 168 | std::set<Layer*>* scroll_children() { return scroll_children_.get(); } |
| 169 | const std::set<Layer*>* scroll_children() const { |
| 170 | return scroll_children_.get(); |
| 171 | } |
| 172 | |
| 173 | void SetClipParent(Layer* ancestor); |
| 174 | |
| 175 | Layer* clip_parent() { return clip_parent_; } |
| 176 | const Layer* clip_parent() const { |
| 177 | return clip_parent_; |
| 178 | } |
| 179 | |
| 180 | void AddClipChild(Layer* child); |
| 181 | void RemoveClipChild(Layer* child); |
| 182 | |
| 183 | std::set<Layer*>* clip_children() { return clip_children_.get(); } |
| 184 | const std::set<Layer*>* clip_children() const { |
| 185 | return clip_children_.get(); |
| 186 | } |
| 187 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 188 | DrawProperties<Layer, RenderSurface>& draw_properties() { |
| 189 | return draw_properties_; |
| 190 | } |
| 191 | const DrawProperties<Layer, RenderSurface>& draw_properties() const { |
| 192 | return draw_properties_; |
| 193 | } |
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 194 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 195 | // The following are shortcut accessors to get various information from |
| 196 | // draw_properties_ |
| 197 | const gfx::Transform& draw_transform() const { |
| 198 | return draw_properties_.target_space_transform; |
| 199 | } |
| 200 | const gfx::Transform& screen_space_transform() const { |
| 201 | return draw_properties_.screen_space_transform; |
| 202 | } |
| 203 | float draw_opacity() const { return draw_properties_.opacity; } |
| 204 | bool draw_opacity_is_animating() const { |
| 205 | return draw_properties_.opacity_is_animating; |
| 206 | } |
| 207 | bool draw_transform_is_animating() const { |
| 208 | return draw_properties_.target_space_transform_is_animating; |
| 209 | } |
| 210 | bool screen_space_transform_is_animating() const { |
| 211 | return draw_properties_.screen_space_transform_is_animating; |
| 212 | } |
| 213 | bool screen_space_opacity_is_animating() const { |
| 214 | return draw_properties_.screen_space_opacity_is_animating; |
| 215 | } |
| 216 | bool can_use_lcd_text() const { return draw_properties_.can_use_lcd_text; } |
| 217 | bool is_clipped() const { return draw_properties_.is_clipped; } |
| 218 | gfx::Rect clip_rect() const { return draw_properties_.clip_rect; } |
| 219 | gfx::Rect drawable_content_rect() const { |
| 220 | return draw_properties_.drawable_content_rect; |
| 221 | } |
| 222 | gfx::Rect visible_content_rect() const { |
| 223 | return draw_properties_.visible_content_rect; |
| 224 | } |
| 225 | Layer* render_target() { |
| 226 | DCHECK(!draw_properties_.render_target || |
| 227 | draw_properties_.render_target->render_surface()); |
| 228 | return draw_properties_.render_target; |
| 229 | } |
| 230 | const Layer* render_target() const { |
| 231 | DCHECK(!draw_properties_.render_target || |
| 232 | draw_properties_.render_target->render_surface()); |
| 233 | return draw_properties_.render_target; |
| 234 | } |
| 235 | RenderSurface* render_surface() const { |
| 236 | return draw_properties_.render_surface.get(); |
| 237 | } |
[email protected] | 420fdf6e | 2013-08-26 20:36:38 | [diff] [blame] | 238 | int num_unclipped_descendants() const { |
| 239 | return draw_properties_.num_unclipped_descendants; |
| 240 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 241 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 242 | void SetScrollOffset(gfx::Vector2d scroll_offset); |
| 243 | gfx::Vector2d scroll_offset() const { return scroll_offset_; } |
[email protected] | a90fac7 | 2013-06-06 18:56:13 | [diff] [blame] | 244 | void SetScrollOffsetFromImplSide(gfx::Vector2d scroll_offset); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 245 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 246 | void SetMaxScrollOffset(gfx::Vector2d max_scroll_offset); |
| 247 | gfx::Vector2d max_scroll_offset() const { return max_scroll_offset_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 248 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 249 | void SetScrollable(bool scrollable); |
| 250 | bool scrollable() const { return scrollable_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 251 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 252 | void SetShouldScrollOnMainThread(bool should_scroll_on_main_thread); |
| 253 | bool should_scroll_on_main_thread() const { |
| 254 | return should_scroll_on_main_thread_; |
| 255 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 256 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 257 | void SetHaveWheelEventHandlers(bool have_wheel_event_handlers); |
| 258 | bool have_wheel_event_handlers() const { return have_wheel_event_handlers_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 259 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 260 | void SetNonFastScrollableRegion(const Region& non_fast_scrollable_region); |
| 261 | const Region& non_fast_scrollable_region() const { |
| 262 | return non_fast_scrollable_region_; |
| 263 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 264 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 265 | void SetTouchEventHandlerRegion(const Region& touch_event_handler_region); |
| 266 | const Region& touch_event_handler_region() const { |
| 267 | return touch_event_handler_region_; |
| 268 | } |
[email protected] | 23d56be | 2012-11-08 00:33:34 | [diff] [blame] | 269 | |
[email protected] | 28096ed | 2013-07-01 07:38:58 | [diff] [blame] | 270 | void set_did_scroll_callback(const base::Closure& callback) { |
| 271 | did_scroll_callback_ = callback; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 272 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 273 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 274 | void SetDrawCheckerboardForMissingTiles(bool checkerboard); |
| 275 | bool DrawCheckerboardForMissingTiles() const { |
| 276 | return draw_checkerboard_for_missing_tiles_; |
| 277 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 278 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 279 | void SetForceRenderSurface(bool force_render_surface); |
| 280 | bool force_render_surface() const { return force_render_surface_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 281 | |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 282 | gfx::Vector2d ScrollDelta() const { return gfx::Vector2d(); } |
[email protected] | 4ec78f8 | 2013-07-11 18:45:47 | [diff] [blame] | 283 | gfx::Vector2dF TotalScrollOffset() const { |
| 284 | // Floating point to match the LayerImpl version. |
| 285 | return scroll_offset() + ScrollDelta(); |
| 286 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 287 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 288 | void SetDoubleSided(bool double_sided); |
| 289 | bool double_sided() const { return double_sided_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 290 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 291 | void SetPreserves3d(bool preserves_3d) { preserves_3d_ = preserves_3d; } |
| 292 | bool preserves_3d() const { return preserves_3d_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 293 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 294 | void set_use_parent_backface_visibility(bool use) { |
| 295 | use_parent_backface_visibility_ = use; |
| 296 | } |
| 297 | bool use_parent_backface_visibility() const { |
| 298 | return use_parent_backface_visibility_; |
| 299 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 300 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 301 | virtual void SetLayerTreeHost(LayerTreeHost* host); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 302 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 303 | bool HasDelegatedContent() const { return false; } |
| 304 | bool HasContributingDelegatedRenderPasses() const { return false; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 305 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 306 | void SetIsDrawable(bool is_drawable); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 307 | |
[email protected] | c0ae06c1 | 2013-06-24 18:32:19 | [diff] [blame] | 308 | void SetHideLayerAndSubtree(bool hide); |
| 309 | bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } |
| 310 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 311 | void SetReplicaLayer(Layer* layer); |
| 312 | Layer* replica_layer() { return replica_layer_.get(); } |
| 313 | const Layer* replica_layer() const { return replica_layer_.get(); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 314 | |
[email protected] | 22898ed | 2013-06-01 04:52:30 | [diff] [blame] | 315 | bool has_mask() const { return !!mask_layer_.get(); } |
| 316 | bool has_replica() const { return !!replica_layer_.get(); } |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 317 | bool replica_has_mask() const { |
[email protected] | 22898ed | 2013-06-01 04:52:30 | [diff] [blame] | 318 | return replica_layer_.get() && |
| 319 | (mask_layer_.get() || replica_layer_->mask_layer_.get()); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 320 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 321 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 322 | // These methods typically need to be overwritten by derived classes. |
| 323 | virtual bool DrawsContent() const; |
[email protected] | 445881f | 2013-04-16 01:11:59 | [diff] [blame] | 324 | virtual void SavePaintProperties(); |
[email protected] | 49304bde | 2013-07-08 21:31:22 | [diff] [blame] | 325 | // Returns true iff any resources were updated that need to be committed. |
| 326 | virtual bool Update(ResourceUpdateQueue* queue, |
| 327 | const OcclusionTracker* occlusion); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 328 | virtual bool NeedMoreUpdates(); |
| 329 | virtual void SetIsMask(bool is_mask) {} |
[email protected] | 4830141f | 2013-05-18 01:36:05 | [diff] [blame] | 330 | virtual void ReduceMemoryUsage() {} |
[email protected] | 039fa8c | 2013-10-09 22:37:28 | [diff] [blame] | 331 | virtual void OnOutputSurfaceCreated() {} |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 332 | |
[email protected] | ae716ce | 2013-08-16 13:04:24 | [diff] [blame] | 333 | virtual std::string DebugName(); |
| 334 | |
| 335 | void SetLayerClient(LayerClient* client) { client_ = client; } |
| 336 | |
[email protected] | 2a9d2c1d | 2013-05-29 11:48:49 | [diff] [blame] | 337 | void SetCompositingReasons(CompositingReasons reasons); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 338 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 339 | virtual void PushPropertiesTo(LayerImpl* layer); |
| 340 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 341 | void CreateRenderSurface(); |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 342 | void ClearRenderSurface(); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 343 | |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 344 | // The contents scale converts from logical, non-page-scaled pixels to target |
| 345 | // pixels. The contents scale is 1 for the root layer as it is already in |
| 346 | // physical pixels. By default contents scale is forced to be 1 except for |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 347 | // subclasses of ContentsScalingLayer. |
| 348 | float contents_scale_x() const { return draw_properties_.contents_scale_x; } |
| 349 | float contents_scale_y() const { return draw_properties_.contents_scale_y; } |
| 350 | gfx::Size content_bounds() const { return draw_properties_.content_bounds; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 351 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 352 | virtual void CalculateContentsScale(float ideal_contents_scale, |
[email protected] | b673495c | 2013-05-07 17:16:06 | [diff] [blame] | 353 | float device_scale_factor, |
| 354 | float page_scale_factor, |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 355 | bool animating_transform_to_screen, |
| 356 | float* contents_scale_x, |
| 357 | float* contents_scale_y, |
| 358 | gfx::Size* content_bounds); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 359 | |
[email protected] | 3698e79 | 2013-08-24 00:21:16 | [diff] [blame] | 360 | LayerTreeHost* layer_tree_host() { return layer_tree_host_; } |
| 361 | const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 362 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 363 | // Set the priority of all desired textures in this layer. |
| 364 | virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) {} |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 365 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 366 | bool AddAnimation(scoped_ptr<Animation> animation); |
| 367 | void PauseAnimation(int animation_id, double time_offset); |
| 368 | void RemoveAnimation(int animation_id); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 369 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 370 | void SuspendAnimations(double monotonic_time); |
| 371 | void ResumeAnimations(double monotonic_time); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 372 | |
[email protected] | db2586f | 2013-08-15 22:03:14 | [diff] [blame] | 373 | bool AnimatedBoundsForBox(const gfx::BoxF& box, gfx::BoxF* bounds) { |
| 374 | return layer_animation_controller_->AnimatedBoundsForBox(box, bounds); |
| 375 | } |
| 376 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 377 | LayerAnimationController* layer_animation_controller() { |
| 378 | return layer_animation_controller_.get(); |
| 379 | } |
[email protected] | 7f5605c | 2013-04-08 18:08:35 | [diff] [blame] | 380 | void SetLayerAnimationControllerForTest( |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 381 | scoped_refptr<LayerAnimationController> controller); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 382 | |
[email protected] | 3cae03e | 2013-06-26 22:13:52 | [diff] [blame] | 383 | void set_layer_animation_delegate(AnimationDelegate* delegate) { |
[email protected] | 7f5605c | 2013-04-08 18:08:35 | [diff] [blame] | 384 | layer_animation_controller_->set_layer_animation_delegate(delegate); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 385 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 386 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 387 | bool HasActiveAnimation() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 388 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 389 | void AddLayerAnimationEventObserver( |
| 390 | LayerAnimationEventObserver* animation_observer); |
| 391 | void RemoveLayerAnimationEventObserver( |
| 392 | LayerAnimationEventObserver* animation_observer); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 393 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 394 | virtual Region VisibleContentOpaqueRegion() const; |
[email protected] | e10cd02 | 2012-12-18 00:32:26 | [diff] [blame] | 395 | |
[email protected] | 80413d7 | 2013-08-30 20:25:33 | [diff] [blame] | 396 | virtual ScrollbarLayerInterface* ToScrollbarLayer(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 397 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 398 | gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 399 | |
[email protected] | f7837a9 | 2013-08-21 03:00:05 | [diff] [blame] | 400 | virtual skia::RefPtr<SkPicture> GetPicture() const; |
| 401 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 402 | // Constructs a LayerImpl of the correct runtime type for this Layer type. |
| 403 | virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
[email protected] | aedf4e5 | 2013-01-09 23:24:44 | [diff] [blame] | 404 | |
[email protected] | 4460464 | 2013-08-01 01:14:09 | [diff] [blame] | 405 | bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); } |
| 406 | void ResetNeedsDisplayForTesting() { update_rect_ = gfx::RectF(); } |
[email protected] | 48871fc | 2013-01-23 07:36:51 | [diff] [blame] | 407 | |
[email protected] | d8411661 | 2013-03-29 05:32:49 | [diff] [blame] | 408 | RenderingStatsInstrumentation* rendering_stats_instrumentation() const; |
| 409 | |
[email protected] | 445881f | 2013-04-16 01:11:59 | [diff] [blame] | 410 | const PaintProperties& paint_properties() const { |
| 411 | return paint_properties_; |
| 412 | } |
| 413 | |
[email protected] | 35a99a1 | 2013-05-09 23:52:29 | [diff] [blame] | 414 | // The scale at which contents should be rastered, to match the scale at |
| 415 | // which they will drawn to the screen. This scale is a component of the |
| 416 | // contents scale but does not include page/device scale factors. |
| 417 | // TODO(danakj): This goes away when TiledLayer goes away. |
| 418 | void set_raster_scale(float scale) { raster_scale_ = scale; } |
| 419 | float raster_scale() const { return raster_scale_; } |
| 420 | bool raster_scale_is_unknown() const { return raster_scale_ == 0.f; } |
| 421 | |
[email protected] | 7924c185 | 2013-05-24 16:18:43 | [diff] [blame] | 422 | virtual bool SupportsLCDText() const; |
| 423 | |
[email protected] | f4e25f9 | 2013-07-13 20:54:53 | [diff] [blame] | 424 | bool needs_push_properties() const { return needs_push_properties_; } |
| 425 | bool descendant_needs_push_properties() const { |
| 426 | return num_dependents_need_push_properties_ > 0; |
| 427 | } |
| 428 | |
[email protected] | 666d7cf | 2013-10-12 01:30:29 | [diff] [blame^] | 429 | virtual void RunMicroBenchmark(MicroBenchmark* benchmark); |
| 430 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 431 | protected: |
| 432 | friend class LayerImpl; |
| 433 | friend class TreeSynchronizer; |
| 434 | virtual ~Layer(); |
[email protected] | 090e1a7 | 2013-01-29 07:07:45 | [diff] [blame] | 435 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 436 | Layer(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 437 | |
[email protected] | 3519b87 | 2013-07-30 07:17:50 | [diff] [blame] | 438 | // These SetNeeds functions are in order of severity of update: |
| 439 | // |
| 440 | // Called when this layer has been modified in some way, but isn't sure |
| 441 | // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers |
| 442 | // before it knows whether or not a commit is required. |
| 443 | void SetNeedsUpdate(); |
| 444 | // Called when a property has been modified in a way that the layer |
| 445 | // knows immediately that a commit is required. This implies SetNeedsUpdate |
| 446 | // as well as SetNeedsPushProperties to push that property. |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 447 | void SetNeedsCommit(); |
[email protected] | 3519b87 | 2013-07-30 07:17:50 | [diff] [blame] | 448 | // Called when there's been a change in layer structure. Implies both |
| 449 | // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 450 | void SetNeedsFullTreeSync(); |
[email protected] | 74b43cc | 2013-08-30 06:29:27 | [diff] [blame] | 451 | |
| 452 | // Called when the next commit should wait until the pending tree is activated |
| 453 | // before finishing the commit and unblocking the main thread. Used to ensure |
| 454 | // unused resources on the impl thread are returned before commit completes. |
| 455 | void SetNextCommitWaitsForActivation(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 456 | |
[email protected] | f4e25f9 | 2013-07-13 20:54:53 | [diff] [blame] | 457 | void SetNeedsPushProperties(); |
| 458 | void AddDependentNeedsPushProperties(); |
| 459 | void RemoveDependentNeedsPushProperties(); |
| 460 | bool parent_should_know_need_push_properties() const { |
| 461 | return needs_push_properties() || descendant_needs_push_properties(); |
| 462 | } |
| 463 | |
[email protected] | 74b43cc | 2013-08-30 06:29:27 | [diff] [blame] | 464 | bool IsPropertyChangeAllowed() const; |
| 465 | |
[email protected] | 0e98cdd | 2013-08-23 00:44:30 | [diff] [blame] | 466 | // If this layer has a scroll parent, it removes |this| from its list of |
| 467 | // scroll children. |
| 468 | void RemoveFromScrollTree(); |
| 469 | |
| 470 | // If this layer has a clip parent, it removes |this| from its list of clip |
| 471 | // children. |
| 472 | void RemoveFromClipTree(); |
| 473 | |
[email protected] | 35a99a1 | 2013-05-09 23:52:29 | [diff] [blame] | 474 | void reset_raster_scale_to_unknown() { raster_scale_ = 0.f; } |
| 475 | |
[email protected] | f4e25f9 | 2013-07-13 20:54:53 | [diff] [blame] | 476 | // This flag is set when the layer needs to push properties to the impl |
| 477 | // side. |
| 478 | bool needs_push_properties_; |
| 479 | |
| 480 | // The number of direct children or dependent layers that need to be recursed |
| 481 | // to in order for them or a descendent of them to push properties to the impl |
| 482 | // side. |
| 483 | int num_dependents_need_push_properties_; |
| 484 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 485 | // Tracks whether this layer may have changed stacking order with its |
| 486 | // siblings. |
| 487 | bool stacking_order_changed_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 488 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 489 | // The update rect is the region of the compositor resource that was |
| 490 | // actually updated by the compositor. For layers that may do updating |
| 491 | // outside the compositor's control (i.e. plugin layers), this information |
| 492 | // is not available and the update rect will remain empty. |
| 493 | // Note this rect is in layer space (not content space). |
| 494 | gfx::RectF update_rect_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 495 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 496 | scoped_refptr<Layer> mask_layer_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 497 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 498 | int layer_id_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 499 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 500 | // When true, the layer is about to perform an update. Any commit requests |
[email protected] | 3519b87 | 2013-07-30 07:17:50 | [diff] [blame] | 501 | // will be handled implicitly after the update completes. |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 502 | bool ignore_set_needs_commit_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 503 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 504 | private: |
| 505 | friend class base::RefCounted<Layer>; |
[email protected] | 29493a1 | 2012-12-20 01:42:42 | [diff] [blame] | 506 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 507 | void SetParent(Layer* layer); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 508 | bool DescendantIsFixedToContainerLayer() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 509 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 510 | // Returns the index of the child or -1 if not found. |
| 511 | int IndexOfChild(const Layer* reference); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 512 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 513 | // This should only be called from RemoveFromParent(). |
| 514 | void RemoveChildOrDependent(Layer* child); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 515 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 516 | // LayerAnimationValueObserver implementation. |
[email protected] | b4c6d81 | 2013-10-03 15:48:56 | [diff] [blame] | 517 | virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 518 | virtual void OnOpacityAnimated(float opacity) OVERRIDE; |
| 519 | virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; |
| 520 | virtual bool IsActive() const OVERRIDE; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 521 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 522 | LayerList children_; |
| 523 | Layer* parent_; |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 524 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 525 | // Layer instances have a weak pointer to their LayerTreeHost. |
| 526 | // This pointer value is nil when a Layer is not in a tree and is |
| 527 | // updated via SetLayerTreeHost() if a layer moves between trees. |
| 528 | LayerTreeHost* layer_tree_host_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 529 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 530 | scoped_refptr<LayerAnimationController> layer_animation_controller_; |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 531 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 532 | // Layer properties. |
| 533 | gfx::Size bounds_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 534 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 535 | gfx::Vector2d scroll_offset_; |
| 536 | gfx::Vector2d max_scroll_offset_; |
| 537 | bool scrollable_; |
| 538 | bool should_scroll_on_main_thread_; |
| 539 | bool have_wheel_event_handlers_; |
| 540 | Region non_fast_scrollable_region_; |
| 541 | Region touch_event_handler_region_; |
| 542 | gfx::PointF position_; |
| 543 | gfx::PointF anchor_point_; |
| 544 | SkColor background_color_; |
[email protected] | 2a9d2c1d | 2013-05-29 11:48:49 | [diff] [blame] | 545 | CompositingReasons compositing_reasons_; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 546 | float opacity_; |
[email protected] | ae6b1a7 | 2013-06-25 18:49:29 | [diff] [blame] | 547 | FilterOperations filters_; |
| 548 | FilterOperations background_filters_; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 549 | float anchor_point_z_; |
| 550 | bool is_container_for_fixed_position_layers_; |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 551 | LayerPositionConstraint position_constraint_; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 552 | bool is_drawable_; |
[email protected] | c0ae06c1 | 2013-06-24 18:32:19 | [diff] [blame] | 553 | bool hide_layer_and_subtree_; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 554 | bool masks_to_bounds_; |
| 555 | bool contents_opaque_; |
| 556 | bool double_sided_; |
| 557 | bool preserves_3d_; |
| 558 | bool use_parent_backface_visibility_; |
| 559 | bool draw_checkerboard_for_missing_tiles_; |
| 560 | bool force_render_surface_; |
[email protected] | 0e98cdd | 2013-08-23 00:44:30 | [diff] [blame] | 561 | Layer* scroll_parent_; |
| 562 | scoped_ptr<std::set<Layer*> > scroll_children_; |
| 563 | |
| 564 | Layer* clip_parent_; |
| 565 | scoped_ptr<std::set<Layer*> > clip_children_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 566 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 567 | gfx::Transform transform_; |
| 568 | gfx::Transform sublayer_transform_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 569 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 570 | // Replica layer used for reflections. |
| 571 | scoped_refptr<Layer> replica_layer_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 572 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 573 | // Transient properties. |
| 574 | float raster_scale_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 575 | |
[email protected] | ae716ce | 2013-08-16 13:04:24 | [diff] [blame] | 576 | LayerClient* client_; |
| 577 | |
[email protected] | 0e5f714 | 2013-05-24 06:45:36 | [diff] [blame] | 578 | ScopedPtrVector<CopyOutputRequest> copy_requests_; |
[email protected] | 18a7019 | 2013-04-26 16:18:25 | [diff] [blame] | 579 | |
[email protected] | 28096ed | 2013-07-01 07:38:58 | [diff] [blame] | 580 | base::Closure did_scroll_callback_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 581 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 582 | DrawProperties<Layer, RenderSurface> draw_properties_; |
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 583 | |
[email protected] | 445881f | 2013-04-16 01:11:59 | [diff] [blame] | 584 | PaintProperties paint_properties_; |
| 585 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 586 | DISALLOW_COPY_AND_ASSIGN(Layer); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 587 | }; |
| 588 | |
[email protected] | ddf9df8 | 2012-10-16 06:52:46 | [diff] [blame] | 589 | } // namespace cc |
| 590 | |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 591 | #endif // CC_LAYERS_LAYER_H_ |