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

Unified 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: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: cc/debug/debug_colors.cc
diff --git a/cc/debug/debug_colors.cc b/cc/debug/debug_colors.cc
index 353bd7996e0a4fcdf4079726eaa1b6940c48953c..5ebd7653aa2ded6dc404ed71e80bd67eff4f033f 100644
--- a/cc/debug/debug_colors.cc
+++ b/cc/debug/debug_colors.cc
@@ -173,13 +173,17 @@ SkColor DebugColors::EvictedTileCheckerboardColor() {
// ======= Debug rect colors =======
+SkColor fadedGreen(const int initial_value, const int step) {
caseq 2014/03/05 13:20:59 static SkColor FadedGreen...
malch 2014/03/05 14:43:26 Done.
+ int value = initial_value - (step * initial_value / DebugColors::kFadeSteps);
+ return SkColorSetARGB(value > 0 ? value : 0, 0, 195, 0);
caseq 2014/03/05 13:20:59 Can we rather fade them reducing alpha to 0?
malch 2014/03/05 14:43:26 Done.
+}
// Paint rects in green.
-SkColor DebugColors::PaintRectBorderColor() {
- return SkColorSetARGB(255, 0, 195, 0);
+SkColor DebugColors::PaintRectBorderColor(const int step) {
+ return fadedGreen(255, step);
}
int DebugColors::PaintRectBorderWidth() { return 2; }
-SkColor DebugColors::PaintRectFillColor() {
- return SkColorSetARGB(30, 0, 195, 0);
+SkColor DebugColors::PaintRectFillColor(const int step) {
+ return fadedGreen(60, step);
}
// Property-changed rects in blue.

Powered by Google App Engine
This is Rietveld 408576698