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

Unified Diff: cc/layers/heads_up_display_layer_impl.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/layers/heads_up_display_layer_impl.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/heads_up_display_layer_impl.cc
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
index 51c0ed28466063145376a0bef136e345daec4af0..cd98c8e94bd81feb5e1fcba2a72e4dc51b4b7572 100644
--- a/cc/layers/heads_up_display_layer_impl.cc
+++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -684,6 +684,7 @@ void HeadsUpDisplayLayerImpl::DrawDebugRects(
const std::vector<DebugRect>& debug_rects = debug_rect_history->debug_rects();
std::vector<DebugRect> new_paint_rects;
+ std::vector<DebugRect> new_first_paint_rects;
for (size_t i = 0; i < debug_rects.size(); ++i) {
SkColor stroke_color = 0;
@@ -695,6 +696,9 @@ void HeadsUpDisplayLayerImpl::DrawDebugRects(
case PAINT_RECT_TYPE:
new_paint_rects.push_back(debug_rects[i]);
continue;
+ case FIRST_PAINT_RECT_TYPE:
+ new_first_paint_rects.push_back(debug_rects[i]);
+ continue;
case PROPERTY_CHANGED_RECT_TYPE:
stroke_color = DebugColors::PropertyChangedRectBorderColor();
fill_color = DebugColors::PropertyChangedRectFillColor();
@@ -773,13 +777,35 @@ void HeadsUpDisplayLayerImpl::DrawDebugRects(
if (fade_step_ > 0) {
fade_step_--;
for (size_t i = 0; i < paint_rects_.size(); ++i) {
- DrawDebugRect(canvas,
- &paint,
- paint_rects_[i],
- DebugColors::PaintRectBorderColor(fade_step_),
- DebugColors::PaintRectFillColor(fade_step_),
- DebugColors::PaintRectBorderWidth(),
- "");
+ bool is_first_paint = paint_rects_[i].type == FIRST_PAINT_RECT_TYPE;
+ DrawDebugRect(
+ canvas,
+ &paint,
+ paint_rects_[i],
+ DebugColors::PaintRectBorderColor(fade_step_, is_first_paint),
+ DebugColors::PaintRectFillColor(fade_step_, is_first_paint),
+ DebugColors::PaintRectBorderWidth(),
+ "");
+ }
+ }
+
+ // TODO(kouhei)
+ if (new_first_paint_rects.size()) {
+ first_paint_rects_.swap(new_first_paint_rects);
+ fade_step_f_ = DebugColors::kFadeSteps;
+ }
+ if (fade_step_f_ > 0) {
+ fade_step_f_--;
+ for (size_t i = 0; i < first_paint_rects_.size(); ++i) {
+ bool is_first_paint = first_paint_rects_[i].type == FIRST_PAINT_RECT_TYPE;
+ DrawDebugRect(
+ canvas,
+ &paint,
+ first_paint_rects_[i],
+ DebugColors::PaintRectBorderColor(fade_step_f_, is_first_paint),
+ DebugColors::PaintRectFillColor(fade_step_f_, is_first_paint),
+ DebugColors::PaintRectBorderWidth(),
+ "");
}
}
}
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698