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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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/trees/damage_tracker.h ('k') | cc/trees/layer_tree_host.h » ('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 <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
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
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
OLDNEW
« no previous file with comments | « cc/trees/damage_tracker.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698