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_DEBUG_RECT_HISTORY_H_ | 5 #ifndef CC_DEBUG_DEBUG_RECT_HISTORY_H_ |
6 #define CC_DEBUG_DEBUG_RECT_HISTORY_H_ | 6 #define CC_DEBUG_DEBUG_RECT_HISTORY_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/layers/layer_collections.h" | 12 #include "cc/layers/layer_collections.h" |
12 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
13 | 14 |
14 namespace cc { | 15 namespace cc { |
15 | 16 |
16 class LayerImpl; | 17 class LayerImpl; |
17 class LayerTreeDebugState; | 18 class LayerTreeDebugState; |
18 class LayerTreeImpl; | 19 class LayerTreeImpl; |
19 | 20 |
20 // There are currently six types of debug rects: | 21 // There are currently six types of debug rects: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 55 |
55 DebugRectType type; | 56 DebugRectType type; |
56 gfx::Rect rect; | 57 gfx::Rect rect; |
57 }; | 58 }; |
58 | 59 |
59 // This class maintains a history of rects of various types that can be used | 60 // This class maintains a history of rects of various types that can be used |
60 // for debugging purposes. The overhead of collecting rects is performed only if | 61 // for debugging purposes. The overhead of collecting rects is performed only if |
61 // the appropriate LayerTreeSettings are enabled. | 62 // the appropriate LayerTreeSettings are enabled. |
62 class DebugRectHistory { | 63 class DebugRectHistory { |
63 public: | 64 public: |
64 static scoped_ptr<DebugRectHistory> Create(); | 65 static std::unique_ptr<DebugRectHistory> Create(); |
65 | 66 |
66 ~DebugRectHistory(); | 67 ~DebugRectHistory(); |
67 | 68 |
68 // Note: Saving debug rects must happen before layers' change tracking is | 69 // Note: Saving debug rects must happen before layers' change tracking is |
69 // reset. | 70 // reset. |
70 void SaveDebugRectsForCurrentFrame( | 71 void SaveDebugRectsForCurrentFrame( |
71 LayerImpl* root_layer, | 72 LayerImpl* root_layer, |
72 LayerImpl* hud_layer, | 73 LayerImpl* hud_layer, |
73 const LayerImplList& render_surface_layer_list, | 74 const LayerImplList& render_surface_layer_list, |
74 const LayerTreeDebugState& debug_state); | 75 const LayerTreeDebugState& debug_state); |
(...skipping 21 matching lines...) Expand all Loading... |
96 const LayerImplList& render_surface_layer_list); | 97 const LayerImplList& render_surface_layer_list); |
97 | 98 |
98 std::vector<DebugRect> debug_rects_; | 99 std::vector<DebugRect> debug_rects_; |
99 | 100 |
100 DISALLOW_COPY_AND_ASSIGN(DebugRectHistory); | 101 DISALLOW_COPY_AND_ASSIGN(DebugRectHistory); |
101 }; | 102 }; |
102 | 103 |
103 } // namespace cc | 104 } // namespace cc |
104 | 105 |
105 #endif // CC_DEBUG_DEBUG_RECT_HISTORY_H_ | 106 #endif // CC_DEBUG_DEBUG_RECT_HISTORY_H_ |
OLD | NEW |