Chromium Code Reviews| Index: cc/debug/debug_rect_history.cc |
| diff --git a/cc/debug/debug_rect_history.cc b/cc/debug/debug_rect_history.cc |
| index de8bfc2cc2f84f5922837b9d3fc31ff0d98dceb5..8472c28f7f95c84a400299fccb67897804a61424 100644 |
| --- a/cc/debug/debug_rect_history.cc |
| +++ b/cc/debug/debug_rect_history.cc |
| @@ -125,11 +125,15 @@ void DebugRectHistory::SaveSurfaceDamageRects( |
| RenderSurfaceImpl* render_surface = render_surface_layer->render_surface(); |
| DCHECK(render_surface); |
| - debug_rects_.push_back(DebugRect( |
| - SURFACE_DAMAGE_RECT_TYPE, |
| - MathUtil::MapEnclosingClippedRect( |
| - render_surface->screen_space_transform(), |
| - render_surface->damage_tracker()->current_damage_rect()))); |
| + gfx::Rect damage_rect; |
| + bool is_valid_rect = |
| + render_surface->damage_tracker()->GetDamageRectIfValid(&damage_rect); |
|
enne (OOO)
2017/01/19 23:23:39
Maybe encapsulate this conditional block in a Rend
danakj
2017/01/20 17:03:04
My one thot on this is that then you have 2 ways t
vmpstr
2017/01/20 21:38:18
I think it still makes sense, since the two access
vmpstr
2017/01/20 21:38:18
Done.
|
| + if (!is_valid_rect) |
| + damage_rect = render_surface->content_rect(); |
| + debug_rects_.push_back( |
| + DebugRect(SURFACE_DAMAGE_RECT_TYPE, |
| + MathUtil::MapEnclosingClippedRect( |
| + render_surface->screen_space_transform(), damage_rect))); |
| } |
| } |