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

Side by Side Diff: cc/layer_quad_unittest.cc

Issue 12471007: Part 8 of cc/ directory shuffles: resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/layer_quad.cc ('k') | cc/layer_tiling_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/layer_quad.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/quad_f.h"
9
10 namespace cc {
11 namespace {
12
13 TEST(LayerQuadTest, QuadFConversion)
14 {
15 gfx::PointF p1(-0.5, -0.5);
16 gfx::PointF p2( 0.5, -0.5);
17 gfx::PointF p3( 0.5, 0.5);
18 gfx::PointF p4(-0.5, 0.5);
19
20 gfx::QuadF quadCW(p1, p2, p3, p4);
21 LayerQuad layerQuadCW(quadCW);
22 EXPECT_TRUE(layerQuadCW.ToQuadF() == quadCW);
23
24 gfx::QuadF quadCCW(p1, p4, p3, p2);
25 LayerQuad layerQuadCCW(quadCCW);
26 EXPECT_TRUE(layerQuadCCW.ToQuadF() == quadCCW);
27 }
28
29 TEST(LayerQuadTest, Inflate)
30 {
31 gfx::PointF p1(-0.5, -0.5);
32 gfx::PointF p2( 0.5, -0.5);
33 gfx::PointF p3( 0.5, 0.5);
34 gfx::PointF p4(-0.5, 0.5);
35
36 gfx::QuadF quad(p1, p2, p3, p4);
37 LayerQuad layerQuad(quad);
38 quad.Scale(2, 2);
39 layerQuad.Inflate(0.5);
40 EXPECT_TRUE(layerQuad.ToQuadF() == quad);
41 }
42
43 } // namespace
44 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_quad.cc ('k') | cc/layer_tiling_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698