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

Unified Diff: ui/gfx/transform.h

Issue 12541006: Use LCD text if the transform IsAlmostIdentityAndIntegerTranslation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Transform::IsAlmostXXX methods 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/transform.h
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 10885bd3aaff9d3c345fe948a6744bb6ee93ebb4..48261f4eeaa0441864b6935ac50d6075f10b1ec8 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -116,6 +116,14 @@ class UI_EXPORT Transform {
// translation.
bool IsIdentityOrIntegerTranslation() const;
+ // These "Almost" methods check if the transform is very near to meet the
+ // conditions. Useful when the transform has been computed many steps and
+ // contains tiny errors but can still be treated as meeting the conditions
+ // approximately.
+ bool IsAlmostIdentity() const;
+ bool IsAlmostIdentityOrTranslation() const;
+ bool IsAlmostIdentityOrIntegerTranslation() const;
+
// Returns true if the matrix is has only scaling and translation components.
bool IsScaleOrTranslation() const {
int mask = SkMatrix44::kScale_Mask | SkMatrix44::kTranslate_Mask;

Powered by Google App Engine
This is Rietveld 408576698