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

Unified Diff: include/core/SkMatrix.h

Issue 151923006: Add rotation APIs in radians to SkCanvas, SkMatrix Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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: include/core/SkMatrix.h
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index 9bbbc1745b3d64118125a08af39c2be28040b6de..1e27fb3c0aedf987c9980cd9de5b2523556d02b2 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -201,6 +201,14 @@ public:
/** Set the matrix to rotate about (0,0) by the specified number of degrees.
*/
void setRotate(SkScalar degrees);
+ /** Set the matrix to rotate by the specified number of radians, with a
+ pivot point at (px, py). The pivot point is the coordinate that should
+ remain unchanged by the specified transformation.
+ */
+ void setRotateRadians(SkScalar radians, SkScalar px, SkScalar py);
+ /** Set the matrix to rotate about (0,0) by the specified number of radians.
+ */
+ void setRotateRadians(SkScalar radians);
/** Set the matrix to rotate by the specified sine and cosine values, with
a pivot point at (px, py). The pivot point is the coordinate that
should remain unchanged by the specified transformation.
@@ -244,6 +252,14 @@ public:
M' = M * R(degrees)
*/
bool preRotate(SkScalar degrees);
+ /** Preconcats the matrix with the specified rotation.
+ M' = M * R(radians, px, py)
+ */
+ bool preRotateRadians(SkScalar degrees, SkScalar px, SkScalar py);
+ /** Preconcats the matrix with the specified rotation.
+ M' = M * R(radians)
+ */
+ bool preRotateRadians(SkScalar degrees);
/** Preconcats the matrix with the specified skew.
M' = M * K(kx, ky, px, py)
*/
@@ -281,6 +297,14 @@ public:
M' = R(degrees) * M
*/
bool postRotate(SkScalar degrees);
+ /** Postconcats the matrix with the specified rotation.
+ M' = R(radians, px, py) * M
+ */
+ bool postRotateRadians(SkScalar degrees, SkScalar px, SkScalar py);
+ /** Postconcats the matrix with the specified rotation.
+ M' = R(radians) * M
+ */
+ bool postRotateRadians(SkScalar degrees);
/** Postconcats the matrix with the specified skew.
M' = K(kx, ky, px, py) * M
*/
« include/core/SkCanvas.h ('K') | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698