Coordinated Graphics: remove the DidChangeScrollPosition message.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2013 05:29:40 +0000 (05:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2013 05:29:40 +0000 (05:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108051

Patch by Huang Dongsung <luxtella@company100.net> 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
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h
Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h

index ecaa58c5e2485015534db3946677ceb66c019d35..2919fa10ecb6141e421088d06b4a9970edf649bb 100644 (file)
@@ -1,3 +1,26 @@
+2013-02-11  Huang Dongsung  <luxtella@company100.net>
+
+        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  <rniwa@webkit.org>
 
         Disable delete button controller on non-Mac ports and delete EditorClient::shouldShowDeleteInterface
index 6281bd6eb1b194d08d67dfc1703d48d86235285b..b609736b2ec20150a7398e22d878a40c4b43cc39 100644 (file)
@@ -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<GraphicsSurface> 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);
index a3ef243a49a51c7b8b4ca7e76e1feafae8c8566b..0b8d5dbce8fd41f5831c40d2ed093c5dadc76919 100644 (file)
@@ -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<GraphicsSurface>);
     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<CoordinatedSurface>);
     void removeUpdateAtlas(uint32_t atlasID);
-    void flushLayerChanges();
+    void flushLayerChanges(const FloatPoint& scrollPosition);
     void createImageBacking(CoordinatedImageBackingID);
     void updateImageBacking(CoordinatedImageBackingID, PassRefPtr<CoordinatedSurface>);
     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;
index da68355bd3446ce742c387058b28a4e0439af390..ab31714ed77837350b2645eaaa17ad873e4c1cd2 100644 (file)
@@ -1,3 +1,38 @@
+2013-02-11  Huang Dongsung  <luxtella@company100.net>
+
+        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  <rniwa@webkit.org>
 
         Disable delete button controller on non-Mac ports and delete EditorClient::shouldShowDeleteInterface
index 4234977ba40d87c0e5b0dc8173b0656cbfd97d24..72af8035fc2627d32149a4369ef1bc0ffb68fc1d 100644 (file)
@@ -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)
 {
index c4347bb6ebbfecef5883d018a984f19975101620..e6fbf951f42c56b8bbb571550ab65b46cb22a5d5 100644 (file)
@@ -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);
index 513e8cffbac280a0c667169cccd9d61b612717a9..5ce12836bf23f0d0bc6874787f161b2a8942586c 100644 (file)
@@ -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)
 
index c3b63befc75b24a1e7cebe434206cdea74cdfe28..59e839b2c532161c3084ef3cf5141aaa0d89e432 100644 (file)
@@ -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()
index 544ea7a09b798dc2cd4c714adc81667682ebb89c..7e1d1bae043ee7b10d4beaf87ba1d2aee8893d75 100644 (file)
@@ -200,7 +200,6 @@ private:
     bool m_waitingForUIProcess;
     bool m_isSuspended;
     WebCore::FloatRect m_visibleContentsRect;
-    bool m_shouldSendScrollPositionUpdate;
 
     LayerTreeContext m_layerTreeContext;
     bool m_shouldSyncFrame;