Changeset 168338 in webkit
- Timestamp:
- May 5, 2014 6:10:30 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r168333 r168338 1 2014-05-05 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Flickery scrolling inside overflow-scrolling: touch 4 https://bugs.webkit.org/show_bug.cgi?id=132591 5 <rdar://problem/16760466> 6 7 Reviewed by Tim Horton. 8 9 Avoid triggering layer tree commits that touch the layer's boundsOrigin 10 while the user is scrolling in the UI process. 11 12 Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration" 13 flag to the ScrollingTree to say that we're in the middle of a user interaction 14 (and also to send a final non-interactive update). That gets passed along 15 to the web process, and turned into "SyncScrollingLayerPosition" update. 16 AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults 17 this, and uses it to set a flag on the ScrollableArea to say that the scroll 18 is a user scroll. 19 20 RenderLayerBacking then makes use of this (in existing code, shared with WK1) 21 to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(), 22 which updates the GraphicsLayer without touching platform layers. This is necessary 23 so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility 24 computations). 25 26 Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized 27 for WebKit1 by checking the type of platform layer. 28 29 * WebCore.exp.in: 30 * page/scrolling/AsyncScrollingCoordinator.cpp: 31 (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): 32 * page/scrolling/ScrollingTree.cpp: 33 (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): 34 * page/scrolling/ScrollingTree.h: 35 * platform/graphics/GraphicsLayer.h: 36 (WebCore::GraphicsLayer::syncBoundsOrigin): 37 * platform/graphics/ca/GraphicsLayerCA.cpp: 38 (WebCore::GraphicsLayerCA::computeVisibleRect): 39 * rendering/RenderLayerBacking.cpp: 40 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): 41 1 42 2014-05-05 Alexey Proskuryakov <ap@apple.com> 2 43 -
trunk/Source/WebCore/WebCore.exp.in
r168316 r168338 2761 2761 __ZN7WebCore13ScrollingTree36viewportChangedViaDelegatedScrollingEyRKNS_9FloatRectEd 2762 2762 __ZN7WebCore13ScrollingTree37setScrollingPerformanceLoggingEnabledEb 2763 __ZN7WebCore13ScrollingTree42scrollPositionChangedViaDelegatedScrollingEyRKNS_10FloatPointE 2763 __ZN7WebCore13ScrollingTree42scrollPositionChangedViaDelegatedScrollingEyRKNS_10FloatPointEb 2764 2764 __ZN7WebCore13ScrollingTreeC2Ev 2765 2765 __ZN7WebCore13ScrollingTreeD1Ev -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r168244 r168338 255 255 256 256 // Overflow-scroll area. 257 if (ScrollableArea* scrollableArea = frameView->scrollableAreaForScrollLayerID(scrollingNodeID)) 257 if (ScrollableArea* scrollableArea = frameView->scrollableAreaForScrollLayerID(scrollingNodeID)) { 258 scrollableArea->setIsUserScroll(scrollingLayerPositionAction == SyncScrollingLayerPosition); 258 259 scrollableArea->scrollToOffsetWithoutAnimation(scrollPosition); 260 scrollableArea->setIsUserScroll(false); 261 } 259 262 } 260 263 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r168325 r168338 111 111 } 112 112 113 void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatPoint& scrollPosition )113 void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatPoint& scrollPosition, bool inUserInteration) 114 114 { 115 115 ScrollingTreeNode* node = nodeForID(nodeID); … … 124 124 125 125 // Update GraphicsLayers and scroll state. 126 scrollingTreeNodeDidScroll(nodeID, scrollPosition );126 scrollingTreeNodeDidScroll(nodeID, scrollPosition, inUserInteration ? SyncScrollingLayerPosition : SetScrollingLayerPosition); 127 127 } 128 128 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r167262 r168338 85 85 // Delegated scrolling has scrolled a node. Update layer positions on descendant tree nodes, 86 86 // and call scrollingTreeNodeDidScroll(). 87 virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatPoint& scrollPosition );87 virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool inUserInteration); 88 88 89 89 FloatPoint mainFrameScrollPosition(); -
trunk/Source/WebCore/platform/ScrollableArea.h
r167560 r168338 69 69 virtual void didEndScroll() { } 70 70 virtual void didUpdateScroll() { } 71 #endif 71 72 virtual void setIsUserScroll(bool) { } 72 #endif73 73 74 74 // Functions for controlling if you can scroll past the end of the document. -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r168219 r168338 290 290 // For platforms that move underlying platform layers on a different thread for scrolling; just update the GraphicsLayer state. 291 291 virtual void syncPosition(const FloatPoint& p) { m_position = p; } 292 292 293 293 // Anchor point: (0, 0) is top left, (1, 1) is bottom right. The anchor point 294 294 // affects the origin of the transforms. … … 303 303 const FloatPoint& boundsOrigin() const { return m_boundsOrigin; } 304 304 virtual void setBoundsOrigin(const FloatPoint& origin) { m_boundsOrigin = origin; } 305 306 // For platforms that move underlying platform layers on a different thread for scrolling; just update the GraphicsLayer state. 307 virtual void syncBoundsOrigin(const FloatPoint& origin) { m_boundsOrigin = origin; } 305 308 306 309 const TransformationMatrix& transform() const { return m_transform; } -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r168227 r168338 1148 1148 FloatPoint boundsOrigin = m_boundsOrigin; 1149 1149 #if PLATFORM(IOS) 1150 // UIKit may be changing layer bounds behind our back in overflow-scroll layers, so use the layer's origin. 1151 boundsOrigin = m_layer->bounds().location(); 1150 // In WK1, UIKit may be changing layer bounds behind our back in overflow-scroll layers, so use the layer's origin. 1151 if (m_layer->isPlatformCALayerMac()) 1152 boundsOrigin = m_layer->bounds().location(); 1152 1153 #endif 1153 1154 clipRectForChildren.move(boundsOrigin.x(), boundsOrigin.y()); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r168314 r168338 925 925 926 926 if (m_owningLayer.isInUserScroll()) { 927 // If scrolling is happening externally, we don't want to touch the layer bounds origin here because that will cause 928 // jitter. Set a flag to ensure that we sync up later.927 // If scrolling is happening externally, we don't want to touch the layer bounds origin here because that will cause jitter. 928 m_scrollingLayer->syncBoundsOrigin(FloatPoint(scrollOffset.width(), scrollOffset.height())); 929 929 m_owningLayer.setRequiresScrollBoundsOriginUpdate(true); 930 930 } else { -
trunk/Source/WebKit2/ChangeLog
r168333 r168338 1 2014-05-05 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Flickery scrolling inside overflow-scrolling: touch 4 https://bugs.webkit.org/show_bug.cgi?id=132591 5 <rdar://problem/16760466> 6 7 Reviewed by Tim Horton. 8 9 Avoid triggering layer tree commits that touch the layer's boundsOrigin 10 while the user is scrolling in the UI process. 11 12 Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration" 13 flag to the ScrollingTree to say that we're in the middle of a user interaction 14 (and also to send a final non-interactive update). That gets passed along 15 to the web process, and turned into "SyncScrollingLayerPosition" update. 16 AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults 17 this, and uses it to set a flag on the ScrollableArea to say that the scroll 18 is a user scroll. 19 20 RenderLayerBacking then makes use of this (in existing code, shared with WK1) 21 to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(), 22 which updates the GraphicsLayer without touching platform layers. This is necessary 23 so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility 24 computations). 25 26 Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized 27 for WebKit1 by checking the type of platform layer. 28 29 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: 30 (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID): 31 (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion): 32 (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling): 33 (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll): 34 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: 35 * UIProcess/Scrolling/RemoteScrollingTree.cpp: 36 (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll): 37 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: 38 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: 39 (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): 40 (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): 41 (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): 42 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): 43 * WebProcess/Scrolling/RemoteScrollingCoordinator.h: 44 * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in: 45 * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: 46 (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): 47 1 48 2014-05-05 Alexey Proskuryakov <ap@apple.com> 2 49 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
r167262 r168338 57 57 } 58 58 59 WebCore::ScrollingNodeID RemoteScrollingCoordinatorProxy::rootScrollingNodeID() const59 ScrollingNodeID RemoteScrollingCoordinatorProxy::rootScrollingNodeID() const 60 60 { 61 61 if (!m_scrollingTree->rootNode()) … … 140 140 } 141 141 142 bool RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion(const WebCore::IntPoint& p) const142 bool RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion(const IntPoint& p) const 143 143 { 144 144 return m_scrollingTree->isPointInNonFastScrollableRegion(p); 145 145 } 146 146 147 void RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatRect& viewportRect, double scale)147 void RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const FloatRect& viewportRect, double scale) 148 148 { 149 149 m_scrollingTree->viewportChangedViaDelegatedScrolling(nodeID, viewportRect, scale); … … 151 151 152 152 // This comes from the scrolling tree. 153 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll( WebCore::ScrollingNodeID scrolledNodeID, const WebCore::FloatPoint& newScrollPosition)153 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction) 154 154 { 155 155 // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects() … … 158 158 return; 159 159 160 m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition ));160 m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition, scrollingLayerPositionAction)); 161 161 } 162 162 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
r167262 r168338 53 53 54 54 // Inform the web process that the scroll position changed (called from the scrolling tree) 55 void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition );55 void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, WebCore::SetOrSyncScrollingLayerPosition); 56 56 void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll); 57 57 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp
r167262 r168338 78 78 #endif 79 79 80 void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, SetOrSyncScrollingLayerPosition )80 void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction) 81 81 { 82 m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(nodeID, scrollPosition );82 m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(nodeID, scrollPosition, scrollingLayerPositionAction); 83 83 } 84 84 -
trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h
r166531 r168338 42 42 virtual ~ScrollingTreeOverflowScrollingNodeIOS(); 43 43 44 void scrollViewDidScroll(const WebCore::FloatPoint& );44 void scrollViewDidScroll(const WebCore::FloatPoint&, bool inUserInteration); 45 45 46 46 private: -
trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm
r167891 r168338 59 59 - (void)scrollViewDidScroll:(UIScrollView *)scrollView 60 60 { 61 _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset );61 _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset, _inUserInteraction); 62 62 } 63 63 … … 69 69 - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)willDecelerate 70 70 { 71 if ( !willDecelerate)71 if (_inUserInteraction && !willDecelerate) { 72 72 _inUserInteraction = NO; 73 _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset, _inUserInteraction); 74 } 73 75 } 74 76 75 77 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView 76 78 { 77 _inUserInteraction = NO; 79 if (_inUserInteraction) { 80 _inUserInteraction = NO; 81 _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset, _inUserInteraction); 82 } 78 83 } 79 84 … … 146 151 } 147 152 148 void ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll(const FloatPoint& scrollPosition )153 void ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll(const FloatPoint& scrollPosition, bool inUserInteration) 149 154 { 150 scrollingTree().scrollPositionChangedViaDelegatedScrolling(scrollingNodeID(), scrollPosition );155 scrollingTree().scrollPositionChangedViaDelegatedScrolling(scrollingNodeID(), scrollPosition, inUserInteration); 151 156 } 152 157 -
trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h
r162139 r168338 72 72 73 73 // Respond to UI process changes. 74 void scrollPositionChangedForNode(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition );74 void scrollPositionChangedForNode(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool syncLayerPosition); 75 75 76 76 WebPage* m_webPage; -
trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in
r161529 r168338 24 24 25 25 messages -> RemoteScrollingCoordinator { 26 ScrollPositionChangedForNode(uint64_t nodeID, WebCore::FloatPoint scrollPosition );26 ScrollPositionChangedForNode(uint64_t nodeID, WebCore::FloatPoint scrollPosition, bool syncLayerPosition); 27 27 } 28 28 -
trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm
r166531 r168338 92 92 93 93 // Notification from the UI process that we scrolled. 94 void RemoteScrollingCoordinator::scrollPositionChangedForNode(ScrollingNodeID nodeID, const FloatPoint& scrollPosition )94 void RemoteScrollingCoordinator::scrollPositionChangedForNode(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, bool syncLayerPosition) 95 95 { 96 scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, false /* FIXME */, SyncScrollingLayerPosition);96 scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, false /* FIXME */, syncLayerPosition ? SyncScrollingLayerPosition : SetScrollingLayerPosition); 97 97 } 98 98
Note: See TracChangeset
for help on using the changeset viewer.