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

Unified Diff: cc/debug_colors.cc

Issue 11316026: cc: Create cc::DebugColors class to hold all the debugging color/width constants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« cc/debug_colors.h ('K') | « cc/debug_colors.h ('k') | cc/layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug_colors.cc
diff --git a/cc/debug_colors.cc b/cc/debug_colors.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2bedaee4c50751e3109ef7ba3fbed0bfde5e523c
--- /dev/null
+++ b/cc/debug_colors.cc
@@ -0,0 +1,57 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/debug_colors.h"
+
+#include "cc/layer_tree_host_impl.h"
+
+namespace cc {
+
+static const float Scale(float width, const LayerTreeHostImpl* hostImpl) {
+ return width * (hostImpl ? hostImpl->deviceScaleFactor() : 1);
+}
+
+// Tiled content layers are orange.
+SkColor DebugColors::kTiledContentLayerBorderColor() { return SkColorSetARGB(128, 255, 128, 0); }
+int DebugColors::kTiledContentLayerBorderWidth(const LayerTreeHostImpl* hostImpl) { return Scale(2, hostImpl); }
+
+// Non-tiled content layers area green.
+SkColor DebugColors::kContentLayerBorderColor() { return SkColorSetARGB(128, 0, 128, 32); }
+int DebugColors::kContentLayerBorderWidth(const LayerTreeHostImpl* hostImpl) { return Scale(2, hostImpl); }
+
+// Masking layers are pale blue and wide.
+SkColor DebugColors::kMaskingLayerBorderColor() { return SkColorSetARGB(48, 128, 255, 255); }
+int DebugColors::kMaskingLayerBorderWidth(const LayerTreeHostImpl* hostImpl) { return Scale(20, hostImpl); }
+
+// Other container layers are yellow.
+SkColor DebugColors::kContainerLayerBorderColor() { return SkColorSetARGB(192, 255, 255, 0); }
+int DebugColors::kContainerLayerBorderWidth(const LayerTreeHostImpl* hostImpl) { return Scale(2, hostImpl); }
+
+// Render surfaces are blue.
+SkColor DebugColors::kSurfaceBorderColor() { return SkColorSetARGB(100, 0, 0, 255); }
+SkColor DebugColors::kSurfaceBorderWidth(const LayerTreeHostImpl* hostImpl) { return Scale(2, hostImpl); }
+
+// Replicas of render surfaces are purple.
+SkColor DebugColors::kSurfaceReplicaBorderColor() { return SkColorSetARGB(100, 160, 0, 255); }
+SkColor DebugColors::kSurfaceReplicaBorderWidth(const LayerTreeHostImpl* hostImpl) { return Scale(2, hostImpl); }
+
+// Tile borders are cyan.
+SkColor DebugColors::kTileBorderColor() { return SkColorSetARGB(100, 80, 200, 200); }
+int DebugColors::kTileBorderWidth(const LayerTreeHostImpl* hostImpl) { return Scale(1, hostImpl); }
+
+// Missing tile borders are red.
+SkColor DebugColors::kMissingTileBorderColor() { return SkColorSetARGB(100, 255, 0, 0); }
+int DebugColors::kMissingTileBorderWidth(const LayerTreeHostImpl* hostImpl) { return Scale(1, hostImpl); }
+
+// Culled tile borders are brown.
+SkColor DebugColors::kCulledTileBorderColor() { return SkColorSetARGB(120, 160, 100, 0); }
+int DebugColors::kCulledTileBorderWidth(const LayerTreeHostImpl* hostImpl) { return Scale(1, hostImpl); }
+
+// Invalidated tiles get sky blue checkerboards.
+SkColor DebugColors::kInvalidatedTileCheckerboardColor() { return SkColorSetRGB(128, 200, 245); }
+
+// Evicted tiles get pale red checkerboards.
+SkColor DebugColors::kEvictedTileCheckerboardColor() { return SkColorSetRGB(255, 200, 200); }
+
+} // namespace cc
« cc/debug_colors.h ('K') | « cc/debug_colors.h ('k') | cc/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698