Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 gfx::Rect TrackDamageFromLeftoverRects(); | 57 gfx::Rect TrackDamageFromLeftoverRects(); |
| 58 | 58 |
| 59 void PrepareRectHistoryForUpdate(); | 59 void PrepareRectHistoryForUpdate(); |
| 60 | 60 |
| 61 // These helper functions are used only in TrackDamageFromActiveLayers(). | 61 // These helper functions are used only in TrackDamageFromActiveLayers(). |
| 62 void ExtendDamageForLayer(LayerImpl* layer, gfx::Rect* target_damage_rect); | 62 void ExtendDamageForLayer(LayerImpl* layer, gfx::Rect* target_damage_rect); |
| 63 void ExtendDamageForRenderSurface(LayerImpl* layer, | 63 void ExtendDamageForRenderSurface(LayerImpl* layer, |
| 64 gfx::Rect* target_damage_rect); | 64 gfx::Rect* target_damage_rect); |
| 65 | 65 |
| 66 struct RectMapData { | 66 struct RectMapData { |
| 67 RectMapData() : layer_id_(0), mailboxId_(0) {} | 67 RectMapData() : layer_id_(0), mailboxId_(0), is_render_surface_(false) {} |
|
ajuma
2016/05/16 15:16:21
How about splitting the map in two, one map for la
jaydasika
2016/05/16 19:32:49
Done.
| |
| 68 explicit RectMapData(int layer_id) : layer_id_(layer_id), mailboxId_(0) {} | 68 explicit RectMapData(int layer_id) |
| 69 void Update(const gfx::Rect& rect, unsigned int mailboxId) { | 69 : layer_id_(layer_id), mailboxId_(0), is_render_surface_(false) {} |
| 70 void Update(const gfx::Rect& rect, | |
| 71 unsigned int mailboxId, | |
| 72 bool is_render_surface) { | |
| 70 mailboxId_ = mailboxId; | 73 mailboxId_ = mailboxId; |
| 71 rect_ = rect; | 74 rect_ = rect; |
| 75 is_render_surface_ = is_render_surface; | |
| 72 } | 76 } |
| 73 | 77 |
| 74 bool operator < (const RectMapData& other) const { | 78 bool operator < (const RectMapData& other) const { |
| 75 return layer_id_ < other.layer_id_; | 79 return layer_id_ < other.layer_id_; |
| 76 } | 80 } |
| 77 | 81 |
| 78 int layer_id_; | 82 int layer_id_; |
| 79 unsigned int mailboxId_; | 83 unsigned int mailboxId_; |
| 84 bool is_render_surface_; | |
| 80 gfx::Rect rect_; | 85 gfx::Rect rect_; |
| 81 }; | 86 }; |
| 82 typedef std::vector<RectMapData> SortedRectMap; | 87 typedef std::vector<RectMapData> SortedRectMap; |
| 83 | 88 |
| 84 RectMapData& RectDataForLayer(int layer_id, bool* layer_is_new); | 89 RectMapData& RectDataForLayer(int layer_id, bool* layer_is_new); |
| 85 | 90 |
| 86 SortedRectMap rect_history_; | 91 SortedRectMap rect_history_; |
| 87 | 92 |
| 88 unsigned int mailboxId_; | 93 unsigned int mailboxId_; |
| 89 gfx::Rect current_damage_rect_; | 94 gfx::Rect current_damage_rect_; |
| 90 | 95 |
| 91 DISALLOW_COPY_AND_ASSIGN(DamageTracker); | 96 DISALLOW_COPY_AND_ASSIGN(DamageTracker); |
| 92 }; | 97 }; |
| 93 | 98 |
| 94 } // namespace cc | 99 } // namespace cc |
| 95 | 100 |
| 96 #endif // CC_TREES_DAMAGE_TRACKER_H_ | 101 #endif // CC_TREES_DAMAGE_TRACKER_H_ |
| OLD | NEW |