Changeset 106304 in webkit


Ignore:
Timestamp:
Jan 30, 2012 5:07:43 PM (12 years ago)
Author:
andersca@apple.com
Message:

Show debug borders for individual tile cache tiles
https://bugs.webkit.org/show_bug.cgi?id=77388

Reviewed by Sam Weinig.

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::updateDebugIndicators):
Give tile cache tiles a thin dark blue border.

  • platform/graphics/ca/mac/TileCache.h:

(WebCore::TileCache::tileDebugBorderWidth):
(WebCore::TileCache::tileDebugBorderColor):
Add getters and member variables for the tile debug border width and color.

  • platform/graphics/ca/mac/TileCache.mm:

(WebCore::TileCache::TileCache):
Initialize m_tileDebugBorderWidth.

(WebCore::TileCache::setTileDebugBorderWidth):
Update the border width of each tile layer.

(WebCore::TileCache::setTileDebugBorderColor):
Update the border color of each tile layer.

(WebCore::TileCache::createTileLayer):
Set the border color and border width.

  • platform/graphics/ca/mac/WebTileCacheLayer.h:
  • platform/graphics/ca/mac/WebTileCacheLayer.mm:

(-[WebTileCacheLayer borderColor]):
(-[WebTileCacheLayer setBorderColor:]):
(-[WebTileCacheLayer borderWidth]):
(-[WebTileCacheLayer setBorderWidth:]):
Call through to the TileCache.

  • platform/graphics/mac/WebLayer.mm:

(drawLayerContents):
Don't draw the repaint counter for tile cache layers, each tile will maintain its own repaint counter.

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106301 r106304  
     12012-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
    1422012-01-30  Rakesh KN  <rakesh.kn@motorola.com>
    243
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r106190 r106304  
    327327    if (GraphicsLayer::showDebugBorders()) {
    328328        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)
    330334                setDebugBorder(Color(255, 128, 0, 128), 2); // tiled layer: orange
    331335            else
  • trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h

    r106163 r106304  
    5858    CALayer *tileContainerLayer() const { return m_tileContainerLayer.get(); }
    5959
     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
    6066private:
    6167    TileCache(WebTileCacheLayer*, const IntSize& tileSize);
     
    7581    RetainPtr<CALayer> m_tileContainerLayer;
    7682
     83    RetainPtr<CGColorRef> m_tileDebugBorderColor;
     84    float m_tileDebugBorderWidth;
     85
    7786    // Number of tiles in each dimension.
    7887    IntSize m_numTilesInGrid;
  • trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm

    r106163 r106304  
    5353    , m_tileSize(tileSize)
    5454    , m_tileContainerLayer(adoptCF([[CALayer alloc] init]))
     55    , m_tileDebugBorderWidth(0)
    5556    , m_acceleratesDrawing(false)
    5657{
     
    115116{
    116117#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
    117     if (acceleratesDrawing == m_acceleratesDrawing)
     118    if (m_acceleratesDrawing == acceleratesDrawing)
    118119        return;
    119120
     
    125126    UNUSED_PARAM(acceleratesDrawing);
    126127#endif
     128}
     129
     130void 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
     140void 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()];
    127148}
    128149
     
    194215    [layer.get() setAnchorPoint:CGPointZero];
    195216    [layer.get() setTileCache:this];
     217    [layer.get() setBorderColor:m_tileDebugBorderColor.get()];
     218    [layer.get() setBorderWidth:m_tileDebugBorderWidth];
    196219
    197220#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
  • trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.h

    r103114 r106304  
    3636
    3737- (CALayer *)tileContainerLayer;
     38
    3839@end
  • trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.mm

    r106163 r106304  
    7878}
    7979
     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
    80100@end
  • trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm

    r102644 r106304  
    8686    layerContents = platformLayer->owner();
    8787    ASSERT(layerContents);
    88     if (layerContents && layerContents->platformCALayerShowRepaintCounter()) {
     88    if (platformLayer->layerType() != PlatformCALayer::LayerTypeTileCacheLayer && layerContents && layerContents->platformCALayerShowRepaintCounter()) {
    8989        bool isTiledLayer = [layer isKindOfClass:[CATiledLayer class]];
    9090
Note: See TracChangeset for help on using the changeset viewer.