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

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

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/test/tiled_layer_test_common.cc ('k') | cc/trees/damage_tracker.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 #ifndef CC_TREES_DAMAGE_TRACKER_H_ 5 #ifndef CC_TREES_DAMAGE_TRACKER_H_
6 #define CC_TREES_DAMAGE_TRACKER_H_ 6 #define CC_TREES_DAMAGE_TRACKER_H_
7 7
8 #include <vector> 8 #include <vector>
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // Computes the region where pixels have actually changed on a 26 // Computes the region where pixels have actually changed on a
27 // RenderSurfaceImpl. This region is used to scissor what is actually drawn to 27 // RenderSurfaceImpl. This region is used to scissor what is actually drawn to
28 // the screen to save GPU computation and bandwidth. 28 // the screen to save GPU computation and bandwidth.
29 class CC_EXPORT DamageTracker { 29 class CC_EXPORT DamageTracker {
30 public: 30 public:
31 static scoped_ptr<DamageTracker> Create(); 31 static scoped_ptr<DamageTracker> Create();
32 ~DamageTracker(); 32 ~DamageTracker();
33 33
34 void DidDrawDamagedArea() { current_damage_rect_ = gfx::RectF(); } 34 void DidDrawDamagedArea() { current_damage_rect_ = gfx::RectF(); }
35 void AddDamageNextUpdate(gfx::RectF dmg) { current_damage_rect_.Union(dmg); } 35 void AddDamageNextUpdate(const gfx::RectF& dmg) {
36 current_damage_rect_.Union(dmg);
37 }
36 void UpdateDamageTrackingState( 38 void UpdateDamageTrackingState(
37 const LayerImplList& layer_list, 39 const LayerImplList& layer_list,
38 int target_surface_layer_id, 40 int target_surface_layer_id,
39 bool target_surface_property_changed_only_from_descendant, 41 bool target_surface_property_changed_only_from_descendant,
40 gfx::Rect target_surface_content_rect, 42 const gfx::Rect& target_surface_content_rect,
41 LayerImpl* target_surface_mask_layer, 43 LayerImpl* target_surface_mask_layer,
42 const FilterOperations& filters); 44 const FilterOperations& filters);
43 45
44 gfx::RectF current_damage_rect() { return current_damage_rect_; } 46 gfx::RectF current_damage_rect() { return current_damage_rect_; }
45 47
46 private: 48 private:
47 DamageTracker(); 49 DamageTracker();
48 50
49 gfx::RectF TrackDamageFromActiveLayers( 51 gfx::RectF TrackDamageFromActiveLayers(
50 const LayerImplList& layer_list, 52 const LayerImplList& layer_list,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 85
84 unsigned int mailboxId_; 86 unsigned int mailboxId_;
85 gfx::RectF current_damage_rect_; 87 gfx::RectF current_damage_rect_;
86 88
87 DISALLOW_COPY_AND_ASSIGN(DamageTracker); 89 DISALLOW_COPY_AND_ASSIGN(DamageTracker);
88 }; 90 };
89 91
90 } // namespace cc 92 } // namespace cc
91 93
92 #endif // CC_TREES_DAMAGE_TRACKER_H_ 94 #endif // CC_TREES_DAMAGE_TRACKER_H_
OLDNEW
« no previous file with comments | « cc/test/tiled_layer_test_common.cc ('k') | cc/trees/damage_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698