Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: Source/core/dom/DOMMatrix.cpp

Issue 479863002: Implement rotate*() methods in DOMMatrix. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use testharnessreport.js Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/DOMMatrix.h ('k') | Source/core/dom/DOMMatrix.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/DOMMatrix.h ('k') | Source/core/dom/DOMMatrix.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698