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 #include "config.h" | 6 #include "config.h" |
7 | 7 |
8 #include "CCLayerQuad.h" | 8 #include "CCLayerQuad.h" |
9 | 9 |
| 10 #include "base/logging.h" |
| 11 |
10 namespace cc { | 12 namespace cc { |
11 | 13 |
12 CCLayerQuad::Edge::Edge(const FloatPoint& p, const FloatPoint& q) | 14 CCLayerQuad::Edge::Edge(const FloatPoint& p, const FloatPoint& q) |
13 { | 15 { |
14 ASSERT(p != q); | 16 DCHECK(p != q); |
15 | 17 |
16 FloatPoint tangent(p.y() - q.y(), q.x() - p.x()); | 18 FloatPoint tangent(p.y() - q.y(), q.x() - p.x()); |
17 float cross2 = p.x() * q.y() - q.x() * p.y(); | 19 float cross2 = p.x() * q.y() - q.x() * p.y(); |
18 | 20 |
19 set(tangent.x(), tangent.y(), cross2); | 21 set(tangent.x(), tangent.y(), cross2); |
20 scale(1.0f / tangent.length()); | 22 scale(1.0f / tangent.length()); |
21 } | 23 } |
22 | 24 |
23 CCLayerQuad::CCLayerQuad(const FloatQuad& quad) | 25 CCLayerQuad::CCLayerQuad(const FloatQuad& quad) |
24 { | 26 { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 flattened[5] = m_top.z(); | 63 flattened[5] = m_top.z(); |
62 flattened[6] = m_right.x(); | 64 flattened[6] = m_right.x(); |
63 flattened[7] = m_right.y(); | 65 flattened[7] = m_right.y(); |
64 flattened[8] = m_right.z(); | 66 flattened[8] = m_right.z(); |
65 flattened[9] = m_bottom.x(); | 67 flattened[9] = m_bottom.x(); |
66 flattened[10] = m_bottom.y(); | 68 flattened[10] = m_bottom.y(); |
67 flattened[11] = m_bottom.z(); | 69 flattened[11] = m_bottom.z(); |
68 } | 70 } |
69 | 71 |
70 } // namespace cc | 72 } // namespace cc |
OLD | NEW |