Index: cc/trees/damage_tracker.cc |
diff --git a/cc/trees/damage_tracker.cc b/cc/trees/damage_tracker.cc |
index 40741461320fa0affe36e8f7d8628d61691b1271..866f09d65692388c8e508d3456ed35054dd49d1b 100644 |
--- a/cc/trees/damage_tracker.cc |
+++ b/cc/trees/damage_tracker.cc |
@@ -287,6 +287,9 @@ void DamageTracker::ExtendDamageForLayer(LayerImpl* layer, |
layer->draw_transform(), gfx::Rect(layer->content_bounds())); |
data.Update(rect_in_target_space, mailboxId_); |
+ gfx::RectF damage_rect = |
+ gfx::UnionRects(layer->update_rect(), layer->damage_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,14 +298,13 @@ 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 (!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()); |
- gfx::Rect update_rect_in_target_space = MathUtil::MapEnclosingClippedRect( |
- layer->draw_transform(), update_content_rect); |
- target_damage_rect->Union(update_rect_in_target_space); |
+ // only affected by the layer's damaged area, which could be empty. |
+ gfx::Rect damage_content_rect = layer->LayerRectToContentRect(damage_rect); |
+ gfx::Rect damage_rect_in_target_space = MathUtil::MapEnclosingClippedRect( |
+ layer->draw_transform(), damage_content_rect); |
+ target_damage_rect->Union(damage_rect_in_target_space); |
} |
} |