OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_LAYERS_LAYER_H_ | 5 #ifndef CC_LAYERS_LAYER_H_ |
6 #define CC_LAYERS_LAYER_H_ | 6 #define CC_LAYERS_LAYER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void SetMaskLayer(Layer* mask_layer); | 128 void SetMaskLayer(Layer* mask_layer); |
129 Layer* mask_layer() { return mask_layer_.get(); } | 129 Layer* mask_layer() { return mask_layer_.get(); } |
130 const Layer* mask_layer() const { return mask_layer_.get(); } | 130 const Layer* mask_layer() const { return mask_layer_.get(); } |
131 | 131 |
132 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); | 132 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); |
133 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } | 133 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } |
134 | 134 |
135 void SetOpacity(float opacity); | 135 void SetOpacity(float opacity); |
136 float opacity() const { return opacity_; } | 136 float opacity() const { return opacity_; } |
137 bool OpacityIsAnimating() const; | 137 bool OpacityIsAnimating() const; |
| 138 bool HasPotentiallyRunningOpacityAnimation() const; |
138 virtual bool OpacityCanAnimateOnImplThread() const; | 139 virtual bool OpacityCanAnimateOnImplThread() const; |
139 | 140 |
140 void SetBlendMode(SkXfermode::Mode blend_mode); | 141 void SetBlendMode(SkXfermode::Mode blend_mode); |
141 SkXfermode::Mode blend_mode() const { return blend_mode_; } | 142 SkXfermode::Mode blend_mode() const { return blend_mode_; } |
142 | 143 |
143 bool uses_default_blend_mode() const { | 144 bool uses_default_blend_mode() const { |
144 return blend_mode_ == SkXfermode::kSrcOver_Mode; | 145 return blend_mode_ == SkXfermode::kSrcOver_Mode; |
145 } | 146 } |
146 | 147 |
147 // A layer is root for an isolated group when it and all its descendants are | 148 // A layer is root for an isolated group when it and all its descendants are |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 182 } |
182 | 183 |
183 void SetPositionConstraint(const LayerPositionConstraint& constraint); | 184 void SetPositionConstraint(const LayerPositionConstraint& constraint); |
184 const LayerPositionConstraint& position_constraint() const { | 185 const LayerPositionConstraint& position_constraint() const { |
185 return position_constraint_; | 186 return position_constraint_; |
186 } | 187 } |
187 | 188 |
188 void SetTransform(const gfx::Transform& transform); | 189 void SetTransform(const gfx::Transform& transform); |
189 const gfx::Transform& transform() const { return transform_; } | 190 const gfx::Transform& transform() const { return transform_; } |
190 bool TransformIsAnimating() const; | 191 bool TransformIsAnimating() const; |
| 192 bool HasPotentiallyRunningTransformAnimation() const; |
191 bool AnimationsPreserveAxisAlignment() const; | 193 bool AnimationsPreserveAxisAlignment() const; |
192 bool transform_is_invertible() const { return transform_is_invertible_; } | 194 bool transform_is_invertible() const { return transform_is_invertible_; } |
193 | 195 |
194 void SetTransformOrigin(const gfx::Point3F&); | 196 void SetTransformOrigin(const gfx::Point3F&); |
195 gfx::Point3F transform_origin() const { return transform_origin_; } | 197 gfx::Point3F transform_origin() const { return transform_origin_; } |
196 | 198 |
| 199 bool ScrollOffsetAnimationWasInterrupted() const; |
| 200 |
197 void SetScrollParent(Layer* parent); | 201 void SetScrollParent(Layer* parent); |
198 | 202 |
199 Layer* scroll_parent() { return scroll_parent_; } | 203 Layer* scroll_parent() { return scroll_parent_; } |
200 const Layer* scroll_parent() const { return scroll_parent_; } | 204 const Layer* scroll_parent() const { return scroll_parent_; } |
201 | 205 |
202 void AddScrollChild(Layer* child); | 206 void AddScrollChild(Layer* child); |
203 void RemoveScrollChild(Layer* child); | 207 void RemoveScrollChild(Layer* child); |
204 | 208 |
205 std::set<Layer*>* scroll_children() { return scroll_children_.get(); } | 209 std::set<Layer*>* scroll_children() { return scroll_children_.get(); } |
206 const std::set<Layer*>* scroll_children() const { | 210 const std::set<Layer*>* scroll_children() const { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 397 |
394 void ClearRenderSurfaceLayerList(); | 398 void ClearRenderSurfaceLayerList(); |
395 | 399 |
396 LayerTreeHost* layer_tree_host() { return layer_tree_host_; } | 400 LayerTreeHost* layer_tree_host() { return layer_tree_host_; } |
397 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } | 401 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } |
398 | 402 |
399 bool AddAnimation(scoped_ptr<Animation> animation); | 403 bool AddAnimation(scoped_ptr<Animation> animation); |
400 void PauseAnimation(int animation_id, double time_offset); | 404 void PauseAnimation(int animation_id, double time_offset); |
401 void RemoveAnimation(int animation_id); | 405 void RemoveAnimation(int animation_id); |
402 void RemoveAnimation(int animation_id, Animation::TargetProperty property); | 406 void RemoveAnimation(int animation_id, Animation::TargetProperty property); |
403 | 407 LayerAnimationController* layer_animation_controller() const { |
404 LayerAnimationController* layer_animation_controller() { | |
405 return layer_animation_controller_.get(); | 408 return layer_animation_controller_.get(); |
406 } | 409 } |
407 void SetLayerAnimationControllerForTest( | 410 void SetLayerAnimationControllerForTest( |
408 scoped_refptr<LayerAnimationController> controller); | 411 scoped_refptr<LayerAnimationController> controller); |
409 | 412 |
410 void set_layer_animation_delegate(AnimationDelegate* delegate) { | 413 void set_layer_animation_delegate(AnimationDelegate* delegate) { |
411 DCHECK(layer_animation_controller_); | 414 DCHECK(layer_animation_controller_); |
412 layer_animation_controller_->set_layer_animation_delegate(delegate); | 415 layer_animation_controller_->set_layer_animation_delegate(delegate); |
413 } | 416 } |
414 | 417 |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 | 764 |
762 std::vector<FrameTimingRequest> frame_timing_requests_; | 765 std::vector<FrameTimingRequest> frame_timing_requests_; |
763 bool frame_timing_requests_dirty_; | 766 bool frame_timing_requests_dirty_; |
764 | 767 |
765 DISALLOW_COPY_AND_ASSIGN(Layer); | 768 DISALLOW_COPY_AND_ASSIGN(Layer); |
766 }; | 769 }; |
767 | 770 |
768 } // namespace cc | 771 } // namespace cc |
769 | 772 |
770 #endif // CC_LAYERS_LAYER_H_ | 773 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |