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

Unified Diff: include/core/SkMatrix.h

Issue 1040783002: use table of procs (and unrolling) to speed up mapPts (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 89bd7935c9726b2e68ebe96d6bf64ee08397d622..0408634ead7602640884cfe198372b4f92724157 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -426,7 +426,9 @@ public:
this->mapPoints(pts, pts, count);
}
- void mapPts(SkPoint dst[], const SkPoint src[], int count) const;
+ 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).
@@ -799,7 +801,12 @@ 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