| Index: cc/CCTiledLayerImpl.cpp
|
| diff --git a/cc/CCTiledLayerImpl.cpp b/cc/CCTiledLayerImpl.cpp
|
| index 272422bbe8b54d9f70dad7e9d9c13bfea1ced8d5..77d632918175dc3731c5ed4a4ff20577dd1b8845 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:
|
| @@ -84,7 +94,7 @@ bool CCTiledLayerImpl::hasTileAt(int i, int j) const
|
| return m_tiler->tileAt(i, j);
|
| }
|
|
|
| -bool CCTiledLayerImpl::hasTextureIdForTileAt(int i, int j) const
|
| +bool CCTiledLayerImpl::hasResourceIdForTileAt(int i, int j) const
|
| {
|
| return hasTileAt(i, j) && tileAt(i, j)->resourceId();
|
| }
|
| @@ -146,9 +156,19 @@ void CCTiledLayerImpl::appendQuads(CCQuadSink& quadSink, CCAppendQuadsData& appe
|
| continue;
|
|
|
| if (!tile || !tile->resourceId()) {
|
| - if (drawCheckerboardForMissingTiles())
|
| - appendQuadsData.hadMissingTiles |= quadSink.append(CCCheckerboardDrawQuad::create(sharedQuadState, tileRect).PassAs<CCDrawQuad>(), appendQuadsData);
|
| - else
|
| + if (drawCheckerboardForMissingTiles()) {
|
| + SkColor defaultColor = SkColorSetRGB(defaultCheckerboardColorRed, defaultCheckerboardColorGreen, defaultCheckerboardColorBlue);
|
| + SkColor evictedColor = SkColorSetRGB(debugTileEvictedCheckerboardColorRed, debugTileEvictedCheckerboardColorGreen, debugTileEvictedCheckerboardColorBlue);
|
| + SkColor invalidatedColor = SkColorSetRGB(debugTileInvalidatedCheckerboardColorRed, debugTileEvictedCheckerboardColorGreen, debugTileEvictedCheckerboardColorBlue);
|
| +
|
| + SkColor checkerColor;
|
| + if (hasDebugBorders())
|
| + checkerColor = tile ? invalidatedColor : evictedColor;
|
| + else
|
| + checkerColor = defaultColor;
|
| +
|
| + appendQuadsData.hadMissingTiles |= quadSink.append(CCCheckerboardDrawQuad::create(sharedQuadState, tileRect, checkerColor).PassAs<CCDrawQuad>(), appendQuadsData);
|
| + } else
|
| appendQuadsData.hadMissingTiles |= quadSink.append(CCSolidColorDrawQuad::create(sharedQuadState, tileRect, backgroundColor()).PassAs<CCDrawQuad>(), appendQuadsData);
|
| continue;
|
| }
|
| @@ -198,6 +218,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)
|
|
|