Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: cc/trees/damage_tracker.cc

Issue 2241763002: cc: fix damage tracker rect with hidpi filters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/render_surface_impl.cc ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/layers/render_surface_impl.cc ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698