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/layer_tree_host_impl.cc

Issue 11348381: cc: Always commit and redraw after scrolling (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years 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 | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 26e1b3dc40d961978c4b35d5e5ca05b6d6750c94..e2ea0daf119eb72966e87c2787ef43b1dfded5fa 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -1292,6 +1292,7 @@ bool LayerTreeHostImpl::scrollBy(const gfx::Point& viewportPoint,
return false;
gfx::Vector2dF pendingDelta = scrollDelta;
+ bool didScroll = false;
for (LayerImpl* layerImpl = m_currentlyScrollingLayerImpl; layerImpl; layerImpl = layerImpl->parent()) {
if (!layerImpl->scrollable())
@@ -1309,6 +1310,7 @@ bool LayerTreeHostImpl::scrollBy(const gfx::Point& viewportPoint,
float moveThresholdSquared = 0.1f * 0.1f;
if (appliedDelta.LengthSquared() < moveThresholdSquared)
continue;
+ didScroll = true;
// If the applied delta is within 45 degrees of the input delta, bail out to make it easier
// to scroll just one layer in one direction without affecting any of its parents.
@@ -1327,12 +1329,11 @@ bool LayerTreeHostImpl::scrollBy(const gfx::Point& viewportPoint,
break;
}
- if (!scrollDelta.IsZero() && gfx::ToFlooredVector2d(pendingDelta).IsZero()) {
+ if (didScroll) {
m_client->setNeedsCommitOnImplThread();
m_client->setNeedsRedrawOnImplThread();
- return true;
}
- return false;
+ return didScroll;
}
void LayerTreeHostImpl::clearCurrentlyScrollingLayer()
« no previous file with comments | « no previous file | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698