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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } else { | 121 } else { |
122 // TODO(shawnsingh): can we clamp this damage to the surface's content rect? | 122 // TODO(shawnsingh): can we clamp this damage to the surface's content rect? |
123 // (affects performance, but not correctness) | 123 // (affects performance, but not correctness) |
124 damage_for_this_update.Union(damage_from_active_layers); | 124 damage_for_this_update.Union(damage_from_active_layers); |
125 damage_for_this_update.Union(damage_from_surface_mask); | 125 damage_for_this_update.Union(damage_from_surface_mask); |
126 damage_for_this_update.Union(damage_from_leftover_rects); | 126 damage_for_this_update.Union(damage_from_leftover_rects); |
127 | 127 |
128 gfx::Rect damage_rect; | 128 gfx::Rect damage_rect; |
129 bool is_rect_valid = damage_for_this_update.GetAsRect(&damage_rect); | 129 bool is_rect_valid = damage_for_this_update.GetAsRect(&damage_rect); |
130 if (is_rect_valid) { | 130 if (is_rect_valid) { |
131 damage_rect = filters.MapRect( | 131 damage_rect = |
132 damage_rect, target_surface->FiltersTransform().matrix()); | 132 filters.MapRect(damage_rect, target_surface->SurfaceScale().matrix()); |
133 damage_for_this_update = DamageAccumulator(); | 133 damage_for_this_update = DamageAccumulator(); |
134 damage_for_this_update.Union(damage_rect); | 134 damage_for_this_update.Union(damage_rect); |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 // Damage accumulates until we are notified that we actually did draw on that | 138 // Damage accumulates until we are notified that we actually did draw on that |
139 // frame. | 139 // frame. |
140 current_damage_.Union(damage_for_this_update); | 140 current_damage_.Union(damage_for_this_update); |
141 } | 141 } |
142 | 142 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 } | 439 } |
440 | 440 |
441 rect->set_x(x_); | 441 rect->set_x(x_); |
442 rect->set_y(y_); | 442 rect->set_y(y_); |
443 rect->set_width(width.ValueOrDie()); | 443 rect->set_width(width.ValueOrDie()); |
444 rect->set_height(height.ValueOrDie()); | 444 rect->set_height(height.ValueOrDie()); |
445 return true; | 445 return true; |
446 } | 446 } |
447 | 447 |
448 } // namespace cc | 448 } // namespace cc |
OLD | NEW |