| 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 #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 "FloatRect.h" | 11 #include "ui/gfx/rect_f.h" |
| 12 #include "IntRect.h" | |
| 13 #include <wtf/Vector.h> | 12 #include <wtf/Vector.h> |
| 14 #include <vector> | 13 #include <vector> |
| 15 | 14 |
| 16 namespace cc { | 15 namespace cc { |
| 17 | 16 |
| 18 class LayerImpl; | 17 class LayerImpl; |
| 19 struct LayerTreeSettings; | 18 struct LayerTreeSettings; |
| 20 | 19 |
| 21 // There are currently six types of debug rects: | 20 // There are currently six types of debug rects: |
| 22 // | 21 // |
| (...skipping 10 matching lines...) Expand all Loading... |
| 33 // | 32 // |
| 34 // - Screen space rects: this is the region the contents occupy in screen space. | 33 // - Screen space rects: this is the region the contents occupy in screen space. |
| 35 // | 34 // |
| 36 // - Replica screen space rects: this is the region the replica's contents occup
y in screen space. | 35 // - Replica screen space rects: this is the region the replica's contents occup
y in screen space. |
| 37 // | 36 // |
| 38 // - Occluding rects: these are the regions that contribute to the occluded regi
on. | 37 // - Occluding rects: these are the regions that contribute to the occluded regi
on. |
| 39 // | 38 // |
| 40 enum DebugRectType { PaintRectType, PropertyChangedRectType, SurfaceDamageRectTy
pe, ScreenSpaceRectType, ReplicaScreenSpaceRectType, OccludingRectType }; | 39 enum DebugRectType { PaintRectType, PropertyChangedRectType, SurfaceDamageRectTy
pe, ScreenSpaceRectType, ReplicaScreenSpaceRectType, OccludingRectType }; |
| 41 | 40 |
| 42 struct DebugRect { | 41 struct DebugRect { |
| 43 DebugRect(DebugRectType newType, FloatRect newRect) | 42 DebugRect(DebugRectType newType, gfx::RectF newRect) |
| 44 : type(newType) | 43 : type(newType) |
| 45 , rect(newRect) { } | 44 , rect(newRect) { } |
| 46 | 45 |
| 47 DebugRectType type; | 46 DebugRectType type; |
| 48 FloatRect rect; | 47 gfx::RectF rect; |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 // This class maintains a history of rects of various types that can be used | 50 // 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 | 51 // for debugging purposes. The overhead of collecting rects is performed only if |
| 53 // the appropriate LayerTreeSettings are enabled. | 52 // the appropriate LayerTreeSettings are enabled. |
| 54 class DebugRectHistory { | 53 class DebugRectHistory { |
| 55 public: | 54 public: |
| 56 static scoped_ptr<DebugRectHistory> create(); | 55 static scoped_ptr<DebugRectHistory> create(); |
| 57 | 56 |
| 58 ~DebugRectHistory(); | 57 ~DebugRectHistory(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 72 void saveOccludingRects(const Vector<gfx::Rect>& occludingScreenSpaceRects); | 71 void saveOccludingRects(const Vector<gfx::Rect>& occludingScreenSpaceRects); |
| 73 | 72 |
| 74 Vector<DebugRect> m_debugRects; | 73 Vector<DebugRect> m_debugRects; |
| 75 | 74 |
| 76 DISALLOW_COPY_AND_ASSIGN(DebugRectHistory); | 75 DISALLOW_COPY_AND_ASSIGN(DebugRectHistory); |
| 77 }; | 76 }; |
| 78 | 77 |
| 79 } // namespace cc | 78 } // namespace cc |
| 80 | 79 |
| 81 #endif | 80 #endif |
| OLD | NEW |