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

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
« no previous file with comments | « 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..93c0ce362fa1b85ab83bbad9acc77bee78421f87
--- /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* host_impl) {
+ return width * (host_impl ? host_impl->deviceScaleFactor() : 1);
+}
+
+// Tiled content layers are orange.
+SkColor DebugColors::TiledContentLayerBorderColor() { return SkColorSetARGB(128, 255, 128, 0); }
+int DebugColors::TiledContentLayerBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
+
+// Non-tiled content layers area green.
+SkColor DebugColors::ContentLayerBorderColor() { return SkColorSetARGB(128, 0, 128, 32); }
+int DebugColors::ContentLayerBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
+
+// Masking layers are pale blue and wide.
+SkColor DebugColors::MaskingLayerBorderColor() { return SkColorSetARGB(48, 128, 255, 255); }
+int DebugColors::MaskingLayerBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(20, host_impl); }
+
+// Other container layers are yellow.
+SkColor DebugColors::ContainerLayerBorderColor() { return SkColorSetARGB(192, 255, 255, 0); }
+int DebugColors::ContainerLayerBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
+
+// Render surfaces are blue.
+SkColor DebugColors::SurfaceBorderColor() { return SkColorSetARGB(100, 0, 0, 255); }
+int DebugColors::SurfaceBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
+
+// Replicas of render surfaces are purple.
+SkColor DebugColors::SurfaceReplicaBorderColor() { return SkColorSetARGB(100, 160, 0, 255); }
+int DebugColors::SurfaceReplicaBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
+
+// Tile borders are cyan.
+SkColor DebugColors::TileBorderColor() { return SkColorSetARGB(100, 80, 200, 200); }
+int DebugColors::TileBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(1, host_impl); }
+
+// Missing tile borders are red.
+SkColor DebugColors::MissingTileBorderColor() { return SkColorSetARGB(100, 255, 0, 0); }
+int DebugColors::MissingTileBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(1, host_impl); }
+
+// Culled tile borders are brown.
+SkColor DebugColors::CulledTileBorderColor() { return SkColorSetARGB(120, 160, 100, 0); }
+int DebugColors::CulledTileBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(1, host_impl); }
+
+// Invalidated tiles get sky blue checkerboards.
+SkColor DebugColors::InvalidatedTileCheckerboardColor() { return SkColorSetRGB(128, 200, 245); }
+
+// Evicted tiles get pale red checkerboards.
+SkColor DebugColors::EvictedTileCheckerboardColor() { return SkColorSetRGB(255, 200, 200); }
+
+} // namespace cc
« no previous file with comments | « cc/debug_colors.h ('k') | cc/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698