| 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 | 5 |
| 6 #ifndef CCLayerQuad_h | 6 #ifndef CCLayerQuad_h |
| 7 #define CCLayerQuad_h | 7 #define CCLayerQuad_h |
| 8 | 8 |
| 9 #include "FloatQuad.h" | 9 #include "ui/gfx/point_f.h" |
| 10 |
| 11 namespace gfx { |
| 12 class QuadF; |
| 13 } |
| 10 | 14 |
| 11 static const float kAntiAliasingInflateDistance = 0.5f; | 15 static const float kAntiAliasingInflateDistance = 0.5f; |
| 12 | 16 |
| 13 namespace cc { | 17 namespace cc { |
| 14 | 18 |
| 15 class LayerQuad { | 19 class LayerQuad { |
| 16 public: | 20 public: |
| 17 class Edge { | 21 class Edge { |
| 18 public: | 22 public: |
| 19 Edge() | 23 Edge() |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 (x() * e.z() - e.x() * z()) / (e.x() * y() - x() * e.y())); | 70 (x() * e.z() - e.x() * z()) / (e.x() * y() - x() * e.y())); |
| 67 } | 71 } |
| 68 | 72 |
| 69 private: | 73 private: |
| 70 float m_x; | 74 float m_x; |
| 71 float m_y; | 75 float m_y; |
| 72 float m_z; | 76 float m_z; |
| 73 }; | 77 }; |
| 74 | 78 |
| 75 LayerQuad(const Edge& left, const Edge& top, const Edge& right, const Edge&
bottom); | 79 LayerQuad(const Edge& left, const Edge& top, const Edge& right, const Edge&
bottom); |
| 76 LayerQuad(const FloatQuad&); | 80 LayerQuad(const gfx::QuadF&); |
| 77 | 81 |
| 78 Edge left() const { return m_left; } | 82 Edge left() const { return m_left; } |
| 79 Edge top() const { return m_top; } | 83 Edge top() const { return m_top; } |
| 80 Edge right() const { return m_right; } | 84 Edge right() const { return m_right; } |
| 81 Edge bottom() const { return m_bottom; } | 85 Edge bottom() const { return m_bottom; } |
| 82 | 86 |
| 83 void inflateX(float dx) { m_left.moveZ(dx); m_right.moveZ(dx); } | 87 void inflateX(float dx) { m_left.moveZ(dx); m_right.moveZ(dx); } |
| 84 void inflateY(float dy) { m_top.moveZ(dy); m_bottom.moveZ(dy); } | 88 void inflateY(float dy) { m_top.moveZ(dy); m_bottom.moveZ(dy); } |
| 85 void inflate(float d) { inflateX(d); inflateY(d); } | 89 void inflate(float d) { inflateX(d); inflateY(d); } |
| 86 void inflateAntiAliasingDistance() { inflate(kAntiAliasingInflateDistance);
} | 90 void inflateAntiAliasingDistance() { inflate(kAntiAliasingInflateDistance);
} |
| 87 | 91 |
| 88 FloatQuad floatQuad() const; | 92 gfx::QuadF ToQuadF() const; |
| 89 | 93 |
| 90 void toFloatArray(float[12]) const; | 94 void toFloatArray(float[12]) const; |
| 91 | 95 |
| 92 private: | 96 private: |
| 93 Edge m_left; | 97 Edge m_left; |
| 94 Edge m_top; | 98 Edge m_top; |
| 95 Edge m_right; | 99 Edge m_right; |
| 96 Edge m_bottom; | 100 Edge m_bottom; |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 } | 103 } |
| 100 | 104 |
| 101 #endif | 105 #endif |
| OLD | NEW |