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

Unified Diff: cc/base/math_util.h

Issue 27223008: Provide approximate type functions for SkMatrix44. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename functions taking gfx::Transform. Created 7 years, 2 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
« no previous file with comments | « no previous file | cc/base/math_util.cc » ('j') | cc/base/math_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/math_util.h
diff --git a/cc/base/math_util.h b/cc/base/math_util.h
index 67a93709d0fe57efdc9d90d89466a665d268f4b6..0123eb468d3cd8a7d927f86b4554f079e13e731d 100644
--- a/cc/base/math_util.h
+++ b/cc/base/math_util.h
@@ -177,6 +177,18 @@ class CC_EXPORT MathUtil {
// If the value is inf, returns max double/float representation.
static scoped_ptr<base::Value> AsValueSafely(double value);
static scoped_ptr<base::Value> AsValueSafely(float value);
+
+ // Check if matrices are of a certain type using approximate math. Each
+ // function gets a tolerance parameter to specify the maximum allowed
+ // absolute difference to the exact values.
+ static bool IsApproximatelyPureTranslation(
+ const gfx::Transform& transform, SkMScalar tolerance);
+ static bool IsMatrixApproximatelyPureTranslation(
+ const SkMatrix44& matrix, SkMScalar tolerance);
+ static bool IsApproximatelyIntegerTransform(
+ const gfx::Transform& transform, SkMScalar tolerance);
+ static bool IsMatrixApproximatelyIntegerTransform(
+ const SkMatrix44& matrix, SkMScalar tolerance);
};
} // namespace cc
« no previous file with comments | « no previous file | cc/base/math_util.cc » ('j') | cc/base/math_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698