| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 void set_num_unclipped_descendants(size_t descendants) { | 229 void set_num_unclipped_descendants(size_t descendants) { |
| 230 num_unclipped_descendants_ = descendants; | 230 num_unclipped_descendants_ = descendants; |
| 231 } | 231 } |
| 232 size_t num_unclipped_descendants() const { | 232 size_t num_unclipped_descendants() const { |
| 233 return num_unclipped_descendants_; | 233 return num_unclipped_descendants_; |
| 234 } | 234 } |
| 235 | 235 |
| 236 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); | 236 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); |
| 237 | 237 |
| 238 gfx::ScrollOffset scroll_offset() const { return inputs_.scroll_offset; } | 238 gfx::ScrollOffset scroll_offset() const { return inputs_.scroll_offset; } |
| 239 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); | 239 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset, |
| 240 gfx::Vector2dF* overscroll_delta); |
| 240 | 241 |
| 241 void SetScrollClipLayerId(int clip_layer_id); | 242 // TODO(tapted): Remove this overload. |
| 243 void SetScrollClipLayerId(int clip_layer_id) { |
| 244 SetScrollClipAndCanOverscroll(clip_layer_id, false); |
| 245 } |
| 246 void SetScrollClipAndCanOverscroll(int clip_layer_id, bool can_overscroll); |
| 247 |
| 242 bool scrollable() const { return inputs_.scroll_clip_layer_id != INVALID_ID; } | 248 bool scrollable() const { return inputs_.scroll_clip_layer_id != INVALID_ID; } |
| 249 gfx::ScrollOffset overscroll() const { return inputs_.overscroll; } |
| 243 Layer* scroll_clip_layer() const; | 250 Layer* scroll_clip_layer() const; |
| 244 | 251 |
| 245 void SetUserScrollable(bool horizontal, bool vertical); | 252 void SetUserScrollable(bool horizontal, bool vertical); |
| 246 bool user_scrollable_horizontal() const { | 253 bool user_scrollable_horizontal() const { |
| 247 return inputs_.user_scrollable_horizontal; | 254 return inputs_.user_scrollable_horizontal; |
| 248 } | 255 } |
| 249 bool user_scrollable_vertical() const { | 256 bool user_scrollable_vertical() const { |
| 250 return inputs_.user_scrollable_vertical; | 257 return inputs_.user_scrollable_vertical; |
| 251 } | 258 } |
| 252 | 259 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 275 } | 282 } |
| 276 | 283 |
| 277 void SetForceRenderSurfaceForTesting(bool force_render_surface); | 284 void SetForceRenderSurfaceForTesting(bool force_render_surface); |
| 278 bool force_render_surface_for_testing() const { | 285 bool force_render_surface_for_testing() const { |
| 279 return force_render_surface_for_testing_; | 286 return force_render_surface_for_testing_; |
| 280 } | 287 } |
| 281 | 288 |
| 282 gfx::ScrollOffset CurrentScrollOffset() const { | 289 gfx::ScrollOffset CurrentScrollOffset() const { |
| 283 return inputs_.scroll_offset; | 290 return inputs_.scroll_offset; |
| 284 } | 291 } |
| 292 gfx::ScrollOffset CurrentOverscroll() const { return inputs_.overscroll; } |
| 285 | 293 |
| 286 void SetDoubleSided(bool double_sided); | 294 void SetDoubleSided(bool double_sided); |
| 287 bool double_sided() const { return inputs_.double_sided; } | 295 bool double_sided() const { return inputs_.double_sided; } |
| 288 | 296 |
| 289 void SetShouldFlattenTransform(bool flatten); | 297 void SetShouldFlattenTransform(bool flatten); |
| 290 bool should_flatten_transform() const { | 298 bool should_flatten_transform() const { |
| 291 return inputs_.should_flatten_transform; | 299 return inputs_.should_flatten_transform; |
| 292 } | 300 } |
| 293 | 301 |
| 294 bool Is3dSorted() const { return inputs_.sorting_context_id != 0; } | 302 bool Is3dSorted() const { return inputs_.sorting_context_id != 0; } |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 | 653 |
| 646 bool use_parent_backface_visibility : 1; | 654 bool use_parent_backface_visibility : 1; |
| 647 | 655 |
| 648 SkColor background_color; | 656 SkColor background_color; |
| 649 | 657 |
| 650 FilterOperations filters; | 658 FilterOperations filters; |
| 651 FilterOperations background_filters; | 659 FilterOperations background_filters; |
| 652 gfx::PointF filters_origin; | 660 gfx::PointF filters_origin; |
| 653 | 661 |
| 654 gfx::ScrollOffset scroll_offset; | 662 gfx::ScrollOffset scroll_offset; |
| 663 gfx::ScrollOffset overscroll; |
| 655 | 664 |
| 656 // This variable indicates which ancestor layer (if any) whose size, | 665 // This variable indicates which ancestor layer (if any) whose size, |
| 657 // transformed relative to this layer, defines the maximum scroll offset | 666 // transformed relative to this layer, defines the maximum scroll offset |
| 658 // for this layer. | 667 // for this layer. |
| 659 int scroll_clip_layer_id; | 668 int scroll_clip_layer_id; |
| 660 bool user_scrollable_horizontal : 1; | 669 bool user_scrollable_horizontal : 1; |
| 661 bool user_scrollable_vertical : 1; | 670 bool user_scrollable_vertical : 1; |
| 671 bool can_overscroll : 1; |
| 662 | 672 |
| 663 uint32_t main_thread_scrolling_reasons; | 673 uint32_t main_thread_scrolling_reasons; |
| 664 Region non_fast_scrollable_region; | 674 Region non_fast_scrollable_region; |
| 665 | 675 |
| 666 Region touch_event_handler_region; | 676 Region touch_event_handler_region; |
| 667 | 677 |
| 668 bool is_container_for_fixed_position_layers : 1; | 678 bool is_container_for_fixed_position_layers : 1; |
| 669 LayerPositionConstraint position_constraint; | 679 LayerPositionConstraint position_constraint; |
| 670 | 680 |
| 671 LayerStickyPositionConstraint sticky_position_constraint; | 681 LayerStickyPositionConstraint sticky_position_constraint; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 // These all act like draw properties, so don't need push properties. | 734 // These all act like draw properties, so don't need push properties. |
| 725 gfx::Rect visible_layer_rect_; | 735 gfx::Rect visible_layer_rect_; |
| 726 size_t num_unclipped_descendants_; | 736 size_t num_unclipped_descendants_; |
| 727 | 737 |
| 728 DISALLOW_COPY_AND_ASSIGN(Layer); | 738 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 729 }; | 739 }; |
| 730 | 740 |
| 731 } // namespace cc | 741 } // namespace cc |
| 732 | 742 |
| 733 #endif // CC_LAYERS_LAYER_H_ | 743 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |