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 CCDamageTracker_h | 5 #ifndef CCDamageTracker_h |
6 #define CCDamageTracker_h | 6 #define CCDamageTracker_h |
7 | 7 |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/cc_export.h" |
10 #include "FloatRect.h" | 11 #include "FloatRect.h" |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 namespace WebKit { | 14 namespace WebKit { |
14 class WebFilterOperations; | 15 class WebFilterOperations; |
15 } | 16 } |
16 | 17 |
17 class SkImageFilter; | 18 class SkImageFilter; |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
20 | 21 |
21 class LayerImpl; | 22 class LayerImpl; |
22 class RenderSurfaceImpl; | 23 class RenderSurfaceImpl; |
23 | 24 |
24 // Computes the region where pixels have actually changed on a RenderSurfaceImpl
. This region is used | 25 // Computes the region where pixels have actually changed on a RenderSurfaceImpl
. This region is used |
25 // to scissor what is actually drawn to the screen to save GPU computation and b
andwidth. | 26 // to scissor what is actually drawn to the screen to save GPU computation and b
andwidth. |
26 class DamageTracker { | 27 class CC_EXPORT DamageTracker { |
27 public: | 28 public: |
28 static scoped_ptr<DamageTracker> create(); | 29 static scoped_ptr<DamageTracker> create(); |
29 ~DamageTracker(); | 30 ~DamageTracker(); |
30 | 31 |
31 void didDrawDamagedArea() { m_currentDamageRect = FloatRect(); } | 32 void didDrawDamagedArea() { m_currentDamageRect = FloatRect(); } |
32 void forceFullDamageNextUpdate() { m_forceFullDamageNextUpdate = true; } | 33 void forceFullDamageNextUpdate() { m_forceFullDamageNextUpdate = true; } |
33 void updateDamageTrackingState(const std::vector<LayerImpl*>& layerList, int
targetSurfaceLayerID, bool targetSurfacePropertyChangedOnlyFromDescendant, cons
t IntRect& targetSurfaceContentRect, LayerImpl* targetSurfaceMaskLayer, const We
bKit::WebFilterOperations&, SkImageFilter* filter); | 34 void updateDamageTrackingState(const std::vector<LayerImpl*>& layerList, int
targetSurfaceLayerID, bool targetSurfacePropertyChangedOnlyFromDescendant, cons
t IntRect& targetSurfaceContentRect, LayerImpl* targetSurfaceMaskLayer, const We
bKit::WebFilterOperations&, SkImageFilter* filter); |
34 | 35 |
35 const FloatRect& currentDamageRect() { return m_currentDamageRect; } | 36 const FloatRect& currentDamageRect() { return m_currentDamageRect; } |
36 | 37 |
(...skipping 13 matching lines...) Expand all Loading... |
50 | 51 |
51 // To correctly track exposed regions, two hashtables of rects are maintaine
d. | 52 // To correctly track exposed regions, two hashtables of rects are maintaine
d. |
52 // The "current" map is used to compute exposed regions of the current frame
, while | 53 // The "current" map is used to compute exposed regions of the current frame
, while |
53 // the "next" map is used to collect layer rects that are used in the next f
rame. | 54 // the "next" map is used to collect layer rects that are used in the next f
rame. |
54 typedef base::hash_map<int, FloatRect> RectMap; | 55 typedef base::hash_map<int, FloatRect> RectMap; |
55 scoped_ptr<RectMap> m_currentRectHistory; | 56 scoped_ptr<RectMap> m_currentRectHistory; |
56 scoped_ptr<RectMap> m_nextRectHistory; | 57 scoped_ptr<RectMap> m_nextRectHistory; |
57 | 58 |
58 FloatRect m_currentDamageRect; | 59 FloatRect m_currentDamageRect; |
59 bool m_forceFullDamageNextUpdate; | 60 bool m_forceFullDamageNextUpdate; |
| 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(DamageTracker); |
60 }; | 63 }; |
61 | 64 |
62 } // namespace cc | 65 } // namespace cc |
63 | 66 |
64 #endif // CCDamageTracker_h | 67 #endif // CCDamageTracker_h |
OLD | NEW |