| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 void set_num_unclipped_descendants(size_t descendants) { | 227 void set_num_unclipped_descendants(size_t descendants) { |
| 228 num_unclipped_descendants_ = descendants; | 228 num_unclipped_descendants_ = descendants; |
| 229 } | 229 } |
| 230 size_t num_unclipped_descendants() const { | 230 size_t num_unclipped_descendants() const { |
| 231 return num_unclipped_descendants_; | 231 return num_unclipped_descendants_; |
| 232 } | 232 } |
| 233 | 233 |
| 234 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); | 234 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); |
| 235 | 235 |
| 236 gfx::ScrollOffset scroll_offset() const { return inputs_.scroll_offset; } | 236 gfx::ScrollOffset scroll_offset() const { return inputs_.scroll_offset; } |
| 237 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); | 237 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset, |
| 238 gfx::Vector2dF* overscroll_delta); |
| 238 | 239 |
| 239 void SetScrollClipLayerId(int clip_layer_id); | 240 // TODO(tapted): Remove this overload. |
| 241 void SetScrollClipLayerId(int clip_layer_id) { |
| 242 SetScrollClipAndCanOverscroll(clip_layer_id, false); |
| 243 } |
| 244 void SetScrollClipAndCanOverscroll(int clip_layer_id, bool can_overscroll); |
| 245 |
| 240 bool scrollable() const { return inputs_.scroll_clip_layer_id != INVALID_ID; } | 246 bool scrollable() const { return inputs_.scroll_clip_layer_id != INVALID_ID; } |
| 247 gfx::ScrollOffset overscroll() const { return inputs_.overscroll; } |
| 241 Layer* scroll_clip_layer() const; | 248 Layer* scroll_clip_layer() const; |
| 242 | 249 |
| 243 void SetUserScrollable(bool horizontal, bool vertical); | 250 void SetUserScrollable(bool horizontal, bool vertical); |
| 244 bool user_scrollable_horizontal() const { | 251 bool user_scrollable_horizontal() const { |
| 245 return inputs_.user_scrollable_horizontal; | 252 return inputs_.user_scrollable_horizontal; |
| 246 } | 253 } |
| 247 bool user_scrollable_vertical() const { | 254 bool user_scrollable_vertical() const { |
| 248 return inputs_.user_scrollable_vertical; | 255 return inputs_.user_scrollable_vertical; |
| 249 } | 256 } |
| 250 | 257 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 273 } | 280 } |
| 274 | 281 |
| 275 void SetForceRenderSurfaceForTesting(bool force_render_surface); | 282 void SetForceRenderSurfaceForTesting(bool force_render_surface); |
| 276 bool force_render_surface_for_testing() const { | 283 bool force_render_surface_for_testing() const { |
| 277 return force_render_surface_for_testing_; | 284 return force_render_surface_for_testing_; |
| 278 } | 285 } |
| 279 | 286 |
| 280 gfx::ScrollOffset CurrentScrollOffset() const { | 287 gfx::ScrollOffset CurrentScrollOffset() const { |
| 281 return inputs_.scroll_offset; | 288 return inputs_.scroll_offset; |
| 282 } | 289 } |
| 290 gfx::ScrollOffset CurrentOverscroll() const { return inputs_.overscroll; } |
| 283 | 291 |
| 284 void SetDoubleSided(bool double_sided); | 292 void SetDoubleSided(bool double_sided); |
| 285 bool double_sided() const { return inputs_.double_sided; } | 293 bool double_sided() const { return inputs_.double_sided; } |
| 286 | 294 |
| 287 void SetShouldFlattenTransform(bool flatten); | 295 void SetShouldFlattenTransform(bool flatten); |
| 288 bool should_flatten_transform() const { | 296 bool should_flatten_transform() const { |
| 289 return inputs_.should_flatten_transform; | 297 return inputs_.should_flatten_transform; |
| 290 } | 298 } |
| 291 | 299 |
| 292 bool Is3dSorted() const { return inputs_.sorting_context_id != 0; } | 300 bool Is3dSorted() const { return inputs_.sorting_context_id != 0; } |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 662 |
| 655 bool use_parent_backface_visibility : 1; | 663 bool use_parent_backface_visibility : 1; |
| 656 | 664 |
| 657 SkColor background_color; | 665 SkColor background_color; |
| 658 | 666 |
| 659 FilterOperations filters; | 667 FilterOperations filters; |
| 660 FilterOperations background_filters; | 668 FilterOperations background_filters; |
| 661 gfx::PointF filters_origin; | 669 gfx::PointF filters_origin; |
| 662 | 670 |
| 663 gfx::ScrollOffset scroll_offset; | 671 gfx::ScrollOffset scroll_offset; |
| 672 gfx::ScrollOffset overscroll; |
| 664 | 673 |
| 665 // This variable indicates which ancestor layer (if any) whose size, | 674 // This variable indicates which ancestor layer (if any) whose size, |
| 666 // transformed relative to this layer, defines the maximum scroll offset | 675 // transformed relative to this layer, defines the maximum scroll offset |
| 667 // for this layer. | 676 // for this layer. |
| 668 int scroll_clip_layer_id; | 677 int scroll_clip_layer_id; |
| 669 bool user_scrollable_horizontal : 1; | 678 bool user_scrollable_horizontal : 1; |
| 670 bool user_scrollable_vertical : 1; | 679 bool user_scrollable_vertical : 1; |
| 680 bool can_overscroll : 1; |
| 671 | 681 |
| 672 uint32_t main_thread_scrolling_reasons; | 682 uint32_t main_thread_scrolling_reasons; |
| 673 Region non_fast_scrollable_region; | 683 Region non_fast_scrollable_region; |
| 674 | 684 |
| 675 Region touch_event_handler_region; | 685 Region touch_event_handler_region; |
| 676 | 686 |
| 677 bool is_container_for_fixed_position_layers : 1; | 687 bool is_container_for_fixed_position_layers : 1; |
| 678 LayerPositionConstraint position_constraint; | 688 LayerPositionConstraint position_constraint; |
| 679 | 689 |
| 680 LayerStickyPositionConstraint sticky_position_constraint; | 690 LayerStickyPositionConstraint sticky_position_constraint; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 // These all act like draw properties, so don't need push properties. | 746 // These all act like draw properties, so don't need push properties. |
| 737 gfx::Rect visible_layer_rect_; | 747 gfx::Rect visible_layer_rect_; |
| 738 size_t num_unclipped_descendants_; | 748 size_t num_unclipped_descendants_; |
| 739 | 749 |
| 740 DISALLOW_COPY_AND_ASSIGN(Layer); | 750 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 741 }; | 751 }; |
| 742 | 752 |
| 743 } // namespace cc | 753 } // namespace cc |
| 744 | 754 |
| 745 #endif // CC_LAYERS_LAYER_H_ | 755 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |