diff options
author | Mike Reed <reed@google.com> | 2017-10-13 13:26:00 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-13 13:26:08 +0000 |
commit | f0cb7a09abe35e8eff152212e68f3cee3be075df (patch) | |
tree | 75ac268d2dd0f99c21863c79601e47bd4f7e918d /src | |
parent | cccaef1667857432a68051000ab3f338fc2e64b6 (diff) |
Revert "move SkMatrix anonymous affine enum to private"
This reverts commit 708ec81d7a9bba12cd7e574b5c5ae80b2ad77919.
Reason for revert: broke android
frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp
frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp:153:54: error: no member named 'kAScaleX' in 'SkMatrix'; did you mean 'kMScaleX'?
FS_MATRIX transform = {transformValues[SkMatrix::kAScaleX], transformValues[SkMatrix::kASkewY],
~~~~~~~~~~^~~~~~~~
Original change's description:
> move SkMatrix anonymous affine enum to private
>
> enum members aren't used by SkMatrix.h or by
> clients outside of Skia.
>
> R: reed@google.com, bungeman@google.com
> Bug: skia:6898
> Change-Id: I6873b4106e5ffe354caf5ec18cc613910304fa13
> Reviewed-on: https://skia-review.googlesource.com/59160
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Cary Clark <caryclark@skia.org>
TBR=bungeman@google.com,reed@google.com,caryclark@skia.org
Change-Id: I7fe80879e8b851c9036fc910a314129c299d82d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6898
Reviewed-on: https://skia-review.googlesource.com/59460
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkMatrix.cpp | 37 | ||||
-rw-r--r-- | src/core/SkMatrixPriv.h | 12 | ||||
-rw-r--r-- | src/xps/SkXPSDevice.cpp | 13 |
3 files changed, 24 insertions, 38 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp index 45f77344fb..0ed9565fb9 100644 --- a/src/core/SkMatrix.cpp +++ b/src/core/SkMatrix.cpp @@ -7,7 +7,6 @@ #include "SkFloatBits.h" #include "SkMatrix.h" -#include "SkMatrixPriv.h" #include "SkNx.h" #include "SkPaint.h" #include "SkRSXform.h" @@ -76,12 +75,12 @@ void SkMatrix::set9(const SkScalar buffer[]) { } void SkMatrix::setAffine(const SkScalar buffer[]) { - fMat[kMScaleX] = buffer[SkMatrixPriv::kAScaleX]; - fMat[kMSkewX] = buffer[SkMatrixPriv::kASkewX]; - fMat[kMTransX] = buffer[SkMatrixPriv::kATransX]; - fMat[kMSkewY] = buffer[SkMatrixPriv::kASkewY]; - fMat[kMScaleY] = buffer[SkMatrixPriv::kAScaleY]; - fMat[kMTransY] = buffer[SkMatrixPriv::kATransY]; + fMat[kMScaleX] = buffer[kAScaleX]; + fMat[kMSkewX] = buffer[kASkewX]; + fMat[kMTransX] = buffer[kATransX]; + fMat[kMSkewY] = buffer[kASkewY]; + fMat[kMScaleY] = buffer[kAScaleY]; + fMat[kMTransY] = buffer[kATransY]; fMat[kMPersp0] = 0; fMat[kMPersp1] = 0; fMat[kMPersp2] = 1; @@ -779,12 +778,12 @@ static double sk_inv_determinant(const float mat[9], int isPerspective) { } void SkMatrix::SetAffineIdentity(SkScalar affine[6]) { - affine[SkMatrixPriv::kAScaleX] = 1; - affine[SkMatrixPriv::kASkewY] = 0; - affine[SkMatrixPriv::kASkewX] = 0; - affine[SkMatrixPriv::kAScaleY] = 1; - affine[SkMatrixPriv::kATransX] = 0; - affine[SkMatrixPriv::kATransY] = 0; + affine[kAScaleX] = 1; + affine[kASkewY] = 0; + affine[kASkewX] = 0; + affine[kAScaleY] = 1; + affine[kATransX] = 0; + affine[kATransY] = 0; } bool SkMatrix::asAffine(SkScalar affine[6]) const { @@ -792,12 +791,12 @@ bool SkMatrix::asAffine(SkScalar affine[6]) const { return false; } if (affine) { - affine[SkMatrixPriv::kAScaleX] = this->fMat[kMScaleX]; - affine[SkMatrixPriv::kASkewY] = this->fMat[kMSkewY]; - affine[SkMatrixPriv::kASkewX] = this->fMat[kMSkewX]; - affine[SkMatrixPriv::kAScaleY] = this->fMat[kMScaleY]; - affine[SkMatrixPriv::kATransX] = this->fMat[kMTransX]; - affine[SkMatrixPriv::kATransY] = this->fMat[kMTransY]; + affine[kAScaleX] = this->fMat[kMScaleX]; + affine[kASkewY] = this->fMat[kMSkewY]; + affine[kASkewX] = this->fMat[kMSkewX]; + affine[kAScaleY] = this->fMat[kMScaleY]; + affine[kATransX] = this->fMat[kMTransX]; + affine[kATransY] = this->fMat[kMTransY]; } return true; } diff --git a/src/core/SkMatrixPriv.h b/src/core/SkMatrixPriv.h index e38a99751f..ee6f8a153d 100644 --- a/src/core/SkMatrixPriv.h +++ b/src/core/SkMatrixPriv.h @@ -13,18 +13,6 @@ class SkMatrixPriv { public: - /** Affine arrays are in column major order - because that's how PDF and XPS like it. - */ - enum { - kAScaleX, - kASkewY, - kASkewX, - kAScaleY, - kATransX, - kATransY, - }; - /** * Attempt to map the rect through the inverse of the matrix. If it is not invertible, * then this returns false and dst is unchanged. diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp index 6f62f89b45..801b80c0b0 100644 --- a/src/xps/SkXPSDevice.cpp +++ b/src/xps/SkXPSDevice.cpp @@ -35,7 +35,6 @@ #include "SkImageEncoder.h" #include "SkImagePriv.h" #include "SkMaskFilter.h" -#include "SkMatrixPriv.h" #include "SkPaint.h" #include "SkPathEffect.h" #include "SkPathOps.h" @@ -520,12 +519,12 @@ HRESULT SkXPSDevice::createXpsTransform(const SkMatrix& matrix, return S_FALSE; } XPS_MATRIX rawXpsMatrix = { - SkScalarToFLOAT(affine[SkMatrixPriv::kAScaleX]), - SkScalarToFLOAT(affine[SkMatrixPriv::kASkewY]), - SkScalarToFLOAT(affine[SkMatrixPriv::kASkewX]), - SkScalarToFLOAT(affine[SkMatrixPriv::kAScaleY]), - SkScalarToFLOAT(affine[SkMatrixPriv::kATransX]), - SkScalarToFLOAT(affine[SkMatrixPriv::kATransY]), + SkScalarToFLOAT(affine[SkMatrix::kAScaleX]), + SkScalarToFLOAT(affine[SkMatrix::kASkewY]), + SkScalarToFLOAT(affine[SkMatrix::kASkewX]), + SkScalarToFLOAT(affine[SkMatrix::kAScaleY]), + SkScalarToFLOAT(affine[SkMatrix::kATransX]), + SkScalarToFLOAT(affine[SkMatrix::kATransY]), }; HRM(this->fXpsFactory->CreateMatrixTransform(&rawXpsMatrix, xpsTransform), "Could not create transform."); |