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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scroll delta -> vector2dF, scroll offset -> ScrollOffset Created 6 years, 3 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 8d25539725914ee4d495f5ac580b86ae70aec0d4..624fe6b07a8cec5d30686bb3111f6b5d46da4efb 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -52,13 +52,13 @@ static gfx::Vector2dF GetEffectiveScrollDelta(LayerType* layer) {
}
template <typename LayerType>
-static gfx::Vector2dF GetEffectiveTotalScrollOffset(LayerType* layer) {
- gfx::Vector2dF offset = layer->TotalScrollOffset();
+static gfx::ScrollOffset GetEffectiveTotalScrollOffset(LayerType* layer) {
+ gfx::ScrollOffset offset = layer->TotalScrollOffset();
// 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.
if (layer->scroll_parent())
- offset += layer->scroll_parent()->ScrollDelta();
+ offset += gfx::ScrollOffset(layer->scroll_parent()->ScrollDelta());
return offset;
}
@@ -1645,8 +1645,8 @@ static void CalculateDrawPropertiesInternal(
layer->parent()->screen_space_transform_is_animating();
}
gfx::Point3F transform_origin = layer->transform_origin();
- gfx::Vector2dF scroll_offset = GetEffectiveTotalScrollOffset(layer);
- gfx::PointF position = layer->position() - scroll_offset;
+ gfx::ScrollOffset scroll_offset = GetEffectiveTotalScrollOffset(layer);
+ gfx::PointF position = layer->position() - scroll_offset.ToVector2dF();
gfx::Transform combined_transform = data_from_ancestor.parent_matrix;
if (!layer->transform().IsIdentity()) {
// LT = Tr[origin] * Tr[origin2transformOrigin]

Powered by Google App Engine
This is Rietveld 408576698