Chromium Code Reviews| Index: cc/CCTiledLayerImpl.cpp |
| diff --git a/cc/CCTiledLayerImpl.cpp b/cc/CCTiledLayerImpl.cpp |
| index 7693082b0893e229b1811778dc9d271e622359d6..1b07cb1e266cc116f62d19a7d6103c625664bfaa 100644 |
| --- a/cc/CCTiledLayerImpl.cpp |
| +++ b/cc/CCTiledLayerImpl.cpp |
| @@ -35,6 +35,16 @@ static const int debugTileBorderMissingTileColorRed = 255; |
| static const int debugTileBorderMissingTileColorGreen = 0; |
| static const int debugTileBorderMissingTileColorBlue = 0; |
| +static const int defaultCheckerboardColorRed = 241; |
| +static const int defaultCheckerboardColorGreen = 241; |
| +static const int defaultCheckerboardColorBlue = 241; |
| +static const int debugTileEvictedCheckerboardColorRed = 255; |
| +static const int debugTileEvictedCheckerboardColorGreen = 200; |
| +static const int debugTileEvictedCheckerboardColorBlue = 200; |
| +static const int debugTileInvalidatedCheckerboardColorRed = 128; |
| +static const int debugTileInvalidatedCheckerboardColorGreen = 200; |
| +static const int debugTileInvalidatedCheckerboardColorBlue = 245; |
| + |
| class DrawableTile : public CCLayerTilingData::Tile { |
| WTF_MAKE_NONCOPYABLE(DrawableTile); |
| public: |
| @@ -148,9 +158,19 @@ void CCTiledLayerImpl::appendQuads(CCQuadSink& quadSink, CCAppendQuadsData& appe |
| continue; |
| if (!tile || !tile->resourceId()) { |
| - if (drawCheckerboardForMissingTiles()) |
| - appendQuadsData.hadMissingTiles |= quadSink.append(CCCheckerboardDrawQuad::create(sharedQuadState, tileRect), appendQuadsData); |
| - else |
| + if (drawCheckerboardForMissingTiles()) { |
| + SkColor defaultColor = SkColorSetARGB(255, defaultCheckerboardColorRed, defaultCheckerboardColorGreen, defaultCheckerboardColorBlue); |
|
jamesr
2012/09/21 22:28:08
SkColorSetRGB() is shorter if you don't have trans
|
| + SkColor evictedColor = SkColorSetARGB(255, debugTileEvictedCheckerboardColorRed, debugTileEvictedCheckerboardColorGreen, debugTileEvictedCheckerboardColorBlue); |
| + SkColor invalidatedColor = SkColorSetARGB(255, debugTileInvalidatedCheckerboardColorRed, debugTileEvictedCheckerboardColorGreen, debugTileEvictedCheckerboardColorBlue); |
| + |
| + SkColor checkerColor; |
| + if (hasDebugBorders()) |
| + checkerColor = !tile ? evictedColor : invalidatedColor; |
|
jamesr
2012/09/21 22:28:08
Hmm, I find ternaries on inverted bools a bit hard
|
| + else |
| + checkerColor = defaultColor; |
| + |
| + appendQuadsData.hadMissingTiles |= quadSink.append(CCCheckerboardDrawQuad::create(sharedQuadState, tileRect, checkerColor), appendQuadsData); |
| + } else |
| appendQuadsData.hadMissingTiles |= quadSink.append(CCSolidColorDrawQuad::create(sharedQuadState, tileRect, backgroundColor()), appendQuadsData); |
| continue; |
| } |
| @@ -200,6 +220,15 @@ void CCTiledLayerImpl::pushTileProperties(int i, int j, CCResourceProvider::Reso |
| tile->setOpaqueRect(opaqueRect); |
| } |
| +void CCTiledLayerImpl::pushInvalidTile(int i, int j) |
| +{ |
| + DrawableTile* tile = tileAt(i, j); |
| + if (!tile) |
| + tile = createTile(i, j); |
| + tile->setResourceId(0); |
| + tile->setOpaqueRect(IntRect()); |
| +} |
| + |
| Region CCTiledLayerImpl::visibleContentOpaqueRegion() const |
| { |
| if (m_skipsDraw) |