Changeset 142578 in webkit


Ignore:
Timestamp:
Feb 11, 2013 9:29:40 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Coordinated Graphics: remove the DidChangeScrollPosition message.
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:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r142576 r142578  
     12013-02-11  Huang Dongsung  <luxtella@company100.net>
     2
     3        Coordinated Graphics: remove the DidChangeScrollPosition message.
     4        https://bugs.webkit.org/show_bug.cgi?id=108051
     5
     6        Reviewed by Noam Rosenthal.
     7        Signed off for WebKit2 by Benjamin Poulain.
     8
     9        Currently, we use the DidChangeScrollPosition message to send the scroll
     10        position that WebCore used in this frame to UI Process. We had to have
     11        some member variables for the DidChangeScrollPosition message.
     12        However, we can send a scroll position via the DidRenderFrame message,
     13        because CoordinatedGraphicsScene::m_renderedContentsScrollPosition is
     14        updated at the moment of flushing. So we can remove the
     15        DidChangeScrollPosition message and some redundant member variables.
     16
     17        No tests. No change in behavior.
     18
     19        * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
     20        (WebCore::CoordinatedGraphicsScene::flushLayerChanges):
     21        * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
     22        (CoordinatedGraphicsScene):
     23
    1242013-02-11  Ryosuke Niwa  <rniwa@webkit.org>
    225
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp

    r142524 r142578  
    231231    for (LayerRawPtrMap::iterator it = m_fixedLayers.begin(); it != end; ++it)
    232232        toTextureMapperLayer(it->value)->setScrollPositionDeltaIfNeeded(delta);
    233 }
    234 
    235 void CoordinatedGraphicsScene::didChangeScrollPosition(const FloatPoint& position)
    236 {
    237     m_pendingRenderedContentsScrollPosition = position;
    238233}
    239234
     
    574569}
    575570
    576 void CoordinatedGraphicsScene::flushLayerChanges()
    577 {
    578     m_renderedContentsScrollPosition = m_pendingRenderedContentsScrollPosition;
     571void CoordinatedGraphicsScene::flushLayerChanges(const FloatPoint& scrollPosition)
     572{
     573    m_renderedContentsScrollPosition = scrollPosition;
    579574
    580575    // Since the frame has now been rendered, we can safely unlock the animations until the next layout.
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h

    r142524 r142578  
    8787    void setContentsSize(const FloatSize&);
    8888    void setVisibleContentsRect(const FloatRect&);
    89     void didChangeScrollPosition(const FloatPoint& position);
    9089#if USE(GRAPHICS_SURFACE)
    9190    void createCanvas(CoordinatedLayerID, const IntSize&, PassRefPtr<GraphicsSurface>);
     
    122121    void createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface>);
    123122    void removeUpdateAtlas(uint32_t atlasID);
    124     void flushLayerChanges();
     123    void flushLayerChanges(const FloatPoint& scrollPosition);
    125124    void createImageBacking(CoordinatedImageBackingID);
    126125    void updateImageBacking(CoordinatedImageBackingID, PassRefPtr<CoordinatedSurface>);
     
    215214    CoordinatedLayerID m_rootLayerID;
    216215    FloatPoint m_renderedContentsScrollPosition;
    217     FloatPoint m_pendingRenderedContentsScrollPosition;
    218216    bool m_animationsLocked;
    219217#if ENABLE(REQUEST_ANIMATION_FRAME)
  • trunk/Source/WebKit2/ChangeLog

    r142576 r142578  
     12013-02-11  Huang Dongsung  <luxtella@company100.net>
     2
     3        Coordinated Graphics: remove the DidChangeScrollPosition message.
     4        https://bugs.webkit.org/show_bug.cgi?id=108051
     5
     6        Reviewed by Noam Rosenthal.
     7        Signed off for WebKit2 by Benjamin Poulain.
     8
     9        Currently, we use the DidChangeScrollPosition message to send the scroll
     10        position that WebCore used in this frame to UI Process. We had to have
     11        some member variables for the DidChangeScrollPosition message.
     12        However, we can send a scroll position via the DidRenderFrame message,
     13        because CoordinatedGraphicsScene::m_renderedContentsScrollPosition is
     14        updated at the moment of flushing. So we can remove the
     15        DidChangeScrollPosition message and some redundant member variables.
     16
     17        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
     18        (WebKit::CoordinatedLayerTreeHostProxy::didRenderFrame):
     19        (WebKit):
     20        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
     21        (CoordinatedLayerTreeHostProxy):
     22        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
     23          Remove the DidChangeScrollPosition message.
     24        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
     25        (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
     26        (WebKit::CoordinatedLayerTreeHost::flushPendingLayerChanges):
     27          Send a scroll position via the DidChangeScrollPosition message.
     28        (WebKit::CoordinatedLayerTreeHost::syncLayerState):
     29          Don't send a scroll position because flushPendingLayerChanges() does
     30          that. In addition, it is weird to check if we must send a scroll
     31          position at the moment of sending the SyncLayerState message of every
     32          layers.
     33        (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
     34        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
     35
    1362013-02-11  Ryosuke Niwa  <rniwa@webkit.org>
    237
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp

    r142160 r142578  
    132132#endif
    133133
    134 void CoordinatedLayerTreeHostProxy::didRenderFrame(const IntSize& contentsSize, const IntRect& coveredRect)
    135 {
    136     dispatchUpdate(bind(&CoordinatedGraphicsScene::flushLayerChanges, m_scene.get()));
     134void CoordinatedLayerTreeHostProxy::didRenderFrame(const FloatPoint& scrollPosition, const IntSize& contentsSize, const IntRect& coveredRect)
     135{
     136    dispatchUpdate(bind(&CoordinatedGraphicsScene::flushLayerChanges, m_scene.get(), scrollPosition));
    137137    updateViewport();
    138138#if USE(TILED_BACKING_STORE)
     
    210210#endif
    211211
    212 void CoordinatedLayerTreeHostProxy::didChangeScrollPosition(const FloatPoint& position)
    213 {
    214     dispatchUpdate(bind(&CoordinatedGraphicsScene::didChangeScrollPosition, m_scene.get(), position));
    215 }
    216 
    217212#if USE(GRAPHICS_SURFACE)
    218213void CoordinatedLayerTreeHostProxy::createCanvas(CoordinatedLayerID id, const IntSize& canvasSize, const GraphicsSurfaceToken& token)
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h

    r142160 r142578  
    6868    void setContentsSize(const WebCore::FloatSize&);
    6969    void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint& trajectoryVector);
    70     void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
     70    void didRenderFrame(const WebCore::FloatPoint& scrollPosition, const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
    7171    void createTileForLayer(WebCore::CoordinatedLayerID, uint32_t tileID, const WebCore::IntRect&, const WebCore::SurfaceUpdateInfo&);
    7272    void updateTileForLayer(WebCore::CoordinatedLayerID, uint32_t tileID, const WebCore::IntRect&, const WebCore::SurfaceUpdateInfo&);
     
    7878    void clearImageBackingContents(WebCore::CoordinatedImageBackingID);
    7979    void removeImageBacking(WebCore::CoordinatedImageBackingID);
    80     void didChangeScrollPosition(const WebCore::FloatPoint& position);
    8180#if USE(GRAPHICS_SURFACE)
    8281    void createCanvas(WebCore::CoordinatedLayerID, const WebCore::IntSize&, const WebCore::GraphicsSurfaceToken&);
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in

    r142160 r142578  
    4141    ClearImageBackingContents(uint64_t imageID)
    4242    RemoveImageBacking(uint64_t imageID)
    43     DidRenderFrame(WebCore::IntSize contentsSize, WebCore::IntRect coveredRect)
    44     DidChangeScrollPosition(WebCore::FloatPoint position)
     43    DidRenderFrame(WebCore::FloatPoint scrollPosition, WebCore::IntSize contentsSize, WebCore::IntRect coveredRect)
    4544    SetLayerAnimations(uint32_t id, WebCore::GraphicsLayerAnimations animations)
    4645    SetAnimationsLocked(bool locked)
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp

    r142143 r142578  
    8686    , m_waitingForUIProcess(true)
    8787    , m_isSuspended(false)
    88     , m_shouldSendScrollPositionUpdate(true)
    8988    , m_shouldSyncFrame(false)
    9089    , m_didInitializeRootCompositingLayer(false)
     
    293292        IntSize contentsSize = roundedIntSize(m_nonCompositedContentLayer->size());
    294293        IntRect coveredRect = toCoordinatedGraphicsLayer(m_nonCompositedContentLayer.get())->coverRect();
    295         m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DidRenderFrame(contentsSize, coveredRect));
     294        m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DidRenderFrame(m_visibleContentsRect.location(), contentsSize, coveredRect));
    296295        m_waitingForUIProcess = true;
    297296        m_shouldSyncFrame = false;
     
    353352void CoordinatedLayerTreeHost::syncLayerState(CoordinatedLayerID id, const CoordinatedLayerInfo& info)
    354353{
    355     if (m_shouldSendScrollPositionUpdate) {
    356         m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DidChangeScrollPosition(m_visibleContentsRect.location()));
    357         m_shouldSendScrollPositionUpdate = false;
    358     }
    359 
    360354    m_shouldSyncFrame = true;
    361355    m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::SetCompositingLayerState(id, info));
     
    745739        m_webPage->setFixedVisibleContentRect(roundedIntRect(rect));
    746740    }
    747 
    748     if (contentsRectDidChange)
    749         m_shouldSendScrollPositionUpdate = true;
    750741}
    751742
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h

    r142143 r142578  
    201201    bool m_isSuspended;
    202202    WebCore::FloatRect m_visibleContentsRect;
    203     bool m_shouldSendScrollPositionUpdate;
    204203
    205204    LayerTreeContext m_layerTreeContext;
Note: See TracChangeset for help on using the changeset viewer.