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

Unified Diff: cc/debug/debug_colors.cc

Issue 474783002: HUD: Show first paint invalidation in red (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compilefix Created 6 years, 3 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
« no previous file with comments | « cc/debug/debug_colors.h ('k') | cc/debug/debug_rect_history.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/debug_colors.cc
diff --git a/cc/debug/debug_colors.cc b/cc/debug/debug_colors.cc
index 6cbbfe9431d6104a814df11d927eeb1d67c03953..399b71e8db0d7d0703a8bebccda3b7713f8e99e0 100644
--- a/cc/debug/debug_colors.cc
+++ b/cc/debug/debug_colors.cc
@@ -171,13 +171,19 @@ static SkColor FadedGreen(int initial_value, int step) {
int value = step * initial_value / DebugColors::kFadeSteps;
return SkColorSetARGB(value, 0, 195, 0);
}
+static SkColor FadedRed(int initial_value, int step) {
+ DCHECK_GE(step, 0);
+ DCHECK_LE(step, DebugColors::kFadeSteps);
+ int value = step * initial_value / DebugColors::kFadeSteps;
+ return SkColorSetARGB(value, 200, 0, 0);
+}
// Paint rects in green.
-SkColor DebugColors::PaintRectBorderColor(int step) {
- return FadedGreen(255, step);
+SkColor DebugColors::PaintRectBorderColor(int step, bool is_first_paint) {
+ return is_first_paint ? FadedRed(255, step) : FadedGreen(255, step);
}
int DebugColors::PaintRectBorderWidth() { return 2; }
-SkColor DebugColors::PaintRectFillColor(int step) {
- return FadedGreen(60, step);
+SkColor DebugColors::PaintRectFillColor(int step, bool is_first_paint) {
+ return is_first_paint ? FadedRed(60, step) : FadedGreen(60, step);
}
// Property-changed rects in blue.
« no previous file with comments | « cc/debug/debug_colors.h ('k') | cc/debug/debug_rect_history.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698