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_RESOURCES_LAYER_QUAD_H_ | 6 #ifndef CC_RESOURCES_LAYER_QUAD_H_ |
7 #define CC_RESOURCES_LAYER_QUAD_H_ | 7 #define CC_RESOURCES_LAYER_QUAD_H_ |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 private: | 66 private: |
67 float x_; | 67 float x_; |
68 float y_; | 68 float y_; |
69 float z_; | 69 float z_; |
70 }; | 70 }; |
71 | 71 |
72 LayerQuad(const Edge& left, | 72 LayerQuad(const Edge& left, |
73 const Edge& top, | 73 const Edge& top, |
74 const Edge& right, | 74 const Edge& right, |
75 const Edge& bottom); | 75 const Edge& bottom); |
76 LayerQuad(const gfx::QuadF& quad); | 76 explicit LayerQuad(const gfx::QuadF& quad); |
77 | 77 |
78 Edge left() const { return left_; } | 78 Edge left() const { return left_; } |
79 Edge top() const { return top_; } | 79 Edge top() const { return top_; } |
80 Edge right() const { return right_; } | 80 Edge right() const { return right_; } |
81 Edge bottom() const { return bottom_; } | 81 Edge bottom() const { return bottom_; } |
82 | 82 |
83 void InflateX(float dx) { left_.move_z(dx); right_.move_z(dx); } | 83 void InflateX(float dx) { |
84 void InflateY(float dy) { top_.move_z(dy); bottom_.move_z(dy); } | 84 left_.move_z(dx); |
85 void Inflate(float d) { InflateX(d); InflateY(d); } | 85 right_.move_z(dx); |
| 86 } |
| 87 void InflateY(float dy) { |
| 88 top_.move_z(dy); |
| 89 bottom_.move_z(dy); |
| 90 } |
| 91 void Inflate(float d) { |
| 92 InflateX(d); |
| 93 InflateY(d); |
| 94 } |
86 void InflateAntiAliasingDistance() { | 95 void InflateAntiAliasingDistance() { |
87 Inflate(kAntiAliasingInflateDistance); | 96 Inflate(kAntiAliasingInflateDistance); |
88 } | 97 } |
89 | 98 |
90 gfx::QuadF ToQuadF() const; | 99 gfx::QuadF ToQuadF() const; |
91 | 100 |
92 void ToFloatArray(float flattened[12]) const; | 101 void ToFloatArray(float flattened[12]) const; |
93 | 102 |
94 private: | 103 private: |
95 Edge left_; | 104 Edge left_; |
96 Edge top_; | 105 Edge top_; |
97 Edge right_; | 106 Edge right_; |
98 Edge bottom_; | 107 Edge bottom_; |
99 | 108 |
100 DISALLOW_COPY_AND_ASSIGN(LayerQuad); | 109 DISALLOW_COPY_AND_ASSIGN(LayerQuad); |
101 }; | 110 }; |
102 | 111 |
103 } | 112 } // namespace cc |
104 | 113 |
105 #endif // CC_RESOURCES_LAYER_QUAD_H_ | 114 #endif // CC_RESOURCES_LAYER_QUAD_H_ |
OLD | NEW |