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

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

Issue 1325803002: Apply skew on both axes together rather than sequentially on Compositor thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test for skewY Created 5 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_unittest.cc ('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 #include "ui/gfx/transform_util.h" 5 #include "ui/gfx/transform_util.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/geometry/point.h" 8 #include "ui/gfx/geometry/point.h"
9 #include "ui/gfx/geometry/point3_f.h" 9 #include "ui/gfx/geometry/point3_f.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 Transform result(Transform::kSkipInitialization); 163 Transform result(Transform::kSkipInitialization);
164 Transform transform; 164 Transform transform;
165 165
166 166
167 transform.RotateAboutZAxis(89.99); 167 transform.RotateAboutZAxis(89.99);
168 transform.Scale3d(SkDoubleToMScalar(1.0), 168 transform.Scale3d(SkDoubleToMScalar(1.0),
169 SkDoubleToMScalar(3.00001), 169 SkDoubleToMScalar(3.00001),
170 SkDoubleToMScalar(2.0)); 170 SkDoubleToMScalar(2.0));
171 transform.Translate3d(SkDoubleToMScalar(30.5), SkDoubleToMScalar(20.0), 171 transform.Translate3d(SkDoubleToMScalar(30.5), SkDoubleToMScalar(20.0),
172 SkDoubleToMScalar(10.1)); 172 SkDoubleToMScalar(10.1));
173 transform.SkewX(20.0); 173 transform.Skew(20.0, 0.0);
174 Rect viewport(1920, 1200); 174 Rect viewport(1920, 1200);
175 bool snapped = SnapTransform(&result, transform, viewport); 175 bool snapped = SnapTransform(&result, transform, viewport);
176 EXPECT_FALSE(snapped) << "Skewed viewport should not snap."; 176 EXPECT_FALSE(snapped) << "Skewed viewport should not snap.";
177 } 177 }
178 178
179 TEST(TransformUtilTest, TransformAboutPivot) { 179 TEST(TransformUtilTest, TransformAboutPivot) {
180 Transform transform; 180 Transform transform;
181 transform.Scale(3, 4); 181 transform.Scale(3, 4);
182 transform = TransformAboutPivot(Point(7, 8), transform); 182 transform = TransformAboutPivot(Point(7, 8), transform);
183 183
(...skipping 16 matching lines...) Expand all
200 DecomposedTransform result; 200 DecomposedTransform result;
201 BlendDecomposedTransforms(&result, first, second, 0.25); 201 BlendDecomposedTransforms(&result, first, second, 0.25);
202 for (size_t i = 0; i < 4; ++i) { 202 for (size_t i = 0; i < 4; ++i) {
203 EXPECT_TRUE(std::isfinite(result.quaternion[i])); 203 EXPECT_TRUE(std::isfinite(result.quaternion[i]));
204 EXPECT_FALSE(std::isnan(result.quaternion[i])); 204 EXPECT_FALSE(std::isnan(result.quaternion[i]));
205 } 205 }
206 } 206 }
207 207
208 } // namespace 208 } // namespace
209 } // namespace gfx 209 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/transform_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698