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

Unified Diff: include/core/SkMatrix.h

Issue 1278323002: api helpers inspired by blink use-cases (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « include/core/SkCanvas.h ('k') | include/core/SkRRect.h » ('j') | no next file with comments »
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 1626750208363f7da95dd71dee7f84860e932404..6560cb5c2b1df32fc7dfe0b1c136f2e393b74d79 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -369,6 +369,11 @@ public:
@return true if the matrix can be represented by the rectangle mapping.
*/
bool setRectToRect(const SkRect& src, const SkRect& dst, ScaleToFit stf);
+ static SkMatrix MakeRectToRect(const SkRect& src, const SkRect& dst, ScaleToFit stf) {
+ SkMatrix m;
+ m.setRectToRect(src, dst, stf);
+ return m;
+ }
/** Set the matrix such that the specified src points would map to the
specified dst points. count must be within [0..4].
« no previous file with comments | « include/core/SkCanvas.h ('k') | include/core/SkRRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698