OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_DEBUG_RECT_HISTORY_H_ | 5 #ifndef CC_DEBUG_RECT_HISTORY_H_ |
6 #define CC_DEBUG_RECT_HISTORY_H_ | 6 #define CC_DEBUG_RECT_HISTORY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
11 #include "ui/gfx/rect_f.h" | 11 #include "ui/gfx/rect_f.h" |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 class LayerImpl; | 16 class LayerImpl; |
17 struct LayerTreeSettings; | 17 struct LayerTreeSwitches; |
18 | 18 |
19 // There are currently six types of debug rects: | 19 // There are currently six types of debug rects: |
20 // | 20 // |
21 // - Paint rects (update rects): regions of a layer that needed to be re-uploade
d to the | 21 // - Paint rects (update rects): regions of a layer that needed to be re-uploade
d to the |
22 // texture resource; in most cases implying that they had to be repainted, too
. | 22 // texture resource; in most cases implying that they had to be repainted, too
. |
23 // | 23 // |
24 // - Property-changed rects: enclosing bounds of layers that cause changes to th
e screen | 24 // - Property-changed rects: enclosing bounds of layers that cause changes to th
e screen |
25 // even if the layer did not change internally. (For example, if the layer's o
pacity or | 25 // even if the layer did not change internally. (For example, if the layer's o
pacity or |
26 // position changes.) | 26 // position changes.) |
27 // | 27 // |
(...skipping 24 matching lines...) Expand all Loading... |
52 // This class maintains a history of rects of various types that can be used | 52 // This class maintains a history of rects of various types that can be used |
53 // for debugging purposes. The overhead of collecting rects is performed only if | 53 // for debugging purposes. The overhead of collecting rects is performed only if |
54 // the appropriate LayerTreeSettings are enabled. | 54 // the appropriate LayerTreeSettings are enabled. |
55 class DebugRectHistory { | 55 class DebugRectHistory { |
56 public: | 56 public: |
57 static scoped_ptr<DebugRectHistory> create(); | 57 static scoped_ptr<DebugRectHistory> create(); |
58 | 58 |
59 ~DebugRectHistory(); | 59 ~DebugRectHistory(); |
60 | 60 |
61 // Note: Saving debug rects must happen before layers' change tracking is re
set. | 61 // Note: Saving debug rects must happen before layers' change tracking is re
set. |
62 void saveDebugRectsForCurrentFrame(LayerImpl* rootLayer, const std::vector<L
ayerImpl*>& renderSurfaceLayerList, const std::vector<gfx::Rect>& occludingScree
nSpaceRects, const std::vector<gfx::Rect>& nonOccludingScreenSpaceRects, const L
ayerTreeSettings&); | 62 void saveDebugRectsForCurrentFrame(LayerImpl* rootLayer, const std::vector<L
ayerImpl*>& renderSurfaceLayerList, const std::vector<gfx::Rect>& occludingScree
nSpaceRects, const std::vector<gfx::Rect>& nonOccludingScreenSpaceRects, const L
ayerTreeSwitches& switches); |
63 | 63 |
64 const std::vector<DebugRect>& debugRects() { return m_debugRects; } | 64 const std::vector<DebugRect>& debugRects() { return m_debugRects; } |
65 | 65 |
66 private: | 66 private: |
67 DebugRectHistory(); | 67 DebugRectHistory(); |
68 | 68 |
69 void savePaintRects(LayerImpl*); | 69 void savePaintRects(LayerImpl*); |
70 void savePropertyChangedRects(const std::vector<LayerImpl*>& renderSurfaceLa
yerList); | 70 void savePropertyChangedRects(const std::vector<LayerImpl*>& renderSurfaceLa
yerList); |
71 void saveSurfaceDamageRects(const std::vector<LayerImpl* >& renderSurfaceLay
erList); | 71 void saveSurfaceDamageRects(const std::vector<LayerImpl* >& renderSurfaceLay
erList); |
72 void saveScreenSpaceRects(const std::vector<LayerImpl* >& renderSurfaceLayer
List); | 72 void saveScreenSpaceRects(const std::vector<LayerImpl* >& renderSurfaceLayer
List); |
73 void saveOccludingRects(const std::vector<gfx::Rect>& occludingScreenSpaceRe
cts); | 73 void saveOccludingRects(const std::vector<gfx::Rect>& occludingScreenSpaceRe
cts); |
74 void saveNonOccludingRects(const std::vector<gfx::Rect>& nonOccludingScreenS
paceRects); | 74 void saveNonOccludingRects(const std::vector<gfx::Rect>& nonOccludingScreenS
paceRects); |
75 | 75 |
76 std::vector<DebugRect> m_debugRects; | 76 std::vector<DebugRect> m_debugRects; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(DebugRectHistory); | 78 DISALLOW_COPY_AND_ASSIGN(DebugRectHistory); |
79 }; | 79 }; |
80 | 80 |
81 } // namespace cc | 81 } // namespace cc |
82 | 82 |
83 #endif // CC_DEBUG_RECT_HISTORY_H_ | 83 #endif // CC_DEBUG_RECT_HISTORY_H_ |
OLD | NEW |