Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1702)

Side by Side Diff: cc/debug_rect_history.h

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScaleAsVector Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/damage_tracker_unittest.cc ('k') | cc/debug_rect_history.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <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 LayerTreeSettings;
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 //
28 // - Surface damage rects: the aggregate damage on a target surface that is caus ed by all 28 // - Surface damage rects: the aggregate damage on a target surface that is caus ed by all
29 // layers and surfaces that contribute to it. This includes (1) paint rects, ( 2) property- 29 // layers and surfaces that contribute to it. This includes (1) paint rects, ( 2) property-
30 // changed rects, and (3) newly exposed areas. 30 // changed rects, and (3) newly exposed areas.
31 // 31 //
32 // - Screen space rects: this is the region the contents occupy in screen space. 32 // - Screen space rects: this is the region the contents occupy in screen space.
33 // 33 //
34 // - Replica screen space rects: this is the region the replica's contents occup y in screen space. 34 // - Replica screen space rects: this is the region the replica's contents occup y in screen space.
35 // 35 //
36 // - Occluding rects: these are the regions that contribute to the occluded regi on. 36 // - Occluding rects: these are the regions that contribute to the occluded regi on.
37 // 37 //
38 enum DebugRectType { PaintRectType, PropertyChangedRectType, SurfaceDamageRectTy pe, ScreenSpaceRectType, ReplicaScreenSpaceRectType, OccludingRectType }; 38 enum DebugRectType { PaintRectType, PropertyChangedRectType, SurfaceDamageRectTy pe, ScreenSpaceRectType, ReplicaScreenSpaceRectType, OccludingRectType };
39 39
40 struct DebugRect { 40 struct DebugRect {
41 DebugRect(DebugRectType newType, FloatRect newRect) 41 DebugRect(DebugRectType newType, gfx::RectF newRect)
42 : type(newType) 42 : type(newType)
43 , rect(newRect) { } 43 , rect(newRect) { }
44 44
45 DebugRectType type; 45 DebugRectType type;
46 FloatRect rect; 46 gfx::RectF rect;
47 }; 47 };
48 48
49 // This class maintains a history of rects of various types that can be used 49 // This class maintains a history of rects of various types that can be used
50 // for debugging purposes. The overhead of collecting rects is performed only if 50 // for debugging purposes. The overhead of collecting rects is performed only if
51 // the appropriate LayerTreeSettings are enabled. 51 // the appropriate LayerTreeSettings are enabled.
52 class DebugRectHistory { 52 class DebugRectHistory {
53 public: 53 public:
54 static scoped_ptr<DebugRectHistory> create(); 54 static scoped_ptr<DebugRectHistory> create();
55 55
56 ~DebugRectHistory(); 56 ~DebugRectHistory();
(...skipping 13 matching lines...) Expand all
70 void saveOccludingRects(const std::vector<gfx::Rect>& occludingScreenSpaceRe cts); 70 void saveOccludingRects(const std::vector<gfx::Rect>& occludingScreenSpaceRe cts);
71 71
72 std::vector<DebugRect> m_debugRects; 72 std::vector<DebugRect> m_debugRects;
73 73
74 DISALLOW_COPY_AND_ASSIGN(DebugRectHistory); 74 DISALLOW_COPY_AND_ASSIGN(DebugRectHistory);
75 }; 75 };
76 76
77 } // namespace cc 77 } // namespace cc
78 78
79 #endif 79 #endif
OLDNEW
« no previous file with comments | « cc/damage_tracker_unittest.cc ('k') | cc/debug_rect_history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698