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 "cc/trees/layer_sorter.h" | 5 #include "cc/trees/layer_sorter.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <limits> | 9 #include <limits> |
10 #include <vector> | 10 #include <vector> |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 const gfx::Transform& draw_transform) { | 186 const gfx::Transform& draw_transform) { |
187 gfx::QuadF layer_quad(gfx::RectF(0.f, 0.f, width, height)); | 187 gfx::QuadF layer_quad(gfx::RectF(0.f, 0.f, width, height)); |
188 | 188 |
189 // Compute the projection of the layer quad onto the z = 0 plane. | 189 // Compute the projection of the layer quad onto the z = 0 plane. |
190 | 190 |
191 gfx::PointF clipped_quad[8]; | 191 gfx::PointF clipped_quad[8]; |
192 int num_vertices_in_clipped_quad; | 192 int num_vertices_in_clipped_quad; |
193 MathUtil::MapClippedQuad(draw_transform, | 193 MathUtil::MapClippedQuad(draw_transform, |
194 layer_quad, | 194 layer_quad, |
195 clipped_quad, | 195 clipped_quad, |
196 num_vertices_in_clipped_quad); | 196 &num_vertices_in_clipped_quad); |
197 | 197 |
198 if (num_vertices_in_clipped_quad < 3) { | 198 if (num_vertices_in_clipped_quad < 3) { |
199 projected_bounds = gfx::RectF(); | 199 projected_bounds = gfx::RectF(); |
200 return; | 200 return; |
201 } | 201 } |
202 | 202 |
203 projected_bounds = | 203 projected_bounds = |
204 MathUtil::ComputeEnclosingRectOfVertices(clipped_quad, | 204 MathUtil::ComputeEnclosingRectOfVertices(clipped_quad, |
205 num_vertices_in_clipped_quad); | 205 num_vertices_in_clipped_quad); |
206 | 206 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 *it = sorted_list[count++]->layer; | 458 *it = sorted_list[count++]->layer; |
459 | 459 |
460 DVLOG(2) << "Sorting end ----"; | 460 DVLOG(2) << "Sorting end ----"; |
461 | 461 |
462 nodes_.clear(); | 462 nodes_.clear(); |
463 edges_.clear(); | 463 edges_.clear(); |
464 active_edges_.clear(); | 464 active_edges_.clear(); |
465 } | 465 } |
466 | 466 |
467 } // namespace cc | 467 } // namespace cc |
OLD | NEW |