Changeset 109788 in webkit
- Timestamp:
- Mar 5, 2012 1:10:23 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109787 r109788 1 2012-03-05 Anders Carlsson <andersca@apple.com> 2 3 Let RenderLayerCompositor set the tile cache visible rect 4 https://bugs.webkit.org/show_bug.cgi?id=80317 5 6 Reviewed by Simon Fraser. 7 8 We can't compute the visible rect from CALayers, because that breaks when we're updating 9 the scroll layer position on the main thread (since by the time visibleRectChanged() is called, 10 the CALayers won't yet have been updated). 11 12 * platform/graphics/GraphicsLayer.h: 13 (WebCore::GraphicsLayer::visibleRectChanged): 14 * platform/graphics/ca/GraphicsLayerCA.cpp: 15 (WebCore::GraphicsLayerCA::visibleRectChanged): 16 * platform/graphics/ca/GraphicsLayerCA.h: 17 (GraphicsLayerCA): 18 * platform/graphics/ca/PlatformCALayer.h: 19 (PlatformCALayer): 20 * platform/graphics/ca/mac/PlatformCALayerMac.mm: 21 (PlatformCALayer::visibleRectChanged): 22 * platform/graphics/ca/mac/TileCache.h: 23 (TileCache): 24 * platform/graphics/ca/mac/TileCache.mm: 25 (WebCore::TileCache::visibleRectChanged): 26 (WebCore::TileCache::revalidateTiles): 27 * platform/graphics/ca/mac/WebTileCacheLayer.h: 28 (WebCore): 29 * platform/graphics/ca/mac/WebTileCacheLayer.mm: 30 (-[WebTileCacheLayer visibleRectChanged:]): 31 * platform/graphics/ca/win/PlatformCALayerWin.cpp: 32 (PlatformCALayer::visibleRectChanged): 33 * rendering/RenderLayerCompositor.cpp: 34 (WebCore::RenderLayerCompositor::frameViewDidScroll): 35 1 36 2012-03-05 Kangil Han <kangil.han@samsung.com> 2 37 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r107422 r109788 429 429 430 430 // Called whenever the visible rect of the given GraphicsLayer changed. 431 virtual void visibleRectChanged( ) { }431 virtual void visibleRectChanged(const IntRect&) { } 432 432 433 433 #if PLATFORM(QT) || PLATFORM(GTK) -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r107657 r109788 860 860 } 861 861 862 void GraphicsLayerCA::visibleRectChanged( )863 { 864 m_layer->visibleRectChanged( );862 void GraphicsLayerCA::visibleRectChanged(const IntRect& visibleRect) 863 { 864 m_layer->visibleRectChanged(visibleRect); 865 865 } 866 866 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r107422 r109788 135 135 virtual void syncCompositingStateForThisLayerOnly(); 136 136 137 virtual void visibleRectChanged( ) OVERRIDE;137 virtual void visibleRectChanged(const IntRect&) OVERRIDE; 138 138 139 139 bool allowTiledLayer() const { return m_allowTiledLayer; } -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r106385 r109788 204 204 void setContentsScale(float); 205 205 206 void visibleRectChanged( );206 void visibleRectChanged(const IntRect&); 207 207 208 208 #if PLATFORM(WIN) -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r106385 r109788 957 957 } 958 958 959 void PlatformCALayer::visibleRectChanged( )959 void PlatformCALayer::visibleRectChanged(const IntRect& visibleRect) 960 960 { 961 961 if (m_layerType != LayerTypeTileCacheLayer) … … 963 963 964 964 WebTileCacheLayer *tileCacheLayer = static_cast<WebTileCacheLayer *>(m_layer.get()); 965 [tileCacheLayer visibleRectChanged ];965 [tileCacheLayer visibleRectChanged:visibleRect]; 966 966 } 967 967 -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h
r108397 r109788 63 63 64 64 CALayer *tileContainerLayer() const { return m_tileContainerLayer.get(); } 65 void visibleRectChanged( );65 void visibleRectChanged(const IntRect&); 66 66 67 67 float tileDebugBorderWidth() const { return m_tileDebugBorderWidth; } … … 76 76 TileCache(WebTileCacheLayer*, const IntSize& tileSize); 77 77 78 FloatRect visibleRect() const;79 78 IntRect bounds() const; 80 79 … … 94 93 RetainPtr<CALayer> m_tileContainerLayer; 95 94 const IntSize m_tileSize; 95 IntRect m_visibleRect; 96 96 97 97 typedef HashMap<TileIndex, RetainPtr<WebTileLayer> > TileMap; -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
r108825 r109788 194 194 } 195 195 196 void TileCache::visibleRectChanged() 197 { 198 scheduleTileRevalidation(); 196 void TileCache::visibleRectChanged(const IntRect& visibleRect) 197 { 198 if (m_visibleRect == visibleRect) 199 return; 200 201 m_visibleRect = visibleRect; 202 revalidateTiles(); 199 203 } 200 204 … … 217 221 for (TileMap::const_iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it) 218 222 [it->second.get() setBorderColor:m_tileDebugBorderColor.get()]; 219 }220 221 FloatRect TileCache::visibleRect() const222 {223 CGRect rect = [m_tileCacheLayer bounds];224 225 CALayer *layer = m_tileCacheLayer;226 CALayer *superlayer = [layer superlayer];227 228 while (superlayer) {229 CGRect rectInSuperlayerCoordinates = [superlayer convertRect:rect fromLayer:layer];230 231 if ([superlayer masksToBounds])232 rect = CGRectIntersection([superlayer bounds], rectInSuperlayerCoordinates);233 else234 rect = rectInSuperlayerCoordinates;235 236 layer = superlayer;237 superlayer = [layer superlayer];238 }239 240 return [m_tileCacheLayer convertRect:rect fromLayer:layer];241 223 } 242 224 … … 282 264 return; 283 265 284 IntRect tileCoverageRect = enclosingIntRect(visibleRect()); 285 if (tileCoverageRect.isEmpty()) 286 return; 266 if (m_visibleRect.isEmpty()) 267 return; 268 269 IntRect tileCoverageRect = m_visibleRect; 287 270 288 271 // Inflate the coverage rect so that it covers 2x of the visible width and 3x of the visible height. -
trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.h
r106385 r109788 28 28 29 29 namespace WebCore { 30 class IntRect; 30 31 class TileCache; 31 32 } … … 36 37 37 38 - (CALayer *)tileContainerLayer; 38 - (void)visibleRectChanged ;39 - (void)visibleRectChanged:(const WebCore::IntRect&)visibleRect; 39 40 40 41 @end -
trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.mm
r109486 r109788 121 121 } 122 122 123 - (void)visibleRectChanged 123 - (void)visibleRectChanged:(const IntRect&)visibleRect 124 124 { 125 _tileCache->visibleRectChanged( );125 _tileCache->visibleRectChanged(visibleRect); 126 126 } 127 127 -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
r107900 r109788 634 634 } 635 635 636 void PlatformCALayer::visibleRectChanged( )636 void PlatformCALayer::visibleRectChanged(const IntRect&) 637 637 { 638 638 } -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r108422 r109788 979 979 980 980 if (RenderLayerBacking* backing = rootRenderLayer()->backing()) 981 backing->graphicsLayer()->visibleRectChanged( );981 backing->graphicsLayer()->visibleRectChanged(frameView->visibleContentRect(false /* exclude scrollbars */)); 982 982 983 983 if (!m_scrollLayer)
Note: See TracChangeset
for help on using the changeset viewer.