Move ViewMatrix off of drawstate
BUG=skia:
Review URL: https://codereview.chromium.org/815553003
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index c90067d..4ab088c 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -183,9 +183,11 @@
return SkNEW_ARGS(GrGLConicEffect, (*this, bt));
}
-GrConicEffect::GrConicEffect(GrColor color, uint8_t coverage, GrPrimitiveEdgeType edgeType,
- const SkMatrix& localMatrix)
- : INHERITED(color, false, localMatrix), fCoverageScale(coverage), fEdgeType(edgeType) {
+GrConicEffect::GrConicEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t coverage,
+ GrPrimitiveEdgeType edgeType, const SkMatrix& localMatrix)
+ : INHERITED(color, viewMatrix, localMatrix)
+ , fCoverageScale(coverage)
+ , fEdgeType(edgeType) {
this->initClassID<GrConicEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInConicCoeffs = &this->addVertexAttrib(GrAttribute("inConicCoeffs",
@@ -228,7 +230,8 @@
do {
GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
random->nextULessThan(kGrProcessorEdgeTypeCnt));
- gp = GrConicEffect::Create(GrRandomColor(random), edgeType, caps,
+ gp = GrConicEffect::Create(GrRandomColor(random), GrProcessorUnitTest::TestMatrix(random),
+ edgeType, caps,
GrProcessorUnitTest::TestMatrix(random));
} while (NULL == gp);
return gp;
@@ -395,9 +398,11 @@
return SkNEW_ARGS(GrGLQuadEffect, (*this, bt));
}
-GrQuadEffect::GrQuadEffect(GrColor color, uint8_t coverage, GrPrimitiveEdgeType edgeType,
- const SkMatrix& localMatrix)
- : INHERITED(color, false, localMatrix), fCoverageScale(coverage), fEdgeType(edgeType) {
+GrQuadEffect::GrQuadEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t coverage,
+ GrPrimitiveEdgeType edgeType, const SkMatrix& localMatrix)
+ : INHERITED(color, viewMatrix, localMatrix)
+ , fCoverageScale(coverage)
+ , fEdgeType(edgeType) {
this->initClassID<GrQuadEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInHairQuadEdge = &this->addVertexAttrib(GrAttribute("inHairQuadEdge",
@@ -440,7 +445,9 @@
do {
GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
random->nextULessThan(kGrProcessorEdgeTypeCnt));
- gp = GrQuadEffect::Create(GrRandomColor(random), edgeType, caps,
+ gp = GrQuadEffect::Create(GrRandomColor(random),
+ GrProcessorUnitTest::TestMatrix(random),
+ edgeType, caps,
GrProcessorUnitTest::TestMatrix(random));
} while (NULL == gp);
return gp;
@@ -629,8 +636,9 @@
return SkNEW_ARGS(GrGLCubicEffect, (*this, bt));
}
-GrCubicEffect::GrCubicEffect(GrColor color, GrPrimitiveEdgeType edgeType)
- : INHERITED(color), fEdgeType(edgeType) {
+GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix,
+ GrPrimitiveEdgeType edgeType)
+ : INHERITED(color, viewMatrix), fEdgeType(edgeType) {
this->initClassID<GrCubicEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInCubicCoeffs = &this->addVertexAttrib(GrAttribute("inCubicCoeffs",
@@ -671,7 +679,8 @@
do {
GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
random->nextULessThan(kGrProcessorEdgeTypeCnt));
- gp = GrCubicEffect::Create(GrRandomColor(random), edgeType, caps);
+ gp = GrCubicEffect::Create(GrRandomColor(random),
+ GrProcessorUnitTest::TestMatrix(random), edgeType, caps);
} while (NULL == gp);
return gp;
}
diff --git a/src/gpu/effects/GrBezierEffect.h b/src/gpu/effects/GrBezierEffect.h
index b985fec..1bd93b6 100644
--- a/src/gpu/effects/GrBezierEffect.h
+++ b/src/gpu/effects/GrBezierEffect.h
@@ -59,6 +59,7 @@
class GrConicEffect : public GrGeometryProcessor {
public:
static GrGeometryProcessor* Create(GrColor color,
+ const SkMatrix& viewMatrix,
const GrPrimitiveEdgeType edgeType,
const GrDrawTargetCaps& caps,
const SkMatrix& localMatrix,
@@ -68,17 +69,19 @@
if (!caps.shaderDerivativeSupport()) {
return NULL;
}
- return SkNEW_ARGS(GrConicEffect, (color, coverage, kFillAA_GrProcessorEdgeType,
+ return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage,
+ kFillAA_GrProcessorEdgeType,
localMatrix));
case kHairlineAA_GrProcessorEdgeType:
if (!caps.shaderDerivativeSupport()) {
return NULL;
}
- return SkNEW_ARGS(GrConicEffect, (color, coverage,
+ return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage,
kHairlineAA_GrProcessorEdgeType,
localMatrix));
case kFillBW_GrProcessorEdgeType:
- return SkNEW_ARGS(GrConicEffect, (color, coverage, kFillBW_GrProcessorEdgeType,
+ return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage,
+ kFillBW_GrProcessorEdgeType,
localMatrix));
default:
return NULL;
@@ -107,7 +110,8 @@
const GrBatchTracker&) const SK_OVERRIDE;
private:
- GrConicEffect(GrColor, uint8_t coverage, GrPrimitiveEdgeType, const SkMatrix& localMatrix);
+ GrConicEffect(GrColor, const SkMatrix& viewMatrix, uint8_t coverage, GrPrimitiveEdgeType,
+ const SkMatrix& localMatrix);
virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE;
@@ -139,6 +143,7 @@
class GrQuadEffect : public GrGeometryProcessor {
public:
static GrGeometryProcessor* Create(GrColor color,
+ const SkMatrix& viewMatrix,
const GrPrimitiveEdgeType edgeType,
const GrDrawTargetCaps& caps,
const SkMatrix& localMatrix,
@@ -148,16 +153,19 @@
if (!caps.shaderDerivativeSupport()) {
return NULL;
}
- return SkNEW_ARGS(GrQuadEffect, (color, coverage, kFillAA_GrProcessorEdgeType,
+ return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage,
+ kFillAA_GrProcessorEdgeType,
localMatrix));
case kHairlineAA_GrProcessorEdgeType:
if (!caps.shaderDerivativeSupport()) {
return NULL;
}
- return SkNEW_ARGS(GrQuadEffect, (color, coverage, kHairlineAA_GrProcessorEdgeType,
+ return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage,
+ kHairlineAA_GrProcessorEdgeType,
localMatrix));
case kFillBW_GrProcessorEdgeType:
- return SkNEW_ARGS(GrQuadEffect, (color, coverage, kFillBW_GrProcessorEdgeType,
+ return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage,
+ kFillBW_GrProcessorEdgeType,
localMatrix));
default:
return NULL;
@@ -186,7 +194,8 @@
const GrBatchTracker&) const SK_OVERRIDE;
private:
- GrQuadEffect(GrColor, uint8_t coverage, GrPrimitiveEdgeType, const SkMatrix& localMatrix);
+ GrQuadEffect(GrColor, const SkMatrix& viewMatrix, uint8_t coverage, GrPrimitiveEdgeType,
+ const SkMatrix& localMatrix);
virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE;
@@ -220,6 +229,7 @@
class GrCubicEffect : public GrGeometryProcessor {
public:
static GrGeometryProcessor* Create(GrColor color,
+ const SkMatrix& viewMatrix,
const GrPrimitiveEdgeType edgeType,
const GrDrawTargetCaps& caps) {
switch (edgeType) {
@@ -227,14 +237,16 @@
if (!caps.shaderDerivativeSupport()) {
return NULL;
}
- return SkNEW_ARGS(GrCubicEffect, (color, kFillAA_GrProcessorEdgeType));
+ return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, kFillAA_GrProcessorEdgeType));
case kHairlineAA_GrProcessorEdgeType:
if (!caps.shaderDerivativeSupport()) {
return NULL;
}
- return SkNEW_ARGS(GrCubicEffect, (color, kHairlineAA_GrProcessorEdgeType));
+ return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix,
+ kHairlineAA_GrProcessorEdgeType));
case kFillBW_GrProcessorEdgeType:
- return SkNEW_ARGS(GrCubicEffect, (color, kFillBW_GrProcessorEdgeType));
+ return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix,
+ kFillBW_GrProcessorEdgeType));
default:
return NULL;
}
@@ -262,7 +274,7 @@
const GrBatchTracker&) const SK_OVERRIDE;
private:
- GrCubicEffect(GrColor, GrPrimitiveEdgeType);
+ GrCubicEffect(GrColor, const SkMatrix& viewMatrix, GrPrimitiveEdgeType);
virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE;
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 44de98a..936bf32 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -93,7 +93,7 @@
GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture,
const GrTextureParams& params, bool useColorAttrib,
bool opaqueVertexColors, const SkMatrix& localMatrix)
- : INHERITED(color, opaqueVertexColors, localMatrix)
+ : INHERITED(color, SkMatrix::I(), localMatrix, opaqueVertexColors)
, fTextureAccess(texture, params)
, fInColor(NULL) {
this->initClassID<GrBitmapTextGeoProc>();
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index 339e44a..4788b3a 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -165,11 +165,9 @@
}
bool GrDashingEffect::DrawDashLine(GrGpu* gpu, GrDrawTarget* target, GrDrawState* drawState,
- GrColor color, const SkPoint pts[2], const GrPaint& paint,
- const GrStrokeInfo& strokeInfo) {
- const SkMatrix& vm = drawState->getViewMatrix();
-
- if (!can_fast_path_dash(pts, strokeInfo, *target, *drawState, vm)) {
+ GrColor color, const SkMatrix& viewMatrix, const SkPoint pts[2],
+ const GrPaint& paint, const GrStrokeInfo& strokeInfo) {
+ if (!can_fast_path_dash(pts, strokeInfo, *target, *drawState, viewMatrix)) {
return false;
}
@@ -204,7 +202,7 @@
// Scale corrections of intervals and stroke from view matrix
SkScalar parallelScale;
SkScalar perpScale;
- calc_dash_scaling(¶llelScale, &perpScale, vm, ptsRot);
+ calc_dash_scaling(¶llelScale, &perpScale, viewMatrix, ptsRot);
bool hasCap = SkPaint::kButt_Cap != cap && 0 != srcStrokeWidth;
@@ -222,7 +220,7 @@
SkScalar startAdj = 0;
SkMatrix combinedMatrix = srcRotInv;
- combinedMatrix.postConcat(vm);
+ combinedMatrix.postConcat(viewMatrix);
bool lineDone = false;
SkRect startRect;
@@ -328,7 +326,7 @@
lineDone = true;
SkPoint devicePts[2];
- vm.mapPoints(devicePts, ptsRot, 2);
+ viewMatrix.mapPoints(devicePts, ptsRot, 2);
SkScalar lineLength = SkPoint::Distance(devicePts[0], devicePts[1]);
if (hasCap) {
lineLength += 2.f * halfDevStroke;
@@ -338,13 +336,11 @@
// reset to device coordinates
SkMatrix invert;
- if (!vm.invert(&invert)) {
+ if (!viewMatrix.invert(&invert)) {
SkDebugf("Failed to invert\n");
return false;
}
- GrDrawState::AutoViewMatrixRestore avmr(drawState);
-
SkAutoTUnref<const GrGeometryProcessor> gp;
bool fullDash = devIntervals[1] > 0.f || useAA;
if (fullDash) {
@@ -360,7 +356,9 @@
gp.reset(GrDashingEffect::Create(color, edgeType, devInfo, strokeWidth, capType, invert));
} else {
// Set up the vertex data for the line and start/end dashes
- gp.reset(GrDefaultGeoProcFactory::Create(color, GrDefaultGeoProcFactory::kPosition_GPType,
+ gp.reset(GrDefaultGeoProcFactory::Create(GrDefaultGeoProcFactory::kPosition_GPType,
+ color,
+ SkMatrix::I(),
invert));
}
@@ -388,7 +386,7 @@
// Draw interior part of dashed line
if (!lineDone) {
SkPoint devicePts[2];
- vm.mapPoints(devicePts, ptsRot, 2);
+ viewMatrix.mapPoints(devicePts, ptsRot, 2);
SkScalar lineLength = SkPoint::Distance(devicePts[0], devicePts[1]);
if (hasCap) {
lineLength += 2.f * halfDevStroke;
@@ -675,7 +673,7 @@
const DashInfo& info,
SkScalar radius,
const SkMatrix& localMatrix)
- : INHERITED(color, false, localMatrix), fEdgeType(edgeType) {
+ : INHERITED(color, SkMatrix::I(), localMatrix), fEdgeType(edgeType) {
this->initClassID<DashingCircleEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInCoord = &this->addVertexAttrib(GrAttribute("inCoord", kVec2f_GrVertexAttribType));
@@ -728,7 +726,8 @@
info.fIntervals[1] = random->nextRangeScalar(0, 10.f);
info.fPhase = random->nextRangeScalar(0, info.fIntervals[1]);
- return DashingCircleEffect::Create(GrRandomColor(random), edgeType, info, strokeWidth,
+ return DashingCircleEffect::Create(GrRandomColor(random),
+ edgeType, info, strokeWidth,
GrProcessorUnitTest::TestMatrix(random));
}
@@ -969,7 +968,7 @@
const DashInfo& info,
SkScalar strokeWidth,
const SkMatrix& localMatrix)
- : INHERITED(color, false, localMatrix), fEdgeType(edgeType) {
+ : INHERITED(color, SkMatrix::I(), localMatrix), fEdgeType(edgeType) {
this->initClassID<DashingLineEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInCoord = &this->addVertexAttrib(GrAttribute("inCoord", kVec2f_GrVertexAttribType));
@@ -1022,7 +1021,8 @@
info.fIntervals[1] = random->nextRangeScalar(0, 10.f);
info.fPhase = random->nextRangeScalar(0, info.fIntervals[0] + info.fIntervals[1]);
- return DashingLineEffect::Create(GrRandomColor(random), edgeType, info, strokeWidth,
+ return DashingLineEffect::Create(GrRandomColor(random),
+ edgeType, info, strokeWidth,
GrProcessorUnitTest::TestMatrix(random));
}
@@ -1036,7 +1036,8 @@
const SkMatrix& localMatrix) {
switch (cap) {
case GrDashingEffect::kRound_DashCap:
- return DashingCircleEffect::Create(color, edgeType, info, SkScalarHalf(strokeWidth),
+ return DashingCircleEffect::Create(color, edgeType, info,
+ SkScalarHalf(strokeWidth),
localMatrix);
case GrDashingEffect::kNonRound_DashCap:
return DashingLineEffect::Create(color, edgeType, info, strokeWidth, localMatrix);
diff --git a/src/gpu/effects/GrDashingEffect.h b/src/gpu/effects/GrDashingEffect.h
index 61cba7e..651a240 100644
--- a/src/gpu/effects/GrDashingEffect.h
+++ b/src/gpu/effects/GrDashingEffect.h
@@ -24,8 +24,8 @@
class SkPath;
namespace GrDashingEffect {
- bool DrawDashLine(GrGpu*, GrDrawTarget*, GrDrawState*, GrColor, const SkPoint pts[2],
- const GrPaint& paint, const GrStrokeInfo& strokeInfo);
+ bool DrawDashLine(GrGpu*, GrDrawTarget*, GrDrawState*, GrColor, const SkMatrix& viewMatrix,
+ const SkPoint pts[2], const GrPaint& paint, const GrStrokeInfo& strokeInfo);
enum DashCap {
kRound_DashCap,
diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp
index f5510d4..669a504 100755
--- a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp
+++ b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp
@@ -186,6 +186,7 @@
///////////////////////////////////////////////////////////////////////////////
GrDistanceFieldTextureEffect::GrDistanceFieldTextureEffect(GrColor color,
+ const SkMatrix& viewMatrix,
GrTexture* texture,
const GrTextureParams& params,
#ifdef SK_GAMMA_APPLY_TO_A8
@@ -194,7 +195,7 @@
float luminance,
#endif
uint32_t flags, bool opaqueVertexColors)
- : INHERITED(color, opaqueVertexColors)
+ : INHERITED(color, viewMatrix, SkMatrix::I(), opaqueVertexColors)
, fTextureAccess(texture, params)
#ifdef SK_GAMMA_APPLY_TO_A8
, fGammaTextureAccess(gamma, gammaParams)
@@ -289,7 +290,9 @@
GrTextureParams::kNone_FilterMode);
#endif
- return GrDistanceFieldTextureEffect::Create(GrRandomColor(random), textures[texIdx], params,
+ return GrDistanceFieldTextureEffect::Create(GrRandomColor(random),
+ GrProcessorUnitTest::TestMatrix(random),
+ textures[texIdx], params,
#ifdef SK_GAMMA_APPLY_TO_A8
textures[texIdx2], params2,
random->nextF(),
@@ -443,11 +446,12 @@
GrDistanceFieldNoGammaTextureEffect::GrDistanceFieldNoGammaTextureEffect(
GrColor color,
+ const SkMatrix& viewMatrix,
GrTexture* texture,
const GrTextureParams& params,
uint32_t flags,
bool opaqueVertexColors)
- : INHERITED(color, opaqueVertexColors)
+ : INHERITED(color, viewMatrix, SkMatrix::I(), opaqueVertexColors)
, fTextureAccess(texture, params)
, fFlags(flags & kNonLCD_DistanceFieldEffectMask)
, fInColor(NULL) {
@@ -525,7 +529,9 @@
GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBilerp_FilterMode
: GrTextureParams::kNone_FilterMode);
- return GrDistanceFieldNoGammaTextureEffect::Create(GrRandomColor(random), textures[texIdx],
+ return GrDistanceFieldNoGammaTextureEffect::Create(GrRandomColor(random),
+ GrProcessorUnitTest::TestMatrix(random),
+ textures[texIdx],
params,
random->nextBool() ? kSimilarity_DistanceFieldEffectFlag : 0, random->nextBool());
}
@@ -748,12 +754,12 @@
///////////////////////////////////////////////////////////////////////////////
GrDistanceFieldLCDTextureEffect::GrDistanceFieldLCDTextureEffect(
- GrColor color,
+ GrColor color, const SkMatrix& viewMatrix,
GrTexture* texture, const GrTextureParams& params,
GrTexture* gamma, const GrTextureParams& gParams,
SkColor textColor,
uint32_t flags)
- : INHERITED(color)
+ : INHERITED(color, viewMatrix, SkMatrix::I())
, fTextureAccess(texture, params)
, fGammaTextureAccess(gamma, gParams)
, fTextColor(textColor)
@@ -839,7 +845,9 @@
uint32_t flags = kUseLCD_DistanceFieldEffectFlag;
flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0;
flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0;
- return GrDistanceFieldLCDTextureEffect::Create(GrRandomColor(random), textures[texIdx], params,
+ return GrDistanceFieldLCDTextureEffect::Create(GrRandomColor(random),
+ GrProcessorUnitTest::TestMatrix(random),
+ textures[texIdx], params,
textures[texIdx2], params2,
textColor,
flags);
diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.h b/src/gpu/effects/GrDistanceFieldTextureEffect.h
index 7acd279..1be06df 100644
--- a/src/gpu/effects/GrDistanceFieldTextureEffect.h
+++ b/src/gpu/effects/GrDistanceFieldTextureEffect.h
@@ -47,16 +47,19 @@
class GrDistanceFieldTextureEffect : public GrGeometryProcessor {
public:
#ifdef SK_GAMMA_APPLY_TO_A8
- static GrGeometryProcessor* Create(GrColor color, GrTexture* tex, const GrTextureParams& params,
+ static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix, GrTexture* tex,
+ const GrTextureParams& params,
GrTexture* gamma, const GrTextureParams& gammaParams,
float lum, uint32_t flags, bool opaqueVertexColors) {
- return SkNEW_ARGS(GrDistanceFieldTextureEffect, (color, tex, params, gamma, gammaParams, lum,
+ return SkNEW_ARGS(GrDistanceFieldTextureEffect, (color, viewMatrix, tex, params, gamma,
+ gammaParams, lum,
flags, opaqueVertexColors));
}
#else
- static GrGeometryProcessor* Create(GrColor color, GrTexture* tex, const GrTextureParams& params,
+ static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix, GrTexture* tex,
+ const GrTextureParams& params,
uint32_t flags, bool opaqueVertexColors) {
- return SkNEW_ARGS(GrDistanceFieldTextureEffect, (color, tex, params, flags,
+ return SkNEW_ARGS(GrDistanceFieldTextureEffect, (color, viewMatrix, tex, params, flags,
opaqueVertexColors));
}
#endif
@@ -86,7 +89,8 @@
const GrBatchTracker&) const SK_OVERRIDE;
private:
- GrDistanceFieldTextureEffect(GrColor, GrTexture* texture, const GrTextureParams& params,
+ GrDistanceFieldTextureEffect(GrColor, const SkMatrix& viewMatrix, GrTexture* texture,
+ const GrTextureParams& params,
#ifdef SK_GAMMA_APPLY_TO_A8
GrTexture* gamma, const GrTextureParams& gammaParams, float lum,
#endif
@@ -120,10 +124,11 @@
*/
class GrDistanceFieldNoGammaTextureEffect : public GrGeometryProcessor {
public:
- static GrGeometryProcessor* Create(GrColor color, GrTexture* tex, const GrTextureParams& params,
+ static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix, GrTexture* tex,
+ const GrTextureParams& params,
uint32_t flags, bool opaqueVertexColors) {
- return SkNEW_ARGS(GrDistanceFieldNoGammaTextureEffect, (color, tex, params, flags,
- opaqueVertexColors));
+ return SkNEW_ARGS(GrDistanceFieldNoGammaTextureEffect, (color, viewMatrix, tex, params,
+ flags, opaqueVertexColors));
}
virtual ~GrDistanceFieldNoGammaTextureEffect() {}
@@ -148,8 +153,9 @@
const GrBatchTracker&) const SK_OVERRIDE;
private:
- GrDistanceFieldNoGammaTextureEffect(GrColor, GrTexture* texture, const GrTextureParams& params,
- uint32_t flags, bool opaqueVertexColors);
+ GrDistanceFieldNoGammaTextureEffect(GrColor, const SkMatrix& viewMatrix, GrTexture* texture,
+ const GrTextureParams& params, uint32_t flags,
+ bool opaqueVertexColors);
virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE;
@@ -174,11 +180,12 @@
*/
class GrDistanceFieldLCDTextureEffect : public GrGeometryProcessor {
public:
- static GrGeometryProcessor* Create(GrColor color, GrTexture* tex, const GrTextureParams& params,
- GrTexture* gamma, const GrTextureParams& gammaParams,
+ static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix, GrTexture* tex,
+ const GrTextureParams& params, GrTexture* gamma,
+ const GrTextureParams& gammaParams,
SkColor textColor, uint32_t flags) {
return SkNEW_ARGS(GrDistanceFieldLCDTextureEffect,
- (color, tex, params, gamma, gammaParams, textColor, flags));
+ (color, viewMatrix, tex, params, gamma, gammaParams, textColor, flags));
}
virtual ~GrDistanceFieldLCDTextureEffect() {}
@@ -203,10 +210,10 @@
const GrBatchTracker&) const SK_OVERRIDE;
private:
- GrDistanceFieldLCDTextureEffect(GrColor, GrTexture* texture, const GrTextureParams& params,
+ GrDistanceFieldLCDTextureEffect(GrColor, const SkMatrix& viewMatrix, GrTexture* texture,
+ const GrTextureParams& params,
GrTexture* gamma, const GrTextureParams& gammaParams,
- SkColor textColor,
- uint32_t flags);
+ SkColor textColor, uint32_t flags);
virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE;