Chromium Code Reviews| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 m_matrix.scaleNonUniform(sx, sy); | 73 m_matrix.scaleNonUniform(sx, sy); |
| 74 else | 74 else |
| 75 m_matrix.scale3d(sx, sy, sz); | 75 m_matrix.scale3d(sx, sy, sz); |
| 76 | 76 |
| 77 if (hasTranslation) | 77 if (hasTranslation) |
| 78 translateSelf(-ox, -oy, -oz); | 78 translateSelf(-ox, -oy, -oz); |
| 79 | 79 |
| 80 return this; | 80 return this; |
| 81 } | 81 } |
| 82 | 82 |
| 83 DOMMatrix* DOMMatrix::rotateSelf(double angle, double ox, double oy) | |
| 84 { | |
| 85 bool hasTranslation = (ox || oy); | |
| 86 | |
| 87 if (hasTranslation) | |
| 88 translateSelf(ox, oy); | |
| 89 | |
| 90 m_matrix.rotate(angle); | |
| 91 | |
| 92 if (hasTranslation) | |
| 93 translateSelf(-ox, -oy); | |
| 94 | |
| 95 return this; | |
| 96 } | |
| 97 | |
| 98 DOMMatrix* DOMMatrix::rotateFromVectorSelf(double x, double y) | |
| 99 { | |
| 100 m_matrix.rotateFromVector(x, y); | |
| 101 | |
| 102 return this; | |
| 103 } | |
| 104 | |
| 105 DOMMatrix* DOMMatrix::rotateAxisAngleSelf( | |
| 106 double x, double y, double z, double angle) | |
| 107 { | |
| 108 if (x != 0 || y != 0) | |
|
zino
2014/08/17 15:32:50
http://dev.w3.org/fxtf/geometry/#dom-dommatrix-rot
| |
| 109 m_is2D = false; | |
| 110 | |
| 111 m_matrix.rotate3d(x, y, z, angle); | |
| 112 | |
| 113 return this; | |
| 114 } | |
| 115 | |
| 83 } // namespace blink | 116 } // namespace blink |
| OLD | NEW |