aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-10-19 18:01:13 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-20 15:14:05 +0000
commit9480d822f283582aa016ee9ca3f6d618ddcefbbb (patch)
treee18990881022436d80522d0df1e367d5c985ebb7 /src
parentb68defab6ded545f03e186392c65b0ed62e7855b (diff)
make skmatrix getmapproc private
Make SkMatrix MapXYProc MapPtsProc and friends private. Code search turned up no clients in chromium, google3, android. Fingers crossed. R:reed@google.com Bug: skia:6898 Change-Id: Iee20fe5150499215a09f67cc6f117b685f38f455 Reviewed-on: https://skia-review.googlesource.com/62140 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapProcState.cpp2
-rw-r--r--src/core/SkBitmapProcState.h4
-rw-r--r--src/core/SkDevice.cpp3
-rw-r--r--src/core/SkFindAndPlaceGlyph.h5
-rw-r--r--src/core/SkMatrixPriv.h11
-rw-r--r--src/core/SkPath.cpp3
-rw-r--r--src/core/SkTextMapStateProc.h6
-rw-r--r--src/shaders/gradients/Sk4fGradientBase.cpp2
-rw-r--r--src/shaders/gradients/Sk4fGradientBase.h4
-rw-r--r--src/shaders/gradients/SkGradientShader.cpp2
-rw-r--r--src/shaders/gradients/SkGradientShaderPriv.h3
11 files changed, 30 insertions, 15 deletions
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index e5643974ef..2f727397d9 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -155,7 +155,7 @@ bool SkBitmapProcInfo::init(const SkMatrix& inv, const SkPaint& paint) {
* and may be removed.
*/
bool SkBitmapProcState::chooseProcs() {
- fInvProc = fInvMatrix.getMapXYProc();
+ fInvProc = SkMatrixPriv::GetMapXYProc(fInvMatrix);
fInvSx = SkScalarToFixed(fInvMatrix.getScaleX());
fInvSxFractionalInt = SkScalarToFractionalInt(fInvMatrix.getScaleX());
fInvKy = SkScalarToFixed(fInvMatrix.getSkewY());
diff --git a/src/core/SkBitmapProcState.h b/src/core/SkBitmapProcState.h
index 00fb160aba..46e418cc02 100644
--- a/src/core/SkBitmapProcState.h
+++ b/src/core/SkBitmapProcState.h
@@ -13,7 +13,7 @@
#include "SkBitmapProvider.h"
#include "SkFixed.h"
#include "SkFloatBits.h"
-#include "SkMatrix.h"
+#include "SkMatrixPriv.h"
#include "SkMipMap.h"
#include "SkPaint.h"
#include "SkShader.h"
@@ -78,7 +78,7 @@ struct SkBitmapProcState : public SkBitmapProcInfo {
typedef U16CPU (*FixedTileProc)(SkFixed); // returns 0..0xFFFF
typedef U16CPU (*IntTileProc)(int value, int count); // returns 0..count-1
- SkMatrix::MapXYProc fInvProc; // chooseProcs
+ SkMatrixPriv::MapXYProc fInvProc; // chooseProcs
SkFractionalInt fInvSxFractionalInt;
SkFractionalInt fInvKyFractionalInt;
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index b69c441913..b36a73aeb2 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -14,6 +14,7 @@
#include "SkImagePriv.h"
#include "SkImage_Base.h"
#include "SkLatticeIter.h"
+#include "SkMatrixPriv.h"
#include "SkPatchUtils.h"
#include "SkPathMeasure.h"
#include "SkPathPriv.h"
@@ -328,7 +329,7 @@ bool SkBaseDevice::peekPixels(SkPixmap* pmap) {
static void morphpoints(SkPoint dst[], const SkPoint src[], int count,
SkPathMeasure& meas, const SkMatrix& matrix) {
- SkMatrix::MapXYProc proc = matrix.getMapXYProc();
+ SkMatrixPriv::MapXYProc proc = SkMatrixPriv::GetMapXYProc(matrix);
for (int i = 0; i < count; i++) {
SkPoint pos;
diff --git a/src/core/SkFindAndPlaceGlyph.h b/src/core/SkFindAndPlaceGlyph.h
index a11c4ecc7d..7ef4a465b3 100644
--- a/src/core/SkFindAndPlaceGlyph.h
+++ b/src/core/SkFindAndPlaceGlyph.h
@@ -12,6 +12,7 @@
#include "SkAutoKern.h"
#include "SkGlyph.h"
#include "SkGlyphCache.h"
+#include "SkMatrixPriv.h"
#include "SkPaint.h"
#include "SkTemplates.h"
#include "SkUtils.h"
@@ -235,7 +236,7 @@ private:
class GeneralMapper final : public MapperInterface {
public:
GeneralMapper(const SkMatrix& matrix, const SkPoint origin)
- : fOrigin(origin), fMatrix(matrix), fMapProc(matrix.getMapXYProc()) { }
+ : fOrigin(origin), fMatrix(matrix), fMapProc(SkMatrixPriv::GetMapXYProc(matrix)) { }
SkPoint map(SkPoint position) const override {
SkPoint result;
@@ -246,7 +247,7 @@ private:
private:
const SkPoint fOrigin;
const SkMatrix& fMatrix;
- const SkMatrix::MapXYProc fMapProc;
+ const SkMatrixPriv::MapXYProc fMapProc;
};
// TextAlignmentAdjustment handles shifting the glyph based on its width.
diff --git a/src/core/SkMatrixPriv.h b/src/core/SkMatrixPriv.h
index 47a1d5f287..b0df2ecf9a 100644
--- a/src/core/SkMatrixPriv.h
+++ b/src/core/SkMatrixPriv.h
@@ -13,6 +13,17 @@
class SkMatrixPriv {
public:
+ typedef SkMatrix::MapXYProc MapXYProc;
+ typedef SkMatrix::MapPtsProc MapPtsProc;
+
+ static MapPtsProc GetMapPtsProc(const SkMatrix& matrix) {
+ return SkMatrix::GetMapPtsProc(matrix.getType());
+ }
+
+ static MapXYProc GetMapXYProc(const SkMatrix& matrix) {
+ return SkMatrix::GetMapXYProc(matrix.getType());
+ }
+
/**
* 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/core/SkPath.cpp b/src/core/SkPath.cpp
index a460990429..a053c767dc 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -11,6 +11,7 @@
#include "SkData.h"
#include "SkGeometry.h"
#include "SkMath.h"
+#include "SkMatrixPriv.h"
#include "SkPathPriv.h"
#include "SkPathRef.h"
#include "SkRRect.h"
@@ -1526,7 +1527,7 @@ void SkPath::addPath(const SkPath& path, const SkMatrix& matrix, AddPathMode mod
SkPoint pts[4];
Verb verb;
- SkMatrix::MapPtsProc proc = matrix.getMapPtsProc();
+ SkMatrixPriv::MapPtsProc proc = SkMatrixPriv::GetMapPtsProc(matrix);
bool firstVerb = true;
while ((verb = iter.next(pts)) != kDone_Verb) {
switch (verb) {
diff --git a/src/core/SkTextMapStateProc.h b/src/core/SkTextMapStateProc.h
index 81ef5dee50..39897061a4 100644
--- a/src/core/SkTextMapStateProc.h
+++ b/src/core/SkTextMapStateProc.h
@@ -9,13 +9,13 @@
#define SkTextMapStateProc_DEFINED
#include "SkPoint.h"
-#include "SkMatrix.h"
+#include "SkMatrixPriv.h"
class SkTextMapStateProc {
public:
SkTextMapStateProc(const SkMatrix& matrix, const SkPoint& offset, int scalarsPerPosition)
: fMatrix(matrix)
- , fProc(matrix.getMapXYProc())
+ , fProc(SkMatrixPriv::GetMapXYProc(matrix))
, fOffset(offset)
, fScaleX(fMatrix.getScaleX()) {
SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
@@ -50,7 +50,7 @@ private:
kOnlyTransX,
kX
} fMapCase;
- const SkMatrix::MapXYProc fProc;
+ const SkMatrixPriv::MapXYProc fProc;
SkPoint fOffset; // In kOnly* mode, this includes the matrix translation component.
SkScalar fScaleX; // This is only used by kOnly... cases.
};
diff --git a/src/shaders/gradients/Sk4fGradientBase.cpp b/src/shaders/gradients/Sk4fGradientBase.cpp
index 60f8ced4b0..42f30c4a5c 100644
--- a/src/shaders/gradients/Sk4fGradientBase.cpp
+++ b/src/shaders/gradients/Sk4fGradientBase.cpp
@@ -293,7 +293,7 @@ GradientShaderBase4fContext::GradientShaderBase4fContext(const SkGradientShaderB
const SkMatrix& inverse = this->getTotalInverse();
fDstToPos.setConcat(shader.fPtsToUnit, inverse);
SkASSERT(!fDstToPos.hasPerspective());
- fDstToPosProc = fDstToPos.getMapXYProc();
+ fDstToPosProc = SkMatrixPriv::GetMapXYProc(fDstToPos);
if (shader.fColorsAreOpaque && this->getPaintAlpha() == SK_AlphaOPAQUE) {
fFlags |= kOpaqueAlpha_Flag;
diff --git a/src/shaders/gradients/Sk4fGradientBase.h b/src/shaders/gradients/Sk4fGradientBase.h
index b2c2b3762c..6361eece0c 100644
--- a/src/shaders/gradients/Sk4fGradientBase.h
+++ b/src/shaders/gradients/Sk4fGradientBase.h
@@ -11,7 +11,7 @@
#include "Sk4fGradientPriv.h"
#include "SkColor.h"
#include "SkGradientShaderPriv.h"
-#include "SkMatrix.h"
+#include "SkMatrixPriv.h"
#include "SkNx.h"
#include "SkPM4f.h"
#include "SkShaderBase.h"
@@ -65,7 +65,7 @@ public:
protected:
Sk4fGradientIntervalBuffer fIntervals;
SkMatrix fDstToPos;
- SkMatrix::MapXYProc fDstToPosProc;
+ SkMatrixPriv::MapXYProc fDstToPosProc;
uint8_t fFlags;
bool fColorsArePremul;
bool fDither;
diff --git a/src/shaders/gradients/SkGradientShader.cpp b/src/shaders/gradients/SkGradientShader.cpp
index 53f25643c6..6dcc0ae479 100644
--- a/src/shaders/gradients/SkGradientShader.cpp
+++ b/src/shaders/gradients/SkGradientShader.cpp
@@ -512,7 +512,7 @@ SkGradientShaderBase::GradientShaderBaseContext::GradientShaderBaseContext(
fDstToIndex.setConcat(shader.fPtsToUnit, inverse);
SkASSERT(!fDstToIndex.hasPerspective());
- fDstToIndexProc = fDstToIndex.getMapXYProc();
+ fDstToIndexProc = SkMatrixPriv::GetMapXYProc(fDstToIndex);
// now convert our colors in to PMColors
unsigned paintAlpha = this->getPaintAlpha();
diff --git a/src/shaders/gradients/SkGradientShaderPriv.h b/src/shaders/gradients/SkGradientShaderPriv.h
index da9098cb5d..23ff30f9d4 100644
--- a/src/shaders/gradients/SkGradientShaderPriv.h
+++ b/src/shaders/gradients/SkGradientShaderPriv.h
@@ -16,6 +16,7 @@
#include "SkClampRange.h"
#include "SkColorData.h"
#include "SkColorSpace.h"
+#include "SkMatrixPriv.h"
#include "SkOnce.h"
#include "SkPM4fPriv.h"
#include "SkRasterPipeline.h"
@@ -162,7 +163,7 @@ public:
protected:
SkMatrix fDstToIndex;
- SkMatrix::MapXYProc fDstToIndexProc;
+ SkMatrixPriv::MapXYProc fDstToIndexProc;
uint8_t fDstToIndexClass;
uint8_t fFlags;
bool fDither;