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 CC_LAYER_QUAD_H_ | 6 #ifndef CC_LAYER_QUAD_H_ |
7 #define CC_LAYER_QUAD_H_ | 7 #define CC_LAYER_QUAD_H_ |
8 | 8 |
9 #include "cc/cc_export.h" | 9 #include "cc/cc_export.h" |
10 #include "ui/gfx/point_f.h" | 10 #include "ui/gfx/point_f.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 (x() * e.z() - e.x() * z()) / (e.x() * y() - x() * e.y())); | 71 (x() * e.z() - e.x() * z()) / (e.x() * y() - x() * e.y())); |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 float m_x; | 75 float m_x; |
76 float m_y; | 76 float m_y; |
77 float m_z; | 77 float m_z; |
78 }; | 78 }; |
79 | 79 |
80 LayerQuad(const Edge& left, const Edge& top, const Edge& right, const Edge&
bottom); | 80 LayerQuad(const Edge& left, const Edge& top, const Edge& right, const Edge&
bottom); |
81 LayerQuad(const gfx::QuadF&); | 81 explicit LayerQuad(const gfx::QuadF&); |
82 | 82 |
83 Edge left() const { return m_left; } | 83 Edge left() const { return m_left; } |
84 Edge top() const { return m_top; } | 84 Edge top() const { return m_top; } |
85 Edge right() const { return m_right; } | 85 Edge right() const { return m_right; } |
86 Edge bottom() const { return m_bottom; } | 86 Edge bottom() const { return m_bottom; } |
87 | 87 |
88 void inflateX(float dx) { m_left.moveZ(dx); m_right.moveZ(dx); } | 88 void inflateX(float dx) { m_left.moveZ(dx); m_right.moveZ(dx); } |
89 void inflateY(float dy) { m_top.moveZ(dy); m_bottom.moveZ(dy); } | 89 void inflateY(float dy) { m_top.moveZ(dy); m_bottom.moveZ(dy); } |
90 void inflate(float d) { inflateX(d); inflateY(d); } | 90 void inflate(float d) { inflateX(d); inflateY(d); } |
91 void inflateAntiAliasingDistance() { inflate(kAntiAliasingInflateDistance);
} | 91 void inflateAntiAliasingDistance() { inflate(kAntiAliasingInflateDistance);
} |
92 | 92 |
93 gfx::QuadF ToQuadF() const; | 93 gfx::QuadF ToQuadF() const; |
94 | 94 |
95 void toFloatArray(float[12]) const; | 95 void toFloatArray(float[12]) const; |
96 | 96 |
97 private: | 97 private: |
98 Edge m_left; | 98 Edge m_left; |
99 Edge m_top; | 99 Edge m_top; |
100 Edge m_right; | 100 Edge m_right; |
101 Edge m_bottom; | 101 Edge m_bottom; |
102 }; | 102 }; |
103 | 103 |
104 } | 104 } |
105 | 105 |
106 #endif // CC_LAYER_QUAD_H_ | 106 #endif // CC_LAYER_QUAD_H_ |
OLD | NEW |