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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 800613009: Convert scroll offsets to use SyncedProperty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 3e70aeb38d24ba19239123b16c3b32a16d3cacfd..b723d01932110363376cfa148fb47f588f406ba6 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -46,19 +46,19 @@ static void SortLayers(LayerImplList::iterator first,
template <typename LayerType>
static gfx::Vector2dF GetEffectiveScrollDelta(LayerType* layer) {
- gfx::Vector2dF scroll_delta = layer->ScrollDelta();
+ gfx::ScrollOffset scroll_delta = layer->ScrollDelta();
// The scroll parent's scroll delta is the amount we've scrolled on the
// compositor thread since the commit for this layer tree's source frame.
// we last reported to the main thread. I.e., it's the discrepancy between
// a scroll parent's scroll delta and offset, so we must add it here.
if (layer->scroll_parent())
scroll_delta += layer->scroll_parent()->ScrollDelta();
- return scroll_delta;
+ return gfx::Vector2dF(scroll_delta.x(), scroll_delta.y());
}
template <typename LayerType>
-static gfx::ScrollOffset GetEffectiveTotalScrollOffset(LayerType* layer) {
- gfx::ScrollOffset offset = layer->TotalScrollOffset();
+static gfx::ScrollOffset GetEffectiveCurrentScrollOffset(LayerType* layer) {
+ gfx::ScrollOffset offset = layer->CurrentScrollOffset();
// The scroll parent's total scroll offset (scroll offset + scroll delta)
// can't be used because its scroll offset has already been applied to the
// scroll children's positions by the main thread layer positioning code.
@@ -1666,7 +1666,7 @@ static void CalculateDrawPropertiesInternal(
layer->parent()->screen_space_transform_is_animating();
}
gfx::Point3F transform_origin = layer->transform_origin();
- gfx::ScrollOffset scroll_offset = GetEffectiveTotalScrollOffset(layer);
+ gfx::ScrollOffset scroll_offset = GetEffectiveCurrentScrollOffset(layer);
gfx::PointF position =
layer->position() - ScrollOffsetToVector2dF(scroll_offset);
gfx::Transform combined_transform = data_from_ancestor.parent_matrix;

Powered by Google App Engine
This is Rietveld 408576698