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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 2664083005: [Root Layer Scrolls] Fix touch event rect clearing. (Closed)
Patch Set: variable renames Created 3 years, 10 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: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 0f6ed9237dd76ae8e572c22e88581f5893f061bc..42d8e24513932932a9e0caf7eeb9b7c53c743a6b 100644
--- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -736,9 +736,26 @@ void ScrollingCoordinator::setTouchEventTargetRects(
LayerHitTestRects& layerRects) {
TRACE_EVENT0("input", "ScrollingCoordinator::setTouchEventTargetRects");
- // Update the list of layers with touch hit rects.
- HashSet<const PaintLayer*> oldLayersWithTouchRects;
- m_layersWithTouchRects.swap(oldLayersWithTouchRects);
+ // Ensure we have an entry for each composited layer that previously had rects
+ // (so that old ones will get cleared out). Note that ideally we'd track this
+ // on GraphicsLayer instead of Layer, but we have no good hook into the
+ // lifetime of a GraphicsLayer.
+ GraphicsLayerHitTestRects graphicsLayerRects;
+ for (const PaintLayer* layer : m_layersWithTouchRects) {
+ if (layer->layoutObject()->frameView() &&
+ layer->layoutObject()->frameView()->shouldThrottleRendering()) {
+ continue;
+ }
+ GraphicsLayer* mainGraphicsLayer =
+ layer->graphicsLayerBacking(layer->layoutObject());
+ if (mainGraphicsLayer)
+ graphicsLayerRects.add(mainGraphicsLayer, Vector<LayoutRect>());
+ GraphicsLayer* scrollingContentsLayer = layer->graphicsLayerBacking();
+ if (scrollingContentsLayer && scrollingContentsLayer != mainGraphicsLayer)
+ graphicsLayerRects.add(scrollingContentsLayer, Vector<LayoutRect>());
+ }
+
+ m_layersWithTouchRects.clear();
for (const auto& layerRect : layerRects) {
if (!layerRect.value.isEmpty()) {
const PaintLayer* compositedLayer =
@@ -749,16 +766,7 @@ void ScrollingCoordinator::setTouchEventTargetRects(
}
}
- // Ensure we have an entry for each composited layer that previously had rects
- // (so that old ones will get cleared out). Note that ideally we'd track this
- // on GraphicsLayer instead of Layer, but we have no good hook into the
- // lifetime of a GraphicsLayer.
- for (const PaintLayer* layer : oldLayersWithTouchRects) {
- if (!layerRects.contains(layer))
- layerRects.add(layer, Vector<LayoutRect>());
- }
- GraphicsLayerHitTestRects graphicsLayerRects;
projectRectsToGraphicsLayerSpace(m_page->deprecatedLocalMainFrame(),
layerRects, graphicsLayerRects);
« 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