OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 m_matrix = t; | 87 m_matrix = t; |
88 } else { // There is something there but parsing failed. | 88 } else { // There is something there but parsing failed. |
89 exceptionState.throwDOMException(SyntaxError, "Failed to parse '" + stri
ng + "'."); | 89 exceptionState.throwDOMException(SyntaxError, "Failed to parse '" + stri
ng + "'."); |
90 } | 90 } |
91 } | 91 } |
92 | 92 |
93 // Perform a concatenation of the matrices (this * secondMatrix) | 93 // Perform a concatenation of the matrices (this * secondMatrix) |
94 PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::multiply(CSSMatrix* secondMatrix) c
onst | 94 PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::multiply(CSSMatrix* secondMatrix) c
onst |
95 { | 95 { |
96 if (!secondMatrix) | 96 if (!secondMatrix) |
97 return 0; | 97 return nullptr; |
98 | 98 |
99 return CSSMatrix::create(TransformationMatrix(m_matrix).multiply(secondMatri
x->m_matrix)); | 99 return CSSMatrix::create(TransformationMatrix(m_matrix).multiply(secondMatri
x->m_matrix)); |
100 } | 100 } |
101 | 101 |
102 PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::inverse(ExceptionState& exceptionSt
ate) const | 102 PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::inverse(ExceptionState& exceptionSt
ate) const |
103 { | 103 { |
104 if (!m_matrix.isInvertible()) { | 104 if (!m_matrix.isInvertible()) { |
105 exceptionState.throwDOMException(NotSupportedError, "The matrix is not i
nvertable."); | 105 exceptionState.throwDOMException(NotSupportedError, "The matrix is not i
nvertable."); |
106 return 0; | 106 return nullptr; |
107 } | 107 } |
108 | 108 |
109 return CSSMatrix::create(m_matrix.inverse()); | 109 return CSSMatrix::create(m_matrix.inverse()); |
110 } | 110 } |
111 | 111 |
112 PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::translate(double x, double y, doubl
e z) const | 112 PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::translate(double x, double y, doubl
e z) const |
113 { | 113 { |
114 if (std::isnan(x)) | 114 if (std::isnan(x)) |
115 x = 0; | 115 x = 0; |
116 if (std::isnan(y)) | 116 if (std::isnan(y)) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 if (m_matrix.isAffine()) | 184 if (m_matrix.isAffine()) |
185 return String::format("matrix(%f, %f, %f, %f, %f, %f)", m_matrix.a(), m_
matrix.b(), m_matrix.c(), m_matrix.d(), m_matrix.e(), m_matrix.f()); | 185 return String::format("matrix(%f, %f, %f, %f, %f, %f)", m_matrix.a(), m_
matrix.b(), m_matrix.c(), m_matrix.d(), m_matrix.e(), m_matrix.f()); |
186 return String::format("matrix3d(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f,
%f, %f, %f, %f, %f)", | 186 return String::format("matrix3d(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f,
%f, %f, %f, %f, %f)", |
187 m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(), | 187 m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(), |
188 m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(), | 188 m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(), |
189 m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(), | 189 m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(), |
190 m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44()); | 190 m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44()); |
191 } | 191 } |
192 | 192 |
193 } // namespace WebCore | 193 } // namespace WebCore |
OLD | NEW |