Changeset 106304 in webkit
- Timestamp:
- Jan 30, 2012 5:07:43 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106301 r106304 1 2012-01-30 Anders Carlsson <andersca@apple.com> 2 3 Show debug borders for individual tile cache tiles 4 https://bugs.webkit.org/show_bug.cgi?id=77388 5 6 Reviewed by Sam Weinig. 7 8 * platform/graphics/GraphicsLayer.cpp: 9 (WebCore::GraphicsLayer::updateDebugIndicators): 10 Give tile cache tiles a thin dark blue border. 11 12 * platform/graphics/ca/mac/TileCache.h: 13 (WebCore::TileCache::tileDebugBorderWidth): 14 (WebCore::TileCache::tileDebugBorderColor): 15 Add getters and member variables for the tile debug border width and color. 16 17 * platform/graphics/ca/mac/TileCache.mm: 18 (WebCore::TileCache::TileCache): 19 Initialize m_tileDebugBorderWidth. 20 21 (WebCore::TileCache::setTileDebugBorderWidth): 22 Update the border width of each tile layer. 23 24 (WebCore::TileCache::setTileDebugBorderColor): 25 Update the border color of each tile layer. 26 27 (WebCore::TileCache::createTileLayer): 28 Set the border color and border width. 29 30 * platform/graphics/ca/mac/WebTileCacheLayer.h: 31 * platform/graphics/ca/mac/WebTileCacheLayer.mm: 32 (-[WebTileCacheLayer borderColor]): 33 (-[WebTileCacheLayer setBorderColor:]): 34 (-[WebTileCacheLayer borderWidth]): 35 (-[WebTileCacheLayer setBorderWidth:]): 36 Call through to the TileCache. 37 38 * platform/graphics/mac/WebLayer.mm: 39 (drawLayerContents): 40 Don't draw the repaint counter for tile cache layers, each tile will maintain its own repaint counter. 41 1 42 2012-01-30 Rakesh KN <rakesh.kn@motorola.com> 2 43 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r106190 r106304 327 327 if (GraphicsLayer::showDebugBorders()) { 328 328 if (drawsContent()) { 329 if (m_usingTiledLayer) 329 // FIXME: It's weird to ask the client if this layer is a tile cache layer. 330 // Maybe we should just cache that information inside GraphicsLayer? 331 if (m_client->shouldUseTileCache(this)) // tile cache layer: dark blue 332 setDebugBorder(Color(0, 0, 128, 128), 0.5); 333 else if (m_usingTiledLayer) 330 334 setDebugBorder(Color(255, 128, 0, 128), 2); // tiled layer: orange 331 335 else -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h
r106163 r106304 58 58 CALayer *tileContainerLayer() const { return m_tileContainerLayer.get(); } 59 59 60 float tileDebugBorderWidth() const { return m_tileDebugBorderWidth; } 61 void setTileDebugBorderWidth(float); 62 63 CGColorRef tileDebugBorderColor() const { return m_tileDebugBorderColor.get(); } 64 void setTileDebugBorderColor(CGColorRef); 65 60 66 private: 61 67 TileCache(WebTileCacheLayer*, const IntSize& tileSize); … … 75 81 RetainPtr<CALayer> m_tileContainerLayer; 76 82 83 RetainPtr<CGColorRef> m_tileDebugBorderColor; 84 float m_tileDebugBorderWidth; 85 77 86 // Number of tiles in each dimension. 78 87 IntSize m_numTilesInGrid; -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
r106163 r106304 53 53 , m_tileSize(tileSize) 54 54 , m_tileContainerLayer(adoptCF([[CALayer alloc] init])) 55 , m_tileDebugBorderWidth(0) 55 56 , m_acceleratesDrawing(false) 56 57 { … … 115 116 { 116 117 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 117 if ( acceleratesDrawing == m_acceleratesDrawing)118 if (m_acceleratesDrawing == acceleratesDrawing) 118 119 return; 119 120 … … 125 126 UNUSED_PARAM(acceleratesDrawing); 126 127 #endif 128 } 129 130 void TileCache::setTileDebugBorderWidth(float borderWidth) 131 { 132 if (m_tileDebugBorderWidth == borderWidth) 133 return; 134 135 m_tileDebugBorderWidth = borderWidth; 136 for (WebTileLayer* tileLayer in [m_tileContainerLayer.get() sublayers]) 137 [tileLayer setBorderWidth:m_tileDebugBorderWidth]; 138 } 139 140 void TileCache::setTileDebugBorderColor(CGColorRef borderColor) 141 { 142 if (m_tileDebugBorderColor == borderColor) 143 return; 144 145 m_tileDebugBorderColor = borderColor; 146 for (WebTileLayer* tileLayer in [m_tileContainerLayer.get() sublayers]) 147 [tileLayer setBorderColor:m_tileDebugBorderColor.get()]; 127 148 } 128 149 … … 194 215 [layer.get() setAnchorPoint:CGPointZero]; 195 216 [layer.get() setTileCache:this]; 217 [layer.get() setBorderColor:m_tileDebugBorderColor.get()]; 218 [layer.get() setBorderWidth:m_tileDebugBorderWidth]; 196 219 197 220 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) -
trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.h
r103114 r106304 36 36 37 37 - (CALayer *)tileContainerLayer; 38 38 39 @end -
trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.mm
r106163 r106304 78 78 } 79 79 80 - (CGColorRef)borderColor 81 { 82 return _tileCache->tileDebugBorderColor(); 83 } 84 85 - (void)setBorderColor:(CGColorRef)borderColor 86 { 87 _tileCache->setTileDebugBorderColor(borderColor); 88 } 89 90 - (CGFloat)borderWidth 91 { 92 return _tileCache->tileDebugBorderWidth(); 93 } 94 95 - (void)setBorderWidth:(CGFloat)borderWidth 96 { 97 _tileCache->setTileDebugBorderWidth(borderWidth); 98 } 99 80 100 @end -
trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm
r102644 r106304 86 86 layerContents = platformLayer->owner(); 87 87 ASSERT(layerContents); 88 if ( layerContents && layerContents->platformCALayerShowRepaintCounter()) {88 if (platformLayer->layerType() != PlatformCALayer::LayerTypeTileCacheLayer && layerContents && layerContents->platformCALayerShowRepaintCounter()) { 89 89 bool isTiledLayer = [layer isKindOfClass:[CATiledLayer class]]; 90 90
Note: See TracChangeset
for help on using the changeset viewer.