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

Unified Diff: cc/math_util_unittest.cc

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScaleAsVector 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/math_util.cc ('k') | cc/occlusion_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/math_util_unittest.cc
diff --git a/cc/math_util_unittest.cc b/cc/math_util_unittest.cc
index c342834020b6286fecef1ed23bd2f007bd92f526..0d2a677473d32b852e6f8c5299ced7fafa475505 100644
--- a/cc/math_util_unittest.cc
+++ b/cc/math_util_unittest.cc
@@ -6,10 +6,11 @@
#include "cc/math_util.h"
-#include "FloatRect.h"
#include "cc/test/geometry_test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/rect.h"
+#include "ui/gfx/rect_f.h"
#include <public/WebTransformationMatrix.h>
using namespace cc;
@@ -90,12 +91,12 @@ TEST(MathUtilTest, verifyProjectionOfPerpendicularPlane)
transform.makeIdentity();
transform.setM33(0);
- FloatRect rect = FloatRect(0, 0, 1, 1);
- FloatRect projectedRect = MathUtil::projectClippedRect(transform, rect);
+ gfx::RectF rect = gfx::RectF(0, 0, 1, 1);
+ gfx::RectF projectedRect = MathUtil::projectClippedRect(transform, rect);
EXPECT_EQ(0, projectedRect.x());
EXPECT_EQ(0, projectedRect.y());
- EXPECT_TRUE(projectedRect.isEmpty());
+ EXPECT_TRUE(projectedRect.IsEmpty());
}
TEST(MathUtilTest, verifyEnclosingClippedRectUsesCorrectInitialBounds)
@@ -109,27 +110,27 @@ TEST(MathUtilTest, verifyEnclosingClippedRectUsesCorrectInitialBounds)
// However, if there is a bug where the initial xmin/xmax/ymin/ymax are initialized to
// numeric_limits<float>::min() (which is zero, not -flt_max) then the enclosing
// clipped rect will be computed incorrectly.
- FloatRect result = MathUtil::computeEnclosingClippedRect(h1, h2, h3, h4);
+ gfx::RectF result = MathUtil::computeEnclosingClippedRect(h1, h2, h3, h4);
- EXPECT_FLOAT_RECT_EQ(FloatRect(FloatPoint(-100, -100), FloatSize(90, 90)), result);
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(gfx::PointF(-100, -100), gfx::SizeF(90, 90)), result);
}
TEST(MathUtilTest, verifyEnclosingRectOfVerticesUsesCorrectInitialBounds)
{
- FloatPoint vertices[3];
+ gfx::PointF vertices[3];
int numVertices = 3;
- vertices[0] = FloatPoint(-10, -100);
- vertices[1] = FloatPoint(-100, -10);
- vertices[2] = FloatPoint(-30, -30);
+ vertices[0] = gfx::PointF(-10, -100);
+ vertices[1] = gfx::PointF(-100, -10);
+ vertices[2] = gfx::PointF(-30, -30);
// The bounds of the enclosing rect should be -100 to -10 for both x and y. However,
// if there is a bug where the initial xmin/xmax/ymin/ymax are initialized to
// numeric_limits<float>::min() (which is zero, not -flt_max) then the enclosing
// clipped rect will be computed incorrectly.
- FloatRect result = MathUtil::computeEnclosingRectOfVertices(vertices, numVertices);
+ gfx::RectF result = MathUtil::computeEnclosingRectOfVertices(vertices, numVertices);
- EXPECT_FLOAT_RECT_EQ(FloatRect(FloatPoint(-100, -100), FloatSize(90, 90)), result);
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(gfx::PointF(-100, -100), gfx::SizeF(90, 90)), result);
}
TEST(MathUtilTest, smallestAngleBetweenVectors)
« no previous file with comments | « cc/math_util.cc ('k') | cc/occlusion_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698