OLD | NEW |
---|---|
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/debug_colors.h" | 5 #include "cc/debug/debug_colors.h" |
6 | 6 |
7 #include "cc/trees/layer_tree_impl.h" | 7 #include "cc/trees/layer_tree_impl.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
11 static int paintRectColors[][3] = { | |
12 {0, 95, 0}, | |
13 {0, 175, 0}, | |
14 {0, 255, 0} | |
15 }; | |
16 static int currentPaintRectColor = 2; | |
caseq
2013/12/27 09:44:10
please use s_ on statics.
| |
17 | |
11 static float Scale(float width, const LayerTreeImpl* tree_impl) { | 18 static float Scale(float width, const LayerTreeImpl* tree_impl) { |
12 return width * (tree_impl ? tree_impl->device_scale_factor() : 1); | 19 return width * (tree_impl ? tree_impl->device_scale_factor() : 1); |
13 } | 20 } |
14 | 21 |
15 // ======= Layer border colors ======= | 22 // ======= Layer border colors ======= |
16 | 23 |
17 // Tiled content layers are orange. | 24 // Tiled content layers are orange. |
18 SkColor DebugColors::TiledContentLayerBorderColor() { | 25 SkColor DebugColors::TiledContentLayerBorderColor() { |
19 return SkColorSetARGB(128, 255, 128, 0); | 26 return SkColorSetARGB(128, 255, 128, 0); |
20 } | 27 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 return SkColorSetRGB(128, 200, 245); | 163 return SkColorSetRGB(128, 200, 245); |
157 } | 164 } |
158 | 165 |
159 // Evicted tiles get pale red checkerboards. | 166 // Evicted tiles get pale red checkerboards. |
160 SkColor DebugColors::EvictedTileCheckerboardColor() { | 167 SkColor DebugColors::EvictedTileCheckerboardColor() { |
161 return SkColorSetRGB(255, 200, 200); | 168 return SkColorSetRGB(255, 200, 200); |
162 } | 169 } |
163 | 170 |
164 // ======= Debug rect colors ======= | 171 // ======= Debug rect colors ======= |
165 | 172 |
166 // Paint rects in red. | 173 // Paint rects in shades of green. |
167 SkColor DebugColors::PaintRectBorderColor() { | 174 SkColor DebugColors::PaintRectBorderColor() { |
168 return SkColorSetARGB(255, 255, 0, 0); | 175 currentPaintRectColor = (currentPaintRectColor + 1) % 3; |
176 return SkColorSetARGB(255, | |
177 paintRectColors[currentPaintRectColor][0], | |
caseq
2013/12/27 09:44:10
Line continuation indent is 4 spaces.
| |
178 paintRectColors[currentPaintRectColor][1], | |
179 paintRectColors[currentPaintRectColor][2]); | |
169 } | 180 } |
170 int DebugColors::PaintRectBorderWidth() { return 2; } | 181 int DebugColors::PaintRectBorderWidth() { return 2; } |
171 SkColor DebugColors::PaintRectFillColor() { | 182 SkColor DebugColors::PaintRectFillColor() { |
172 return SkColorSetARGB(30, 255, 0, 0); | 183 return SkColorSetARGB(30, |
184 paintRectColors[currentPaintRectColor][0], | |
185 paintRectColors[currentPaintRectColor][1], | |
186 paintRectColors[currentPaintRectColor][2]); | |
173 } | 187 } |
174 | 188 |
175 // Property-changed rects in blue. | 189 // Property-changed rects in blue. |
176 SkColor DebugColors::PropertyChangedRectBorderColor() { | 190 SkColor DebugColors::PropertyChangedRectBorderColor() { |
177 return SkColorSetARGB(255, 0, 0, 255); | 191 return SkColorSetARGB(255, 0, 0, 255); |
178 } | 192 } |
179 int DebugColors::PropertyChangedRectBorderWidth() { return 2; } | 193 int DebugColors::PropertyChangedRectBorderWidth() { return 2; } |
180 SkColor DebugColors::PropertyChangedRectFillColor() { | 194 SkColor DebugColors::PropertyChangedRectFillColor() { |
181 return SkColorSetARGB(30, 0, 0, 255); | 195 return SkColorSetARGB(30, 0, 0, 255); |
182 } | 196 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 SkColor DebugColors::MemoryDisplayTextColor() { | 304 SkColor DebugColors::MemoryDisplayTextColor() { |
291 return SkColorSetARGB(255, 220, 220, 220); | 305 return SkColorSetARGB(255, 220, 220, 220); |
292 } | 306 } |
293 | 307 |
294 // Paint time display in green (similar to paint times in the WebInspector) | 308 // Paint time display in green (similar to paint times in the WebInspector) |
295 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() { | 309 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() { |
296 return SkColorSetRGB(75, 155, 55); | 310 return SkColorSetRGB(75, 155, 55); |
297 } | 311 } |
298 | 312 |
299 } // namespace cc | 313 } // namespace cc |
OLD | NEW |