aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMatrix.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-12-18 15:50:34 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-18 21:50:26 +0000
commitf226e66d75374e370f3ae2c6895bc689670e9e18 (patch)
treeb1e38311a08f7294f366fe3e89c4ba231f3be600 /src/core/SkMatrix.cpp
parentde71572f650005e36d4fc2fe95fb5677a25ae4f6 (diff)
Revert "Transform vertices for distance field glyphs on CPU."
This reverts commit 0215e39d7e415d0530231df6ad20d5f215c72152. Reason for revert: break intel 540 and HD2000 intel release bots on gltestthreading gm dftext_blob_pers Original change's description: > Transform vertices for distance field glyphs on CPU. > > This allows batching of DF draws with different view matrices. > > For perspective matrices this means the transformed position vertex > attribute must have w values. Currently, non-perspective DF draws still > use 2 component positions, though this could be changed in the future. > Consequently, perspective draws can batch with other perspective draws > but not non-perspective draws. > > Adds a GM to test batching and reusing the same blobs with both perspective > and non-perspective matrices. > > Change-Id: I0e42c5449ebf3a5a54025dbcdec824d904d5bd9e > Reviewed-on: https://skia-review.googlesource.com/79900 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Jim Van Verth <jvanverth@google.com> TBR=jvanverth@google.com,bsalomon@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Idc658d9263976d5b5e00a5026c5d6d3c8f4bdc2d Reviewed-on: https://skia-review.googlesource.com/86560 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/core/SkMatrix.cpp')
-rw-r--r--src/core/SkMatrix.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index 4851aeacf6..d02524068e 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -1037,48 +1037,32 @@ const SkMatrix::MapPtsProc SkMatrix::gMapPtsProcs[] = {
///////////////////////////////////////////////////////////////////////////////
-void SkMatrix::mapHomogeneousPointsWithStride(SkPoint3 dst[], const SkPoint3 src[], size_t stride,
- int count) const {
+void SkMatrix::mapHomogeneousPoints(SkPoint3 dst[], const SkPoint3 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]);
if (count > 0) {
if (this->isIdentity()) {
- if (src != dst) {
- if (stride == sizeof(SkPoint3)) {
- memcpy(dst, src, count * sizeof(SkPoint3));
- } else {
- for (int i = 0; i < count; ++i) {
- *dst = *src;
- dst = reinterpret_cast<SkPoint3*>(reinterpret_cast<char*>(dst) + stride);
- src = reinterpret_cast<const SkPoint3*>(reinterpret_cast<const char*>(src) +
- stride);
- }
- }
- }
+ memcpy(dst, src, count * sizeof(SkPoint3));
return;
}
do {
SkScalar sx = src->fX;
SkScalar sy = src->fY;
SkScalar sw = src->fZ;
- src = reinterpret_cast<const SkPoint3*>(reinterpret_cast<const char*>(src) + stride);
+ src++;
SkScalar x = sdot(sx, fMat[kMScaleX], sy, fMat[kMSkewX], sw, fMat[kMTransX]);
SkScalar y = sdot(sx, fMat[kMSkewY], sy, fMat[kMScaleY], sw, fMat[kMTransY]);
SkScalar w = sdot(sx, fMat[kMPersp0], sy, fMat[kMPersp1], sw, fMat[kMPersp2]);
dst->set(x, y, w);
- dst = reinterpret_cast<SkPoint3*>(reinterpret_cast<char*>(dst) + stride);
+ dst++;
} while (--count);
}
}
-void SkMatrix::mapHomogeneousPoints(SkPoint3 dst[], const SkPoint3 src[], int count) const {
- this->mapHomogeneousPointsWithStride(dst, src, sizeof(SkPoint3), count);
-}
-
///////////////////////////////////////////////////////////////////////////////
void SkMatrix::mapVectors(SkPoint dst[], const SkPoint src[], int count) const {