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

Unified Diff: include/core/SkMatrix.h

Issue 1045493002: use Sk4f for matrix math (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 | « bench/MatrixBench.cpp ('k') | src/core/SkMatrix.cpp » ('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 0408634ead7602640884cfe198372b4f92724157..1c79d22121c8fdb5cba9b937fc6c312e2dfbf542 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -413,7 +413,12 @@ public:
@param count The number of points in src to read, and then transform
into dst.
*/
- void mapPoints(SkPoint dst[], const SkPoint src[], int count) const;
+ void mapPoints(SkPoint dst[], const SkPoint src[], int count) const {
+ SkASSERT((dst && src && count > 0) || 0 == count);
+ // no partial overlap
+ SkASSERT(src == dst || &dst[count] <= &src[0] || &src[count] <= &dst[0]);
+ this->getMapPtsProc()(*this, dst, src, count);
+ }
/** Apply this matrix to the array of points, overwriting it with the
transformed values.
@@ -426,10 +431,6 @@ public:
this->mapPoints(pts, pts, count);
}
- void mapPts(SkPoint dst[], const SkPoint src[], int count) const {
- gMapVPtsProcs[this->getType() & 0xF](*this, dst, src, count);
- }
-
/** Like mapPoints but with custom byte stride between the points. Stride
* should be a multiple of sizeof(SkScalar).
*/
@@ -801,12 +802,9 @@ private:
int count);
static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
- static void Trans_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
- static void Scale_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
static const MapPtsProc gMapPtsProcs[];
- static const MapPtsProc gMapVPtsProcs[];
friend class SkPerspIter;
};
« no previous file with comments | « bench/MatrixBench.cpp ('k') | src/core/SkMatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698