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