Chromium Code Reviews| Index: cc/trees/damage_tracker.cc |
| diff --git a/cc/trees/damage_tracker.cc b/cc/trees/damage_tracker.cc |
| index 40741461320fa0affe36e8f7d8628d61691b1271..7f020072f330c755bf9af933cf9ae807fa07397c 100644 |
| --- a/cc/trees/damage_tracker.cc |
| +++ b/cc/trees/damage_tracker.cc |
| @@ -287,6 +287,10 @@ void DamageTracker::ExtendDamageForLayer(LayerImpl* layer, |
| layer->draw_transform(), gfx::Rect(layer->content_bounds())); |
| data.Update(rect_in_target_space, mailboxId_); |
| + // Union layer's update_rect with damage_rect |
|
reveman
2014/04/15 16:25:59
nit: missing period at the end of the line.
|
| + gfx::RectF unified_update_and_damage_rect = |
|
reveman
2014/04/15 16:25:59
The comment and variable names below are no longer
|
| + gfx::UnionRects(layer->update_rect(), layer->damage_content_rect()); |
| + |
| if (layer_is_new || layer->LayerPropertyChanged()) { |
| // If a layer is new or has changed, then its entire layer rect affects the |
| // target surface. |
| @@ -295,11 +299,11 @@ void DamageTracker::ExtendDamageForLayer(LayerImpl* layer, |
| // The layer's old region is now exposed on the target surface, too. |
| // Note old_rect_in_target_space is already in target space. |
| target_damage_rect->Union(old_rect_in_target_space); |
| - } else if (!layer->update_rect().IsEmpty()) { |
| + } else if (!unified_update_and_damage_rect.IsEmpty()) { |
| // If the layer properties haven't changed, then the the target surface is |
| // only affected by the layer's update area, which could be empty. |
| gfx::Rect update_content_rect = |
| - layer->LayerRectToContentRect(layer->update_rect()); |
| + layer->LayerRectToContentRect(unified_update_and_damage_rect); |
| gfx::Rect update_rect_in_target_space = MathUtil::MapEnclosingClippedRect( |
| layer->draw_transform(), update_content_rect); |
| target_damage_rect->Union(update_rect_in_target_space); |