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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 | 441 |
442 void SetBounds(const gfx::Size& bounds); | 442 void SetBounds(const gfx::Size& bounds); |
443 gfx::Size bounds() const; | 443 gfx::Size bounds() const; |
444 // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions | 444 // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions |
445 // of pixels) due to use of single precision float. | 445 // of pixels) due to use of single precision float. |
446 gfx::SizeF BoundsForScrolling() const; | 446 gfx::SizeF BoundsForScrolling() const; |
447 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); | 447 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); |
448 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } | 448 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } |
449 | 449 |
450 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); | 450 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); |
451 // must only be called by tests when updating scroll offset of a single layer, | |
452 // the standard process to update scroll offsets is to call | |
453 // ScrollTree::UpdateScrollOffsetMap() which updates scroll offsets of all | |
454 // layers. | |
455 void PushScrollOffsetFromMainThread(const gfx::ScrollOffset& scroll_offset); | |
456 | |
457 gfx::ScrollOffset CurrentScrollOffset() const; | 451 gfx::ScrollOffset CurrentScrollOffset() const; |
458 gfx::ScrollOffset BaseScrollOffset() const; | |
459 gfx::Vector2dF ScrollDelta() const; | 452 gfx::Vector2dF ScrollDelta() const; |
460 void SetScrollDelta(const gfx::Vector2dF& delta); | |
461 | 453 |
462 gfx::ScrollOffset MaxScrollOffset() const; | 454 gfx::ScrollOffset MaxScrollOffset() const; |
463 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; | 455 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; |
464 gfx::Vector2dF ClampScrollToMaxScrollOffset(); | 456 gfx::Vector2dF ClampScrollToMaxScrollOffset(); |
465 void SetScrollCompensationAdjustment(const gfx::Vector2dF& scroll_offset) { | 457 void SetScrollCompensationAdjustment(const gfx::Vector2dF& scroll_offset) { |
466 scroll_compensation_adjustment_ = scroll_offset; | 458 scroll_compensation_adjustment_ = scroll_offset; |
467 } | 459 } |
468 gfx::Vector2dF ScrollCompensationAdjustment() const { | 460 gfx::Vector2dF ScrollCompensationAdjustment() const { |
469 return scroll_compensation_adjustment_; | 461 return scroll_compensation_adjustment_; |
470 } | 462 } |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 // If true, the layer or one of its descendants has a touch handler. | 847 // If true, the layer or one of its descendants has a touch handler. |
856 bool layer_or_descendant_has_touch_handler_; | 848 bool layer_or_descendant_has_touch_handler_; |
857 bool sorted_for_recursion_; | 849 bool sorted_for_recursion_; |
858 | 850 |
859 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 851 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
860 }; | 852 }; |
861 | 853 |
862 } // namespace cc | 854 } // namespace cc |
863 | 855 |
864 #endif // CC_LAYERS_LAYER_IMPL_H_ | 856 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |