[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 | |
avi | 02a4d17 | 2015-12-21 06:14:36 | [diff] [blame] | 8 | #include <stddef.h> |
| 9 | #include <stdint.h> |
| 10 | |
[email protected] | 0e98cdd | 2013-08-23 00:44:30 | [diff] [blame] | 11 | #include <set> |
[email protected] | c8686a0 | 2012-11-27 08:29:00 | [diff] [blame] | 12 | #include <string> |
vmpstr | 3d1d72c | 2015-01-26 18:27:40 | [diff] [blame] | 13 | #include <vector> |
[email protected] | c8686a0 | 2012-11-27 08:29:00 | [diff] [blame] | 14 | |
[email protected] | 18a7019 | 2013-04-26 16:18:25 | [diff] [blame] | 15 | #include "base/callback.h" |
avi | 02a4d17 | 2015-12-21 06:14:36 | [diff] [blame] | 16 | #include "base/macros.h" |
[email protected] | a8461d8 | 2012-10-16 21:11:14 | [diff] [blame] | 17 | #include "base/memory/ref_counted.h" |
[email protected] | e10cd02 | 2012-12-18 00:32:26 | [diff] [blame] | 18 | #include "base/observer_list.h" |
[email protected] | 95e4e1a0 | 2013-03-18 07:09:09 | [diff] [blame] | 19 | #include "cc/animation/layer_animation_controller.h" |
[email protected] | 95e4e1a0 | 2013-03-18 07:09:09 | [diff] [blame] | 20 | #include "cc/animation/layer_animation_value_observer.h" |
[email protected] | b8384e2 | 2013-12-03 02:20:48 | [diff] [blame] | 21 | #include "cc/animation/layer_animation_value_provider.h" |
[email protected] | 681ccff | 2013-03-18 06:13:52 | [diff] [blame] | 22 | #include "cc/base/cc_export.h" |
| 23 | #include "cc/base/region.h" |
vmpstr | 3d1d72c | 2015-01-26 18:27:40 | [diff] [blame] | 24 | #include "cc/debug/frame_timing_request.h" |
[email protected] | 666d7cf | 2013-10-12 01:30:29 | [diff] [blame] | 25 | #include "cc/debug/micro_benchmark.h" |
tdresser | 81e84c67 | 2016-01-18 23:21:22 | [diff] [blame] | 26 | #include "cc/input/input_handler.h" |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 27 | #include "cc/layers/layer_lists.h" |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 28 | #include "cc/layers/layer_position_constraint.h" |
[email protected] | 445881f | 2013-04-16 01:11:59 | [diff] [blame] | 29 | #include "cc/layers/paint_properties.h" |
rbyers | 18779d82 | 2015-02-05 06:22:06 | [diff] [blame] | 30 | #include "cc/layers/scroll_blocks_on.h" |
[email protected] | ae6b1a7 | 2013-06-25 18:49:29 | [diff] [blame] | 31 | #include "cc/output/filter_operations.h" |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 32 | #include "cc/trees/property_tree.h" |
[email protected] | 1940c4e | 2012-12-04 05:08:15 | [diff] [blame] | 33 | #include "skia/ext/refptr.h" |
[email protected] | ddf9df8 | 2012-10-16 06:52:46 | [diff] [blame] | 34 | #include "third_party/skia/include/core/SkColor.h" |
[email protected] | 1940c4e | 2012-12-04 05:08:15 | [diff] [blame] | 35 | #include "third_party/skia/include/core/SkImageFilter.h" |
[email protected] | f7837a9 | 2013-08-21 03:00:05 | [diff] [blame] | 36 | #include "third_party/skia/include/core/SkPicture.h" |
[email protected] | 7bbeaf4e | 2013-11-26 10:27:22 | [diff] [blame] | 37 | #include "third_party/skia/include/core/SkXfermode.h" |
heejin.r.chung | d28506ba | 2014-10-23 16:36:20 | [diff] [blame] | 38 | #include "ui/gfx/geometry/point3_f.h" |
| 39 | #include "ui/gfx/geometry/rect.h" |
| 40 | #include "ui/gfx/geometry/rect_f.h" |
miletus | f57925d | 2014-10-01 19:38:13 | [diff] [blame] | 41 | #include "ui/gfx/geometry/scroll_offset.h" |
[email protected] | c8686a0 | 2012-11-27 08:29:00 | [diff] [blame] | 42 | #include "ui/gfx/transform.h" |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 43 | |
[email protected] | db2586f | 2013-08-15 22:03:14 | [diff] [blame] | 44 | namespace gfx { |
| 45 | class BoxF; |
| 46 | } |
| 47 | |
[email protected] | 9f3be43 | 2013-12-03 03:53:22 | [diff] [blame] | 48 | namespace base { |
primiano | 1596043 | 2015-02-05 14:20:26 | [diff] [blame] | 49 | namespace trace_event { |
[email protected] | 9f3be43 | 2013-12-03 03:53:22 | [diff] [blame] | 50 | class ConvertableToTraceFormat; |
| 51 | } |
| 52 | } |
| 53 | |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 54 | namespace cc { |
| 55 | |
[email protected] | 4d0786a | 2013-01-07 16:21:20 | [diff] [blame] | 56 | class Animation; |
[email protected] | 3cae03e | 2013-06-26 22:13:52 | [diff] [blame] | 57 | class AnimationDelegate; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 58 | struct AnimationEvent; |
[email protected] | 0e5f714 | 2013-05-24 06:45:36 | [diff] [blame] | 59 | class CopyOutputRequest; |
[email protected] | 7f5605c | 2013-04-08 18:08:35 | [diff] [blame] | 60 | class LayerAnimationEventObserver; |
[email protected] | ae716ce | 2013-08-16 13:04:24 | [diff] [blame] | 61 | class LayerClient; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 62 | class LayerImpl; |
loyso | a6edaaff | 2015-05-25 03:26:44 | [diff] [blame] | 63 | class LayerSettings; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 64 | class LayerTreeHost; |
awoloszyn | e83f28c | 2014-12-22 15:40:00 | [diff] [blame] | 65 | class LayerTreeHostCommon; |
[email protected] | 8bef4057 | 2012-12-11 21:38:08 | [diff] [blame] | 66 | class LayerTreeImpl; |
loyso | 5719778 | 2015-05-28 04:10:18 | [diff] [blame] | 67 | class LayerTreeSettings; |
[email protected] | d8411661 | 2013-03-29 05:32:49 | [diff] [blame] | 68 | class RenderingStatsInstrumentation; |
[email protected] | b4da203 | 2012-10-25 21:22:55 | [diff] [blame] | 69 | class ResourceUpdateQueue; |
[email protected] | 80413d7 | 2013-08-30 20:25:33 | [diff] [blame] | 70 | class ScrollbarLayerInterface; |
[email protected] | d5467eb7 | 2014-08-22 01:16:43 | [diff] [blame] | 71 | class SimpleEnclosedRegion; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 72 | struct AnimationEvent; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 73 | |
nyquist | 353b7d5 | 2015-11-06 22:26:53 | [diff] [blame] | 74 | namespace proto { |
| 75 | class LayerNode; |
nyquist | bc1290a | 2015-11-18 16:09:56 | [diff] [blame] | 76 | class LayerProperties; |
| 77 | class LayerUpdate; |
nyquist | 353b7d5 | 2015-11-06 22:26:53 | [diff] [blame] | 78 | } // namespace proto |
| 79 | |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 80 | // Base class for composited layers. Special layer types are derived from |
| 81 | // this class. |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 82 | class CC_EXPORT Layer : public base::RefCounted<Layer>, |
[email protected] | b8384e2 | 2013-12-03 02:20:48 | [diff] [blame] | 83 | public LayerAnimationValueObserver, |
| 84 | public LayerAnimationValueProvider { |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 85 | public: |
[email protected] | 44d8e84c | 2013-10-19 19:13:22 | [diff] [blame] | 86 | typedef LayerList LayerListType; |
nyquist | 353b7d5 | 2015-11-06 22:26:53 | [diff] [blame] | 87 | typedef base::hash_map<int, scoped_refptr<Layer>> LayerIdMap; |
[email protected] | 44d8e84c | 2013-10-19 19:13:22 | [diff] [blame] | 88 | |
[email protected] | b7c4783f | 2013-03-15 23:11:42 | [diff] [blame] | 89 | enum LayerIdLabels { |
[email protected] | b7c4783f | 2013-03-15 23:11:42 | [diff] [blame] | 90 | INVALID_ID = -1, |
| 91 | }; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 92 | |
loyso | a6edaaff | 2015-05-25 03:26:44 | [diff] [blame] | 93 | static scoped_refptr<Layer> Create(const LayerSettings& settings); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 94 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 95 | int id() const { return layer_id_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 96 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 97 | Layer* RootLayer(); |
| 98 | Layer* parent() { return parent_; } |
| 99 | const Layer* parent() const { return parent_; } |
| 100 | void AddChild(scoped_refptr<Layer> child); |
| 101 | void InsertChild(scoped_refptr<Layer> child, size_t index); |
| 102 | void ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer); |
| 103 | void RemoveFromParent(); |
| 104 | void RemoveAllChildren(); |
| 105 | void SetChildren(const LayerList& children); |
[email protected] | f659521e | 2013-07-26 00:27:06 | [diff] [blame] | 106 | bool HasAncestor(const Layer* ancestor) const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 107 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 108 | const LayerList& children() const { return children_; } |
| 109 | Layer* child_at(size_t index) { return children_[index].get(); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 110 | |
[email protected] | 0e5f714 | 2013-05-24 06:45:36 | [diff] [blame] | 111 | // This requests the layer and its subtree be rendered and given to the |
| 112 | // callback. If the copy is unable to be produced (the layer is destroyed |
miu | a6ce94ca | 2015-03-31 20:21:22 | [diff] [blame] | 113 | // first), then the callback is called with a nullptr/empty result. If the |
| 114 | // request's source property is set, any prior uncommitted requests having the |
| 115 | // same source will be aborted. |
[email protected] | 0e5f714 | 2013-05-24 06:45:36 | [diff] [blame] | 116 | void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> request); |
| 117 | bool HasCopyRequest() const { |
| 118 | return !copy_requests_.empty(); |
[email protected] | 18a7019 | 2013-04-26 16:18:25 | [diff] [blame] | 119 | } |
| 120 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 121 | virtual void SetBackgroundColor(SkColor background_color); |
| 122 | SkColor background_color() const { return background_color_; } |
[email protected] | 2c4cbec | 2013-06-04 21:14:50 | [diff] [blame] | 123 | // If contents_opaque(), return an opaque color else return a |
| 124 | // non-opaque color. Tries to return background_color(), if possible. |
| 125 | SkColor SafeOpaqueBackgroundColor() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 126 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 127 | // A layer's bounds are in logical, non-page-scaled pixels (however, the |
| 128 | // root layer's bounds are in physical pixels). |
[email protected] | 64348ea | 2014-01-29 22:58:26 | [diff] [blame] | 129 | void SetBounds(const gfx::Size& bounds); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 130 | gfx::Size bounds() const { return bounds_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 131 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 132 | void SetMasksToBounds(bool masks_to_bounds); |
| 133 | bool masks_to_bounds() const { return masks_to_bounds_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 134 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 135 | void SetMaskLayer(Layer* mask_layer); |
| 136 | Layer* mask_layer() { return mask_layer_.get(); } |
| 137 | const Layer* mask_layer() const { return mask_layer_.get(); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 138 | |
danakj | 19f0c9e | 2014-10-11 03:24:42 | [diff] [blame] | 139 | virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); |
| 140 | void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 141 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 142 | void SetOpacity(float opacity); |
| 143 | float opacity() const { return opacity_; } |
jaydasika | 8665451 | 2016-01-27 17:05:07 | [diff] [blame^] | 144 | float EffectiveOpacity() const; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 145 | bool OpacityIsAnimating() const; |
loyso | d71ece8 | 2015-07-03 13:48:50 | [diff] [blame] | 146 | bool HasPotentiallyRunningOpacityAnimation() const; |
[email protected] | b7c4783f | 2013-03-15 23:11:42 | [diff] [blame] | 147 | virtual bool OpacityCanAnimateOnImplThread() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 148 | |
[email protected] | 7bbeaf4e | 2013-11-26 10:27:22 | [diff] [blame] | 149 | void SetBlendMode(SkXfermode::Mode blend_mode); |
| 150 | SkXfermode::Mode blend_mode() const { return blend_mode_; } |
| 151 | |
jaydasika | 92239dc | 2015-08-15 02:59:26 | [diff] [blame] | 152 | void set_draw_blend_mode(SkXfermode::Mode blend_mode) { |
| 153 | if (draw_blend_mode_ == blend_mode) |
| 154 | return; |
| 155 | draw_blend_mode_ = blend_mode; |
| 156 | SetNeedsPushProperties(); |
| 157 | } |
| 158 | SkXfermode::Mode draw_blend_mode() const { return draw_blend_mode_; } |
| 159 | |
[email protected] | 7bbeaf4e | 2013-11-26 10:27:22 | [diff] [blame] | 160 | bool uses_default_blend_mode() const { |
| 161 | return blend_mode_ == SkXfermode::kSrcOver_Mode; |
| 162 | } |
| 163 | |
| 164 | // A layer is root for an isolated group when it and all its descendants are |
| 165 | // drawn over a black and fully transparent background, creating an isolated |
| 166 | // group. It should be used along with SetBlendMode(), in order to restrict |
| 167 | // layers within the group to blend with layers outside this group. |
| 168 | void SetIsRootForIsolatedGroup(bool root); |
| 169 | bool is_root_for_isolated_group() const { |
| 170 | return is_root_for_isolated_group_; |
| 171 | } |
| 172 | |
[email protected] | ae6b1a7 | 2013-06-25 18:49:29 | [diff] [blame] | 173 | void SetFilters(const FilterOperations& filters); |
| 174 | const FilterOperations& filters() const { return filters_; } |
[email protected] | b4c6d81 | 2013-10-03 15:48:56 | [diff] [blame] | 175 | bool FilterIsAnimating() const; |
ajuma | 315a478 | 2015-07-24 21:16:34 | [diff] [blame] | 176 | bool HasPotentiallyRunningFilterAnimation() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 177 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 178 | // Background filters are filters applied to what is behind this layer, when |
| 179 | // they are viewed through non-opaque regions in this layer. They are used |
| 180 | // through the WebLayer interface, and are not exposed to HTML. |
[email protected] | ae6b1a7 | 2013-06-25 18:49:29 | [diff] [blame] | 181 | void SetBackgroundFilters(const FilterOperations& filters); |
| 182 | const FilterOperations& background_filters() const { |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 183 | return background_filters_; |
| 184 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 185 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 186 | virtual void SetContentsOpaque(bool opaque); |
| 187 | bool contents_opaque() const { return contents_opaque_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 188 | |
[email protected] | 14bc5d68 | 2014-01-17 07:26:47 | [diff] [blame] | 189 | void SetPosition(const gfx::PointF& position); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 190 | gfx::PointF position() const { return position_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 191 | |
ajuma | 4216ee12 | 2015-05-29 13:07:17 | [diff] [blame] | 192 | // A layer that is a container for fixed position layers cannot be both |
| 193 | // scrollable and have a non-identity transform. |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 194 | void SetIsContainerForFixedPositionLayers(bool container); |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 195 | bool IsContainerForFixedPositionLayers() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 196 | |
miletus | 624d342e | 2015-03-13 03:39:44 | [diff] [blame] | 197 | gfx::Vector2dF FixedContainerSizeDelta() const { |
| 198 | return gfx::Vector2dF(); |
| 199 | } |
| 200 | |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 201 | void SetPositionConstraint(const LayerPositionConstraint& constraint); |
| 202 | const LayerPositionConstraint& position_constraint() const { |
| 203 | return position_constraint_; |
| 204 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 205 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 206 | void SetTransform(const gfx::Transform& transform); |
| 207 | const gfx::Transform& transform() const { return transform_; } |
| 208 | bool TransformIsAnimating() const; |
loyso | d71ece8 | 2015-07-03 13:48:50 | [diff] [blame] | 209 | bool HasPotentiallyRunningTransformAnimation() const; |
ajuma | b4a846f2 | 2015-08-24 19:13:44 | [diff] [blame] | 210 | bool HasOnlyTranslationTransforms() const; |
awoloszyn | e83f28c | 2014-12-22 15:40:00 | [diff] [blame] | 211 | bool AnimationsPreserveAxisAlignment() const; |
[email protected] | 08bdf1b | 2014-04-16 23:23:29 | [diff] [blame] | 212 | bool transform_is_invertible() const { return transform_is_invertible_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 213 | |
ajuma | b4a846f2 | 2015-08-24 19:13:44 | [diff] [blame] | 214 | bool MaximumTargetScale(float* max_scale) const; |
| 215 | bool AnimationStartScale(float* start_scale) const; |
| 216 | |
[email protected] | a256641 | 2014-06-05 03:14:20 | [diff] [blame] | 217 | void SetTransformOrigin(const gfx::Point3F&); |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 218 | gfx::Point3F transform_origin() const { return transform_origin_; } |
[email protected] | a256641 | 2014-06-05 03:14:20 | [diff] [blame] | 219 | |
ajuma | caaa9b3 | 2015-08-04 15:55:29 | [diff] [blame] | 220 | bool HasAnyAnimationTargetingProperty( |
| 221 | Animation::TargetProperty property) const; |
| 222 | |
loyso | d71ece8 | 2015-07-03 13:48:50 | [diff] [blame] | 223 | bool ScrollOffsetAnimationWasInterrupted() const; |
| 224 | |
[email protected] | 0e98cdd | 2013-08-23 00:44:30 | [diff] [blame] | 225 | void SetScrollParent(Layer* parent); |
| 226 | |
| 227 | Layer* scroll_parent() { return scroll_parent_; } |
| 228 | const Layer* scroll_parent() const { return scroll_parent_; } |
| 229 | |
| 230 | void AddScrollChild(Layer* child); |
| 231 | void RemoveScrollChild(Layer* child); |
| 232 | |
| 233 | std::set<Layer*>* scroll_children() { return scroll_children_.get(); } |
| 234 | const std::set<Layer*>* scroll_children() const { |
| 235 | return scroll_children_.get(); |
| 236 | } |
| 237 | |
| 238 | void SetClipParent(Layer* ancestor); |
| 239 | |
| 240 | Layer* clip_parent() { return clip_parent_; } |
| 241 | const Layer* clip_parent() const { |
| 242 | return clip_parent_; |
| 243 | } |
| 244 | |
| 245 | void AddClipChild(Layer* child); |
| 246 | void RemoveClipChild(Layer* child); |
| 247 | |
| 248 | std::set<Layer*>* clip_children() { return clip_children_.get(); } |
| 249 | const std::set<Layer*>* clip_children() const { |
| 250 | return clip_children_.get(); |
| 251 | } |
| 252 | |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 253 | // TODO(enne): Fix style here (and everywhere) once LayerImpl does the same. |
| 254 | gfx::Transform draw_transform() const; |
| 255 | gfx::Transform screen_space_transform() const; |
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 256 | |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 257 | void set_num_unclipped_descendants(size_t descendants) { |
| 258 | num_unclipped_descendants_ = descendants; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 259 | } |
vmpstr | 762e70d | 2015-06-10 02:12:57 | [diff] [blame] | 260 | size_t num_unclipped_descendants() const { |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 261 | return num_unclipped_descendants_; |
[email protected] | 420fdf6e | 2013-08-26 20:36:38 | [diff] [blame] | 262 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 263 | |
miletus | f57925d | 2014-10-01 19:38:13 | [diff] [blame] | 264 | void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); |
miletus | ff93ab7 | 2015-01-30 04:30:44 | [diff] [blame] | 265 | void SetScrollCompensationAdjustment( |
| 266 | const gfx::Vector2dF& scroll_compensation_adjustment); |
| 267 | gfx::Vector2dF ScrollCompensationAdjustment() const; |
miletus | 2c78036b | 2015-01-29 20:52:37 | [diff] [blame] | 268 | |
miletus | f57925d | 2014-10-01 19:38:13 | [diff] [blame] | 269 | gfx::ScrollOffset scroll_offset() const { return scroll_offset_; } |
| 270 | void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 271 | |
[email protected] | adeda57 | 2014-01-31 00:49:47 | [diff] [blame] | 272 | void SetScrollClipLayerId(int clip_layer_id); |
| 273 | bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 274 | |
[email protected] | 59a7d55 | 2013-10-22 03:36:43 | [diff] [blame] | 275 | void SetUserScrollable(bool horizontal, bool vertical); |
| 276 | bool user_scrollable_horizontal() const { |
| 277 | return user_scrollable_horizontal_; |
| 278 | } |
| 279 | bool user_scrollable_vertical() const { return user_scrollable_vertical_; } |
| 280 | |
danakj | 3590476 | 2016-01-21 20:49:40 | [diff] [blame] | 281 | void AddMainThreadScrollingReasons(uint32_t main_thread_scrolling_reasons); |
tdresser | 81e84c67 | 2016-01-18 23:21:22 | [diff] [blame] | 282 | void ClearMainThreadScrollingReasons(); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 283 | bool should_scroll_on_main_thread() const { |
tdresser | 81e84c67 | 2016-01-18 23:21:22 | [diff] [blame] | 284 | return !!main_thread_scrolling_reasons_; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 285 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 286 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 287 | void SetHaveWheelEventHandlers(bool have_wheel_event_handlers); |
| 288 | bool have_wheel_event_handlers() const { return have_wheel_event_handlers_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 289 | |
[email protected] | f998c53 | 2014-03-31 20:02:51 | [diff] [blame] | 290 | void SetHaveScrollEventHandlers(bool have_scroll_event_handlers); |
| 291 | bool have_scroll_event_handlers() const { |
| 292 | return have_scroll_event_handlers_; |
| 293 | } |
| 294 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 295 | void SetNonFastScrollableRegion(const Region& non_fast_scrollable_region); |
| 296 | const Region& non_fast_scrollable_region() const { |
| 297 | return non_fast_scrollable_region_; |
| 298 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 299 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 300 | void SetTouchEventHandlerRegion(const Region& touch_event_handler_region); |
| 301 | const Region& touch_event_handler_region() const { |
| 302 | return touch_event_handler_region_; |
| 303 | } |
[email protected] | 23d56be | 2012-11-08 00:33:34 | [diff] [blame] | 304 | |
rbyers | 18779d82 | 2015-02-05 06:22:06 | [diff] [blame] | 305 | void SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on); |
| 306 | ScrollBlocksOn scroll_blocks_on() const { return scroll_blocks_on_; } |
| 307 | |
[email protected] | 28096ed | 2013-07-01 07:38:58 | [diff] [blame] | 308 | void set_did_scroll_callback(const base::Closure& callback) { |
| 309 | did_scroll_callback_ = callback; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 310 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 311 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 312 | void SetForceRenderSurface(bool force_render_surface); |
| 313 | bool force_render_surface() const { return force_render_surface_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 314 | |
miletus | f57925d | 2014-10-01 19:38:13 | [diff] [blame] | 315 | gfx::Vector2dF ScrollDelta() const { return gfx::Vector2dF(); } |
aelias | d0070ba | 2015-01-31 13:44:49 | [diff] [blame] | 316 | gfx::ScrollOffset CurrentScrollOffset() const { return scroll_offset_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 317 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 318 | void SetDoubleSided(bool double_sided); |
| 319 | bool double_sided() const { return double_sided_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 320 | |
[email protected] | 56fffdd | 2014-02-11 19:50:57 | [diff] [blame] | 321 | void SetShouldFlattenTransform(bool flatten); |
| 322 | bool should_flatten_transform() const { return should_flatten_transform_; } |
| 323 | |
[email protected] | a9d4d4f | 2014-06-19 06:49:28 | [diff] [blame] | 324 | bool Is3dSorted() const { return sorting_context_id_ != 0; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 325 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 326 | void set_use_parent_backface_visibility(bool use) { |
| 327 | use_parent_backface_visibility_ = use; |
| 328 | } |
| 329 | bool use_parent_backface_visibility() const { |
| 330 | return use_parent_backface_visibility_; |
| 331 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 332 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 333 | virtual void SetLayerTreeHost(LayerTreeHost* host); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 334 | |
[email protected] | ad63b2f | 2014-08-11 17:39:54 | [diff] [blame] | 335 | virtual bool HasDelegatedContent() const; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 336 | bool HasContributingDelegatedRenderPasses() const { return false; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 337 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 338 | void SetIsDrawable(bool is_drawable); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 339 | |
[email protected] | c0ae06c1 | 2013-06-24 18:32:19 | [diff] [blame] | 340 | void SetHideLayerAndSubtree(bool hide); |
| 341 | bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } |
| 342 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 343 | void SetReplicaLayer(Layer* layer); |
| 344 | Layer* replica_layer() { return replica_layer_.get(); } |
| 345 | const Layer* replica_layer() const { return replica_layer_.get(); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 346 | |
[email protected] | 22898ed | 2013-06-01 04:52:30 | [diff] [blame] | 347 | bool has_mask() const { return !!mask_layer_.get(); } |
| 348 | bool has_replica() const { return !!replica_layer_.get(); } |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 349 | bool replica_has_mask() const { |
[email protected] | 22898ed | 2013-06-01 04:52:30 | [diff] [blame] | 350 | return replica_layer_.get() && |
| 351 | (mask_layer_.get() || replica_layer_->mask_layer_.get()); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 352 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 353 | |
[email protected] | ad63b2f | 2014-08-11 17:39:54 | [diff] [blame] | 354 | int NumDescendantsThatDrawContent() const; |
| 355 | |
| 356 | // This is only virtual for tests. |
| 357 | // TODO(awoloszyn): Remove this once we no longer need it for tests |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 358 | virtual bool DrawsContent() const; |
[email protected] | ad63b2f | 2014-08-11 17:39:54 | [diff] [blame] | 359 | |
| 360 | // This methods typically need to be overwritten by derived classes. |
chrishtr | bb9af00 | 2015-12-09 02:00:11 | [diff] [blame] | 361 | // TODO(chrishtr): Blink no longer resizes anything during paint. We can |
| 362 | // remove this. |
[email protected] | 445881f | 2013-04-16 01:11:59 | [diff] [blame] | 363 | virtual void SavePaintProperties(); |
danakj | 5f46636a | 2015-06-19 00:01:40 | [diff] [blame] | 364 | // Returns true iff anything was updated that needs to be committed. |
| 365 | virtual bool Update(); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 366 | virtual void SetIsMask(bool is_mask) {} |
[email protected] | a6c1b23 | 2014-05-05 23:53:08 | [diff] [blame] | 367 | virtual bool IsSuitableForGpuRasterization() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 368 | |
ssid | 911e40e | 2015-02-09 17:55:20 | [diff] [blame] | 369 | virtual scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
| 370 | TakeDebugInfo(); |
[email protected] | ae716ce | 2013-08-16 13:04:24 | [diff] [blame] | 371 | |
| 372 | void SetLayerClient(LayerClient* client) { client_ = client; } |
| 373 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 374 | virtual void PushPropertiesTo(LayerImpl* layer); |
| 375 | |
nyquist | 353b7d5 | 2015-11-06 22:26:53 | [diff] [blame] | 376 | // Sets the type proto::LayerType that should be used for serialization |
| 377 | // of the current layer by calling LayerNode::set_type(proto::LayerType). |
| 378 | // TODO(nyquist): Start using a forward declared enum class when |
| 379 | // https://github.com/google/protobuf/issues/67 has been fixed and rolled in. |
| 380 | // This function would preferably instead return a proto::LayerType, but |
| 381 | // since that is an enum (the protobuf library does not generate enum |
| 382 | // classes), it can't be forward declared. We don't want to include |
| 383 | // //cc/proto/layer.pb.h in this header file, as it requires that all |
| 384 | // dependent targets would have to be given the config for how to include it. |
| 385 | virtual void SetTypeForProtoSerialization(proto::LayerNode* proto) const; |
| 386 | |
| 387 | // Recursively iterate over this layer and all children and write the |
| 388 | // hierarchical structure to the given LayerNode proto. In addition to the |
| 389 | // structure itself, the Layer id and type is also written to facilitate |
| 390 | // construction of the correct layer on the client. |
| 391 | void ToLayerNodeProto(proto::LayerNode* proto) const; |
| 392 | |
| 393 | // Recursively iterate over the given LayerNode proto and read the structure |
| 394 | // into this node and its children. The |layer_map| should be used to look |
| 395 | // for previously existing Layers, since they should be re-used between each |
| 396 | // hierarchy update. |
| 397 | void FromLayerNodeProto(const proto::LayerNode& proto, |
| 398 | const LayerIdMap& layer_map); |
| 399 | |
nyquist | bc1290a | 2015-11-18 16:09:56 | [diff] [blame] | 400 | // This method is similar to PushPropertiesTo, but instead of pushing to |
| 401 | // a LayerImpl, it pushes the properties to proto::LayerProperties. It adds |
| 402 | // this layer to the proto::LayerUpdate if it or any of its descendants |
| 403 | // have changed properties. If this layer contains changed properties, the |
| 404 | // properties themselves will also be pushed the proto::LayerProperties. |
| 405 | // Similarly to PushPropertiesTo, this method also resets |
| 406 | // |needs_push_properties_| and |num_dependents_need_push_properties_|. |
| 407 | // Returns whether any of the descendants have changed properties. |
| 408 | bool ToLayerPropertiesProto(proto::LayerUpdate* layer_update); |
| 409 | |
| 410 | // Read all property values from the given LayerProperties object and update |
| 411 | // the current layer. The values for |needs_push_properties_| and |
| 412 | // |num_dependents_need_push_properties_| are always updated, but the rest |
| 413 | // of |proto| is only read if |needs_push_properties_| is set. |
| 414 | void FromLayerPropertiesProto(const proto::LayerProperties& proto); |
| 415 | |
[email protected] | 3698e79 | 2013-08-24 00:21:16 | [diff] [blame] | 416 | LayerTreeHost* layer_tree_host() { return layer_tree_host_; } |
| 417 | const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 418 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 419 | bool AddAnimation(scoped_ptr<Animation> animation); |
| 420 | void PauseAnimation(int animation_id, double time_offset); |
| 421 | void RemoveAnimation(int animation_id); |
noel | ae22bfd | 2015-12-23 11:37:55 | [diff] [blame] | 422 | void AbortAnimation(int animation_id); |
loyso | d71ece8 | 2015-07-03 13:48:50 | [diff] [blame] | 423 | LayerAnimationController* layer_animation_controller() const { |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 424 | return layer_animation_controller_.get(); |
| 425 | } |
[email protected] | 7f5605c | 2013-04-08 18:08:35 | [diff] [blame] | 426 | void SetLayerAnimationControllerForTest( |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 427 | scoped_refptr<LayerAnimationController> controller); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 428 | |
[email protected] | 3cae03e | 2013-06-26 22:13:52 | [diff] [blame] | 429 | void set_layer_animation_delegate(AnimationDelegate* delegate) { |
loyso | 5719778 | 2015-05-28 04:10:18 | [diff] [blame] | 430 | DCHECK(layer_animation_controller_); |
[email protected] | 7f5605c | 2013-04-08 18:08:35 | [diff] [blame] | 431 | layer_animation_controller_->set_layer_animation_delegate(delegate); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 432 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 433 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 434 | bool HasActiveAnimation() const; |
loyso | 5719778 | 2015-05-28 04:10:18 | [diff] [blame] | 435 | void RegisterForAnimations(AnimationRegistrar* registrar); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 436 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 437 | void AddLayerAnimationEventObserver( |
| 438 | LayerAnimationEventObserver* animation_observer); |
| 439 | void RemoveLayerAnimationEventObserver( |
| 440 | LayerAnimationEventObserver* animation_observer); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 441 | |
[email protected] | 80413d7 | 2013-08-30 20:25:33 | [diff] [blame] | 442 | virtual ScrollbarLayerInterface* ToScrollbarLayer(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 443 | |
[email protected] | f7837a9 | 2013-08-21 03:00:05 | [diff] [blame] | 444 | virtual skia::RefPtr<SkPicture> GetPicture() const; |
| 445 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 446 | // Constructs a LayerImpl of the correct runtime type for this Layer type. |
| 447 | virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
[email protected] | aedf4e5 | 2013-01-09 23:24:44 | [diff] [blame] | 448 | |
[email protected] | 4460464 | 2013-08-01 01:14:09 | [diff] [blame] | 449 | bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); } |
danakj | 19f0c9e | 2014-10-11 03:24:42 | [diff] [blame] | 450 | void ResetNeedsDisplayForTesting() { update_rect_ = gfx::Rect(); } |
[email protected] | 48871fc | 2013-01-23 07:36:51 | [diff] [blame] | 451 | |
[email protected] | d8411661 | 2013-03-29 05:32:49 | [diff] [blame] | 452 | RenderingStatsInstrumentation* rendering_stats_instrumentation() const; |
| 453 | |
[email protected] | 445881f | 2013-04-16 01:11:59 | [diff] [blame] | 454 | const PaintProperties& paint_properties() const { |
| 455 | return paint_properties_; |
| 456 | } |
| 457 | |
[email protected] | 7a5a932 | 2014-02-25 12:54:57 | [diff] [blame] | 458 | void SetNeedsPushProperties(); |
[email protected] | f4e25f9 | 2013-07-13 20:54:53 | [diff] [blame] | 459 | bool needs_push_properties() const { return needs_push_properties_; } |
| 460 | bool descendant_needs_push_properties() const { |
| 461 | return num_dependents_need_push_properties_ > 0; |
| 462 | } |
[email protected] | 7a5a932 | 2014-02-25 12:54:57 | [diff] [blame] | 463 | void reset_needs_push_properties_for_testing() { |
| 464 | needs_push_properties_ = false; |
| 465 | } |
[email protected] | f4e25f9 | 2013-07-13 20:54:53 | [diff] [blame] | 466 | |
[email protected] | 666d7cf | 2013-10-12 01:30:29 | [diff] [blame] | 467 | virtual void RunMicroBenchmark(MicroBenchmark* benchmark); |
| 468 | |
[email protected] | a9d4d4f | 2014-06-19 06:49:28 | [diff] [blame] | 469 | void Set3dSortingContextId(int id); |
| 470 | int sorting_context_id() const { return sorting_context_id_; } |
| 471 | |
vollick | 692444f | 2015-05-20 15:39:14 | [diff] [blame] | 472 | void set_property_tree_sequence_number(int sequence_number) { |
| 473 | property_tree_sequence_number_ = sequence_number; |
enne | e95b154 | 2015-04-20 20:35:50 | [diff] [blame] | 474 | } |
nyquist | b36e0d5d | 2016-01-27 00:17:35 | [diff] [blame] | 475 | int property_tree_sequence_number() { return property_tree_sequence_number_; } |
vollick | 692444f | 2015-05-20 15:39:14 | [diff] [blame] | 476 | |
| 477 | void SetTransformTreeIndex(int index); |
| 478 | int transform_tree_index() const; |
| 479 | |
| 480 | void SetClipTreeIndex(int index); |
| 481 | int clip_tree_index() const; |
| 482 | |
weiliangc | 6a52f30 | 2015-08-18 16:29:35 | [diff] [blame] | 483 | void SetEffectTreeIndex(int index); |
| 484 | int effect_tree_index() const; |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 485 | |
| 486 | void set_offset_to_transform_parent(gfx::Vector2dF offset) { |
enne | e95b154 | 2015-04-20 20:35:50 | [diff] [blame] | 487 | if (offset_to_transform_parent_ == offset) |
| 488 | return; |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 489 | offset_to_transform_parent_ = offset; |
enne | e95b154 | 2015-04-20 20:35:50 | [diff] [blame] | 490 | SetNeedsPushProperties(); |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 491 | } |
| 492 | gfx::Vector2dF offset_to_transform_parent() const { |
| 493 | return offset_to_transform_parent_; |
| 494 | } |
| 495 | |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 496 | // TODO(enne): Once LayerImpl only uses property trees, remove these |
| 497 | // functions. |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 498 | const gfx::Rect& visible_rect_from_property_trees() const { |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 499 | return visible_layer_rect(); |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 500 | } |
| 501 | void set_visible_rect_from_property_trees(const gfx::Rect& rect) { |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 502 | set_visible_layer_rect(rect); |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 503 | } |
jaydasika | 5c41bb9 | 2015-08-10 21:47:55 | [diff] [blame] | 504 | const gfx::Rect& clip_rect_in_target_space_from_property_trees() const { |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 505 | return clip_rect(); |
jaydasika | 5c41bb9 | 2015-08-10 21:47:55 | [diff] [blame] | 506 | } |
| 507 | void set_clip_rect_in_target_space_from_property_trees( |
| 508 | const gfx::Rect& rect) { |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 509 | set_clip_rect(rect); |
jaydasika | 5c41bb9 | 2015-08-10 21:47:55 | [diff] [blame] | 510 | } |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 511 | // TODO(enne): This needs a different name. It is a calculated value |
| 512 | // from the property tree builder and not a synonym for "should |
| 513 | // flatten transform". |
ajuma | d0d6442 | 2015-03-14 04:20:08 | [diff] [blame] | 514 | void set_should_flatten_transform_from_property_tree(bool should_flatten) { |
enne | e95b154 | 2015-04-20 20:35:50 | [diff] [blame] | 515 | if (should_flatten_transform_from_property_tree_ == should_flatten) |
| 516 | return; |
ajuma | d0d6442 | 2015-03-14 04:20:08 | [diff] [blame] | 517 | should_flatten_transform_from_property_tree_ = should_flatten; |
enne | e95b154 | 2015-04-20 20:35:50 | [diff] [blame] | 518 | SetNeedsPushProperties(); |
| 519 | } |
| 520 | bool should_flatten_transform_from_property_tree() const { |
| 521 | return should_flatten_transform_from_property_tree_; |
ajuma | d0d6442 | 2015-03-14 04:20:08 | [diff] [blame] | 522 | } |
| 523 | |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 524 | const gfx::Rect& visible_layer_rect() const { return visible_layer_rect_; } |
| 525 | void set_visible_layer_rect(const gfx::Rect& rect) { |
| 526 | visible_layer_rect_ = rect; |
| 527 | } |
| 528 | |
| 529 | const gfx::Rect& clip_rect() const { return clip_rect_; } |
| 530 | void set_clip_rect(const gfx::Rect& rect) { clip_rect_ = rect; } |
| 531 | |
weiliangc | c154ce2 | 2015-12-09 03:39:26 | [diff] [blame] | 532 | // This should only be called during BeginMainFrame since it does not trigger |
| 533 | // a Commit. This is called right after property tree being built and should |
| 534 | // not trigger property tree rebuild. |
| 535 | void SetHasRenderSurface(bool has_render_surface); |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 536 | bool has_render_surface() const { |
| 537 | return has_render_surface_; |
| 538 | } |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 539 | |
vmpstr | 3d1d72c | 2015-01-26 18:27:40 | [diff] [blame] | 540 | // Sets new frame timing requests for this layer. |
| 541 | void SetFrameTimingRequests(const std::vector<FrameTimingRequest>& requests); |
| 542 | |
mpb | 39c5a2ef | 2015-04-22 23:46:15 | [diff] [blame] | 543 | // Accessor for unit tests |
| 544 | const std::vector<FrameTimingRequest>& FrameTimingRequests() const { |
| 545 | return frame_timing_requests_; |
| 546 | } |
| 547 | |
caseq | 4a4b558 | 2015-03-17 18:39:35 | [diff] [blame] | 548 | void DidBeginTracing(); |
sunxd | ed58688e | 2016-01-11 21:01:02 | [diff] [blame] | 549 | |
| 550 | int num_copy_requests_in_target_subtree(); |
jaydasika | 3d10aa6 | 2015-05-06 17:50:44 | [diff] [blame] | 551 | |
vollick | 933f496e | 2015-12-08 04:22:05 | [diff] [blame] | 552 | void SetElementId(uint64_t id); |
| 553 | uint64_t element_id() const { return element_id_; } |
| 554 | |
| 555 | void SetMutableProperties(uint32_t properties); |
| 556 | uint32_t mutable_properties() const { return mutable_properties_; } |
| 557 | |
jaydasika | 976cd10b | 2015-05-26 15:45:24 | [diff] [blame] | 558 | void set_visited(bool visited); |
| 559 | bool visited(); |
| 560 | void set_layer_or_descendant_is_drawn(bool layer_or_descendant_is_drawn); |
| 561 | bool layer_or_descendant_is_drawn(); |
| 562 | void set_sorted_for_recursion(bool sorted_for_recursion); |
| 563 | bool sorted_for_recursion(); |
jaydasika | 976cd10b | 2015-05-26 15:45:24 | [diff] [blame] | 564 | |
skyostil | e5cd474 | 2015-10-13 12:09:53 | [diff] [blame] | 565 | // LayerAnimationValueProvider implementation. |
| 566 | gfx::ScrollOffset ScrollOffsetForAnimation() const override; |
| 567 | |
| 568 | // LayerAnimationValueObserver implementation. |
| 569 | void OnFilterAnimated(const FilterOperations& filters) override; |
| 570 | void OnOpacityAnimated(float opacity) override; |
| 571 | void OnTransformAnimated(const gfx::Transform& transform) override; |
| 572 | void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override; |
| 573 | void OnAnimationWaitingForDeletion() override; |
| 574 | void OnTransformIsPotentiallyAnimatingChanged(bool is_animating) override; |
| 575 | bool IsActive() const override; |
| 576 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 577 | protected: |
| 578 | friend class LayerImpl; |
| 579 | friend class TreeSynchronizer; |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 580 | ~Layer() override; |
[email protected] | 090e1a7 | 2013-01-29 07:07:45 | [diff] [blame] | 581 | |
loyso | a6edaaff | 2015-05-25 03:26:44 | [diff] [blame] | 582 | explicit Layer(const LayerSettings& settings); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 583 | |
[email protected] | 3519b87 | 2013-07-30 07:17:50 | [diff] [blame] | 584 | // These SetNeeds functions are in order of severity of update: |
| 585 | // |
| 586 | // Called when this layer has been modified in some way, but isn't sure |
| 587 | // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers |
| 588 | // before it knows whether or not a commit is required. |
| 589 | void SetNeedsUpdate(); |
| 590 | // Called when a property has been modified in a way that the layer |
| 591 | // knows immediately that a commit is required. This implies SetNeedsUpdate |
| 592 | // as well as SetNeedsPushProperties to push that property. |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 593 | void SetNeedsCommit(); |
vollick | 5057e1e | 2015-04-17 19:12:32 | [diff] [blame] | 594 | // This is identical to SetNeedsCommit, but the former requests a rebuild of |
| 595 | // the property trees. |
| 596 | void SetNeedsCommitNoRebuild(); |
[email protected] | 3519b87 | 2013-07-30 07:17:50 | [diff] [blame] | 597 | // Called when there's been a change in layer structure. Implies both |
| 598 | // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 599 | void SetNeedsFullTreeSync(); |
[email protected] | 74b43cc | 2013-08-30 06:29:27 | [diff] [blame] | 600 | |
| 601 | // Called when the next commit should wait until the pending tree is activated |
| 602 | // before finishing the commit and unblocking the main thread. Used to ensure |
| 603 | // unused resources on the impl thread are returned before commit completes. |
| 604 | void SetNextCommitWaitsForActivation(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 605 | |
[email protected] | ad63b2f | 2014-08-11 17:39:54 | [diff] [blame] | 606 | // Will recalculate whether the layer draws content and set draws_content_ |
| 607 | // appropriately. |
| 608 | void UpdateDrawsContent(bool has_drawable_content); |
| 609 | virtual bool HasDrawableContent() const; |
| 610 | |
| 611 | // Called when the layer's number of drawable descendants changes. |
| 612 | void AddDrawableDescendants(int num); |
| 613 | |
[email protected] | f4e25f9 | 2013-07-13 20:54:53 | [diff] [blame] | 614 | void AddDependentNeedsPushProperties(); |
| 615 | void RemoveDependentNeedsPushProperties(); |
| 616 | bool parent_should_know_need_push_properties() const { |
| 617 | return needs_push_properties() || descendant_needs_push_properties(); |
| 618 | } |
| 619 | |
[email protected] | 74b43cc | 2013-08-30 06:29:27 | [diff] [blame] | 620 | bool IsPropertyChangeAllowed() const; |
| 621 | |
nyquist | bc1290a | 2015-11-18 16:09:56 | [diff] [blame] | 622 | // Serialize all the necessary properties to be able to reconstruct this Layer |
| 623 | // into proto::LayerProperties. This function must not set values for |
| 624 | // |needs_push_properties_| or |num_dependents_need_push_properties_| as they |
| 625 | // are dealt with at a higher level. This is only called if |
| 626 | // |needs_push_properties_| is set. For descendants of Layer, implementations |
nyquist | b0a49d0 | 2015-12-17 03:42:58 | [diff] [blame] | 627 | // must first call their parent class. This method is not marked as const |
| 628 | // as some implementations need reset member fields, similarly to |
| 629 | // PushPropertiesTo(). |
nyquist | bc1290a | 2015-11-18 16:09:56 | [diff] [blame] | 630 | virtual void LayerSpecificPropertiesToProto(proto::LayerProperties* proto); |
| 631 | |
| 632 | // Deserialize all the necessary properties from proto::LayerProperties into |
| 633 | // this Layer. This function must not set values for |needs_push_properties_| |
| 634 | // or |num_dependents_need_push_properties_| as they are dealt with at a |
| 635 | // higher level. This is only called if |needs_push_properties_| is set. For |
| 636 | // descendants of Layer, implementations must first call their parent class. |
| 637 | virtual void FromLayerSpecificPropertiesProto( |
| 638 | const proto::LayerProperties& proto); |
| 639 | |
[email protected] | f4e25f9 | 2013-07-13 20:54:53 | [diff] [blame] | 640 | // This flag is set when the layer needs to push properties to the impl |
| 641 | // side. |
| 642 | bool needs_push_properties_; |
| 643 | |
| 644 | // The number of direct children or dependent layers that need to be recursed |
| 645 | // to in order for them or a descendent of them to push properties to the impl |
| 646 | // side. |
| 647 | int num_dependents_need_push_properties_; |
| 648 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 649 | // Tracks whether this layer may have changed stacking order with its |
| 650 | // siblings. |
| 651 | bool stacking_order_changed_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 652 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 653 | // The update rect is the region of the compositor resource that was |
| 654 | // actually updated by the compositor. For layers that may do updating |
| 655 | // outside the compositor's control (i.e. plugin layers), this information |
| 656 | // is not available and the update rect will remain empty. |
| 657 | // Note this rect is in layer space (not content space). |
danakj | 19f0c9e | 2014-10-11 03:24:42 | [diff] [blame] | 658 | gfx::Rect update_rect_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 659 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 660 | scoped_refptr<Layer> mask_layer_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 661 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 662 | int layer_id_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 663 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 664 | // When true, the layer is about to perform an update. Any commit requests |
[email protected] | 3519b87 | 2013-07-30 07:17:50 | [diff] [blame] | 665 | // will be handled implicitly after the update completes. |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 666 | bool ignore_set_needs_commit_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 667 | |
[email protected] | a9d4d4f | 2014-06-19 06:49:28 | [diff] [blame] | 668 | // Layers that share a sorting context id will be sorted together in 3d |
| 669 | // space. 0 is a special value that means this layer will not be sorted and |
| 670 | // will be drawn in paint order. |
| 671 | int sorting_context_id_; |
| 672 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 673 | private: |
| 674 | friend class base::RefCounted<Layer>; |
nyquist | b0a49d0 | 2015-12-17 03:42:58 | [diff] [blame] | 675 | friend class LayerSerializationTest; |
awoloszyn | e83f28c | 2014-12-22 15:40:00 | [diff] [blame] | 676 | friend class LayerTreeHostCommon; |
nyquist | b0a49d0 | 2015-12-17 03:42:58 | [diff] [blame] | 677 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 678 | void SetParent(Layer* layer); |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 679 | bool DescendantIsFixedToContainerLayer() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 680 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 681 | // This should only be called from RemoveFromParent(). |
| 682 | void RemoveChildOrDependent(Layer* child); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 683 | |
vollick | 66133e8 | 2014-09-13 20:36:44 | [diff] [blame] | 684 | // If this layer has a scroll parent, it removes |this| from its list of |
| 685 | // scroll children. |
| 686 | void RemoveFromScrollTree(); |
| 687 | |
| 688 | // If this layer has a clip parent, it removes |this| from its list of clip |
| 689 | // children. |
| 690 | void RemoveFromClipTree(); |
| 691 | |
weiliangc | c4d2e74d | 2015-06-09 01:21:35 | [diff] [blame] | 692 | // When we detach or attach layer to new LayerTreeHost, all property trees' |
| 693 | // indices becomes invalid. |
| 694 | void InvalidatePropertyTreesIndices(); |
| 695 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 696 | LayerList children_; |
| 697 | Layer* parent_; |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 698 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 699 | // Layer instances have a weak pointer to their LayerTreeHost. |
| 700 | // This pointer value is nil when a Layer is not in a tree and is |
| 701 | // updated via SetLayerTreeHost() if a layer moves between trees. |
| 702 | LayerTreeHost* layer_tree_host_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 703 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 704 | scoped_refptr<LayerAnimationController> layer_animation_controller_; |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 705 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 706 | // Layer properties. |
| 707 | gfx::Size bounds_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 708 | |
miletus | f57925d | 2014-10-01 19:38:13 | [diff] [blame] | 709 | gfx::ScrollOffset scroll_offset_; |
miletus | ff93ab7 | 2015-01-30 04:30:44 | [diff] [blame] | 710 | gfx::Vector2dF scroll_compensation_adjustment_; |
[email protected] | adeda57 | 2014-01-31 00:49:47 | [diff] [blame] | 711 | // This variable indicates which ancestor layer (if any) whose size, |
| 712 | // transformed relative to this layer, defines the maximum scroll offset for |
| 713 | // this layer. |
| 714 | int scroll_clip_layer_id_; |
[email protected] | ad63b2f | 2014-08-11 17:39:54 | [diff] [blame] | 715 | int num_descendants_that_draw_content_; |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 716 | int transform_tree_index_; |
weiliangc | 6a52f30 | 2015-08-18 16:29:35 | [diff] [blame] | 717 | int effect_tree_index_; |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 718 | int clip_tree_index_; |
vollick | 692444f | 2015-05-20 15:39:14 | [diff] [blame] | 719 | int property_tree_sequence_number_; |
vollick | 933f496e | 2015-12-08 04:22:05 | [diff] [blame] | 720 | uint64_t element_id_; |
| 721 | uint32_t mutable_properties_; |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 722 | gfx::Vector2dF offset_to_transform_parent_; |
danakj | 3590476 | 2016-01-21 20:49:40 | [diff] [blame] | 723 | uint32_t main_thread_scrolling_reasons_; |
ajuma | d0d6442 | 2015-03-14 04:20:08 | [diff] [blame] | 724 | bool should_flatten_transform_from_property_tree_ : 1; |
[email protected] | c55f3fc | 2013-12-10 05:48:48 | [diff] [blame] | 725 | bool have_wheel_event_handlers_ : 1; |
[email protected] | f998c53 | 2014-03-31 20:02:51 | [diff] [blame] | 726 | bool have_scroll_event_handlers_ : 1; |
[email protected] | c55f3fc | 2013-12-10 05:48:48 | [diff] [blame] | 727 | bool user_scrollable_horizontal_ : 1; |
| 728 | bool user_scrollable_vertical_ : 1; |
| 729 | bool is_root_for_isolated_group_ : 1; |
| 730 | bool is_container_for_fixed_position_layers_ : 1; |
| 731 | bool is_drawable_ : 1; |
[email protected] | ad63b2f | 2014-08-11 17:39:54 | [diff] [blame] | 732 | bool draws_content_ : 1; |
[email protected] | c55f3fc | 2013-12-10 05:48:48 | [diff] [blame] | 733 | bool hide_layer_and_subtree_ : 1; |
| 734 | bool masks_to_bounds_ : 1; |
| 735 | bool contents_opaque_ : 1; |
| 736 | bool double_sided_ : 1; |
[email protected] | 56fffdd | 2014-02-11 19:50:57 | [diff] [blame] | 737 | bool should_flatten_transform_ : 1; |
[email protected] | c55f3fc | 2013-12-10 05:48:48 | [diff] [blame] | 738 | bool use_parent_backface_visibility_ : 1; |
[email protected] | c55f3fc | 2013-12-10 05:48:48 | [diff] [blame] | 739 | bool force_render_surface_ : 1; |
[email protected] | 08bdf1b | 2014-04-16 23:23:29 | [diff] [blame] | 740 | bool transform_is_invertible_ : 1; |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame] | 741 | bool has_render_surface_ : 1; |
rbyers | 18779d82 | 2015-02-05 06:22:06 | [diff] [blame] | 742 | ScrollBlocksOn scroll_blocks_on_ : 3; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 743 | Region non_fast_scrollable_region_; |
| 744 | Region touch_event_handler_region_; |
| 745 | gfx::PointF position_; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 746 | SkColor background_color_; |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 747 | float opacity_; |
[email protected] | 7bbeaf4e | 2013-11-26 10:27:22 | [diff] [blame] | 748 | SkXfermode::Mode blend_mode_; |
jaydasika | 92239dc | 2015-08-15 02:59:26 | [diff] [blame] | 749 | // draw_blend_mode may be different than blend_mode_, |
| 750 | // when a RenderSurface re-parents the layer's blend_mode. |
| 751 | SkXfermode::Mode draw_blend_mode_; |
[email protected] | ae6b1a7 | 2013-06-25 18:49:29 | [diff] [blame] | 752 | FilterOperations filters_; |
| 753 | FilterOperations background_filters_; |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 754 | LayerPositionConstraint position_constraint_; |
[email protected] | 0e98cdd | 2013-08-23 00:44:30 | [diff] [blame] | 755 | Layer* scroll_parent_; |
danakj | 6496cba | 2014-10-16 01:31:08 | [diff] [blame] | 756 | scoped_ptr<std::set<Layer*>> scroll_children_; |
[email protected] | 0e98cdd | 2013-08-23 00:44:30 | [diff] [blame] | 757 | |
jaydasika | 976cd10b | 2015-05-26 15:45:24 | [diff] [blame] | 758 | // The following three variables are tracker variables. They are bools |
| 759 | // wrapped inside an integer variable. If true, their value equals the |
| 760 | // LayerTreeHost's meta_information_sequence_number. This wrapping of bools |
| 761 | // inside ints is done to avoid a layer tree treewalk to reset their values. |
| 762 | int layer_or_descendant_is_drawn_tracker_; |
| 763 | int sorted_for_recursion_tracker_; |
| 764 | int visited_tracker_; |
| 765 | |
[email protected] | 0e98cdd | 2013-08-23 00:44:30 | [diff] [blame] | 766 | Layer* clip_parent_; |
danakj | 6496cba | 2014-10-16 01:31:08 | [diff] [blame] | 767 | scoped_ptr<std::set<Layer*>> clip_children_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 768 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 769 | gfx::Transform transform_; |
[email protected] | a256641 | 2014-06-05 03:14:20 | [diff] [blame] | 770 | gfx::Point3F transform_origin_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 771 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 772 | // Replica layer used for reflections. |
| 773 | scoped_refptr<Layer> replica_layer_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 774 | |
[email protected] | ae716ce | 2013-08-16 13:04:24 | [diff] [blame] | 775 | LayerClient* client_; |
| 776 | |
vmpstr | a370ef5 | 2015-11-18 10:41:28 | [diff] [blame] | 777 | std::vector<scoped_ptr<CopyOutputRequest>> copy_requests_; |
[email protected] | 18a7019 | 2013-04-26 16:18:25 | [diff] [blame] | 778 | |
[email protected] | 28096ed | 2013-07-01 07:38:58 | [diff] [blame] | 779 | base::Closure did_scroll_callback_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 780 | |
[email protected] | 445881f | 2013-04-16 01:11:59 | [diff] [blame] | 781 | PaintProperties paint_properties_; |
| 782 | |
enne | c95e662 | 2015-08-28 23:23:19 | [diff] [blame] | 783 | // These all act like draw properties, so don't need push properties. |
| 784 | gfx::Rect visible_layer_rect_; |
| 785 | gfx::Rect clip_rect_; |
| 786 | size_t num_unclipped_descendants_; |
vmpstr | 3d1d72c | 2015-01-26 18:27:40 | [diff] [blame] | 787 | |
| 788 | std::vector<FrameTimingRequest> frame_timing_requests_; |
| 789 | bool frame_timing_requests_dirty_; |
vmpstr | 3d1d72c | 2015-01-26 18:27:40 | [diff] [blame] | 790 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 791 | DISALLOW_COPY_AND_ASSIGN(Layer); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 792 | }; |
| 793 | |
[email protected] | ddf9df8 | 2012-10-16 06:52:46 | [diff] [blame] | 794 | } // namespace cc |
| 795 | |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 796 | #endif // CC_LAYERS_LAYER_H_ |