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

Side by Side Diff: cc/debug_colors.cc

Issue 11280012: cc: Move the HUD debug colors into the cc::DebugColors class (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/heads_up_display_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
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/debug_colors.h" 5 #include "cc/debug_colors.h"
6 6
7 #include "cc/layer_tree_host_impl.h" 7 #include "cc/layer_tree_host_impl.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 static const float Scale(float width, const LayerTreeHostImpl* host_impl) { 11 static const float Scale(float width, const LayerTreeHostImpl* host_impl) {
12 return width * (host_impl ? host_impl->deviceScaleFactor() : 1); 12 return width * (host_impl ? host_impl->deviceScaleFactor() : 1);
13 } 13 }
14 14
15 // ======= Layer border colors =======
16
15 // Tiled content layers are orange. 17 // Tiled content layers are orange.
16 SkColor DebugColors::TiledContentLayerBorderColor() { return SkColorSetARGB(128, 255, 128, 0); } 18 SkColor DebugColors::TiledContentLayerBorderColor() { return SkColorSetARGB(128, 255, 128, 0); }
17 int DebugColors::TiledContentLayerBorderWidth(const LayerTreeHostImpl* host_impl ) { return Scale(2, host_impl); } 19 int DebugColors::TiledContentLayerBorderWidth(const LayerTreeHostImpl* host_impl ) { return Scale(2, host_impl); }
18 20
19 // Non-tiled content layers area green. 21 // Non-tiled content layers area green.
20 SkColor DebugColors::ContentLayerBorderColor() { return SkColorSetARGB(128, 0, 1 28, 32); } 22 SkColor DebugColors::ContentLayerBorderColor() { return SkColorSetARGB(128, 0, 1 28, 32); }
21 int DebugColors::ContentLayerBorderWidth(const LayerTreeHostImpl* host_impl) { r eturn Scale(2, host_impl); } 23 int DebugColors::ContentLayerBorderWidth(const LayerTreeHostImpl* host_impl) { r eturn Scale(2, host_impl); }
22 24
23 // Masking layers are pale blue and wide. 25 // Masking layers are pale blue and wide.
24 SkColor DebugColors::MaskingLayerBorderColor() { return SkColorSetARGB(48, 128, 255, 255); } 26 SkColor DebugColors::MaskingLayerBorderColor() { return SkColorSetARGB(48, 128, 255, 255); }
25 int DebugColors::MaskingLayerBorderWidth(const LayerTreeHostImpl* host_impl) { r eturn Scale(20, host_impl); } 27 int DebugColors::MaskingLayerBorderWidth(const LayerTreeHostImpl* host_impl) { r eturn Scale(20, host_impl); }
26 28
27 // Other container layers are yellow. 29 // Other container layers are yellow.
28 SkColor DebugColors::ContainerLayerBorderColor() { return SkColorSetARGB(192, 25 5, 255, 0); } 30 SkColor DebugColors::ContainerLayerBorderColor() { return SkColorSetARGB(192, 25 5, 255, 0); }
29 int DebugColors::ContainerLayerBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); } 31 int DebugColors::ContainerLayerBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
30 32
31 // Render surfaces are blue. 33 // Render surfaces are blue.
32 SkColor DebugColors::SurfaceBorderColor() { return SkColorSetARGB(100, 0, 0, 255 ); } 34 SkColor DebugColors::SurfaceBorderColor() { return SkColorSetARGB(100, 0, 0, 255 ); }
33 int DebugColors::SurfaceBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); } 35 int DebugColors::SurfaceBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
34 36
35 // Replicas of render surfaces are purple. 37 // Replicas of render surfaces are purple.
36 SkColor DebugColors::SurfaceReplicaBorderColor() { return SkColorSetARGB(100, 16 0, 0, 255); } 38 SkColor DebugColors::SurfaceReplicaBorderColor() { return SkColorSetARGB(100, 16 0, 0, 255); }
37 int DebugColors::SurfaceReplicaBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); } 39 int DebugColors::SurfaceReplicaBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
38 40
39 // Tile borders are cyan. 41 // Tile borders are cyan.
40 SkColor DebugColors::TileBorderColor() { return SkColorSetARGB(100, 80, 200, 200 ); } 42 SkColor DebugColors::TileBorderColor() { return SkColorSetARGB(100, 80, 200, 200 ); }
41 int DebugColors::TileBorderWidth(const LayerTreeHostImpl* host_impl) { return Sc ale(1, host_impl); } 43 int DebugColors::TileBorderWidth(const LayerTreeHostImpl* host_impl) { return Sc ale(1, host_impl); }
42 44
45 // ======= Tile colors =======
46
43 // Missing tile borders are red. 47 // Missing tile borders are red.
44 SkColor DebugColors::MissingTileBorderColor() { return SkColorSetARGB(100, 255, 0, 0); } 48 SkColor DebugColors::MissingTileBorderColor() { return SkColorSetARGB(100, 255, 0, 0); }
45 int DebugColors::MissingTileBorderWidth(const LayerTreeHostImpl* host_impl) { re turn Scale(1, host_impl); } 49 int DebugColors::MissingTileBorderWidth(const LayerTreeHostImpl* host_impl) { re turn Scale(1, host_impl); }
46 50
47 // Culled tile borders are brown. 51 // Culled tile borders are brown.
48 SkColor DebugColors::CulledTileBorderColor() { return SkColorSetARGB(120, 160, 1 00, 0); } 52 SkColor DebugColors::CulledTileBorderColor() { return SkColorSetARGB(120, 160, 1 00, 0); }
49 int DebugColors::CulledTileBorderWidth(const LayerTreeHostImpl* host_impl) { ret urn Scale(1, host_impl); } 53 int DebugColors::CulledTileBorderWidth(const LayerTreeHostImpl* host_impl) { ret urn Scale(1, host_impl); }
50 54
55 // ======= Checkerboard colors =======
56
51 // Invalidated tiles get sky blue checkerboards. 57 // Invalidated tiles get sky blue checkerboards.
52 SkColor DebugColors::InvalidatedTileCheckerboardColor() { return SkColorSetRGB(1 28, 200, 245); } 58 SkColor DebugColors::InvalidatedTileCheckerboardColor() { return SkColorSetRGB(1 28, 200, 245); }
53 59
54 // Evicted tiles get pale red checkerboards. 60 // Evicted tiles get pale red checkerboards.
55 SkColor DebugColors::EvictedTileCheckerboardColor() { return SkColorSetRGB(255, 200, 200); } 61 SkColor DebugColors::EvictedTileCheckerboardColor() { return SkColorSetRGB(255, 200, 200); }
56 62
63 // ======= Debug rect colors =======
64
65 // Paint rects in red.
66 SkColor DebugColors::PaintRectBorderColor() { return SkColorSetARGB(255, 255, 0, 0); }
67 int DebugColors::PaintRectBorderWidth(const LayerTreeHostImpl* host_impl) { retu rn Scale(2, host_impl); }
68 SkColor DebugColors::PaintRectFillColor() { return SkColorSetARGB(30, 255, 0, 0) ; }
69
70 // Property-changed rects in blue.
71 SkColor DebugColors::PropertyChangedRectBorderColor() { return SkColorSetARGB(25 5, 0, 0, 255); }
72 int DebugColors::PropertyChangedRectBorderWidth(const LayerTreeHostImpl* host_im pl) { return Scale(2, host_impl); }
73 SkColor DebugColors::PropertyChangedRectFillColor() { return SkColorSetARGB(30, 0, 0, 255); }
74
75 // Surface damage rects in yellow-orange.
76 SkColor DebugColors::SurfaceDamageRectBorderColor() { return SkColorSetARGB(255, 200, 100, 0); }
77 int DebugColors::SurfaceDamageRectBorderWidth(const LayerTreeHostImpl* host_impl ) { return Scale(2, host_impl); }
78 SkColor DebugColors::SurfaceDamageRectFillColor() { return SkColorSetARGB(30, 20 0, 100, 0); }
79
80 // Surface replica screen space rects in green.
81 SkColor DebugColors::ScreenSpaceLayerRectBorderColor() { return SkColorSetARGB(2 55, 100, 200, 0); }
82 int DebugColors::ScreenSpaceLayerRectBorderWidth(const LayerTreeHostImpl* host_i mpl) { return Scale(2, host_impl); }
83 SkColor DebugColors::ScreenSpaceLayerRectFillColor() { return SkColorSetARGB(30, 100, 200, 0); }
84
85 // Layer screen space rects in purple.
86 SkColor DebugColors::ScreenSpaceSurfaceReplicaRectBorderColor() { return SkColor SetARGB(255, 100, 0, 200); }
87 int DebugColors::ScreenSpaceSurfaceReplicaRectBorderWidth(const LayerTreeHostImp l* host_impl) { return Scale(2, host_impl); }
88 SkColor DebugColors::ScreenSpaceSurfaceReplicaRectFillColor() { return SkColorSe tARGB(10, 100, 0, 200); }
89
90 // Occluding rects in pink.
91 SkColor DebugColors::OccludingRectBorderColor() { return SkColorSetARGB(255, 245 , 136, 255); }
92 int DebugColors::OccludingRectBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
93 SkColor DebugColors::OccludingRectFillColor() { return SkColorSetARGB(10, 245, 1 36, 255); }
94
95 // Non-Occluding rects in a reddish color.
96 SkColor DebugColors::NonOccludingRectBorderColor() { return SkColorSetARGB(255, 200, 0, 100); }
97 int DebugColors::NonOccludingRectBorderWidth(const LayerTreeHostImpl* host_impl) { return Scale(2, host_impl); }
98 SkColor DebugColors::NonOccludingRectFillColor() { return SkColorSetARGB(10, 200 , 0, 100); }
99
57 } // namespace cc 100 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug_colors.h ('k') | cc/heads_up_display_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698