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

Unified Diff: cc/layers/layer_impl.cc

Issue 867823007: Make the scroll_delta flooring behavior the same as before SyncedProperty change (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 0e78ca8edff294bd29c2c38a63097e675ecf8736..55ffa7fb994122e462ab07fe5099fa0bef581e6c 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -1083,13 +1083,18 @@ void LayerImpl::PushScrollOffsetFromMainThread(
gfx::ScrollOffset LayerImpl::PullDeltaForMainThread() {
RefreshFromScrollDelegate();
- // TODO(aelias): Remove all this temporary flooring machinery when Blink
- // fully supports fractional scrolls.
- gfx::ScrollOffset current = CurrentScrollOffset();
- gfx::ScrollOffset floored(floor(current.x()), floor(current.y()));
- scroll_offset_->SetCurrent(floored);
+ // TODO(aelias, miletus): Remove all this temporary flooring machinery when
+ // Blink fully supports fractional scrolls.
+ gfx::ScrollOffset current_offset = CurrentScrollOffset();
+ gfx::Vector2dF current_delta = ScrollDelta();
+ gfx::Vector2dF floored_delta(floor(current_delta.x()),
+ floor(current_delta.y()));
+ gfx::Vector2dF diff_delta = floored_delta - current_delta;
+ gfx::ScrollOffset tmp_offset = ScrollOffsetWithDelta(current_offset,
+ diff_delta);
+ scroll_offset_->SetCurrent(tmp_offset);
gfx::ScrollOffset delta = scroll_offset_->PullDeltaForMainThread();
- scroll_offset_->SetCurrent(current);
+ scroll_offset_->SetCurrent(current_offset);
return delta;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698