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

Unified Diff: include/core/SkMatrix.h

Issue 1006173005: add SkMatrix::decomposeScale (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | src/core/SkMatrix.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkMatrix.h
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index a272051067e7dabb511ac38d9ad01f07c206fd55..06527763302dc478c7a30ae342d5d06e1a2c1dd0 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -624,6 +624,18 @@ public:
bool getMinMaxScales(SkScalar scaleFactors[2]) const;
/**
+ * Attempt to decompose this matrix into a scale-only component and whatever remains, where
+ * the scale component is to be applied first.
+ *
+ * M -> Remaining * Scale
+ *
+ * On success, return true and assign the scale and remaining components (assuming their
+ * respective parameters are not null). On failure (not invertible) return false and ignore
+ * the parameters.
+ */
+ bool decomposeScale(SkSize* scale, SkMatrix* remaining) const;
+
+ /**
* Return a reference to a const identity matrix
*/
static const SkMatrix& I();
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | src/core/SkMatrix.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698