OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 CCLayerSorter_h | 5 #ifndef CCLayerSorter_h |
6 #define CCLayerSorter_h | 6 #define CCLayerSorter_h |
7 | 7 |
8 #include "FloatQuad.h" | 8 #include "FloatQuad.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| 11 #include "cc/cc_export.h" |
11 #include "cc/layer_impl.h" | 12 #include "cc/layer_impl.h" |
12 #include "ui/gfx/point3_f.h" | 13 #include "ui/gfx/point3_f.h" |
13 #include "ui/gfx/rect_f.h" | 14 #include "ui/gfx/rect_f.h" |
14 #include "ui/gfx/vector3d_f.h" | 15 #include "ui/gfx/vector3d_f.h" |
15 | 16 |
16 #if defined(COMPILER_GCC) | 17 #if defined(COMPILER_GCC) |
17 namespace cc | 18 namespace cc |
18 { | 19 { |
19 struct GraphEdge; | 20 struct GraphEdge; |
20 }; | 21 }; |
(...skipping 10 matching lines...) Expand all Loading... |
31 | 32 |
32 namespace WebKit { | 33 namespace WebKit { |
33 class WebTransformationMatrix; | 34 class WebTransformationMatrix; |
34 } | 35 } |
35 | 36 |
36 namespace cc { | 37 namespace cc { |
37 | 38 |
38 struct GraphEdge; | 39 struct GraphEdge; |
39 | 40 |
40 // Holds various useful properties derived from a layer's 3D outline. | 41 // Holds various useful properties derived from a layer's 3D outline. |
41 struct LayerShape { | 42 struct CC_EXPORT LayerShape { |
42 LayerShape(); | 43 LayerShape(); |
43 LayerShape(float width, float height, const WebKit::WebTransformationMatrix&
drawTransform); | 44 LayerShape(float width, float height, const WebKit::WebTransformationMatrix&
drawTransform); |
44 ~LayerShape(); | 45 ~LayerShape(); |
45 | 46 |
46 float layerZFromProjectedPoint(const gfx::PointF&) const; | 47 float layerZFromProjectedPoint(const gfx::PointF&) const; |
47 | 48 |
48 gfx::Vector3dF layerNormal; | 49 gfx::Vector3dF layerNormal; |
49 gfx::Point3F transformOrigin; | 50 gfx::Point3F transformOrigin; |
50 FloatQuad projectedQuad; | 51 FloatQuad projectedQuad; |
51 gfx::RectF projectedBounds; | 52 gfx::RectF projectedBounds; |
(...skipping 18 matching lines...) Expand all Loading... |
70 { | 71 { |
71 } | 72 } |
72 | 73 |
73 GraphNode* from; | 74 GraphNode* from; |
74 GraphNode* to; | 75 GraphNode* to; |
75 float weight; | 76 float weight; |
76 }; | 77 }; |
77 | 78 |
78 | 79 |
79 | 80 |
80 class LayerSorter { | 81 class CC_EXPORT LayerSorter { |
81 public: | 82 public: |
82 LayerSorter(); | 83 LayerSorter(); |
83 ~LayerSorter(); | 84 ~LayerSorter(); |
84 | 85 |
85 typedef std::vector<LayerImpl*> LayerList; | 86 typedef std::vector<LayerImpl*> LayerList; |
86 | 87 |
87 void sort(LayerList::iterator first, LayerList::iterator last); | 88 void sort(LayerList::iterator first, LayerList::iterator last); |
88 | 89 |
89 enum ABCompareResult { | 90 enum ABCompareResult { |
90 ABeforeB, | 91 ABeforeB, |
(...skipping 15 matching lines...) Expand all Loading... |
106 | 107 |
107 void createGraphNodes(LayerList::iterator first, LayerList::iterator last); | 108 void createGraphNodes(LayerList::iterator first, LayerList::iterator last); |
108 void createGraphEdges(); | 109 void createGraphEdges(); |
109 void removeEdgeFromList(GraphEdge*, std::vector<GraphEdge*>&); | 110 void removeEdgeFromList(GraphEdge*, std::vector<GraphEdge*>&); |
110 | 111 |
111 DISALLOW_COPY_AND_ASSIGN(LayerSorter); | 112 DISALLOW_COPY_AND_ASSIGN(LayerSorter); |
112 }; | 113 }; |
113 | 114 |
114 } | 115 } |
115 #endif | 116 #endif |
OLD | NEW |