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

Unified Diff: ui/gfx/transform.cc

Issue 11358181: Use nearest neighbor filtering for non-translated quads (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Also test negative translations. 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
Index: ui/gfx/transform.cc
diff --git a/ui/gfx/transform.cc b/ui/gfx/transform.cc
index f8f8ce1a3a1e59a625c2a03d6beac794bb47c1f8..fc03dc263517fbd30992d6efbcd2b81a8cae665c 100644
--- a/ui/gfx/transform.cc
+++ b/ui/gfx/transform.cc
@@ -241,6 +241,18 @@ bool Transform::IsIdentityOrTranslation() const {
return has_no_perspective && has_no_rotation_or_skew && has_no_scale;
}
+bool Transform::IsIdentityOrIntegerTranslation() const {
+ if (!IsIdentityOrTranslation())
+ return false;
+
+ bool no_fractional_translation =
+ static_cast<int>(matrix_.getDouble(0, 3)) == matrix_.getDouble(0, 3) &&
+ static_cast<int>(matrix_.getDouble(1, 3)) == matrix_.getDouble(1, 3) &&
+ static_cast<int>(matrix_.getDouble(2, 3)) == matrix_.getDouble(2, 3);
+
+ return no_fractional_translation;
+}
+
bool Transform::IsScaleOrTranslation() const {
bool has_no_perspective = !matrix_.getDouble(3, 0) &&
!matrix_.getDouble(3, 1) &&
« cc/resource_provider.cc ('K') | « ui/gfx/transform.h ('k') | ui/gfx/transform_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698