Changeset 143472 in webkit
- Timestamp:
- Feb 20, 2013, 10:10:22 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r143444 r143472 1 2013-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 1 78 2013-02-20 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 79 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r142968 r143472 391 391 } 392 392 393 m_page->drawingArea()->setNeedsDisplay (rect);393 m_page->drawingArea()->setNeedsDisplayInRect(rect); 394 394 } 395 395 … … 402 402 403 403 m_page->pageDidScroll(); 404 m_page->drawingArea()->setNeedsDisplay (rect);404 m_page->drawingArea()->setNeedsDisplayInRect(rect); 405 405 } 406 406 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r142839 r143472 1130 1130 // the view on restores from the back/forward cache. 1131 1131 if (m_frame == m_frame->page()->mainWebFrame()) 1132 m_frame->page()->drawingArea()->setNeedsDisplay( m_frame->page()->bounds());1132 m_frame->page()->drawingArea()->setNeedsDisplay(); 1133 1133 } 1134 1134 -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
r142968 r143472 178 178 } 179 179 180 void CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay(const WebCore::IntRect& rect) 180 void CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay() 181 { 182 m_nonCompositedContentLayer->setNeedsDisplay(); 183 if (m_pageOverlayLayer) 184 m_pageOverlayLayer->setNeedsDisplay(); 185 186 scheduleLayerFlush(); 187 } 188 189 void CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect& rect) 181 190 { 182 191 m_nonCompositedContentLayer->setNeedsDisplayInRect(rect); … … 189 198 void CoordinatedLayerTreeHost::scrollNonCompositedContents(const WebCore::IntRect& scrollRect) 190 199 { 191 setNonCompositedContentsNeedDisplay (scrollRect);200 setNonCompositedContentsNeedDisplayInRect(scrollRect); 192 201 } 193 202 -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h
r142968 r143472 65 65 virtual void invalidate(); 66 66 67 virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&); 67 virtual void setNonCompositedContentsNeedDisplay() OVERRIDE; 68 virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) OVERRIDE; 68 69 virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect); 69 70 virtual void forceRepaint(); -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
r142968 r143472 61 61 void didReceiveDrawingAreaMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&); 62 62 63 virtual void setNeedsDisplay(const WebCore::IntRect&) = 0; 63 virtual void setNeedsDisplay() = 0; 64 virtual void setNeedsDisplayInRect(const WebCore::IntRect&) = 0; 64 65 virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) = 0; 65 66 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
r143146 r143472 81 81 } 82 82 83 void DrawingAreaImpl::setNeedsDisplay( const IntRect& rect)83 void DrawingAreaImpl::setNeedsDisplay() 84 84 { 85 85 if (!m_isPaintingEnabled) 86 86 return; 87 87 88 if (m_layerTreeHost) { 89 ASSERT(m_dirtyRegion.isEmpty()); 90 m_layerTreeHost->setNonCompositedContentsNeedDisplay(); 91 return; 92 } 93 94 setNeedsDisplayInRect(m_webPage->bounds()); 95 } 96 97 void 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 88 108 IntRect dirtyRect = rect; 89 109 dirtyRect.intersect(m_webPage->bounds()); … … 92 112 return; 93 113 94 if (m_layerTreeHost) {95 ASSERT(m_dirtyRegion.isEmpty());96 97 m_layerTreeHost->setNonCompositedContentsNeedDisplay(dirtyRect);98 return;99 }100 101 114 if (m_webPage->mainFrameHasCustomRepresentation()) 102 115 return; … … 133 146 // The rect being scrolled is at least as large as the rect we'd like to scroll. 134 147 // Go ahead and just invalidate the scroll rect. 135 setNeedsDisplay (scrollRect);148 setNeedsDisplayInRect(scrollRect); 136 149 return; 137 150 } 138 151 139 152 // Just repaint the entire current scroll rect, we'll scroll the new rect instead. 140 setNeedsDisplay (m_scrollRect);153 setNeedsDisplayInRect(m_scrollRect); 141 154 m_scrollRect = IntRect(); 142 155 m_scrollOffset = IntSize(); … … 185 198 void DrawingAreaImpl::forceRepaint() 186 199 { 187 setNeedsDisplay( m_webPage->bounds());200 setNeedsDisplay(); 188 201 189 202 m_webPage->layoutIfNeeded(); … … 224 237 m_layerTreeHost->didUninstallPageOverlay(); 225 238 226 setNeedsDisplay( m_webPage->bounds());239 setNeedsDisplay(); 227 240 } 228 241 … … 234 247 } 235 248 236 setNeedsDisplay (rect);249 setNeedsDisplayInRect(rect); 237 250 } 238 251 … … 489 502 490 503 // FIXME: We shouldn't always repaint everything here. 491 setNeedsDisplay( m_webPage->bounds());504 setNeedsDisplay(); 492 505 493 506 #if PLATFORM(MAC) -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
r143146 r143472 52 52 53 53 // DrawingArea 54 virtual void setNeedsDisplay(const WebCore::IntRect&); 54 virtual void setNeedsDisplay() OVERRIDE; 55 virtual void setNeedsDisplayInRect(const WebCore::IntRect&) OVERRIDE; 55 56 virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta); 56 57 virtual void setLayerTreeStateIsFrozen(bool); -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
r142968 r143472 65 65 virtual void invalidate() = 0; 66 66 67 virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&) = 0; 67 virtual void setNonCompositedContentsNeedDisplay() = 0; 68 virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) = 0; 68 69 virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect) = 0; 69 70 virtual void forceRepaint() = 0; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r143428 r143472 991 991 view->resize(viewSize); 992 992 view->setNeedsLayout(); 993 m_drawingArea->setNeedsDisplay( IntRect(IntPoint(0, 0), viewSize));993 m_drawingArea->setNeedsDisplay(); 994 994 995 995 m_viewSize = viewSize; … … 1880 1880 1881 1881 m_drawingArea->pageBackgroundTransparencyChanged(); 1882 m_drawingArea->setNeedsDisplay( IntRect(IntPoint(0, 0), m_viewSize));1882 m_drawingArea->setNeedsDisplay(); 1883 1883 } 1884 1884 … … 1897 1897 1898 1898 m_drawingArea->pageBackgroundTransparencyChanged(); 1899 m_drawingArea->setNeedsDisplay( IntRect(IntPoint(0, 0), m_viewSize));1899 m_drawingArea->setNeedsDisplay(); 1900 1900 } 1901 1901 … … 2039 2039 2040 2040 // 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(); 2042 2042 } 2043 2043 -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
r142968 r143472 169 169 } 170 170 171 void LayerTreeHostGtk::setNonCompositedContentsNeedDisplay(const IntRect& rect) 171 void LayerTreeHostGtk::setNonCompositedContentsNeedDisplay() 172 { 173 m_nonCompositedContentLayer->setNeedsDisplay(); 174 if (m_pageOverlayLayer) 175 m_pageOverlayLayer->setNeedsDisplay(); 176 177 scheduleLayerFlush(); 178 } 179 180 void LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect(const IntRect& rect) 172 181 { 173 182 m_nonCompositedContentLayer->setNeedsDisplayInRect(rect); … … 180 189 void LayerTreeHostGtk::scrollNonCompositedContents(const IntRect& scrollRect) 181 190 { 182 setNonCompositedContentsNeedDisplay (scrollRect);191 setNonCompositedContentsNeedDisplayInRect(scrollRect); 183 192 } 184 193 -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h
r142968 r143472 65 65 virtual void setShouldNotifyAfterNextScheduledLayerFlush(bool); 66 66 67 virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&); 67 virtual void setNonCompositedContentsNeedDisplay() OVERRIDE; 68 virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) OVERRIDE; 68 69 virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect); 69 70 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h
r142968 r143472 51 51 virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) OVERRIDE; 52 52 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; 54 55 virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect) OVERRIDE; 55 56 virtual void forceRepaint() OVERRIDE; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm
r142968 r143472 113 113 } 114 114 115 void LayerTreeHostMac::setNonCompositedContentsNeedDisplay(const IntRect& rect) 115 void LayerTreeHostMac::setNonCompositedContentsNeedDisplay() 116 { 117 m_nonCompositedContentLayer->setNeedsDisplay(); 118 if (m_pageOverlayLayer) 119 m_pageOverlayLayer->setNeedsDisplay(); 120 121 scheduleLayerFlush(); 122 } 123 124 void LayerTreeHostMac::setNonCompositedContentsNeedDisplayInRect(const IntRect& rect) 116 125 { 117 126 m_nonCompositedContentLayer->setNeedsDisplayInRect(rect); … … 124 133 void LayerTreeHostMac::scrollNonCompositedContents(const IntRect& scrollRect) 125 134 { 126 setNonCompositedContentsNeedDisplay (scrollRect);135 setNonCompositedContentsNeedDisplayInRect(scrollRect); 127 136 } 128 137 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
r142968 r143472 43 43 44 44 // DrawingArea 45 virtual void setNeedsDisplay(const WebCore::IntRect&) OVERRIDE; 45 virtual void setNeedsDisplay() OVERRIDE; 46 virtual void setNeedsDisplayInRect(const WebCore::IntRect&) OVERRIDE; 46 47 virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) OVERRIDE; 47 48 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
r142968 r143472 48 48 } 49 49 50 void RemoteLayerTreeDrawingArea::setNeedsDisplay(const IntRect&) 50 void RemoteLayerTreeDrawingArea::setNeedsDisplay() 51 { 52 } 53 54 void RemoteLayerTreeDrawingArea::setNeedsDisplayInRect(const IntRect&) 51 55 { 52 56 } -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r142968 r143472 56 56 57 57 // DrawingArea 58 virtual void setNeedsDisplay(const WebCore::IntRect&) OVERRIDE; 58 virtual void setNeedsDisplay() OVERRIDE; 59 virtual void setNeedsDisplayInRect(const WebCore::IntRect&) OVERRIDE; 59 60 virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) OVERRIDE; 60 61 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r142968 r143472 101 101 } 102 102 103 void TiledCoreAnimationDrawingArea::setNeedsDisplay(const IntRect& rect) 103 void TiledCoreAnimationDrawingArea::setNeedsDisplay() 104 { 105 } 106 107 void TiledCoreAnimationDrawingArea::setNeedsDisplayInRect(const IntRect& rect) 104 108 { 105 109 }
Note:
See TracChangeset
for help on using the changeset viewer.