From ca57908c481b58c04cb7e659fb54f3c25df9ffdc Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Tue, 12 Feb 2013 05:29:40 +0000 Subject: [PATCH] Coordinated Graphics: remove the DidChangeScrollPosition message. https://bugs.webkit.org/show_bug.cgi?id=108051 Patch by Huang Dongsung on 2013-02-11 Reviewed by Noam Rosenthal. Signed off for WebKit2 by Benjamin Poulain. Currently, we use the DidChangeScrollPosition message to send the scroll position that WebCore used in this frame to UI Process. We had to have some member variables for the DidChangeScrollPosition message. However, we can send a scroll position via the DidRenderFrame message, because CoordinatedGraphicsScene::m_renderedContentsScrollPosition is updated at the moment of flushing. So we can remove the DidChangeScrollPosition message and some redundant member variables. Source/WebCore: No tests. No change in behavior. * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp: (WebCore::CoordinatedGraphicsScene::flushLayerChanges): * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h: (CoordinatedGraphicsScene): Source/WebKit2: * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp: (WebKit::CoordinatedLayerTreeHostProxy::didRenderFrame): (WebKit): * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: (CoordinatedLayerTreeHostProxy): * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in: Remove the DidChangeScrollPosition message. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): (WebKit::CoordinatedLayerTreeHost::flushPendingLayerChanges): Send a scroll position via the DidChangeScrollPosition message. (WebKit::CoordinatedLayerTreeHost::syncLayerState): Don't send a scroll position because flushPendingLayerChanges() does that. In addition, it is weird to check if we must send a scroll position at the moment of sending the SyncLayerState message of every layers. (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142578 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 23 ++++++++++++ .../coordinated/CoordinatedGraphicsScene.cpp | 9 ++--- .../coordinated/CoordinatedGraphicsScene.h | 4 +-- Source/WebKit2/ChangeLog | 35 +++++++++++++++++++ .../CoordinatedLayerTreeHostProxy.cpp | 9 ++--- .../CoordinatedLayerTreeHostProxy.h | 3 +- .../CoordinatedLayerTreeHostProxy.messages.in | 3 +- .../CoordinatedLayerTreeHost.cpp | 11 +----- .../CoordinatedLayerTreeHost.h | 1 - 9 files changed, 66 insertions(+), 32 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index ecaa58c5e248..2919fa10ecb6 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,26 @@ +2013-02-11 Huang Dongsung + + Coordinated Graphics: remove the DidChangeScrollPosition message. + https://bugs.webkit.org/show_bug.cgi?id=108051 + + Reviewed by Noam Rosenthal. + Signed off for WebKit2 by Benjamin Poulain. + + Currently, we use the DidChangeScrollPosition message to send the scroll + position that WebCore used in this frame to UI Process. We had to have + some member variables for the DidChangeScrollPosition message. + However, we can send a scroll position via the DidRenderFrame message, + because CoordinatedGraphicsScene::m_renderedContentsScrollPosition is + updated at the moment of flushing. So we can remove the + DidChangeScrollPosition message and some redundant member variables. + + No tests. No change in behavior. + + * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp: + (WebCore::CoordinatedGraphicsScene::flushLayerChanges): + * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h: + (CoordinatedGraphicsScene): + 2013-02-11 Ryosuke Niwa Disable delete button controller on non-Mac ports and delete EditorClient::shouldShowDeleteInterface diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp index 6281bd6eb1b1..b609736b2ec2 100644 --- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp +++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp @@ -232,11 +232,6 @@ void CoordinatedGraphicsScene::adjustPositionForFixedLayers() toTextureMapperLayer(it->value)->setScrollPositionDeltaIfNeeded(delta); } -void CoordinatedGraphicsScene::didChangeScrollPosition(const FloatPoint& position) -{ - m_pendingRenderedContentsScrollPosition = position; -} - #if USE(GRAPHICS_SURFACE) void CoordinatedGraphicsScene::createCanvas(CoordinatedLayerID id, const IntSize&, PassRefPtr surface) { @@ -573,9 +568,9 @@ void CoordinatedGraphicsScene::commitPendingBackingStoreOperations() m_backingStoresWithPendingBuffers.clear(); } -void CoordinatedGraphicsScene::flushLayerChanges() +void CoordinatedGraphicsScene::flushLayerChanges(const FloatPoint& scrollPosition) { - m_renderedContentsScrollPosition = m_pendingRenderedContentsScrollPosition; + m_renderedContentsScrollPosition = scrollPosition; // Since the frame has now been rendered, we can safely unlock the animations until the next layout. setAnimationsLocked(false); diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h index a3ef243a49a5..0b8d5dbce8fd 100644 --- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h +++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h @@ -86,7 +86,6 @@ public: #endif void setContentsSize(const FloatSize&); void setVisibleContentsRect(const FloatRect&); - void didChangeScrollPosition(const FloatPoint& position); #if USE(GRAPHICS_SURFACE) void createCanvas(CoordinatedLayerID, const IntSize&, PassRefPtr); void syncCanvas(CoordinatedLayerID, uint32_t frontBuffer); @@ -121,7 +120,7 @@ public: void updateTile(CoordinatedLayerID, uint32_t tileID, const TileUpdate&); void createUpdateAtlas(uint32_t atlasID, PassRefPtr); void removeUpdateAtlas(uint32_t atlasID); - void flushLayerChanges(); + void flushLayerChanges(const FloatPoint& scrollPosition); void createImageBacking(CoordinatedImageBackingID); void updateImageBacking(CoordinatedImageBackingID, PassRefPtr); void clearImageBackingContents(CoordinatedImageBackingID); @@ -214,7 +213,6 @@ private: LayerRawPtrMap m_fixedLayers; CoordinatedLayerID m_rootLayerID; FloatPoint m_renderedContentsScrollPosition; - FloatPoint m_pendingRenderedContentsScrollPosition; bool m_animationsLocked; #if ENABLE(REQUEST_ANIMATION_FRAME) bool m_animationFrameRequested; diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index da68355bd344..ab31714ed778 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,38 @@ +2013-02-11 Huang Dongsung + + Coordinated Graphics: remove the DidChangeScrollPosition message. + https://bugs.webkit.org/show_bug.cgi?id=108051 + + Reviewed by Noam Rosenthal. + Signed off for WebKit2 by Benjamin Poulain. + + Currently, we use the DidChangeScrollPosition message to send the scroll + position that WebCore used in this frame to UI Process. We had to have + some member variables for the DidChangeScrollPosition message. + However, we can send a scroll position via the DidRenderFrame message, + because CoordinatedGraphicsScene::m_renderedContentsScrollPosition is + updated at the moment of flushing. So we can remove the + DidChangeScrollPosition message and some redundant member variables. + + * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp: + (WebKit::CoordinatedLayerTreeHostProxy::didRenderFrame): + (WebKit): + * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: + (CoordinatedLayerTreeHostProxy): + * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in: + Remove the DidChangeScrollPosition message. + * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: + (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): + (WebKit::CoordinatedLayerTreeHost::flushPendingLayerChanges): + Send a scroll position via the DidChangeScrollPosition message. + (WebKit::CoordinatedLayerTreeHost::syncLayerState): + Don't send a scroll position because flushPendingLayerChanges() does + that. In addition, it is weird to check if we must send a scroll + position at the moment of sending the SyncLayerState message of every + layers. + (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect): + * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: + 2013-02-11 Ryosuke Niwa Disable delete button controller on non-Mac ports and delete EditorClient::shouldShowDeleteInterface diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp index 4234977ba40d..72af8035fc26 100644 --- a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp +++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp @@ -131,9 +131,9 @@ void CoordinatedLayerTreeHostProxy::createCustomFilterProgram(int id, const Cust } #endif -void CoordinatedLayerTreeHostProxy::didRenderFrame(const IntSize& contentsSize, const IntRect& coveredRect) +void CoordinatedLayerTreeHostProxy::didRenderFrame(const FloatPoint& scrollPosition, const IntSize& contentsSize, const IntRect& coveredRect) { - dispatchUpdate(bind(&CoordinatedGraphicsScene::flushLayerChanges, m_scene.get())); + dispatchUpdate(bind(&CoordinatedGraphicsScene::flushLayerChanges, m_scene.get(), scrollPosition)); updateViewport(); #if USE(TILED_BACKING_STORE) m_drawingAreaProxy->page()->didRenderFrame(contentsSize, coveredRect); @@ -209,11 +209,6 @@ void CoordinatedLayerTreeHostProxy::animationFrameReady() } #endif -void CoordinatedLayerTreeHostProxy::didChangeScrollPosition(const FloatPoint& position) -{ - dispatchUpdate(bind(&CoordinatedGraphicsScene::didChangeScrollPosition, m_scene.get(), position)); -} - #if USE(GRAPHICS_SURFACE) void CoordinatedLayerTreeHostProxy::createCanvas(CoordinatedLayerID id, const IntSize& canvasSize, const GraphicsSurfaceToken& token) { diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h index c4347bb6ebbf..e6fbf951f42c 100644 --- a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h +++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h @@ -67,7 +67,7 @@ public: void setRootCompositingLayer(WebCore::CoordinatedLayerID); void setContentsSize(const WebCore::FloatSize&); void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint& trajectoryVector); - void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect); + void didRenderFrame(const WebCore::FloatPoint& scrollPosition, const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect); void createTileForLayer(WebCore::CoordinatedLayerID, uint32_t tileID, const WebCore::IntRect&, const WebCore::SurfaceUpdateInfo&); void updateTileForLayer(WebCore::CoordinatedLayerID, uint32_t tileID, const WebCore::IntRect&, const WebCore::SurfaceUpdateInfo&); void removeTileForLayer(WebCore::CoordinatedLayerID, uint32_t tileID); @@ -77,7 +77,6 @@ public: void updateImageBacking(WebCore::CoordinatedImageBackingID, const WebCoordinatedSurface::Handle&); void clearImageBackingContents(WebCore::CoordinatedImageBackingID); void removeImageBacking(WebCore::CoordinatedImageBackingID); - void didChangeScrollPosition(const WebCore::FloatPoint& position); #if USE(GRAPHICS_SURFACE) void createCanvas(WebCore::CoordinatedLayerID, const WebCore::IntSize&, const WebCore::GraphicsSurfaceToken&); void syncCanvas(WebCore::CoordinatedLayerID, uint32_t frontBuffer); diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in index 513e8cffbac2..5ce12836bf23 100644 --- a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in +++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in @@ -40,8 +40,7 @@ messages -> CoordinatedLayerTreeHostProxy { UpdateImageBacking(uint64_t imageID, WebKit::WebCoordinatedSurface::Handle handle) ClearImageBackingContents(uint64_t imageID) RemoveImageBacking(uint64_t imageID) - DidRenderFrame(WebCore::IntSize contentsSize, WebCore::IntRect coveredRect) - DidChangeScrollPosition(WebCore::FloatPoint position) + DidRenderFrame(WebCore::FloatPoint scrollPosition, WebCore::IntSize contentsSize, WebCore::IntRect coveredRect) SetLayerAnimations(uint32_t id, WebCore::GraphicsLayerAnimations animations) SetAnimationsLocked(bool locked) diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp index c3b63befc75b..59e839b2c532 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp @@ -85,7 +85,6 @@ CoordinatedLayerTreeHost::CoordinatedLayerTreeHost(WebPage* webPage) , m_isFlushingLayerChanges(false) , m_waitingForUIProcess(true) , m_isSuspended(false) - , m_shouldSendScrollPositionUpdate(true) , m_shouldSyncFrame(false) , m_didInitializeRootCompositingLayer(false) , m_layerFlushTimer(this, &CoordinatedLayerTreeHost::layerFlushTimerFired) @@ -292,7 +291,7 @@ bool CoordinatedLayerTreeHost::flushPendingLayerChanges() IntSize contentsSize = roundedIntSize(m_nonCompositedContentLayer->size()); IntRect coveredRect = toCoordinatedGraphicsLayer(m_nonCompositedContentLayer.get())->coverRect(); - m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DidRenderFrame(contentsSize, coveredRect)); + m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DidRenderFrame(m_visibleContentsRect.location(), contentsSize, coveredRect)); m_waitingForUIProcess = true; m_shouldSyncFrame = false; } else @@ -352,11 +351,6 @@ void CoordinatedLayerTreeHost::initializeRootCompositingLayerIfNeeded() void CoordinatedLayerTreeHost::syncLayerState(CoordinatedLayerID id, const CoordinatedLayerInfo& info) { - if (m_shouldSendScrollPositionUpdate) { - m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DidChangeScrollPosition(m_visibleContentsRect.location())); - m_shouldSendScrollPositionUpdate = false; - } - m_shouldSyncFrame = true; m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::SetCompositingLayerState(id, info)); } @@ -744,9 +738,6 @@ void CoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect& rect, con // the same while panning. This can have nasty effects on layout. m_webPage->setFixedVisibleContentRect(roundedIntRect(rect)); } - - if (contentsRectDidChange) - m_shouldSendScrollPositionUpdate = true; } void CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged() diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h index 544ea7a09b79..7e1d1bae043e 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h @@ -200,7 +200,6 @@ private: bool m_waitingForUIProcess; bool m_isSuspended; WebCore::FloatRect m_visibleContentsRect; - bool m_shouldSendScrollPositionUpdate; LayerTreeContext m_layerTreeContext; bool m_shouldSyncFrame; -- 2.36.0