| 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" | 5 #include "base/macros.h" |
| 6 | 6 |
| 7 #include "cc/debug/debug_colors.h" | 7 #include "cc/debug/debug_colors.h" |
| 8 | 8 |
| 9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
| 10 | 10 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 return SkColorSetRGB(128, 200, 245); | 166 return SkColorSetRGB(128, 200, 245); |
| 167 } | 167 } |
| 168 | 168 |
| 169 // Evicted tiles get pale red checkerboards. | 169 // Evicted tiles get pale red checkerboards. |
| 170 SkColor DebugColors::EvictedTileCheckerboardColor() { | 170 SkColor DebugColors::EvictedTileCheckerboardColor() { |
| 171 return SkColorSetRGB(255, 200, 200); | 171 return SkColorSetRGB(255, 200, 200); |
| 172 } | 172 } |
| 173 | 173 |
| 174 // ======= Debug rect colors ======= | 174 // ======= Debug rect colors ======= |
| 175 | 175 |
| 176 static SkColor FadedGreen(int initial_value, int step) { |
| 177 DCHECK_GE(step, 0); |
| 178 DCHECK_LE(step, DebugColors::kFadeSteps); |
| 179 int value = step * initial_value / DebugColors::kFadeSteps; |
| 180 return SkColorSetARGB(value, 0, 195, 0); |
| 181 } |
| 176 // Paint rects in green. | 182 // Paint rects in green. |
| 177 SkColor DebugColors::PaintRectBorderColor() { | 183 SkColor DebugColors::PaintRectBorderColor(int step) { |
| 178 return SkColorSetARGB(255, 0, 195, 0); | 184 return FadedGreen(255, step); |
| 179 } | 185 } |
| 180 int DebugColors::PaintRectBorderWidth() { return 2; } | 186 int DebugColors::PaintRectBorderWidth() { return 2; } |
| 181 SkColor DebugColors::PaintRectFillColor() { | 187 SkColor DebugColors::PaintRectFillColor(int step) { |
| 182 return SkColorSetARGB(30, 0, 195, 0); | 188 return FadedGreen(60, step); |
| 183 } | 189 } |
| 184 | 190 |
| 185 // Property-changed rects in blue. | 191 // Property-changed rects in blue. |
| 186 SkColor DebugColors::PropertyChangedRectBorderColor() { | 192 SkColor DebugColors::PropertyChangedRectBorderColor() { |
| 187 return SkColorSetARGB(255, 0, 0, 255); | 193 return SkColorSetARGB(255, 0, 0, 255); |
| 188 } | 194 } |
| 189 int DebugColors::PropertyChangedRectBorderWidth() { return 2; } | 195 int DebugColors::PropertyChangedRectBorderWidth() { return 2; } |
| 190 SkColor DebugColors::PropertyChangedRectFillColor() { | 196 SkColor DebugColors::PropertyChangedRectFillColor() { |
| 191 return SkColorSetARGB(30, 0, 0, 255); | 197 return SkColorSetARGB(30, 0, 0, 255); |
| 192 } | 198 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 SkColor DebugColors::MemoryDisplayTextColor() { | 306 SkColor DebugColors::MemoryDisplayTextColor() { |
| 301 return SkColorSetARGB(255, 220, 220, 220); | 307 return SkColorSetARGB(255, 220, 220, 220); |
| 302 } | 308 } |
| 303 | 309 |
| 304 // Paint time display in green (similar to paint times in the WebInspector) | 310 // Paint time display in green (similar to paint times in the WebInspector) |
| 305 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() { | 311 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() { |
| 306 return SkColorSetRGB(75, 155, 55); | 312 return SkColorSetRGB(75, 155, 55); |
| 307 } | 313 } |
| 308 | 314 |
| 309 } // namespace cc | 315 } // namespace cc |
| OLD | NEW |