aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrBezierEffect.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-09-16 07:17:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-16 07:17:28 -0700
commit08da4f22d790cfc51bbeb10b4b84dab49cf0eaec (patch)
treeeb2c5cc2e59b708065484e18c01f459f6ef59ee9 /src/gpu/effects/GrBezierEffect.cpp
parent8ddbe8b9366c8c59c4fb55f01f253de8a0b37d6e (diff)
Revert of removing GrDrawEffect (patchset #4 id:60001 of https://codereview.chromium.org/571163002/)
Reason for revert: reverting to unblock another revert Original issue's description: > removing GrDrawEffect > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/8ddbe8b9366c8c59c4fb55f01f253de8a0b37d6e R=bsalomon@google.com TBR=bsalomon@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: joshualitt@chromium.org Review URL: https://codereview.chromium.org/577593003
Diffstat (limited to 'src/gpu/effects/GrBezierEffect.cpp')
-rw-r--r--src/gpu/effects/GrBezierEffect.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index 1b4191cc52..8c85809078 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -15,19 +15,19 @@
class GrGLConicEffect : public GrGLGeometryProcessor {
public:
- GrGLConicEffect(const GrBackendEffectFactory&, const GrEffect&);
+ GrGLConicEffect(const GrBackendEffectFactory&, const GrDrawEffect&);
virtual void emitCode(GrGLFullProgramBuilder* builder,
- const GrEffect& effect,
+ const GrDrawEffect& drawEffect,
const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
const TextureSamplerArray&) SK_OVERRIDE;
- static inline void GenKey(const GrEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
+ static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
- virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE {}
+ virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) SK_OVERRIDE {}
private:
GrEffectEdgeType fEdgeType;
@@ -36,14 +36,14 @@ private:
};
GrGLConicEffect::GrGLConicEffect(const GrBackendEffectFactory& factory,
- const GrEffect& effect)
+ const GrDrawEffect& drawEffect)
: INHERITED (factory) {
- const GrConicEffect& ce = effect.cast<GrConicEffect>();
+ const GrConicEffect& ce = drawEffect.castEffect<GrConicEffect>();
fEdgeType = ce.getEdgeType();
}
void GrGLConicEffect::emitCode(GrGLFullProgramBuilder* builder,
- const GrEffect& effect,
+ const GrDrawEffect& drawEffect,
const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
@@ -54,7 +54,7 @@ void GrGLConicEffect::emitCode(GrGLFullProgramBuilder* builder,
builder->addVarying(kVec4f_GrSLType, "ConicCoeffs",
&vsName, &fsName);
- const GrShaderVar& inConicCoeffs = effect.cast<GrConicEffect>().inConicCoeffs();
+ const GrShaderVar& inConicCoeffs = drawEffect.castEffect<GrConicEffect>().inConicCoeffs();
GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder();
vsBuilder->codeAppendf("%s = %s;", vsName, inConicCoeffs.c_str());
@@ -119,9 +119,9 @@ void GrGLConicEffect::emitCode(GrGLFullProgramBuilder* builder,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("edgeAlpha")).c_str());
}
-void GrGLConicEffect::GenKey(const GrEffect& effect, const GrGLCaps&,
+void GrGLConicEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
GrEffectKeyBuilder* b) {
- const GrConicEffect& ce = effect.cast<GrConicEffect>();
+ const GrConicEffect& ce = drawEffect.castEffect<GrConicEffect>();
uint32_t key = ce.isAntiAliased() ? (ce.isFilled() ? 0x0 : 0x1) : 0x2;
b->add32(key);
}
@@ -142,7 +142,7 @@ GrConicEffect::GrConicEffect(GrEffectEdgeType edgeType)
}
bool GrConicEffect::onIsEqual(const GrEffect& other) const {
- const GrConicEffect& ce = other.cast<GrConicEffect>();
+ const GrConicEffect& ce = CastEffect<GrConicEffect>(other);
return (ce.fEdgeType == fEdgeType);
}
@@ -169,19 +169,19 @@ GrEffect* GrConicEffect::TestCreate(SkRandom* random,
class GrGLQuadEffect : public GrGLGeometryProcessor {
public:
- GrGLQuadEffect(const GrBackendEffectFactory&, const GrEffect&);
+ GrGLQuadEffect(const GrBackendEffectFactory&, const GrDrawEffect&);
virtual void emitCode(GrGLFullProgramBuilder* builder,
- const GrEffect& effect,
+ const GrDrawEffect& drawEffect,
const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
const TextureSamplerArray&) SK_OVERRIDE;
- static inline void GenKey(const GrEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
+ static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
- virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE {}
+ virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) SK_OVERRIDE {}
private:
GrEffectEdgeType fEdgeType;
@@ -190,14 +190,14 @@ private:
};
GrGLQuadEffect::GrGLQuadEffect(const GrBackendEffectFactory& factory,
- const GrEffect& effect)
+ const GrDrawEffect& drawEffect)
: INHERITED (factory) {
- const GrQuadEffect& ce = effect.cast<GrQuadEffect>();
+ const GrQuadEffect& ce = drawEffect.castEffect<GrQuadEffect>();
fEdgeType = ce.getEdgeType();
}
void GrGLQuadEffect::emitCode(GrGLFullProgramBuilder* builder,
- const GrEffect& effect,
+ const GrDrawEffect& drawEffect,
const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
@@ -207,7 +207,7 @@ void GrGLQuadEffect::emitCode(GrGLFullProgramBuilder* builder,
builder->addVarying(kVec4f_GrSLType, "HairQuadEdge", &vsName, &fsName);
GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder();
- const GrShaderVar& inHairQuadEdge = effect.cast<GrQuadEffect>().inHairQuadEdge();
+ const GrShaderVar& inHairQuadEdge = drawEffect.castEffect<GrQuadEffect>().inHairQuadEdge();
vsBuilder->codeAppendf("%s = %s;", vsName, inHairQuadEdge.c_str());
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
@@ -257,9 +257,9 @@ void GrGLQuadEffect::emitCode(GrGLFullProgramBuilder* builder,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("edgeAlpha")).c_str());
}
-void GrGLQuadEffect::GenKey(const GrEffect& effect, const GrGLCaps&,
+void GrGLQuadEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
GrEffectKeyBuilder* b) {
- const GrQuadEffect& ce = effect.cast<GrQuadEffect>();
+ const GrQuadEffect& ce = drawEffect.castEffect<GrQuadEffect>();
uint32_t key = ce.isAntiAliased() ? (ce.isFilled() ? 0x0 : 0x1) : 0x2;
b->add32(key);
}
@@ -280,7 +280,7 @@ GrQuadEffect::GrQuadEffect(GrEffectEdgeType edgeType)
}
bool GrQuadEffect::onIsEqual(const GrEffect& other) const {
- const GrQuadEffect& ce = other.cast<GrQuadEffect>();
+ const GrQuadEffect& ce = CastEffect<GrQuadEffect>(other);
return (ce.fEdgeType == fEdgeType);
}
@@ -307,19 +307,19 @@ GrEffect* GrQuadEffect::TestCreate(SkRandom* random,
class GrGLCubicEffect : public GrGLGeometryProcessor {
public:
- GrGLCubicEffect(const GrBackendEffectFactory&, const GrEffect&);
+ GrGLCubicEffect(const GrBackendEffectFactory&, const GrDrawEffect&);
virtual void emitCode(GrGLFullProgramBuilder* builder,
- const GrEffect& effect,
+ const GrDrawEffect& drawEffect,
const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
const TextureSamplerArray&) SK_OVERRIDE;
- static inline void GenKey(const GrEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
+ static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
- virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE {}
+ virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) SK_OVERRIDE {}
private:
GrEffectEdgeType fEdgeType;
@@ -328,14 +328,14 @@ private:
};
GrGLCubicEffect::GrGLCubicEffect(const GrBackendEffectFactory& factory,
- const GrEffect& effect)
+ const GrDrawEffect& drawEffect)
: INHERITED (factory) {
- const GrCubicEffect& ce = effect.cast<GrCubicEffect>();
+ const GrCubicEffect& ce = drawEffect.castEffect<GrCubicEffect>();
fEdgeType = ce.getEdgeType();
}
void GrGLCubicEffect::emitCode(GrGLFullProgramBuilder* builder,
- const GrEffect& effect,
+ const GrDrawEffect& drawEffect,
const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
@@ -347,7 +347,7 @@ void GrGLCubicEffect::emitCode(GrGLFullProgramBuilder* builder,
&vsName, &fsName, GrGLShaderVar::kHigh_Precision);
GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder();
- const GrShaderVar& inCubicCoeffs = effect.cast<GrCubicEffect>().inCubicCoeffs();
+ const GrShaderVar& inCubicCoeffs = drawEffect.castEffect<GrCubicEffect>().inCubicCoeffs();
vsBuilder->codeAppendf("%s = %s;", vsName, inCubicCoeffs.c_str());
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
@@ -437,9 +437,9 @@ void GrGLCubicEffect::emitCode(GrGLFullProgramBuilder* builder,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1(edgeAlpha.c_str())).c_str());
}
-void GrGLCubicEffect::GenKey(const GrEffect& effect, const GrGLCaps&,
+void GrGLCubicEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
GrEffectKeyBuilder* b) {
- const GrCubicEffect& ce = effect.cast<GrCubicEffect>();
+ const GrCubicEffect& ce = drawEffect.castEffect<GrCubicEffect>();
uint32_t key = ce.isAntiAliased() ? (ce.isFilled() ? 0x0 : 0x1) : 0x2;
b->add32(key);
}
@@ -460,7 +460,7 @@ GrCubicEffect::GrCubicEffect(GrEffectEdgeType edgeType)
}
bool GrCubicEffect::onIsEqual(const GrEffect& other) const {
- const GrCubicEffect& ce = other.cast<GrCubicEffect>();
+ const GrCubicEffect& ce = CastEffect<GrCubicEffect>(other);
return (ce.fEdgeType == fEdgeType);
}