Index: include/core/SkMatrix.h |
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h |
index f148e390b5cd4930f2d985f61a286cda3748b7cc..bf545ae538823a5f19a3151fe7555b0ec2fc1ff5 100644 |
--- a/include/core/SkMatrix.h |
+++ b/include/core/SkMatrix.h |
@@ -470,6 +470,18 @@ public: |
return this->mapRect(rect, *rect); |
} |
+ /** Apply this matrix to the src rectangle, and write the four transformed |
+ points into dst. The points written to dst will be the original top-left, top-right, |
+ bottom-right, and bottom-left points transformed by the matrix. |
+ @param dst Where the transformed quad is written. |
robertphillips
2013/08/05 13:55:12
src -> rect?
can this be const?
|
+ @param src The original rectangle to be transformed. |
+ */ |
+ void mapRectToQuad(SkPoint dst[4], const SkRect& rect) { |
reed1
2013/08/05 14:56:02
make the method const
|
+ // This could potentially be faster if we only transformed each x and y of the rect once. |
+ rect.toQuad(dst); |
+ this->mapPoints(dst, 4); |
+ } |
+ |
/** Return the mean radius of a circle after it has been mapped by |
this matrix. NOTE: in perspective this value assumes the circle |
has its center at the origin. |