Chromium Code Reviews| Index: cc/debug/debug_colors.cc |
| diff --git a/cc/debug/debug_colors.cc b/cc/debug/debug_colors.cc |
| index 4e3f32e317d71b87a7b0bd74200454a7a459556a..42a5991180f3aa2fe90f0f9623ab1da0b19859c9 100644 |
| --- a/cc/debug/debug_colors.cc |
| +++ b/cc/debug/debug_colors.cc |
| @@ -2,12 +2,21 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "base/macros.h" |
| + |
| #include "cc/debug/debug_colors.h" |
| #include "cc/trees/layer_tree_impl.h" |
| namespace cc { |
| +static const int kPaintRectColors[][3] = { |
| + {0, 95, 0}, |
| + {0, 175, 0}, |
| + {0, 255, 0} |
| +}; |
| +static int s_currentPaintRectColor = 0; |
| + |
| static float Scale(float width, const LayerTreeImpl* tree_impl) { |
| return width * (tree_impl ? tree_impl->device_scale_factor() : 1); |
| } |
| @@ -171,13 +180,23 @@ SkColor DebugColors::EvictedTileCheckerboardColor() { |
| // ======= Debug rect colors ======= |
| -// Paint rects in red. |
| +// Paint rects in shades of green. |
| SkColor DebugColors::PaintRectBorderColor() { |
| - return SkColorSetARGB(255, 255, 0, 0); |
| + return SkColorSetARGB(255, |
| + kPaintRectColors[s_currentPaintRectColor][0], |
| + kPaintRectColors[s_currentPaintRectColor][1], |
| + kPaintRectColors[s_currentPaintRectColor][2]); |
| } |
| int DebugColors::PaintRectBorderWidth() { return 2; } |
| SkColor DebugColors::PaintRectFillColor() { |
| - return SkColorSetARGB(30, 255, 0, 0); |
| + return SkColorSetARGB(30, |
| + kPaintRectColors[s_currentPaintRectColor][0], |
| + kPaintRectColors[s_currentPaintRectColor][1], |
| + kPaintRectColors[s_currentPaintRectColor][2]); |
| +} |
| +void DebugColors::CyclePaintRectColor() { |
| + s_currentPaintRectColor = |
|
danakj
2014/01/29 18:34:32
Can you move this variable to be a member of the H
|
| + (s_currentPaintRectColor + 1) % arraysize(kPaintRectColors); |
| } |
| // Property-changed rects in blue. |