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

Unified Diff: ui/gfx/transform_unittest.cc

Issue 11358181: Use nearest neighbor filtering for non-translated quads (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Change CHECK() into DCHECK(). Created 8 years 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 | « ui/gfx/transform.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/transform_unittest.cc
diff --git a/ui/gfx/transform_unittest.cc b/ui/gfx/transform_unittest.cc
index 83255388f237dac8f47cdafddee8711370f25e88..31892c3d29a98170d21e045abed59ddcce1ce57d 100644
--- a/ui/gfx/transform_unittest.cc
+++ b/ui/gfx/transform_unittest.cc
@@ -1158,6 +1158,31 @@ TEST(XFormTest, FactorTRS) {
}
}
+TEST(XFormTest, IntegerTranslation) {
+ gfx::Transform transform;
+ EXPECT_TRUE(transform.IsIdentityOrIntegerTranslation());
+
+ transform.Translate3d(1, 2, 3);
+ EXPECT_TRUE(transform.IsIdentityOrIntegerTranslation());
+
+ transform.MakeIdentity();
+ transform.Translate3d(-1, -2, -3);
+ EXPECT_TRUE(transform.IsIdentityOrIntegerTranslation());
+
+ transform.MakeIdentity();
+ transform.Translate3d(4.5, 0, 0);
+ EXPECT_FALSE(transform.IsIdentityOrIntegerTranslation());
+
+ transform.MakeIdentity();
+ transform.Translate3d(0, -6.7, 0);
+ EXPECT_FALSE(transform.IsIdentityOrIntegerTranslation());
+
+ transform.MakeIdentity();
+ transform.Translate3d(0, 0, 8.9);
+ EXPECT_FALSE(transform.IsIdentityOrIntegerTranslation());
+}
+
+
} // namespace
} // namespace gfx
« no previous file with comments | « ui/gfx/transform.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698