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

Unified Diff: cc/trees/damage_tracker.h

Issue 1976413002: cc : Fix damage rect bug caused by deletion of render surface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/texture_layer_unittest.cc ('k') | cc/trees/damage_tracker.cc » ('j') | no next file with comments »
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 d1ed0a1ac1f97b49fda7080fcc8b06fd395c8719..c03ca329cebd43fc596a5fb02b85316ef1d2710e 100644
--- a/cc/trees/damage_tracker.h
+++ b/cc/trees/damage_tracker.h
@@ -63,15 +63,16 @@ class CC_EXPORT DamageTracker {
void ExtendDamageForRenderSurface(LayerImpl* layer,
gfx::Rect* target_damage_rect);
- struct RectMapData {
- RectMapData() : layer_id_(0), mailboxId_(0) {}
- explicit RectMapData(int layer_id) : layer_id_(layer_id), mailboxId_(0) {}
+ struct LayerRectMapData {
+ LayerRectMapData() : layer_id_(0), mailboxId_(0) {}
+ explicit LayerRectMapData(int layer_id)
+ : layer_id_(layer_id), mailboxId_(0) {}
void Update(const gfx::Rect& rect, unsigned int mailboxId) {
mailboxId_ = mailboxId;
rect_ = rect;
}
- bool operator < (const RectMapData& other) const {
+ bool operator<(const LayerRectMapData& other) const {
return layer_id_ < other.layer_id_;
}
@@ -79,11 +80,32 @@ class CC_EXPORT DamageTracker {
unsigned int mailboxId_;
gfx::Rect rect_;
};
- typedef std::vector<RectMapData> SortedRectMap;
- RectMapData& RectDataForLayer(int layer_id, bool* layer_is_new);
+ struct SurfaceRectMapData {
+ SurfaceRectMapData() : surface_id_(0), mailboxId_(0) {}
+ explicit SurfaceRectMapData(int surface_id)
+ : surface_id_(surface_id), mailboxId_(0) {}
+ void Update(const gfx::Rect& rect, unsigned int mailboxId) {
+ mailboxId_ = mailboxId;
+ rect_ = rect;
+ }
+
+ bool operator<(const SurfaceRectMapData& other) const {
+ return surface_id_ < other.surface_id_;
+ }
+
+ int surface_id_;
+ unsigned int mailboxId_;
+ gfx::Rect rect_;
+ };
+ typedef std::vector<LayerRectMapData> SortedRectMapForLayers;
+ typedef std::vector<SurfaceRectMapData> SortedRectMapForSurfaces;
+
+ LayerRectMapData& RectDataForLayer(int layer_id, bool* layer_is_new);
+ SurfaceRectMapData& RectDataForSurface(int layer_id, bool* layer_is_new);
- SortedRectMap rect_history_;
+ SortedRectMapForLayers rect_history_for_layers_;
+ SortedRectMapForSurfaces rect_history_for_surfaces_;
unsigned int mailboxId_;
gfx::Rect current_damage_rect_;
« no previous file with comments | « cc/layers/texture_layer_unittest.cc ('k') | cc/trees/damage_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698