RESOLVED DUPLICATE of bug 79155 74196
[chromium] Delegate scroll events to the main thread when needed
https://bugs.webkit.org/show_bug.cgi?id=74196
Summary [chromium] Delegate scroll events to the main thread when needed
Sami Kyostila
Reported 2011-12-09 12:05:50 PST
Register a scrollable region for each LayerChromium and delegate scroll events inside the region to the main thread for processing. Note that this essentially splits out the Chromium-only changes from bug 71385.
Attachments
Patch (17.49 KB, patch)
2011-12-09 12:09 PST, Sami Kyostila
no flags
Patch (17.54 KB, patch)
2011-12-13 10:32 PST, Sami Kyostila
no flags
Patch (15.42 KB, patch)
2011-12-14 13:40 PST, Sami Kyostila
no flags
Patch (15.28 KB, patch)
2011-12-16 15:17 PST, Sami Kyostila
no flags
Patch (15.61 KB, patch)
2011-12-20 13:02 PST, Sami Kyostila
no flags
Patch (15.61 KB, patch)
2011-12-20 13:24 PST, Sami Kyostila
no flags
Sami Kyostila
Comment 1 2011-12-09 12:09:11 PST
Sami Kyostila
Comment 2 2011-12-13 10:32:09 PST
Created attachment 119033 [details] Patch - Rebased after latest changes to bug 73350.
Adrienne Walker
Comment 3 2011-12-13 12:06:02 PST
Comment on attachment 119033 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=119033&action=review Other than one small thing, this is looking good to me. Thanks for the tests! > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:341 > + IntPoint contentPoint(layerImpl->screenSpaceTransform().inverse().mapPoint(viewportPoint)); > + // The content point for non-root layers must be scaled with the page scale. Note that the > + // page scale delta is already embedded in each layer's screen space transform. > + if (layerImpl != m_scrollLayerImpl) > + contentPoint.scale(m_pageScale, m_pageScale); I know you're just moving code here, but I don't follow this logic and why the scroll layer behaves differently. Would you mind explaining why this is? Don't all layers (root or no) have the page scale applied to them? Also, do you need to apply the page scale delta? Maybe I'd feel more comfortable if there were more tests for this function that covered page scale.
Sami Kyostila
Comment 4 2011-12-14 12:53:02 PST
Comment on attachment 119033 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=119033&action=review Setting as review- until the preceding patch layer scrolling is updated. >> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:341 > > I know you're just moving code here, but I don't follow this logic and why the scroll layer behaves differently. Would you mind explaining why this is? Don't all layers (root or no) have the page scale applied to them? > > Also, do you need to apply the page scale delta? Maybe I'd feel more comfortable if there were more tests for this function that covered page scale. Turns out the code here is not entirely correct, so I'll rework it in the preceding patch. Actually there is no need to differentiate between layers or scale the content point, but instead visibleLayerRect() must be scaled with the inverse of the page scale to get unscaled css coordinates that match the coordinate system of contentPoint. The reason why page scale delta is not needed is that while we are zooming, visibleLayerRect() is recomputed in terms of the original page scale. It never includes m_pageScaleDelta so there is no need to undo that here. I'm not really sure whether this is intended, though.
Sami Kyostila
Comment 5 2011-12-14 13:40:03 PST
James Robinson
Comment 6 2011-12-14 15:32:14 PST
This seems to have quite a few merge conflicts on ToT, does it depend on https://bugs.webkit.org/show_bug.cgi?id=73350 ?
Sami Kyostila
Comment 7 2011-12-15 04:01:15 PST
(In reply to comment #6) > This seems to have quite a few merge conflicts on ToT, does it depend on https://bugs.webkit.org/show_bug.cgi?id=73350 ? Yes, this patch should be applied after the one you linked. Sorry, I should have mentioned that here.
Sami Kyostila
Comment 8 2011-12-16 15:17:49 PST
Created attachment 119684 [details] Patch - Rebased after changes to bug 73350 (no functional changes)
James Robinson
Comment 9 2011-12-19 16:18:22 PST
Comment on attachment 119684 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=119684&action=review > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:486 > + IntPoint contentPoint(layerImpl->screenSpaceTransform().inverse().mapPoint(viewportPoint)); if this layer's screen space transform is not invertible, you need to return false here - just calling .inverse().mapPoint() will map the point through an identity transform
Sami Kyostila
Comment 10 2011-12-20 13:02:11 PST
Created attachment 120064 [details] Patch - Updating according to layer walking order changes in bug 73350.
Sami Kyostila
Comment 11 2011-12-20 13:24:05 PST
Created attachment 120068 [details] Patch - Rebased.
James Robinson
Comment 12 2011-12-20 20:30:35 PST
Comment on attachment 120068 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=120068&action=review > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:480 > + if (!layerImpl) > + return false; when can this parameter be null? > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:489 > + if (!layerImpl->screenSpaceTransform().isInvertible()) > + return false; > + > + IntPoint contentPoint(layerImpl->screenSpaceTransform().inverse().mapPoint(viewportPoint)); > + if (layerImpl->drawsContent() && !isContentPointWithinLayer(layerImpl, contentPoint)) > + return false; > + > + if (layerImpl->isInsideScrollableRegion(contentPoint)) there's not a whole lot (if anything) going on here that the CCLayerTreeHostImpl can do and the layer itself can't - all of the logic here is based on member functions of layerImpl. should this whole thing just be a member function of CCLayerImpl? > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:526 > + if (!layerImpl->drawsContent() && (layerImpl->scrollable() || !layerImpl->scrollableRegion().isEmpty())) at this point, this probably deserves at least a comment explaining why a given layer should or shouldn't be in the assembled list since it's no longer a list of non-drawable scrollable layers
James Robinson
Comment 13 2012-02-21 20:46:53 PST
*** This bug has been marked as a duplicate of bug 79155 ***
Note You need to log in before you can comment on or make changes to this bug.