| 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 #if USE(ACCELERATED_COMPOSITING) | 8 #if USE(ACCELERATED_COMPOSITING) |
| 9 | 9 |
| 10 #include "CCLayerQuad.h" | 10 #include "CCLayerQuad.h" |
| 11 | 11 |
| 12 namespace WebCore { | 12 namespace cc { |
| 13 | 13 |
| 14 CCLayerQuad::Edge::Edge(const FloatPoint& p, const FloatPoint& q) | 14 CCLayerQuad::Edge::Edge(const FloatPoint& p, const FloatPoint& q) |
| 15 { | 15 { |
| 16 ASSERT(p != q); | 16 ASSERT(p != q); |
| 17 | 17 |
| 18 FloatPoint tangent(p.y() - q.y(), q.x() - p.x()); | 18 FloatPoint tangent(p.y() - q.y(), q.x() - p.x()); |
| 19 float cross2 = p.x() * q.y() - q.x() * p.y(); | 19 float cross2 = p.x() * q.y() - q.x() * p.y(); |
| 20 | 20 |
| 21 set(tangent.x(), tangent.y(), cross2); | 21 set(tangent.x(), tangent.y(), cross2); |
| 22 scale(1.0f / tangent.length()); | 22 scale(1.0f / tangent.length()); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 flattened[4] = m_top.y(); | 54 flattened[4] = m_top.y(); |
| 55 flattened[5] = m_top.z(); | 55 flattened[5] = m_top.z(); |
| 56 flattened[6] = m_right.x(); | 56 flattened[6] = m_right.x(); |
| 57 flattened[7] = m_right.y(); | 57 flattened[7] = m_right.y(); |
| 58 flattened[8] = m_right.z(); | 58 flattened[8] = m_right.z(); |
| 59 flattened[9] = m_bottom.x(); | 59 flattened[9] = m_bottom.x(); |
| 60 flattened[10] = m_bottom.y(); | 60 flattened[10] = m_bottom.y(); |
| 61 flattened[11] = m_bottom.z(); | 61 flattened[11] = m_bottom.z(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace WebCore | 64 } // namespace cc |
| 65 | 65 |
| 66 #endif // USE(ACCELERATED_COMPOSITING) | 66 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |