| 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 CCDebugRectHistory_h | 5 #ifndef CCDebugRectHistory_h |
| 6 #define CCDebugRectHistory_h | 6 #define CCDebugRectHistory_h |
| 7 | 7 |
| 8 #if USE(ACCELERATED_COMPOSITING) | 8 #if USE(ACCELERATED_COMPOSITING) |
| 9 | 9 |
| 10 #include "base/basictypes.h" |
| 10 #include "FloatRect.h" | 11 #include "FloatRect.h" |
| 11 #include "IntRect.h" | 12 #include "IntRect.h" |
| 12 #include <wtf/Noncopyable.h> | |
| 13 #include <wtf/PassOwnPtr.h> | 13 #include <wtf/PassOwnPtr.h> |
| 14 #include <wtf/Vector.h> | 14 #include <wtf/Vector.h> |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 | 17 |
| 18 class CCLayerImpl; | 18 class CCLayerImpl; |
| 19 struct CCLayerTreeSettings; | 19 struct CCLayerTreeSettings; |
| 20 | 20 |
| 21 // There are currently six types of debug rects: | 21 // There are currently six types of debug rects: |
| 22 // | 22 // |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 , rect(newRect) { } | 45 , rect(newRect) { } |
| 46 | 46 |
| 47 DebugRectType type; | 47 DebugRectType type; |
| 48 FloatRect rect; | 48 FloatRect rect; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // This class maintains a history of rects of various types that can be used | 51 // This class maintains a history of rects of various types that can be used |
| 52 // for debugging purposes. The overhead of collecting rects is performed only if | 52 // for debugging purposes. The overhead of collecting rects is performed only if |
| 53 // the appropriate CCLayerTreeSettings are enabled. | 53 // the appropriate CCLayerTreeSettings are enabled. |
| 54 class CCDebugRectHistory { | 54 class CCDebugRectHistory { |
| 55 WTF_MAKE_NONCOPYABLE(CCDebugRectHistory); | |
| 56 public: | 55 public: |
| 57 static PassOwnPtr<CCDebugRectHistory> create() | 56 static PassOwnPtr<CCDebugRectHistory> create() |
| 58 { | 57 { |
| 59 return adoptPtr(new CCDebugRectHistory()); | 58 return adoptPtr(new CCDebugRectHistory()); |
| 60 } | 59 } |
| 61 | 60 |
| 62 ~CCDebugRectHistory(); | 61 ~CCDebugRectHistory(); |
| 63 | 62 |
| 64 // Note: Saving debug rects must happen before layers' change tracking is re
set. | 63 // Note: Saving debug rects must happen before layers' change tracking is re
set. |
| 65 void saveDebugRectsForCurrentFrame(CCLayerImpl* rootLayer, const Vector<CCLa
yerImpl*>& renderSurfaceLayerList, const Vector<IntRect>& occludingScreenSpaceRe
cts, const CCLayerTreeSettings&); | 64 void saveDebugRectsForCurrentFrame(CCLayerImpl* rootLayer, const Vector<CCLa
yerImpl*>& renderSurfaceLayerList, const Vector<IntRect>& occludingScreenSpaceRe
cts, const CCLayerTreeSettings&); |
| 66 | 65 |
| 67 const Vector<CCDebugRect>& debugRects() { return m_debugRects; } | 66 const Vector<CCDebugRect>& debugRects() { return m_debugRects; } |
| 68 | 67 |
| 69 private: | 68 private: |
| 70 CCDebugRectHistory(); | 69 CCDebugRectHistory(); |
| 71 | 70 |
| 72 void savePaintRects(CCLayerImpl*); | 71 void savePaintRects(CCLayerImpl*); |
| 73 void savePropertyChangedRects(const Vector<CCLayerImpl*>& renderSurfaceLayer
List); | 72 void savePropertyChangedRects(const Vector<CCLayerImpl*>& renderSurfaceLayer
List); |
| 74 void saveSurfaceDamageRects(const Vector<CCLayerImpl* >& renderSurfaceLayerL
ist); | 73 void saveSurfaceDamageRects(const Vector<CCLayerImpl* >& renderSurfaceLayerL
ist); |
| 75 void saveScreenSpaceRects(const Vector<CCLayerImpl* >& renderSurfaceLayerLis
t); | 74 void saveScreenSpaceRects(const Vector<CCLayerImpl* >& renderSurfaceLayerLis
t); |
| 76 void saveOccludingRects(const Vector<IntRect>& occludingScreenSpaceRects); | 75 void saveOccludingRects(const Vector<IntRect>& occludingScreenSpaceRects); |
| 77 | 76 |
| 78 Vector<CCDebugRect> m_debugRects; | 77 Vector<CCDebugRect> m_debugRects; |
| 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(CCDebugRectHistory); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 } // namespace cc | 82 } // namespace cc |
| 82 | 83 |
| 83 #endif // USE(ACCELERATED_COMPOSITING) | 84 #endif // USE(ACCELERATED_COMPOSITING) |
| 84 | 85 |
| 85 #endif | 86 #endif |
| OLD | NEW |