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

Unified Diff: cc/trees/damage_tracker.h

Issue 79173005: Improve DamageTracker performance. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/trees/damage_tracker.cc » ('j') | cc/trees/damage_tracker.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/damage_tracker.h
diff --git a/cc/trees/damage_tracker.h b/cc/trees/damage_tracker.h
index fbcaa69824df97de458e29d2c0c81fd1a315834b..eb7bf1b8dcff1113a4c0f52ff368fe8571e22b9b 100644
--- a/cc/trees/damage_tracker.h
+++ b/cc/trees/damage_tracker.h
@@ -53,21 +53,29 @@ class CC_EXPORT DamageTracker {
gfx::RectF TrackDamageFromSurfaceMask(LayerImpl* target_surface_mask_layer);
gfx::RectF TrackDamageFromLeftoverRects();
- gfx::RectF RemoveRectFromCurrentFrame(int layer_id, bool* layer_is_new);
- void SaveRectForNextFrame(int layer_id, const gfx::RectF& target_space_rect);
+ void PrepareRectHistoryForUpdate();
// These helper functions are used only in TrackDamageFromActiveLayers().
void ExtendDamageForLayer(LayerImpl* layer, gfx::RectF* target_damage_rect);
void ExtendDamageForRenderSurface(LayerImpl* layer,
gfx::RectF* target_damage_rect);
- // To correctly track exposed regions, two hashtables of rects are maintained.
- // The "current" map is used to compute exposed regions of the current frame,
- // while the "next" map is used to collect layer rects that are used in the
- // next frame.
- typedef base::hash_map<int, gfx::RectF> RectMap;
- scoped_ptr<RectMap> current_rect_history_;
- scoped_ptr<RectMap> next_rect_history_;
+ struct RectMapData {
danakj 2013/11/21 00:13:40 formatting is off, please run git cl format on the
ostap 2013/11/21 17:06:23 Great! Didn't know about "cl format"! Done
+ RectMapData() : updated_(false) {}
+ void Update(const gfx::RectF& rect) {
+ rect_ = rect;
+ updated_ = true;
+ }
+
+ gfx::RectF rect_;
+ bool updated_;
+
+ };
+ typedef base::hash_map<int, RectMapData> RectMap;
+
+ RectMapData& RectDataForLayer(int layer_id, bool* layer_is_new);
+
+ RectMap rect_history_;
gfx::RectF current_damage_rect_;
« no previous file with comments | « no previous file | cc/trees/damage_tracker.cc » ('j') | cc/trees/damage_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698