diff options
author | Steve Block <steveblock@google.com> | 2010-02-02 14:57:50 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-04 15:06:55 +0000 |
commit | d0825bca7fe65beaee391d30da42e937db621564 (patch) | |
tree | 7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebCore/platform/graphics/transforms | |
parent | 3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff) | |
download | external_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2 |
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebCore/platform/graphics/transforms')
-rw-r--r-- | WebCore/platform/graphics/transforms/TransformationMatrix.h | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/WebCore/platform/graphics/transforms/TransformationMatrix.h b/WebCore/platform/graphics/transforms/TransformationMatrix.h index 802ad3c..9e724d5 100644 --- a/WebCore/platform/graphics/transforms/TransformationMatrix.h +++ b/WebCore/platform/graphics/transforms/TransformationMatrix.h @@ -35,6 +35,8 @@ #include <CoreGraphics/CGAffineTransform.h> #elif PLATFORM(CAIRO) #include <cairo.h> +#elif PLATFORM(OPENVG) +#include "VGUtils.h" #elif PLATFORM(QT) #include <QTransform> #elif PLATFORM(SKIA) @@ -43,6 +45,14 @@ #include <wx/graphics.h> #endif +#if PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS)) || (PLATFORM(WX) && OS(WINDOWS)) +#if COMPILER(MINGW) +typedef struct _XFORM XFORM; +#else +typedef struct tagXFORM XFORM; +#endif +#endif + namespace WebCore { class IntRect; @@ -299,6 +309,8 @@ public: operator CGAffineTransform() const; #elif PLATFORM(CAIRO) operator cairo_matrix_t() const; +#elif PLATFORM(OPENVG) + operator VGMatrix() const; #elif PLATFORM(QT) operator QTransform() const; #elif PLATFORM(SKIA) @@ -307,31 +319,31 @@ public: operator wxGraphicsMatrix() const; #endif -#if PLATFORM(WIN) +#if PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS)) || (PLATFORM(WX) && OS(WINDOWS)) operator XFORM() const; #endif + bool isIdentityOrTranslation() const + { + return m_matrix[0][0] == 1 && m_matrix[0][1] == 0 && m_matrix[0][2] == 0 && m_matrix[0][3] == 0 + && m_matrix[1][0] == 0 && m_matrix[1][1] == 1 && m_matrix[1][2] == 0 && m_matrix[1][3] == 0 + && m_matrix[2][0] == 0 && m_matrix[2][1] == 0 && m_matrix[2][2] == 1 && m_matrix[2][3] == 0 + && m_matrix[3][3] == 1; + } + private: // multiply passed 2D point by matrix (assume z=0) void multVecMatrix(double x, double y, double& dstX, double& dstY) const; - + // multiply passed 3D point by matrix void multVecMatrix(double x, double y, double z, double& dstX, double& dstY, double& dstZ) const; - + void setMatrix(const Matrix4 m) { if (m && m != m_matrix) memcpy(m_matrix, m, sizeof(Matrix4)); } - - bool isIdentityOrTranslation() const - { - return m_matrix[0][0] == 1 && m_matrix[0][1] == 0 && m_matrix[0][2] == 0 && m_matrix[0][3] == 0 && - m_matrix[1][0] == 0 && m_matrix[1][1] == 1 && m_matrix[1][2] == 0 && m_matrix[1][3] == 0 && - m_matrix[2][0] == 0 && m_matrix[2][1] == 0 && m_matrix[2][2] == 1 && m_matrix[2][3] == 0 && - m_matrix[3][3] == 1; - } - + Matrix4 m_matrix; }; |