Changeset 143472 in webkit


Ignore:
Timestamp:
Feb 20, 2013 10:10:22 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[WK2] add setNeedsDisplay in DrawingArea to mark whole layer as dirty.
https://bugs.webkit.org/show_bug.cgi?id=110299

Patch by Huang Dongsung <luxtella@company100.net> on 2013-02-20
Reviewed by Anders Carlsson.

Currently, we call setNeedsDisplay with the size of WebPage to mark whole
backing store as dirty. However, the size of non compositing layer can be
inconsistent with the size of WebPage. For example, in Coordinated Graphics, the
size of non compositing layer is contents size.

So, WebPage should not assume the size of non compositing layer, and should just
call setNeedsDisplay when marking whole layer as dirty.

In addition, this patch renames from setNeedsDisplay() with a rect argument to
setNeedsDisplayInRect(), which matches to the terms of GraphicsLayer.

  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::invalidateContentsAndRootView):
(WebKit::WebChromeClient::invalidateContentsForSlowScroll):

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::restoreViewState):

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:

(WebKit::CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay):
(WebKit):
(WebKit::CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplayInRect):
(WebKit::CoordinatedLayerTreeHost::scrollNonCompositedContents):

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:

(CoordinatedLayerTreeHost):

  • WebProcess/WebPage/DrawingArea.h:

(DrawingArea):

  • WebProcess/WebPage/DrawingAreaImpl.cpp:

(WebKit::DrawingAreaImpl::setNeedsDisplay):
(WebKit):
(WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
(WebKit::DrawingAreaImpl::scroll):
(WebKit::DrawingAreaImpl::forceRepaint):
(WebKit::DrawingAreaImpl::didUninstallPageOverlay):
(WebKit::DrawingAreaImpl::setPageOverlayNeedsDisplay):
(WebKit::DrawingAreaImpl::resumePainting):

  • WebProcess/WebPage/DrawingAreaImpl.h:

(DrawingAreaImpl):

  • WebProcess/WebPage/LayerTreeHost.h:

(LayerTreeHost):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::setSize):
(WebKit::WebPage::setDrawsBackground):
(WebKit::WebPage::setDrawsTransparentBackground):
(WebKit::WebPage::resumeActiveDOMObjectsAndAnimations):

  • WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:

(WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay):
(WebKit):
(WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect):
(WebKit::LayerTreeHostGtk::scrollNonCompositedContents):

  • WebProcess/WebPage/gtk/LayerTreeHostGtk.h:

(LayerTreeHostGtk):

  • WebProcess/WebPage/mac/LayerTreeHostMac.h:

(LayerTreeHostMac):

  • WebProcess/WebPage/mac/LayerTreeHostMac.mm:

(WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplay):
(WebKit):
(WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplayInRect):
(WebKit::LayerTreeHostMac::scrollNonCompositedContents):

  • WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:

(RemoteLayerTreeDrawingArea):

  • WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:

(WebKit::RemoteLayerTreeDrawingArea::setNeedsDisplay):
(WebKit):
(WebKit::RemoteLayerTreeDrawingArea::setNeedsDisplayInRect):

  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:

(TiledCoreAnimationDrawingArea):

  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::setNeedsDisplay):
(WebKit):
(WebKit::TiledCoreAnimationDrawingArea::setNeedsDisplayInRect):

Location:
trunk/Source/WebKit2
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r143444 r143472  
     12013-02-20  Huang Dongsung  <luxtella@company100.net>
     2
     3        [WK2] add setNeedsDisplay in DrawingArea to mark whole layer as dirty.
     4        https://bugs.webkit.org/show_bug.cgi?id=110299
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Currently, we call setNeedsDisplay with the size of WebPage to mark whole
     9        backing store as dirty. However, the size of non compositing layer can be
     10        inconsistent with the size of WebPage. For example, in Coordinated Graphics, the
     11        size of non compositing layer is contents size.
     12
     13        So, WebPage should not assume the size of non compositing layer, and should just
     14        call setNeedsDisplay when marking whole layer as dirty.
     15
     16        In addition, this patch renames from setNeedsDisplay() with a rect argument to
     17        setNeedsDisplayInRect(), which matches to the terms of GraphicsLayer.
     18
     19        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     20        (WebKit::WebChromeClient::invalidateContentsAndRootView):
     21        (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
     22        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     23        (WebKit::WebFrameLoaderClient::restoreViewState):
     24        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
     25        (WebKit::CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay):
     26        (WebKit):
     27        (WebKit::CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplayInRect):
     28        (WebKit::CoordinatedLayerTreeHost::scrollNonCompositedContents):
     29        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
     30        (CoordinatedLayerTreeHost):
     31        * WebProcess/WebPage/DrawingArea.h:
     32        (DrawingArea):
     33        * WebProcess/WebPage/DrawingAreaImpl.cpp:
     34        (WebKit::DrawingAreaImpl::setNeedsDisplay):
     35        (WebKit):
     36        (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
     37        (WebKit::DrawingAreaImpl::scroll):
     38        (WebKit::DrawingAreaImpl::forceRepaint):
     39        (WebKit::DrawingAreaImpl::didUninstallPageOverlay):
     40        (WebKit::DrawingAreaImpl::setPageOverlayNeedsDisplay):
     41        (WebKit::DrawingAreaImpl::resumePainting):
     42        * WebProcess/WebPage/DrawingAreaImpl.h:
     43        (DrawingAreaImpl):
     44        * WebProcess/WebPage/LayerTreeHost.h:
     45        (LayerTreeHost):
     46        * WebProcess/WebPage/WebPage.cpp:
     47        (WebKit::WebPage::setSize):
     48        (WebKit::WebPage::setDrawsBackground):
     49        (WebKit::WebPage::setDrawsTransparentBackground):
     50        (WebKit::WebPage::resumeActiveDOMObjectsAndAnimations):
     51        * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
     52        (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay):
     53        (WebKit):
     54        (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect):
     55        (WebKit::LayerTreeHostGtk::scrollNonCompositedContents):
     56        * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
     57        (LayerTreeHostGtk):
     58        * WebProcess/WebPage/mac/LayerTreeHostMac.h:
     59        (LayerTreeHostMac):
     60        * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
     61        (WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplay):
     62        (WebKit):
     63        (WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplayInRect):
     64        (WebKit::LayerTreeHostMac::scrollNonCompositedContents):
     65        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
     66        (RemoteLayerTreeDrawingArea):
     67        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
     68        (WebKit::RemoteLayerTreeDrawingArea::setNeedsDisplay):
     69        (WebKit):
     70        (WebKit::RemoteLayerTreeDrawingArea::setNeedsDisplayInRect):
     71        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
     72        (TiledCoreAnimationDrawingArea):
     73        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     74        (WebKit::TiledCoreAnimationDrawingArea::setNeedsDisplay):
     75        (WebKit):
     76        (WebKit::TiledCoreAnimationDrawingArea::setNeedsDisplayInRect):
     77
    1782013-02-20  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    279
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r142968 r143472  
    391391    }
    392392
    393     m_page->drawingArea()->setNeedsDisplay(rect);
     393    m_page->drawingArea()->setNeedsDisplayInRect(rect);
    394394}
    395395
     
    402402
    403403    m_page->pageDidScroll();
    404     m_page->drawingArea()->setNeedsDisplay(rect);
     404    m_page->drawingArea()->setNeedsDisplayInRect(rect);
    405405}
    406406
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r142839 r143472  
    11301130    // the view on restores from the back/forward cache.
    11311131    if (m_frame == m_frame->page()->mainWebFrame())
    1132         m_frame->page()->drawingArea()->setNeedsDisplay(m_frame->page()->bounds());
     1132        m_frame->page()->drawingArea()->setNeedsDisplay();
    11331133}
    11341134
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp

    r142968 r143472  
    178178}
    179179
    180 void CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay(const WebCore::IntRect& rect)
     180void CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay()
     181{
     182    m_nonCompositedContentLayer->setNeedsDisplay();
     183    if (m_pageOverlayLayer)
     184        m_pageOverlayLayer->setNeedsDisplay();
     185
     186    scheduleLayerFlush();
     187}
     188
     189void CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect& rect)
    181190{
    182191    m_nonCompositedContentLayer->setNeedsDisplayInRect(rect);
     
    189198void CoordinatedLayerTreeHost::scrollNonCompositedContents(const WebCore::IntRect& scrollRect)
    190199{
    191     setNonCompositedContentsNeedDisplay(scrollRect);
     200    setNonCompositedContentsNeedDisplayInRect(scrollRect);
    192201}
    193202
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h

    r142968 r143472  
    6565    virtual void invalidate();
    6666
    67     virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&);
     67    virtual void setNonCompositedContentsNeedDisplay() OVERRIDE;
     68    virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) OVERRIDE;
    6869    virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect);
    6970    virtual void forceRepaint();
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h

    r142968 r143472  
    6161    void didReceiveDrawingAreaMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&);
    6262
    63     virtual void setNeedsDisplay(const WebCore::IntRect&) = 0;
     63    virtual void setNeedsDisplay() = 0;
     64    virtual void setNeedsDisplayInRect(const WebCore::IntRect&) = 0;
    6465    virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) = 0;
    6566
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp

    r143146 r143472  
    8181}
    8282
    83 void DrawingAreaImpl::setNeedsDisplay(const IntRect& rect)
     83void DrawingAreaImpl::setNeedsDisplay()
    8484{
    8585    if (!m_isPaintingEnabled)
    8686        return;
    8787
     88    if (m_layerTreeHost) {
     89        ASSERT(m_dirtyRegion.isEmpty());
     90        m_layerTreeHost->setNonCompositedContentsNeedDisplay();
     91        return;
     92    }
     93
     94    setNeedsDisplayInRect(m_webPage->bounds());
     95}
     96
     97void DrawingAreaImpl::setNeedsDisplayInRect(const IntRect& rect)
     98{
     99    if (!m_isPaintingEnabled)
     100        return;
     101
     102    if (m_layerTreeHost) {
     103        ASSERT(m_dirtyRegion.isEmpty());
     104        m_layerTreeHost->setNonCompositedContentsNeedDisplayInRect(rect);
     105        return;
     106    }
     107   
    88108    IntRect dirtyRect = rect;
    89109    dirtyRect.intersect(m_webPage->bounds());
     
    92112        return;
    93113
    94     if (m_layerTreeHost) {
    95         ASSERT(m_dirtyRegion.isEmpty());
    96 
    97         m_layerTreeHost->setNonCompositedContentsNeedDisplay(dirtyRect);
    98         return;
    99     }
    100    
    101114    if (m_webPage->mainFrameHasCustomRepresentation())
    102115        return;
     
    133146            // The rect being scrolled is at least as large as the rect we'd like to scroll.
    134147            // Go ahead and just invalidate the scroll rect.
    135             setNeedsDisplay(scrollRect);
     148            setNeedsDisplayInRect(scrollRect);
    136149            return;
    137150        }
    138151
    139152        // Just repaint the entire current scroll rect, we'll scroll the new rect instead.
    140         setNeedsDisplay(m_scrollRect);
     153        setNeedsDisplayInRect(m_scrollRect);
    141154        m_scrollRect = IntRect();
    142155        m_scrollOffset = IntSize();
     
    185198void DrawingAreaImpl::forceRepaint()
    186199{
    187     setNeedsDisplay(m_webPage->bounds());
     200    setNeedsDisplay();
    188201
    189202    m_webPage->layoutIfNeeded();
     
    224237        m_layerTreeHost->didUninstallPageOverlay();
    225238
    226     setNeedsDisplay(m_webPage->bounds());
     239    setNeedsDisplay();
    227240}
    228241
     
    234247    }
    235248
    236     setNeedsDisplay(rect);
     249    setNeedsDisplayInRect(rect);
    237250}
    238251
     
    489502
    490503    // FIXME: We shouldn't always repaint everything here.
    491     setNeedsDisplay(m_webPage->bounds());
     504    setNeedsDisplay();
    492505
    493506#if PLATFORM(MAC)
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h

    r143146 r143472  
    5252
    5353    // DrawingArea
    54     virtual void setNeedsDisplay(const WebCore::IntRect&);
     54    virtual void setNeedsDisplay() OVERRIDE;
     55    virtual void setNeedsDisplayInRect(const WebCore::IntRect&) OVERRIDE;
    5556    virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta);
    5657    virtual void setLayerTreeStateIsFrozen(bool);
  • trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h

    r142968 r143472  
    6565    virtual void invalidate() = 0;
    6666
    67     virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&) = 0;
     67    virtual void setNonCompositedContentsNeedDisplay() = 0;
     68    virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) = 0;
    6869    virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect) = 0;
    6970    virtual void forceRepaint() = 0;
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r143428 r143472  
    991991    view->resize(viewSize);
    992992    view->setNeedsLayout();
    993     m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), viewSize));
     993    m_drawingArea->setNeedsDisplay();
    994994   
    995995    m_viewSize = viewSize;
     
    18801880
    18811881    m_drawingArea->pageBackgroundTransparencyChanged();
    1882     m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), m_viewSize));
     1882    m_drawingArea->setNeedsDisplay();
    18831883}
    18841884
     
    18971897
    18981898    m_drawingArea->pageBackgroundTransparencyChanged();
    1899     m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), m_viewSize));
     1899    m_drawingArea->setNeedsDisplay();
    19001900}
    19011901
     
    20392039
    20402040    // We need to repaint on resume to kickstart animated painting again.
    2041     m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), m_viewSize));
     2041    m_drawingArea->setNeedsDisplay();
    20422042}
    20432043
  • trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp

    r142968 r143472  
    169169}
    170170
    171 void LayerTreeHostGtk::setNonCompositedContentsNeedDisplay(const IntRect& rect)
     171void LayerTreeHostGtk::setNonCompositedContentsNeedDisplay()
     172{
     173    m_nonCompositedContentLayer->setNeedsDisplay();
     174    if (m_pageOverlayLayer)
     175        m_pageOverlayLayer->setNeedsDisplay();
     176
     177    scheduleLayerFlush();
     178}
     179
     180void LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect(const IntRect& rect)
    172181{
    173182    m_nonCompositedContentLayer->setNeedsDisplayInRect(rect);
     
    180189void LayerTreeHostGtk::scrollNonCompositedContents(const IntRect& scrollRect)
    181190{
    182     setNonCompositedContentsNeedDisplay(scrollRect);
     191    setNonCompositedContentsNeedDisplayInRect(scrollRect);
    183192}
    184193
  • trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h

    r142968 r143472  
    6565    virtual void setShouldNotifyAfterNextScheduledLayerFlush(bool);
    6666
    67     virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&);
     67    virtual void setNonCompositedContentsNeedDisplay() OVERRIDE;
     68    virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) OVERRIDE;
    6869    virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect);
    6970
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h

    r142968 r143472  
    5151    virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) OVERRIDE;
    5252    virtual void invalidate() OVERRIDE;
    53     virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&) OVERRIDE;
     53    virtual void setNonCompositedContentsNeedDisplay() OVERRIDE;
     54    virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) OVERRIDE;
    5455    virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect) OVERRIDE;
    5556    virtual void forceRepaint() OVERRIDE;
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm

    r142968 r143472  
    113113}
    114114
    115 void LayerTreeHostMac::setNonCompositedContentsNeedDisplay(const IntRect& rect)
     115void LayerTreeHostMac::setNonCompositedContentsNeedDisplay()
     116{
     117    m_nonCompositedContentLayer->setNeedsDisplay();
     118    if (m_pageOverlayLayer)
     119        m_pageOverlayLayer->setNeedsDisplay();
     120
     121    scheduleLayerFlush();
     122}
     123
     124void LayerTreeHostMac::setNonCompositedContentsNeedDisplayInRect(const IntRect& rect)
    116125{
    117126    m_nonCompositedContentLayer->setNeedsDisplayInRect(rect);
     
    124133void LayerTreeHostMac::scrollNonCompositedContents(const IntRect& scrollRect)
    125134{
    126     setNonCompositedContentsNeedDisplay(scrollRect);
     135    setNonCompositedContentsNeedDisplayInRect(scrollRect);
    127136}
    128137
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h

    r142968 r143472  
    4343
    4444    // DrawingArea
    45     virtual void setNeedsDisplay(const WebCore::IntRect&) OVERRIDE;
     45    virtual void setNeedsDisplay() OVERRIDE;
     46    virtual void setNeedsDisplayInRect(const WebCore::IntRect&) OVERRIDE;
    4647    virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) OVERRIDE;
    4748
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm

    r142968 r143472  
    4848}
    4949
    50 void RemoteLayerTreeDrawingArea::setNeedsDisplay(const IntRect&)
     50void RemoteLayerTreeDrawingArea::setNeedsDisplay()
     51{
     52}
     53
     54void RemoteLayerTreeDrawingArea::setNeedsDisplayInRect(const IntRect&)
    5155{
    5256}
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h

    r142968 r143472  
    5656
    5757    // DrawingArea
    58     virtual void setNeedsDisplay(const WebCore::IntRect&) OVERRIDE;
     58    virtual void setNeedsDisplay() OVERRIDE;
     59    virtual void setNeedsDisplayInRect(const WebCore::IntRect&) OVERRIDE;
    5960    virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) OVERRIDE;
    6061
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r142968 r143472  
    101101}
    102102
    103 void TiledCoreAnimationDrawingArea::setNeedsDisplay(const IntRect& rect)
     103void TiledCoreAnimationDrawingArea::setNeedsDisplay()
     104{
     105}
     106
     107void TiledCoreAnimationDrawingArea::setNeedsDisplayInRect(const IntRect& rect)
    104108{
    105109}
Note: See TracChangeset for help on using the changeset viewer.