Index: cc/trees/damage_tracker.cc |
diff --git a/cc/trees/damage_tracker.cc b/cc/trees/damage_tracker.cc |
index 40741461320fa0affe36e8f7d8628d61691b1271..2a0f551b2d5e700a5464d8f010758ed8fc37fd65 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_); |
+ // Unify layer's update_rect and damage_rect. |
danakj
2014/04/17 00:00:56
drop this comment, it just says exactly what the c
|
+ 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,11 +299,10 @@ 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_content_rect = layer->LayerRectToContentRect(damage_rect); |
danakj
2014/04/17 00:00:56
rename this to |damage_content_rect| to match the
|
gfx::Rect update_rect_in_target_space = MathUtil::MapEnclosingClippedRect( |
reveman
2014/04/17 05:18:34
and |damage_rect_in_target_space| here
|
layer->draw_transform(), update_content_rect); |
target_damage_rect->Union(update_rect_in_target_space); |