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

Unified Diff: include/core/SkMatrix.h

Issue 21877006: Add blend optimization helpers and use to convert rect draws to clears. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tot Created 7 years, 5 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 | « gyp/gpu.gypi ('k') | include/core/SkRect.h » ('j') | include/core/SkRect.h » ('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 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.
« no previous file with comments | « gyp/gpu.gypi ('k') | include/core/SkRect.h » ('j') | include/core/SkRect.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698