Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: cc/CCTiledLayerImpl.cpp

Issue 10962042: [cc] Color evicted vs. invalidated checkerboard tiles differently (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« cc/CCRendererGL.cpp ('K') | « cc/CCTiledLayerImpl.h ('k') | cc/ShaderChromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698