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 "base/macros.h" | |
6 | |
5 #include "cc/debug/debug_colors.h" | 7 #include "cc/debug/debug_colors.h" |
6 | 8 |
7 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
8 | 10 |
9 namespace cc { | 11 namespace cc { |
10 | 12 |
13 static const int kPaintRectColors[][3] = {{0, 155, 0}, {0, 195, 0}, | |
danakj
2014/02/10 16:11:12
nit: can you move this down just above the 2 metho
| |
14 {0, 235, 0}}; | |
15 | |
11 static float Scale(float width, const LayerTreeImpl* tree_impl) { | 16 static float Scale(float width, const LayerTreeImpl* tree_impl) { |
12 return width * (tree_impl ? tree_impl->device_scale_factor() : 1); | 17 return width * (tree_impl ? tree_impl->device_scale_factor() : 1); |
13 } | 18 } |
14 | 19 |
15 // ======= Layer border colors ======= | 20 // ======= Layer border colors ======= |
16 | 21 |
17 // Tiled content layers are orange. | 22 // Tiled content layers are orange. |
18 SkColor DebugColors::TiledContentLayerBorderColor() { | 23 SkColor DebugColors::TiledContentLayerBorderColor() { |
19 return SkColorSetARGB(128, 255, 128, 0); | 24 return SkColorSetARGB(128, 255, 128, 0); |
20 } | 25 } |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 return SkColorSetRGB(128, 200, 245); | 169 return SkColorSetRGB(128, 200, 245); |
165 } | 170 } |
166 | 171 |
167 // Evicted tiles get pale red checkerboards. | 172 // Evicted tiles get pale red checkerboards. |
168 SkColor DebugColors::EvictedTileCheckerboardColor() { | 173 SkColor DebugColors::EvictedTileCheckerboardColor() { |
169 return SkColorSetRGB(255, 200, 200); | 174 return SkColorSetRGB(255, 200, 200); |
170 } | 175 } |
171 | 176 |
172 // ======= Debug rect colors ======= | 177 // ======= Debug rect colors ======= |
173 | 178 |
174 // Paint rects in red. | 179 // Paint rects in shades of green. |
175 SkColor DebugColors::PaintRectBorderColor() { | 180 SkColor DebugColors::PaintRectBorderColor(int color_index) { |
176 return SkColorSetARGB(255, 255, 0, 0); | 181 int real_index = color_index % arraysize(kPaintRectColors); |
182 return SkColorSetARGB(255, | |
183 kPaintRectColors[real_index][0], | |
184 kPaintRectColors[real_index][1], | |
185 kPaintRectColors[real_index][2]); | |
177 } | 186 } |
178 int DebugColors::PaintRectBorderWidth() { return 2; } | 187 int DebugColors::PaintRectBorderWidth() { return 2; } |
179 SkColor DebugColors::PaintRectFillColor() { | 188 SkColor DebugColors::PaintRectFillColor(int color_index) { |
180 return SkColorSetARGB(30, 255, 0, 0); | 189 int real_index = color_index % arraysize(kPaintRectColors); |
190 return SkColorSetARGB(30, | |
191 kPaintRectColors[real_index][0], | |
192 kPaintRectColors[real_index][1], | |
193 kPaintRectColors[real_index][2]); | |
181 } | 194 } |
182 | 195 |
183 // Property-changed rects in blue. | 196 // Property-changed rects in blue. |
184 SkColor DebugColors::PropertyChangedRectBorderColor() { | 197 SkColor DebugColors::PropertyChangedRectBorderColor() { |
185 return SkColorSetARGB(255, 0, 0, 255); | 198 return SkColorSetARGB(255, 0, 0, 255); |
186 } | 199 } |
187 int DebugColors::PropertyChangedRectBorderWidth() { return 2; } | 200 int DebugColors::PropertyChangedRectBorderWidth() { return 2; } |
188 SkColor DebugColors::PropertyChangedRectFillColor() { | 201 SkColor DebugColors::PropertyChangedRectFillColor() { |
189 return SkColorSetARGB(30, 0, 0, 255); | 202 return SkColorSetARGB(30, 0, 0, 255); |
190 } | 203 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 SkColor DebugColors::MemoryDisplayTextColor() { | 311 SkColor DebugColors::MemoryDisplayTextColor() { |
299 return SkColorSetARGB(255, 220, 220, 220); | 312 return SkColorSetARGB(255, 220, 220, 220); |
300 } | 313 } |
301 | 314 |
302 // Paint time display in green (similar to paint times in the WebInspector) | 315 // Paint time display in green (similar to paint times in the WebInspector) |
303 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() { | 316 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() { |
304 return SkColorSetRGB(75, 155, 55); | 317 return SkColorSetRGB(75, 155, 55); |
305 } | 318 } |
306 | 319 |
307 } // namespace cc | 320 } // namespace cc |
OLD | NEW |