Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: cc/debug/debug_colors.cc

Issue 187343007: Adding fading effect for paint rectangles in HUD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed int to unsigned. Removed const where it's needless. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(unsigned initial_value, unsigned step) {
177 unsigned value = step * initial_value / DebugColors::kFadeSteps;
danakj 2014/03/06 19:03:21 DCHECK that step is in [0, kFadeSteps]?
178 return SkColorSetARGB(value, 0, 195, 0);
179 }
176 // Paint rects in green. 180 // Paint rects in green.
177 SkColor DebugColors::PaintRectBorderColor() { 181 SkColor DebugColors::PaintRectBorderColor(unsigned step) {
178 return SkColorSetARGB(255, 0, 195, 0); 182 return FadedGreen(255, step);
179 } 183 }
180 int DebugColors::PaintRectBorderWidth() { return 2; } 184 int DebugColors::PaintRectBorderWidth() { return 2; }
181 SkColor DebugColors::PaintRectFillColor() { 185 SkColor DebugColors::PaintRectFillColor(unsigned step) {
182 return SkColorSetARGB(30, 0, 195, 0); 186 return FadedGreen(60, step);
183 } 187 }
184 188
185 // Property-changed rects in blue. 189 // Property-changed rects in blue.
186 SkColor DebugColors::PropertyChangedRectBorderColor() { 190 SkColor DebugColors::PropertyChangedRectBorderColor() {
187 return SkColorSetARGB(255, 0, 0, 255); 191 return SkColorSetARGB(255, 0, 0, 255);
188 } 192 }
189 int DebugColors::PropertyChangedRectBorderWidth() { return 2; } 193 int DebugColors::PropertyChangedRectBorderWidth() { return 2; }
190 SkColor DebugColors::PropertyChangedRectFillColor() { 194 SkColor DebugColors::PropertyChangedRectFillColor() {
191 return SkColorSetARGB(30, 0, 0, 255); 195 return SkColorSetARGB(30, 0, 0, 255);
192 } 196 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 SkColor DebugColors::MemoryDisplayTextColor() { 304 SkColor DebugColors::MemoryDisplayTextColor() {
301 return SkColorSetARGB(255, 220, 220, 220); 305 return SkColorSetARGB(255, 220, 220, 220);
302 } 306 }
303 307
304 // 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)
305 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() { 309 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() {
306 return SkColorSetRGB(75, 155, 55); 310 return SkColorSetRGB(75, 155, 55);
307 } 311 }
308 312
309 } // namespace cc 313 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698