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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/debug_colors.h ('k') | cc/layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/debug_colors.h"
6
7 #include "cc/layer_tree_host_impl.h"
8
9 namespace cc {
10
11 static const float Scale(float width, const LayerTreeHostImpl* host_impl) {
12 return width * (host_impl ? host_impl->deviceScaleFactor() : 1);
13 }
14
15 // Tiled content layers are orange.
16 SkColor DebugColors::TiledContentLayerBorderColor() { return SkColorSetARGB(128, 255, 128, 0); }
17 int DebugColors::TiledContentLayerBorderWidth(const LayerTreeHostImpl* host_impl ) { return Scale(2, host_impl); }
18
19 // Non-tiled content layers area green.
20 SkColor DebugColors::ContentLayerBorderColor() { return SkColorSetARGB(128, 0, 1 28, 32); }
21 int DebugColors::ContentLayerBorderWidth(const LayerTreeHostImpl* host_impl) { r eturn Scale(2, host_impl); }
22
23 // Masking layers are pale blue and wide.
24 SkColor DebugColors::MaskingLayerBorderColor() { return SkColorSetARGB(48, 128, 255, 255); }
25 int DebugColors::MaskingLayerBorderWidth(const LayerTreeHostImpl* host_impl) { r eturn Scale(20, host_impl); }
26
27 // Other container layers are yellow.
28 SkColor DebugColors::ContainerLayerBorderColor() { return SkColorSetARGB(192, 25 5, 255, 0); }
29 int DebugColors::ContainerLayerBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
30
31 // Render surfaces are blue.
32 SkColor DebugColors::SurfaceBorderColor() { return SkColorSetARGB(100, 0, 0, 255 ); }
33 int DebugColors::SurfaceBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
34
35 // Replicas of render surfaces are purple.
36 SkColor DebugColors::SurfaceReplicaBorderColor() { return SkColorSetARGB(100, 16 0, 0, 255); }
37 int DebugColors::SurfaceReplicaBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
38
39 // Tile borders are cyan.
40 SkColor DebugColors::TileBorderColor() { return SkColorSetARGB(100, 80, 200, 200 ); }
41 int DebugColors::TileBorderWidth(const LayerTreeHostImpl* host_impl) { return Sc ale(1, host_impl); }
42
43 // Missing tile borders are red.
44 SkColor DebugColors::MissingTileBorderColor() { return SkColorSetARGB(100, 255, 0, 0); }
45 int DebugColors::MissingTileBorderWidth(const LayerTreeHostImpl* host_impl) { re turn Scale(1, host_impl); }
46
47 // Culled tile borders are brown.
48 SkColor DebugColors::CulledTileBorderColor() { return SkColorSetARGB(120, 160, 1 00, 0); }
49 int DebugColors::CulledTileBorderWidth(const LayerTreeHostImpl* host_impl) { ret urn Scale(1, host_impl); }
50
51 // Invalidated tiles get sky blue checkerboards.
52 SkColor DebugColors::InvalidatedTileCheckerboardColor() { return SkColorSetRGB(1 28, 200, 245); }
53
54 // Evicted tiles get pale red checkerboards.
55 SkColor DebugColors::EvictedTileCheckerboardColor() { return SkColorSetRGB(255, 200, 200); }
56
57 } // namespace cc
OLDNEW
« 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