diff options
author | Greg Daniel <egdaniel@google.com> | 2017-12-18 21:13:41 +0000 |
---|---|---|
committer | Greg Daniel <egdaniel@google.com> | 2017-12-18 21:28:52 +0000 |
commit | de71572f650005e36d4fc2fe95fb5677a25ae4f6 (patch) | |
tree | 32ffbd7c0011caef80327455e18f4f30e9b69c6f /src/core/SkMatrix.cpp | |
parent | 1aa6cdad1036f6c9fee02c4425ccc02e6bb3e46d (diff) |
Revert "move homogenous with stride to matrixpriv"
This reverts commit 2d53d984251a753b9d0fb3adad3be09243cf5c14.
Reason for revert: revert needed to revert previous cl
Original change's description:
> move homogenous with stride to matrixpriv
>
> this appears to be needed only by Skia
> internally, so move it out of the public
> includes.
>
> R=​bsalomon@google.com
> Bug: skia:6898
> Change-Id: Iebdda8f2c9a8fd953dd44bac9b74158d7491c21a
> Reviewed-on: https://skia-review.googlesource.com/85961
> Commit-Queue: Cary Clark <caryclark@skia.org>
> Commit-Queue: Cary Clark <caryclark@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,caryclark@google.com,caryclark@skia.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:6898
Change-Id: Icbd15ee0b524c770a324c490ab0cadf6a045e0d5
Reviewed-on: https://skia-review.googlesource.com/86800
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/core/SkMatrix.cpp')
-rw-r--r-- | src/core/SkMatrix.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp index 23b465277f..4851aeacf6 100644 --- a/src/core/SkMatrix.cpp +++ b/src/core/SkMatrix.cpp @@ -6,7 +6,7 @@ */ #include "SkFloatBits.h" -#include "SkMatrixPriv.h" +#include "SkMatrix.h" #include "SkNx.h" #include "SkPaint.h" #include "SkPoint3.h" @@ -1037,15 +1037,14 @@ const SkMatrix::MapPtsProc SkMatrix::gMapPtsProcs[] = { /////////////////////////////////////////////////////////////////////////////// -void SkMatrixPriv::MapHomogeneousPointsWithStride(const SkMatrix& mx, SkPoint3 dst[], - const SkPoint3 src[], size_t stride, - int count) { +void SkMatrix::mapHomogeneousPointsWithStride(SkPoint3 dst[], const SkPoint3 src[], size_t stride, + 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 (mx.isIdentity()) { + if (this->isIdentity()) { if (src != dst) { if (stride == sizeof(SkPoint3)) { memcpy(dst, src, count * sizeof(SkPoint3)); @@ -1065,11 +1064,10 @@ void SkMatrixPriv::MapHomogeneousPointsWithStride(const SkMatrix& mx, SkPoint3 d SkScalar sy = src->fY; SkScalar sw = src->fZ; src = reinterpret_cast<const SkPoint3*>(reinterpret_cast<const char*>(src) + stride); - const SkScalar* mat = mx.fMat; - typedef SkMatrix M; - SkScalar x = sdot(sx, mat[M::kMScaleX], sy, mat[M::kMSkewX], sw, mat[M::kMTransX]); - SkScalar y = sdot(sx, mat[M::kMSkewY], sy, mat[M::kMScaleY], sw, mat[M::kMTransY]); - SkScalar w = sdot(sx, mat[M::kMPersp0], sy, mat[M::kMPersp1], sw, mat[M::kMPersp2]); + + 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); @@ -1078,7 +1076,7 @@ void SkMatrixPriv::MapHomogeneousPointsWithStride(const SkMatrix& mx, SkPoint3 d } void SkMatrix::mapHomogeneousPoints(SkPoint3 dst[], const SkPoint3 src[], int count) const { - SkMatrixPriv::MapHomogeneousPointsWithStride(*this, dst, src, sizeof(SkPoint3), count); + this->mapHomogeneousPointsWithStride(dst, src, sizeof(SkPoint3), count); } /////////////////////////////////////////////////////////////////////////////// |