| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/damage_tracker.h" | 5 #include "cc/trees/damage_tracker.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 if (target_surface_property_changed_only_from_descendant) { | 133 if (target_surface_property_changed_only_from_descendant) { |
| 134 damage_rect_for_this_update = target_surface_content_rect; | 134 damage_rect_for_this_update = target_surface_content_rect; |
| 135 } else { | 135 } else { |
| 136 // TODO(shawnsingh): can we clamp this damage to the surface's content rect? | 136 // TODO(shawnsingh): can we clamp this damage to the surface's content rect? |
| 137 // (affects performance, but not correctness) | 137 // (affects performance, but not correctness) |
| 138 damage_rect_for_this_update = damage_from_active_layers; | 138 damage_rect_for_this_update = damage_from_active_layers; |
| 139 damage_rect_for_this_update.Union(damage_from_surface_mask); | 139 damage_rect_for_this_update.Union(damage_from_surface_mask); |
| 140 damage_rect_for_this_update.Union(damage_from_leftover_rects); | 140 damage_rect_for_this_update.Union(damage_from_leftover_rects); |
| 141 damage_rect_for_this_update = | 141 damage_rect_for_this_update = |
| 142 filters.MapRect(damage_rect_for_this_update, SkMatrix::I()); | 142 filters.MapRect(damage_rect_for_this_update, |
| 143 target_surface->FiltersTransform().matrix()); |
| 143 } | 144 } |
| 144 | 145 |
| 145 // Damage accumulates until we are notified that we actually did draw on that | 146 // Damage accumulates until we are notified that we actually did draw on that |
| 146 // frame. | 147 // frame. |
| 147 current_damage_rect_.Union(damage_rect_for_this_update); | 148 current_damage_rect_.Union(damage_rect_for_this_update); |
| 148 } | 149 } |
| 149 | 150 |
| 150 DamageTracker::LayerRectMapData& DamageTracker::RectDataForLayer( | 151 DamageTracker::LayerRectMapData& DamageTracker::RectDataForLayer( |
| 151 int layer_id, | 152 int layer_id, |
| 152 bool* layer_is_new) { | 153 bool* layer_is_new) { |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 // used for the blur in this layer this frame. | 430 // used for the blur in this layer this frame. |
| 430 const FilterOperations& background_filters = | 431 const FilterOperations& background_filters = |
| 431 render_surface->BackgroundFilters(); | 432 render_surface->BackgroundFilters(); |
| 432 if (background_filters.HasFilterThatMovesPixels()) { | 433 if (background_filters.HasFilterThatMovesPixels()) { |
| 433 ExpandDamageRectInsideRectWithFilters( | 434 ExpandDamageRectInsideRectWithFilters( |
| 434 target_damage_rect, surface_rect_in_target_space, background_filters); | 435 target_damage_rect, surface_rect_in_target_space, background_filters); |
| 435 } | 436 } |
| 436 } | 437 } |
| 437 | 438 |
| 438 } // namespace cc | 439 } // namespace cc |
| OLD | NEW |