| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "wtf/CPU.h" | 34 #include "wtf/CPU.h" |
| 35 #include "wtf/FastAllocBase.h" | 35 #include "wtf/FastAllocBase.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 | 38 |
| 39 class AffineTransform; | 39 class AffineTransform; |
| 40 class IntRect; | 40 class IntRect; |
| 41 class LayoutRect; | 41 class LayoutRect; |
| 42 class FloatRect; | 42 class FloatRect; |
| 43 class FloatQuad; | 43 class FloatQuad; |
| 44 | 44 class FloatBox; |
| 45 #if CPU(X86_64) | 45 #if CPU(X86_64) |
| 46 #define TRANSFORMATION_MATRIX_USE_X86_64_SSE2 | 46 #define TRANSFORMATION_MATRIX_USE_X86_64_SSE2 |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 class PLATFORM_EXPORT TransformationMatrix { | 49 class PLATFORM_EXPORT TransformationMatrix { |
| 50 WTF_MAKE_FAST_ALLOCATED; | 50 WTF_MAKE_FAST_ALLOCATED; |
| 51 public: | 51 public: |
| 52 | 52 |
| 53 #if CPU(APPLE_ARMV7S) || defined(TRANSFORMATION_MATRIX_USE_X86_64_SSE2) | 53 #if CPU(APPLE_ARMV7S) || defined(TRANSFORMATION_MATRIX_USE_X86_64_SSE2) |
| 54 #if COMPILER(MSVC) | 54 #if COMPILER(MSVC) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // a ray perpendicular to the source plane and computing | 145 // a ray perpendicular to the source plane and computing |
| 146 // the local x,y position of the point where that ray intersects | 146 // the local x,y position of the point where that ray intersects |
| 147 // with the destination plane. | 147 // with the destination plane. |
| 148 FloatPoint projectPoint(const FloatPoint&, bool* clamped = 0) const; | 148 FloatPoint projectPoint(const FloatPoint&, bool* clamped = 0) const; |
| 149 // Projects the four corners of the quad | 149 // Projects the four corners of the quad |
| 150 FloatQuad projectQuad(const FloatQuad&, bool* clamped = 0) const; | 150 FloatQuad projectQuad(const FloatQuad&, bool* clamped = 0) const; |
| 151 // Projects the four corners of the quad and takes a bounding box, | 151 // Projects the four corners of the quad and takes a bounding box, |
| 152 // while sanitizing values created when the w component is negative. | 152 // while sanitizing values created when the w component is negative. |
| 153 LayoutRect clampedBoundsOfProjectedQuad(const FloatQuad&) const; | 153 LayoutRect clampedBoundsOfProjectedQuad(const FloatQuad&) const; |
| 154 | 154 |
| 155 void transformBox(FloatBox&) const; |
| 156 |
| 155 double m11() const { return m_matrix[0][0]; } | 157 double m11() const { return m_matrix[0][0]; } |
| 156 void setM11(double f) { m_matrix[0][0] = f; } | 158 void setM11(double f) { m_matrix[0][0] = f; } |
| 157 double m12() const { return m_matrix[0][1]; } | 159 double m12() const { return m_matrix[0][1]; } |
| 158 void setM12(double f) { m_matrix[0][1] = f; } | 160 void setM12(double f) { m_matrix[0][1] = f; } |
| 159 double m13() const { return m_matrix[0][2]; } | 161 double m13() const { return m_matrix[0][2]; } |
| 160 void setM13(double f) { m_matrix[0][2] = f; } | 162 void setM13(double f) { m_matrix[0][2] = f; } |
| 161 double m14() const { return m_matrix[0][3]; } | 163 double m14() const { return m_matrix[0][3]; } |
| 162 void setM14(double f) { m_matrix[0][3] = f; } | 164 void setM14(double f) { m_matrix[0][3] = f; } |
| 163 double m21() const { return m_matrix[1][0]; } | 165 double m21() const { return m_matrix[1][0]; } |
| 164 void setM21(double f) { m_matrix[1][0] = f; } | 166 void setM21(double f) { m_matrix[1][0] = f; } |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 if (m && m != m_matrix) | 357 if (m && m != m_matrix) |
| 356 memcpy(m_matrix, m, sizeof(Matrix4)); | 358 memcpy(m_matrix, m, sizeof(Matrix4)); |
| 357 } | 359 } |
| 358 | 360 |
| 359 Matrix4 m_matrix; | 361 Matrix4 m_matrix; |
| 360 }; | 362 }; |
| 361 | 363 |
| 362 } // namespace WebCore | 364 } // namespace WebCore |
| 363 | 365 |
| 364 #endif // TransformationMatrix_h | 366 #endif // TransformationMatrix_h |
| OLD | NEW |