From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/css/WebKitCSSMatrix.h | 47 +++++++++++++----------------------- 1 file changed, 17 insertions(+), 30 deletions(-) (limited to 'Source/WebCore/css/WebKitCSSMatrix.h') diff --git a/Source/WebCore/css/WebKitCSSMatrix.h b/Source/WebCore/css/WebKitCSSMatrix.h index 45393fbad..84c0279bf 100644 --- a/Source/WebCore/css/WebKitCSSMatrix.h +++ b/Source/WebCore/css/WebKitCSSMatrix.h @@ -23,31 +23,20 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebKitCSSMatrix_h -#define WebKitCSSMatrix_h +#pragma once +#include "ExceptionOr.h" #include "ScriptWrappable.h" #include "TransformationMatrix.h" -#include -#include -#include namespace WebCore { -typedef int ExceptionCode; - -class WebKitCSSMatrix : public ScriptWrappable, public RefCounted { +class WebKitCSSMatrix final : public ScriptWrappable, public RefCounted { public: - static PassRefPtr create(const TransformationMatrix& m) - { - return adoptRef(new WebKitCSSMatrix(m)); - } - static PassRefPtr create(const String& s, ExceptionCode& ec) - { - return adoptRef(new WebKitCSSMatrix(s, ec)); - } + static Ref create(const TransformationMatrix&); + static ExceptionOr> create(const String&); - virtual ~WebKitCSSMatrix(); + ~WebKitCSSMatrix(); double a() const { return m_matrix.a(); } double b() const { return m_matrix.b(); } @@ -97,66 +86,64 @@ public: void setM43(double f) { m_matrix.setM43(f); } void setM44(double f) { m_matrix.setM44(f); } - void setMatrixValue(const String&, ExceptionCode&); + ExceptionOr setMatrixValue(const String&); // The following math function return a new matrix with the // specified operation applied. The this value is not modified. // Multiply this matrix by secondMatrix, on the right (result = this * secondMatrix) - PassRefPtr multiply(WebKitCSSMatrix* secondMatrix) const; + RefPtr multiply(WebKitCSSMatrix* secondMatrix) const; // Return the inverse of this matrix. Throw an exception if the matrix is not invertible - PassRefPtr inverse(ExceptionCode&) const; + ExceptionOr> inverse() const; // Return this matrix translated by the passed values. // Passing a NaN will use a value of 0. This allows the 3D form to used for 2D operations // Operation is performed as though the this matrix is multiplied by a matrix with // the translation values on the left (result = translation(x,y,z) * this) - PassRefPtr translate(double x, double y, double z) const; + Ref translate(double x, double y, double z) const; // Returns this matrix scaled by the passed values. // Passing scaleX or scaleZ as NaN uses a value of 1, but passing scaleY of NaN // makes it the same as scaleX. This allows the 3D form to used for 2D operations // Operation is performed as though the this matrix is multiplied by a matrix with // the scale values on the left (result = scale(x,y,z) * this) - PassRefPtr scale(double scaleX, double scaleY, double scaleZ) const; + Ref scale(double scaleX, double scaleY, double scaleZ) const; // Returns this matrix rotated by the passed values. // If rotY and rotZ are NaN, rotate about Z (rotX=0, rotateY=0, rotateZ=rotX). // Otherwise use a rotation value of 0 for any passed NaN. // Operation is performed as though the this matrix is multiplied by a matrix with // the rotation values on the left (result = rotation(x,y,z) * this) - PassRefPtr rotate(double rotX, double rotY, double rotZ) const; + Ref rotate(double rotX, double rotY, double rotZ) const; // Returns this matrix rotated about the passed axis by the passed angle. // Passing a NaN will use a value of 0. If the axis is (0,0,0) use a value // Operation is performed as though the this matrix is multiplied by a matrix with // the rotation values on the left (result = rotation(x,y,z,angle) * this) - PassRefPtr rotateAxisAngle(double x, double y, double z, double angle) const; + Ref rotateAxisAngle(double x, double y, double z, double angle) const; // Return this matrix skewed along the X axis by the passed values. // Passing a NaN will use a value of 0. // Operation is performed as though the this matrix is multiplied by a matrix with // the skew values on the left (result = skewX(angle) * this) - PassRefPtr skewX(double angle) const; + Ref skewX(double angle) const; // Return this matrix skewed along the Y axis by the passed values. // Passing a NaN will use a value of 0. // Operation is performed as though the this matrix is multiplied by a matrix with // the skew values on the left (result = skewY(angle) * this) - PassRefPtr skewY(double angle) const; + Ref skewY(double angle) const; const TransformationMatrix& transform() const { return m_matrix; } String toString() const; -protected: +private: + WebKitCSSMatrix() = default; WebKitCSSMatrix(const TransformationMatrix&); - WebKitCSSMatrix(const String&, ExceptionCode&); TransformationMatrix m_matrix; }; } // namespace WebCore - -#endif // WebKitCSSMatrix_h -- cgit v1.2.1