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

Unified Diff: cc/layer_tree_host_impl.cc

Issue 12090014: Add a bit to not bubble scrolls to parent scrolling layers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 1c60e798136e1599d8360977ec278348159225d0..6847ef690ea0d2f16c25c0dae11171c00692c524 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -132,6 +132,7 @@ scoped_ptr<LayerTreeHostImpl> LayerTreeHostImpl::create(const LayerTreeSettings&
LayerTreeHostImpl::LayerTreeHostImpl(const LayerTreeSettings& settings, LayerTreeHostImplClient* client, Proxy* proxy)
: m_client(client)
, m_proxy(proxy)
+ , m_didScrollOnce(false)
, m_scrollDeltaIsInViewportSpace(false)
, m_settings(settings)
, m_debugState(settings.initialDebugState)
@@ -1174,6 +1175,7 @@ InputHandlerClient::ScrollStatus LayerTreeHostImpl::scrollBegin(gfx::Point viewp
DCHECK(!currentlyScrollingLayer());
clearCurrentlyScrollingLayer();
+ m_didScrollOnce = false;
if (!ensureRenderSurfaceLayerList())
return ScrollIgnored;
@@ -1287,7 +1289,8 @@ static gfx::Vector2dF scrollLayerWithLocalDelta(LayerImpl& layerImpl, gfx::Vecto
}
bool LayerTreeHostImpl::scrollBy(const gfx::Point& viewportPoint,
- const gfx::Vector2d& scrollDelta)
+ const gfx::Vector2d& scrollDelta,
+ bool shouldBubble)
{
TRACE_EVENT0("cc", "LayerTreeHostImpl::scrollBy");
if (!currentlyScrollingLayer())
@@ -1312,9 +1315,14 @@ bool LayerTreeHostImpl::scrollBy(const gfx::Point& viewportPoint,
// If the layer wasn't able to move, try the next one in the hierarchy.
float moveThresholdSquared = 0.1f * 0.1f;
- if (appliedDelta.LengthSquared() < moveThresholdSquared)
- continue;
+ if (appliedDelta.LengthSquared() < moveThresholdSquared) {
+ if (shouldBubble || !m_didScrollOnce)
Sami 2013/01/29 11:42:34 I'm not sure this is correct. When we're not bubbl
Yusuf 2013/01/29 18:59:21 Yes, I think you are right. I somehow thought the
+ continue;
+ else
+ break;
Sami 2013/01/29 11:42:34 Indentation seem off.
+ }
didScroll = true;
+ m_didScrollOnce = 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.

Powered by Google App Engine
This is Rietveld 408576698