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

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

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Calculate damage of |force_render_surface|. Created 3 years, 7 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
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 <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 23 matching lines...) Expand all
34 34
35 static void UpdateDamageTracking( 35 static void UpdateDamageTracking(
36 LayerTreeImpl* layer_tree_impl, 36 LayerTreeImpl* layer_tree_impl,
37 const RenderSurfaceList& render_surface_list); 37 const RenderSurfaceList& render_surface_list);
38 38
39 void DidDrawDamagedArea() { current_damage_ = DamageAccumulator(); } 39 void DidDrawDamagedArea() { current_damage_ = DamageAccumulator(); }
40 void AddDamageNextUpdate(const gfx::Rect& dmg) { current_damage_.Union(dmg); } 40 void AddDamageNextUpdate(const gfx::Rect& dmg) { current_damage_.Union(dmg); }
41 41
42 bool GetDamageRectIfValid(gfx::Rect* rect); 42 bool GetDamageRectIfValid(gfx::Rect* rect);
43 43
44 bool has_property_change_on_contributing_render_surface() const {
45 return has_property_change_on_contributing_render_surface_;
46 }
47
44 private: 48 private:
45 DamageTracker(); 49 DamageTracker();
46 50
47 class DamageAccumulator { 51 class DamageAccumulator {
48 public: 52 public:
49 template <typename Type> 53 template <typename Type>
50 void Union(const Type& rect) { 54 void Union(const Type& rect) {
51 if (!is_valid_rect_) 55 if (!is_valid_rect_)
52 return; 56 return;
53 if (rect.IsEmpty()) 57 if (rect.IsEmpty())
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 141
138 SortedRectMapForLayers rect_history_for_layers_; 142 SortedRectMapForLayers rect_history_for_layers_;
139 SortedRectMapForSurfaces rect_history_for_surfaces_; 143 SortedRectMapForSurfaces rect_history_for_surfaces_;
140 144
141 unsigned int mailboxId_; 145 unsigned int mailboxId_;
142 DamageAccumulator current_damage_; 146 DamageAccumulator current_damage_;
143 147
144 // Damage accumulated since the last call to PrepareForUpdate(). 148 // Damage accumulated since the last call to PrepareForUpdate().
145 DamageAccumulator damage_for_this_update_; 149 DamageAccumulator damage_for_this_update_;
146 150
151 // Property changes from contributing render surface accumulated since the
152 // last call to PrepareForUpdate().
153 bool has_property_change_on_contributing_render_surface_;
154
147 DISALLOW_COPY_AND_ASSIGN(DamageTracker); 155 DISALLOW_COPY_AND_ASSIGN(DamageTracker);
148 }; 156 };
149 157
150 } // namespace cc 158 } // namespace cc
151 159
152 #endif // CC_TREES_DAMAGE_TRACKER_H_ 160 #endif // CC_TREES_DAMAGE_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698