OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/quads/draw_polygon.h" | 5 #include "cc/quads/draw_polygon.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // a visible content rect to make the 4 corner points from, and a transformation | 55 // a visible content rect to make the 4 corner points from, and a transformation |
56 // to move it and its normal into screen space. | 56 // to move it and its normal into screen space. |
57 DrawPolygon::DrawPolygon(const DrawQuad* original_ref, | 57 DrawPolygon::DrawPolygon(const DrawQuad* original_ref, |
58 const gfx::RectF& visible_layer_rect, | 58 const gfx::RectF& visible_layer_rect, |
59 const gfx::Transform& transform, | 59 const gfx::Transform& transform, |
60 int draw_order_index) | 60 int draw_order_index) |
61 : normal_(0.0f, 0.0f, 1.0f), | 61 : normal_(0.0f, 0.0f, 1.0f), |
62 order_index_(draw_order_index), | 62 order_index_(draw_order_index), |
63 original_ref_(original_ref), | 63 original_ref_(original_ref), |
64 is_split_(false) { | 64 is_split_(false) { |
65 gfx::Point3F points[8]; | 65 gfx::Point3F points[6]; |
66 int num_vertices_in_clipped_quad; | 66 int num_vertices_in_clipped_quad; |
67 gfx::QuadF send_quad(visible_layer_rect); | 67 gfx::QuadF send_quad(visible_layer_rect); |
68 | 68 |
69 // Doing this mapping here is very important, since we can't just transform | 69 // Doing this mapping here is very important, since we can't just transform |
70 // the points without clipping and not run into strange geometry issues when | 70 // the points without clipping and not run into strange geometry issues when |
71 // crossing w = 0. At this point, in the constructor, we know that we're | 71 // crossing w = 0. At this point, in the constructor, we know that we're |
72 // working with a quad, so we can reuse the MathUtil::MapClippedQuad3d | 72 // working with a quad, so we can reuse the MathUtil::MapClippedQuad3d |
73 // function instead of writing a generic polygon version of it. | 73 // function instead of writing a generic polygon version of it. |
74 MathUtil::MapClippedQuad3d( | 74 MathUtil::MapClippedQuad3d( |
75 transform, send_quad, points, &num_vertices_in_clipped_quad); | 75 transform, send_quad, points, &num_vertices_in_clipped_quad); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 quads->push_back( | 340 quads->push_back( |
341 gfx::QuadF(first, | 341 gfx::QuadF(first, |
342 gfx::PointF(points_[offset].x(), points_[offset].y()), | 342 gfx::PointF(points_[offset].x(), points_[offset].y()), |
343 gfx::PointF(points_[op1].x(), points_[op1].y()), | 343 gfx::PointF(points_[op1].x(), points_[op1].y()), |
344 gfx::PointF(points_[op2].x(), points_[op2].y()))); | 344 gfx::PointF(points_[op2].x(), points_[op2].y()))); |
345 offset = op2; | 345 offset = op2; |
346 } | 346 } |
347 } | 347 } |
348 | 348 |
349 } // namespace cc | 349 } // namespace cc |
OLD | NEW |