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
+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
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)
{
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);
#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);
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);
LayerRawPtrMap m_fixedLayers;
CoordinatedLayerID m_rootLayerID;
FloatPoint m_renderedContentsScrollPosition;
- FloatPoint m_pendingRenderedContentsScrollPosition;
bool m_animationsLocked;
#if ENABLE(REQUEST_ANIMATION_FRAME)
bool m_animationFrameRequested;
+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
}
#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);
}
#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)
{
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);
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);
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)
, m_isFlushingLayerChanges(false)
, m_waitingForUIProcess(true)
, m_isSuspended(false)
- , m_shouldSendScrollPositionUpdate(true)
, m_shouldSyncFrame(false)
, m_didInitializeRootCompositingLayer(false)
, m_layerFlushTimer(this, &CoordinatedLayerTreeHost::layerFlushTimerFired)
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
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));
}
// the same while panning. This can have nasty effects on layout.
m_webPage->setFixedVisibleContentRect(roundedIntRect(rect));
}
-
- if (contentsRectDidChange)
- m_shouldSendScrollPositionUpdate = true;
}
void CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged()
bool m_waitingForUIProcess;
bool m_isSuspended;
WebCore::FloatRect m_visibleContentsRect;
- bool m_shouldSendScrollPositionUpdate;
LayerTreeContext m_layerTreeContext;
bool m_shouldSyncFrame;