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 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/layer_sorter.h" | 7 #include "cc/layer_sorter.h" |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <limits> | 10 #include <limits> |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 return BBeforeA; | 143 return BBeforeA; |
144 } | 144 } |
145 | 145 |
146 LayerShape::LayerShape() | 146 LayerShape::LayerShape() |
147 { | 147 { |
148 } | 148 } |
149 | 149 |
150 LayerShape::LayerShape(float width, float height, const WebTransformationMatrix&
drawTransform) | 150 LayerShape::LayerShape(float width, float height, const WebTransformationMatrix&
drawTransform) |
151 { | 151 { |
152 FloatQuad layerQuad(FloatRect(0, 0, width, height)); | 152 FloatQuad layerQuad(gfx::RectF(0, 0, width, height)); |
153 | 153 |
154 // Compute the projection of the layer quad onto the z = 0 plane. | 154 // Compute the projection of the layer quad onto the z = 0 plane. |
155 | 155 |
156 gfx::PointF clippedQuad[8]; | 156 gfx::PointF clippedQuad[8]; |
157 int numVerticesInClippedQuad; | 157 int numVerticesInClippedQuad; |
158 MathUtil::mapClippedQuad(drawTransform, layerQuad, clippedQuad, numVerticesI
nClippedQuad); | 158 MathUtil::mapClippedQuad(drawTransform, layerQuad, clippedQuad, numVerticesI
nClippedQuad); |
159 | 159 |
160 if (numVerticesInClippedQuad < 3) { | 160 if (numVerticesInClippedQuad < 3) { |
161 projectedBounds = FloatRect(); | 161 projectedBounds = gfx::RectF(); |
162 return; | 162 return; |
163 } | 163 } |
164 | 164 |
165 projectedBounds = MathUtil::computeEnclosingRectOfVertices(clippedQuad, numV
erticesInClippedQuad); | 165 projectedBounds = MathUtil::computeEnclosingRectOfVertices(clippedQuad, numV
erticesInClippedQuad); |
166 | 166 |
167 // NOTE: it will require very significant refactoring and overhead to deal w
ith | 167 // NOTE: it will require very significant refactoring and overhead to deal w
ith |
168 // generalized polygons or multiple quads per layer here. For the sake of la
yer | 168 // generalized polygons or multiple quads per layer here. For the sake of la
yer |
169 // sorting it is equally correct to take a subsection of the polygon that ca
n be made | 169 // sorting it is equally correct to take a subsection of the polygon that ca
n be made |
170 // into a quad. This will only be incorrect in the case of intersecting laye
rs, which | 170 // into a quad. This will only be incorrect in the case of intersecting laye
rs, which |
171 // are not supported yet anyway. | 171 // are not supported yet anyway. |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 *it = sortedList[count++]->layer; | 407 *it = sortedList[count++]->layer; |
408 | 408 |
409 DVLOG(2) << "Sorting end ----"; | 409 DVLOG(2) << "Sorting end ----"; |
410 | 410 |
411 m_nodes.clear(); | 411 m_nodes.clear(); |
412 m_edges.clear(); | 412 m_edges.clear(); |
413 m_activeEdges.clear(); | 413 m_activeEdges.clear(); |
414 } | 414 } |
415 | 415 |
416 } | 416 } |
OLD | NEW |