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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
10 #include "cc/layers/heads_up_display_layer_impl.h" | 10 #include "cc/layers/heads_up_display_layer_impl.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 ExpandRectWithFilters(&filter_rect, filters); | 42 ExpandRectWithFilters(&filter_rect, filters); |
43 | 43 |
44 expanded_damage_rect.Intersect(filter_rect); | 44 expanded_damage_rect.Intersect(filter_rect); |
45 damage_rect->Union(expanded_damage_rect); | 45 damage_rect->Union(expanded_damage_rect); |
46 } | 46 } |
47 | 47 |
48 void DamageTracker::UpdateDamageTrackingState( | 48 void DamageTracker::UpdateDamageTrackingState( |
49 const LayerImplList& layer_list, | 49 const LayerImplList& layer_list, |
50 int target_surface_layer_id, | 50 int target_surface_layer_id, |
51 bool target_surface_property_changed_only_from_descendant, | 51 bool target_surface_property_changed_only_from_descendant, |
52 gfx::Rect target_surface_content_rect, | 52 const gfx::Rect& target_surface_content_rect, |
53 LayerImpl* target_surface_mask_layer, | 53 LayerImpl* target_surface_mask_layer, |
54 const FilterOperations& filters) { | 54 const FilterOperations& filters) { |
55 // | 55 // |
56 // This function computes the "damage rect" of a target surface, and updates | 56 // This function computes the "damage rect" of a target surface, and updates |
57 // the state that is used to correctly track damage across frames. The damage | 57 // the state that is used to correctly track damage across frames. The damage |
58 // rect is the region of the surface that may have changed and needs to be | 58 // rect is the region of the surface that may have changed and needs to be |
59 // redrawn. This can be used to scissor what is actually drawn, to save GPU | 59 // redrawn. This can be used to scissor what is actually drawn, to save GPU |
60 // computation and bandwidth. | 60 // computation and bandwidth. |
61 // | 61 // |
62 // The surface's damage rect is computed as the union of all possible changes | 62 // The surface's damage rect is computed as the union of all possible changes |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 // one in them. This means we need to redraw any pixels in the surface being | 396 // one in them. This means we need to redraw any pixels in the surface being |
397 // used for the blur in this layer this frame. | 397 // used for the blur in this layer this frame. |
398 if (layer->background_filters().HasFilterThatMovesPixels()) { | 398 if (layer->background_filters().HasFilterThatMovesPixels()) { |
399 ExpandDamageRectInsideRectWithFilters(target_damage_rect, | 399 ExpandDamageRectInsideRectWithFilters(target_damage_rect, |
400 surface_rect_in_target_space, | 400 surface_rect_in_target_space, |
401 layer->background_filters()); | 401 layer->background_filters()); |
402 } | 402 } |
403 } | 403 } |
404 | 404 |
405 } // namespace cc | 405 } // namespace cc |
OLD | NEW |