| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
| 6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 void SetBounds(const gfx::Size& bounds); | 304 void SetBounds(const gfx::Size& bounds); |
| 305 gfx::Size bounds() const; | 305 gfx::Size bounds() const; |
| 306 // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions | 306 // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions |
| 307 // of pixels) due to use of single precision float. | 307 // of pixels) due to use of single precision float. |
| 308 gfx::SizeF BoundsForScrolling() const; | 308 gfx::SizeF BoundsForScrolling() const; |
| 309 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); | 309 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); |
| 310 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } | 310 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } |
| 311 | 311 |
| 312 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); | 312 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); |
| 313 gfx::ScrollOffset CurrentScrollOffset() const; | 313 gfx::ScrollOffset CurrentScrollOffset() const; |
| 314 void SetCurrentOverscroll(const gfx::ScrollOffset& overscroll); |
| 315 gfx::ScrollOffset CurrentOverscroll() const; |
| 314 | 316 |
| 315 gfx::ScrollOffset MaxScrollOffset() const; | 317 gfx::ScrollOffset MaxScrollOffset() const; |
| 316 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; | 318 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; |
| 317 gfx::Vector2dF ClampScrollToMaxScrollOffset(); | 319 gfx::Vector2dF ClampScrollToMaxScrollOffset(); |
| 318 | 320 |
| 319 // Returns the delta of the scroll that was outside of the bounds of the | 321 // Returns the delta of the scroll that was outside of the bounds of the |
| 320 // initial scroll | 322 // initial scroll |
| 321 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); | 323 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); |
| 322 | 324 |
| 323 void SetScrollClipLayer(int scroll_clip_layer_id); | 325 // TODO(tapted): Remove this overload. |
| 326 void SetScrollClipLayer(int scroll_clip_layer_id) { |
| 327 SetScrollClipAndCanOverscroll(scroll_clip_layer_id, false); |
| 328 } |
| 329 void SetScrollClipAndCanOverscroll(int scroll_clip_layer_id, |
| 330 bool can_overscroll); |
| 324 int scroll_clip_layer_id() const { return scroll_clip_layer_id_; } | 331 int scroll_clip_layer_id() const { return scroll_clip_layer_id_; } |
| 325 LayerImpl* scroll_clip_layer() const; | 332 LayerImpl* scroll_clip_layer() const; |
| 326 bool scrollable() const; | 333 bool scrollable() const; |
| 334 bool can_overscroll() const { return can_overscroll_; } |
| 327 | 335 |
| 328 void set_user_scrollable_horizontal(bool scrollable); | 336 void set_user_scrollable_horizontal(bool scrollable); |
| 329 bool user_scrollable_horizontal() const { | 337 bool user_scrollable_horizontal() const { |
| 330 return user_scrollable_horizontal_; | 338 return user_scrollable_horizontal_; |
| 331 } | 339 } |
| 332 void set_user_scrollable_vertical(bool scrollable); | 340 void set_user_scrollable_vertical(bool scrollable); |
| 333 bool user_scrollable_vertical() const { return user_scrollable_vertical_; } | 341 bool user_scrollable_vertical() const { return user_scrollable_vertical_; } |
| 334 | 342 |
| 335 bool user_scrollable(ScrollbarOrientation orientation) const; | 343 bool user_scrollable(ScrollbarOrientation orientation) const; |
| 336 | 344 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 515 |
| 508 // Properties synchronized from the associated Layer. | 516 // Properties synchronized from the associated Layer. |
| 509 gfx::Size bounds_; | 517 gfx::Size bounds_; |
| 510 int scroll_clip_layer_id_; | 518 int scroll_clip_layer_id_; |
| 511 | 519 |
| 512 gfx::Vector2dF offset_to_transform_parent_; | 520 gfx::Vector2dF offset_to_transform_parent_; |
| 513 uint32_t main_thread_scrolling_reasons_; | 521 uint32_t main_thread_scrolling_reasons_; |
| 514 | 522 |
| 515 bool user_scrollable_horizontal_ : 1; | 523 bool user_scrollable_horizontal_ : 1; |
| 516 bool user_scrollable_vertical_ : 1; | 524 bool user_scrollable_vertical_ : 1; |
| 525 bool can_overscroll_ : 1; |
| 517 bool should_flatten_transform_from_property_tree_ : 1; | 526 bool should_flatten_transform_from_property_tree_ : 1; |
| 518 | 527 |
| 519 // Tracks if drawing-related properties have changed since last redraw. | 528 // Tracks if drawing-related properties have changed since last redraw. |
| 520 bool layer_property_changed_ : 1; | 529 bool layer_property_changed_ : 1; |
| 521 | 530 |
| 522 bool masks_to_bounds_ : 1; | 531 bool masks_to_bounds_ : 1; |
| 523 bool contents_opaque_ : 1; | 532 bool contents_opaque_ : 1; |
| 524 bool use_parent_backface_visibility_ : 1; | 533 bool use_parent_backface_visibility_ : 1; |
| 525 bool use_local_transform_for_backface_visibility_ : 1; | 534 bool use_local_transform_for_backface_visibility_ : 1; |
| 526 bool should_check_backface_visibility_ : 1; | 535 bool should_check_backface_visibility_ : 1; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 bool scrolls_drawn_descendant_ : 1; | 590 bool scrolls_drawn_descendant_ : 1; |
| 582 bool has_will_change_transform_hint_ : 1; | 591 bool has_will_change_transform_hint_ : 1; |
| 583 bool needs_push_properties_ : 1; | 592 bool needs_push_properties_ : 1; |
| 584 | 593 |
| 585 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 594 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 586 }; | 595 }; |
| 587 | 596 |
| 588 } // namespace cc | 597 } // namespace cc |
| 589 | 598 |
| 590 #endif // CC_LAYERS_LAYER_IMPL_H_ | 599 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |