Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: cc/layers/layer_impl.h

Issue 1766053002: Clean LayerImpl's scroll offset callers in unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/layer_impl.cc » ('j') | cc/layers/layer_impl_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer_impl.cc » ('j') | cc/layers/layer_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698