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

Side by Side Diff: ui/gfx/transform.cc

Issue 2251303003: Implement position: sticky updates on compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master and add comments to WebLayerStickyPositionConstraint members. Created 4 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 | « ui/gfx/transform.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // MSVC++ requires this to be set before any other includes to get M_PI. 5 // MSVC++ requires this to be set before any other includes to get M_PI.
6 #define _USE_MATH_DEFINES 6 #define _USE_MATH_DEFINES
7 7
8 #include "ui/gfx/transform.h" 8 #include "ui/gfx/transform.h"
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 matrix_.preConcat(rot); 168 matrix_.preConcat(rot);
169 } 169 }
170 } 170 }
171 171
172 void Transform::Scale(SkMScalar x, SkMScalar y) { matrix_.preScale(x, y, 1); } 172 void Transform::Scale(SkMScalar x, SkMScalar y) { matrix_.preScale(x, y, 1); }
173 173
174 void Transform::Scale3d(SkMScalar x, SkMScalar y, SkMScalar z) { 174 void Transform::Scale3d(SkMScalar x, SkMScalar y, SkMScalar z) {
175 matrix_.preScale(x, y, z); 175 matrix_.preScale(x, y, z);
176 } 176 }
177 177
178 void Transform::Translate(const Vector2dF& offset) {
179 Translate(offset.x(), offset.y());
180 }
181
178 void Transform::Translate(SkMScalar x, SkMScalar y) { 182 void Transform::Translate(SkMScalar x, SkMScalar y) {
179 matrix_.preTranslate(x, y, 0); 183 matrix_.preTranslate(x, y, 0);
180 } 184 }
181 185
186 void Transform::Translate3d(const Vector3dF& offset) {
187 Translate3d(offset.x(), offset.y(), offset.z());
188 }
189
182 void Transform::Translate3d(SkMScalar x, SkMScalar y, SkMScalar z) { 190 void Transform::Translate3d(SkMScalar x, SkMScalar y, SkMScalar z) {
183 matrix_.preTranslate(x, y, z); 191 matrix_.preTranslate(x, y, z);
184 } 192 }
185 193
186 void Transform::Skew(double angle_x, double angle_y) { 194 void Transform::Skew(double angle_x, double angle_y) {
187 if (matrix_.isIdentity()) { 195 if (matrix_.isIdentity()) {
188 matrix_.set(0, 1, TanDegrees(angle_x)); 196 matrix_.set(0, 1, TanDegrees(angle_x));
189 matrix_.set(1, 0, TanDegrees(angle_y)); 197 matrix_.set(1, 0, TanDegrees(angle_y));
190 } else { 198 } else {
191 SkMatrix44 skew(SkMatrix44::kIdentity_Constructor); 199 SkMatrix44 skew(SkMatrix44::kIdentity_Constructor);
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 matrix_.get(2, 1), 601 matrix_.get(2, 1),
594 matrix_.get(2, 2), 602 matrix_.get(2, 2),
595 matrix_.get(2, 3), 603 matrix_.get(2, 3),
596 matrix_.get(3, 0), 604 matrix_.get(3, 0),
597 matrix_.get(3, 1), 605 matrix_.get(3, 1),
598 matrix_.get(3, 2), 606 matrix_.get(3, 2),
599 matrix_.get(3, 3)); 607 matrix_.get(3, 3));
600 } 608 }
601 609
602 } // namespace gfx 610 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/transform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698