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

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

Issue 11369144: ui: Make gfx::Point::Scale() mutate the class, similar to gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for aura Created 8 years, 1 month 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 | Annotate | Revision Log
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/quad_f.h" 5 #include "ui/gfx/quad_f.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gfx/rect_f.h" 9 #include "ui/gfx/rect_f.h"
10 10
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 338 }
339 339
340 TEST(QuadTest, Scale) { 340 TEST(QuadTest, Scale) {
341 PointF a(1.3f, 1.4f); 341 PointF a(1.3f, 1.4f);
342 PointF b(-0.8f, 4.4f); 342 PointF b(-0.8f, 4.4f);
343 PointF c(1.8f, 6.1f); 343 PointF c(1.8f, 6.1f);
344 PointF d(2.1f, 1.6f); 344 PointF d(2.1f, 1.6f);
345 QuadF q1(a, b, c, d); 345 QuadF q1(a, b, c, d);
346 q1.Scale(1.5f); 346 q1.Scale(1.5f);
347 347
348 PointF a_scaled = a.Scale(1.5f); 348 PointF a_scaled = ScalePoint(a, 1.5f);
349 PointF b_scaled = b.Scale(1.5f); 349 PointF b_scaled = ScalePoint(b, 1.5f);
350 PointF c_scaled = c.Scale(1.5f); 350 PointF c_scaled = ScalePoint(c, 1.5f);
351 PointF d_scaled = d.Scale(1.5f); 351 PointF d_scaled = ScalePoint(d, 1.5f);
352 EXPECT_EQ(q1.ToString(), 352 EXPECT_EQ(q1.ToString(),
353 QuadF(a_scaled, b_scaled, c_scaled, d_scaled).ToString()); 353 QuadF(a_scaled, b_scaled, c_scaled, d_scaled).ToString());
354 354
355 QuadF q2; 355 QuadF q2;
356 q2.Scale(1.5f); 356 q2.Scale(1.5f);
357 EXPECT_EQ(q2.ToString(), q2.ToString()); 357 EXPECT_EQ(q2.ToString(), q2.ToString());
358 } 358 }
359 359
360 } // namespace gfx 360 } // namespace gfx
OLDNEW
« cc/layer_impl.cc ('K') | « ui/gfx/quad_f.cc ('k') | ui/gfx/rect_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698