| 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 <vector> | 9 #include <vector> |
| 10 |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
| 12 #include "cc/layers/layer_collections.h" | 13 #include "cc/layers/layer_collections.h" |
| 13 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
| 14 | 15 |
| 15 class SkImageFilter; | 16 class SkImageFilter; |
| 16 | 17 |
| 17 namespace gfx { | 18 namespace gfx { |
| 18 class Rect; | 19 class Rect; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace cc { | 22 namespace cc { |
| 22 | 23 |
| 23 class FilterOperations; | 24 class FilterOperations; |
| 24 class LayerImpl; | 25 class LayerImpl; |
| 25 class RenderSurfaceImpl; | 26 class RenderSurfaceImpl; |
| 26 | 27 |
| 27 // Computes the region where pixels have actually changed on a | 28 // Computes the region where pixels have actually changed on a |
| 28 // RenderSurfaceImpl. This region is used to scissor what is actually drawn to | 29 // RenderSurfaceImpl. This region is used to scissor what is actually drawn to |
| 29 // the screen to save GPU computation and bandwidth. | 30 // the screen to save GPU computation and bandwidth. |
| 30 class CC_EXPORT DamageTracker { | 31 class CC_EXPORT DamageTracker { |
| 31 public: | 32 public: |
| 32 static scoped_ptr<DamageTracker> Create(); | 33 static std::unique_ptr<DamageTracker> Create(); |
| 33 ~DamageTracker(); | 34 ~DamageTracker(); |
| 34 | 35 |
| 35 void DidDrawDamagedArea() { current_damage_rect_ = gfx::Rect(); } | 36 void DidDrawDamagedArea() { current_damage_rect_ = gfx::Rect(); } |
| 36 void AddDamageNextUpdate(const gfx::Rect& dmg) { | 37 void AddDamageNextUpdate(const gfx::Rect& dmg) { |
| 37 current_damage_rect_.Union(dmg); | 38 current_damage_rect_.Union(dmg); |
| 38 } | 39 } |
| 39 void UpdateDamageTrackingState( | 40 void UpdateDamageTrackingState( |
| 40 const LayerImplList& layer_list, | 41 const LayerImplList& layer_list, |
| 41 int target_surface_layer_id, | 42 int target_surface_layer_id, |
| 42 bool target_surface_property_changed_only_from_descendant, | 43 bool target_surface_property_changed_only_from_descendant, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 86 |
| 86 unsigned int mailboxId_; | 87 unsigned int mailboxId_; |
| 87 gfx::Rect current_damage_rect_; | 88 gfx::Rect current_damage_rect_; |
| 88 | 89 |
| 89 DISALLOW_COPY_AND_ASSIGN(DamageTracker); | 90 DISALLOW_COPY_AND_ASSIGN(DamageTracker); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 } // namespace cc | 93 } // namespace cc |
| 93 | 94 |
| 94 #endif // CC_TREES_DAMAGE_TRACKER_H_ | 95 #endif // CC_TREES_DAMAGE_TRACKER_H_ |
| OLD | NEW |