| 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 #ifndef CC_QUADS_DRAW_POLYGON_H_ | 5 #ifndef CC_QUADS_DRAW_POLYGON_H_ |
| 6 #define CC_QUADS_DRAW_POLYGON_H_ | 6 #define CC_QUADS_DRAW_POLYGON_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| 11 #include "cc/output/bsp_compare_result.h" | 11 #include "cc/output/bsp_compare_result.h" |
| 12 #include "cc/quads/draw_quad.h" | |
| 13 #include "ui/gfx/point3_f.h" | 12 #include "ui/gfx/point3_f.h" |
| 14 #include "ui/gfx/quad_f.h" | 13 #include "ui/gfx/quad_f.h" |
| 14 #include "ui/gfx/rect_f.h" |
| 15 #include "ui/gfx/transform.h" |
| 15 #include "ui/gfx/vector3d_f.h" | 16 #include "ui/gfx/vector3d_f.h" |
| 16 | 17 |
| 17 namespace cc { | 18 namespace cc { |
| 18 | 19 |
| 20 class DrawQuad; |
| 21 |
| 19 class CC_EXPORT DrawPolygon { | 22 class CC_EXPORT DrawPolygon { |
| 20 public: | 23 public: |
| 21 DrawPolygon(); | 24 DrawPolygon(); |
| 22 ~DrawPolygon(); | 25 ~DrawPolygon(); |
| 23 | 26 |
| 24 DrawPolygon(DrawQuad* original_ref, | 27 DrawPolygon(DrawQuad* original_ref, |
| 25 const std::vector<gfx::Point3F>& in_points, | 28 const std::vector<gfx::Point3F>& in_points, |
| 26 const gfx::Vector3dF& normal, | 29 const gfx::Vector3dF& normal, |
| 27 int draw_order_index = 0); | 30 int draw_order_index = 0); |
| 31 DrawPolygon(DrawQuad* original_ref, |
| 32 const gfx::RectF& visible_content_rect, |
| 33 const gfx::Transform& transform, |
| 34 int draw_order_index = 0); |
| 28 | 35 |
| 29 // Split takes this DrawPolygon and splits it into two pieces that are on | 36 // Split takes this DrawPolygon and splits it into two pieces that are on |
| 30 // either side of |splitter|. Any edges of this polygon that cross the plane | 37 // either side of |splitter|. Any edges of this polygon that cross the plane |
| 31 // of |splitter| will have an intersection point that is shared by both | 38 // of |splitter| will have an intersection point that is shared by both |
| 32 // polygons on either side. | 39 // polygons on either side. |
| 33 // Split will only return true if it determines that we got back 2 | 40 // Split will only return true if it determines that we got back 2 |
| 34 // intersection points. Only when it returns true will front and back both be | 41 // intersection points. Only when it returns true will front and back both be |
| 35 // valid new polygons that are on opposite sides of the splitting plane. | 42 // valid new polygons that are on opposite sides of the splitting plane. |
| 36 bool Split(const DrawPolygon& splitter, | 43 bool Split(const DrawPolygon& splitter, |
| 37 scoped_ptr<DrawPolygon>* front, | 44 scoped_ptr<DrawPolygon>* front, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 68 // The pointer to the original quad, which gives us all the drawing info | 75 // The pointer to the original quad, which gives us all the drawing info |
| 69 // we need. | 76 // we need. |
| 70 // This DrawQuad is owned by the caller and its lifetime must be preserved | 77 // This DrawQuad is owned by the caller and its lifetime must be preserved |
| 71 // as long as this DrawPolygon is alive. | 78 // as long as this DrawPolygon is alive. |
| 72 DrawQuad* original_ref_; | 79 DrawQuad* original_ref_; |
| 73 }; | 80 }; |
| 74 | 81 |
| 75 } // namespace cc | 82 } // namespace cc |
| 76 | 83 |
| 77 #endif // CC_QUADS_DRAW_POLYGON_H_ | 84 #endif // CC_QUADS_DRAW_POLYGON_H_ |
| OLD | NEW |