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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 877173002: Fixed position layer counter-scroll with main thread scroll offset fractional part (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ready for review 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 e12e272653ab7fa2ed335c41ed084711a0da16c0..4a14d02432ccf754fa1bef7c3e1d53441239d7f5 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -46,13 +46,15 @@ static void SortLayers(LayerImplList::iterator first,
template <typename LayerType>
static gfx::Vector2dF GetEffectiveScrollDelta(LayerType* layer) {
- gfx::Vector2dF scroll_delta = layer->ScrollDelta();
+ gfx::Vector2dF scroll_delta =
+ layer->ScrollDelta() + layer->MainScrollOffsetFracitionalPart();
aelias_OOO_until_Jul13 2015/01/28 02:04:00 Please add a comment explaining why the fractional
Yufeng Shen (Slow to review) 2015/01/28 22:28:09 Done.
// 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();
+ scroll_delta += layer->scroll_parent()->ScrollDelta() +
+ layer->scroll_parent()->MainScrollOffsetFracitionalPart();
return scroll_delta;
}

Powered by Google App Engine
This is Rietveld 408576698