OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "config.h" | 5 #include "config.h" |
6 #include "core/dom/DOMMatrix.h" | 6 #include "core/dom/DOMMatrix.h" |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 | 9 |
10 DOMMatrix* DOMMatrix::create() | 10 DOMMatrix* DOMMatrix::create() |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 m_matrix.scaleNonUniform(sx, sy); | 93 m_matrix.scaleNonUniform(sx, sy); |
94 else | 94 else |
95 m_matrix.scale3d(sx, sy, sz); | 95 m_matrix.scale3d(sx, sy, sz); |
96 | 96 |
97 if (hasTranslation) | 97 if (hasTranslation) |
98 translateSelf(-ox, -oy, -oz); | 98 translateSelf(-ox, -oy, -oz); |
99 | 99 |
100 return this; | 100 return this; |
101 } | 101 } |
102 | 102 |
| 103 DOMMatrix* DOMMatrix::rotateSelf(double angle, double ox, double oy) |
| 104 { |
| 105 bool hasTranslation = (ox || oy); |
| 106 |
| 107 if (hasTranslation) |
| 108 translateSelf(ox, oy); |
| 109 |
| 110 m_matrix.rotate(angle); |
| 111 |
| 112 if (hasTranslation) |
| 113 translateSelf(-ox, -oy); |
| 114 |
| 115 return this; |
| 116 } |
| 117 |
| 118 DOMMatrix* DOMMatrix::rotateFromVectorSelf(double x, double y) |
| 119 { |
| 120 m_matrix.rotateFromVector(x, y); |
| 121 |
| 122 return this; |
| 123 } |
| 124 |
| 125 DOMMatrix* DOMMatrix::rotateAxisAngleSelf( |
| 126 double x, double y, double z, double angle) |
| 127 { |
| 128 if (x != 0 || y != 0) |
| 129 m_is2D = false; |
| 130 |
| 131 m_matrix.rotate3d(x, y, z, angle); |
| 132 |
| 133 return this; |
| 134 } |
| 135 |
103 } // namespace blink | 136 } // namespace blink |
OLD | NEW |