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