Index: src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp |
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp |
index c02e71eb9a5e045db76c160634f10e752d2e390a..206d2d9687bcd8a86eeb9084d22f591ba0b1c8f6 100644 |
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp |
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp |
@@ -11,7 +11,7 @@ |
#include "SkTwoPointConicalGradient.h" |
#if SK_SUPPORT_GPU |
-#include "GrTBackendEffectFactory.h" |
+#include "GrTBackendProcessorFactory.h" |
#include "gl/builders/GrGLProgramBuilder.h" |
// For brevity |
typedef GrGLProgramDataManager::UniformHandle UniformHandle; |
@@ -60,27 +60,27 @@ class GLEdge2PtConicalEffect; |
class Edge2PtConicalEffect : public GrGradientEffect { |
public: |
- static GrEffect* Create(GrContext* ctx, |
- const SkTwoPointConicalGradient& shader, |
- const SkMatrix& matrix, |
- SkShader::TileMode tm) { |
+ static GrFragmentProcessor* Create(GrContext* ctx, |
+ const SkTwoPointConicalGradient& shader, |
+ const SkMatrix& matrix, |
+ SkShader::TileMode tm) { |
return SkNEW_ARGS(Edge2PtConicalEffect, (ctx, shader, matrix, tm)); |
} |
virtual ~Edge2PtConicalEffect() {} |
static const char* Name() { return "Two-Point Conical Gradient Edge Touching"; } |
- virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
+ virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE; |
// The radial gradient parameters can collapse to a linear (instead of quadratic) equation. |
SkScalar center() const { return fCenterX1; } |
SkScalar diffRadius() const { return fDiffRadius; } |
SkScalar radius() const { return fRadius0; } |
- typedef GLEdge2PtConicalEffect GLEffect; |
+ typedef GLEdge2PtConicalEffect GLProcessor; |
private: |
- virtual bool onIsEqual(const GrEffect& sBase) const SK_OVERRIDE { |
+ virtual bool onIsEqual(const GrProcessor& sBase) const SK_OVERRIDE { |
const Edge2PtConicalEffect& s = sBase.cast<Edge2PtConicalEffect>(); |
return (INHERITED::onIsEqual(sBase) && |
this->fCenterX1 == s.fCenterX1 && |
@@ -119,7 +119,7 @@ private: |
this->addCoordTransform(&fBTransform); |
} |
- GR_DECLARE_EFFECT_TEST; |
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
// @{ |
// Cache of values - these can change arbitrarily, EXCEPT |
@@ -137,19 +137,19 @@ private: |
class GLEdge2PtConicalEffect : public GrGLGradientEffect { |
public: |
- GLEdge2PtConicalEffect(const GrBackendEffectFactory& factory, const GrEffect&); |
+ GLEdge2PtConicalEffect(const GrBackendProcessorFactory& factory, const GrProcessor&); |
virtual ~GLEdge2PtConicalEffect() { } |
virtual void emitCode(GrGLProgramBuilder*, |
- const GrEffect&, |
- const GrEffectKey&, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey&, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray&) SK_OVERRIDE; |
- virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE; |
+ virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE; |
- static void GenKey(const GrEffect&, const GrGLCaps& caps, GrEffectKeyBuilder* b); |
+ static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b); |
protected: |
UniformHandle fParamUni; |
@@ -170,19 +170,19 @@ private: |
}; |
-const GrBackendEffectFactory& Edge2PtConicalEffect::getFactory() const { |
- return GrTBackendEffectFactory<Edge2PtConicalEffect>::getInstance(); |
+const GrBackendFragmentProcessorFactory& Edge2PtConicalEffect::getFactory() const { |
+ return GrTBackendFragmentProcessorFactory<Edge2PtConicalEffect>::getInstance(); |
} |
-GR_DEFINE_EFFECT_TEST(Edge2PtConicalEffect); |
+GR_DEFINE_FRAGMENT_PROCESSOR_TEST(Edge2PtConicalEffect); |
/* |
* All Two point conical gradient test create functions may occasionally create edge case shaders |
*/ |
-GrEffect* Edge2PtConicalEffect::TestCreate(SkRandom* random, |
- GrContext* context, |
- const GrDrawTargetCaps&, |
- GrTexture**) { |
+GrFragmentProcessor* Edge2PtConicalEffect::TestCreate(SkRandom* random, |
+ GrContext* context, |
+ const GrDrawTargetCaps&, |
+ GrTexture**) { |
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()}; |
SkScalar radius1 = random->nextUScalar1(); |
SkPoint center2; |
@@ -209,14 +209,14 @@ GrEffect* Edge2PtConicalEffect::TestCreate(SkRandom* random, |
colors, stops, colorCount, |
tm)); |
SkPaint paint; |
- GrEffect* effect; |
+ GrFragmentProcessor* fp; |
GrColor paintColor; |
- SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect)); |
- return effect; |
+ SkAssertResult(shader->asFragmentProcessor(context, paint, NULL, &paintColor, &fp)); |
+ return fp; |
} |
-GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrBackendProcessorFactory& factory, |
+ const GrProcessor&) |
: INHERITED(factory) |
, fVSVaryingName(NULL) |
, fFSVaryingName(NULL) |
@@ -224,8 +224,8 @@ GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrBackendEffectFactory& fac |
, fCachedDiffRadius(-SK_ScalarMax) {} |
void GLEdge2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect&, |
- const GrEffectKey& key, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray& coords, |
@@ -282,9 +282,9 @@ void GLEdge2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
} |
void GLEdge2PtConicalEffect::setData(const GrGLProgramDataManager& pdman, |
- const GrEffect& effect) { |
- INHERITED::setData(pdman, effect); |
- const Edge2PtConicalEffect& data = effect.cast<Edge2PtConicalEffect>(); |
+ const GrProcessor& processor) { |
+ INHERITED::setData(pdman, processor); |
+ const Edge2PtConicalEffect& data = processor.cast<Edge2PtConicalEffect>(); |
SkScalar radius0 = data.radius(); |
SkScalar diffRadius = data.diffRadius(); |
@@ -303,9 +303,9 @@ void GLEdge2PtConicalEffect::setData(const GrGLProgramDataManager& pdman, |
} |
} |
-void GLEdge2PtConicalEffect::GenKey(const GrEffect& effect, |
- const GrGLCaps&, GrEffectKeyBuilder* b) { |
- b->add32(GenBaseGradientKey(effect)); |
+void GLEdge2PtConicalEffect::GenKey(const GrProcessor& processor, |
+ const GrGLCaps&, GrProcessorKeyBuilder* b) { |
+ b->add32(GenBaseGradientKey(processor)); |
} |
////////////////////////////////////////////////////////////////////////////// |
@@ -375,26 +375,26 @@ class GLFocalOutside2PtConicalEffect; |
class FocalOutside2PtConicalEffect : public GrGradientEffect { |
public: |
- static GrEffect* Create(GrContext* ctx, |
- const SkTwoPointConicalGradient& shader, |
- const SkMatrix& matrix, |
- SkShader::TileMode tm, |
- SkScalar focalX) { |
+ static GrFragmentProcessor* Create(GrContext* ctx, |
+ const SkTwoPointConicalGradient& shader, |
+ const SkMatrix& matrix, |
+ SkShader::TileMode tm, |
+ SkScalar focalX) { |
return SkNEW_ARGS(FocalOutside2PtConicalEffect, (ctx, shader, matrix, tm, focalX)); |
} |
virtual ~FocalOutside2PtConicalEffect() { } |
static const char* Name() { return "Two-Point Conical Gradient Focal Outside"; } |
- virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
+ virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE; |
bool isFlipped() const { return fIsFlipped; } |
SkScalar focal() const { return fFocalX; } |
- typedef GLFocalOutside2PtConicalEffect GLEffect; |
+ typedef GLFocalOutside2PtConicalEffect GLProcessor; |
private: |
- virtual bool onIsEqual(const GrEffect& sBase) const SK_OVERRIDE { |
+ virtual bool onIsEqual(const GrProcessor& sBase) const SK_OVERRIDE { |
const FocalOutside2PtConicalEffect& s = sBase.cast<FocalOutside2PtConicalEffect>(); |
return (INHERITED::onIsEqual(sBase) && |
this->fFocalX == s.fFocalX && |
@@ -408,7 +408,7 @@ private: |
SkScalar focalX) |
: INHERITED(ctx, shader, matrix, tm), fFocalX(focalX), fIsFlipped(shader.isFlippedGrad()) {} |
- GR_DECLARE_EFFECT_TEST; |
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
SkScalar fFocalX; |
bool fIsFlipped; |
@@ -418,19 +418,19 @@ private: |
class GLFocalOutside2PtConicalEffect : public GrGLGradientEffect { |
public: |
- GLFocalOutside2PtConicalEffect(const GrBackendEffectFactory& factory, const GrEffect&); |
+ GLFocalOutside2PtConicalEffect(const GrBackendProcessorFactory& factory, const GrProcessor&); |
virtual ~GLFocalOutside2PtConicalEffect() { } |
virtual void emitCode(GrGLProgramBuilder*, |
- const GrEffect&, |
- const GrEffectKey&, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey&, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray&) SK_OVERRIDE; |
- virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE; |
+ virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE; |
- static void GenKey(const GrEffect&, const GrGLCaps& caps, GrEffectKeyBuilder* b); |
+ static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b); |
protected: |
UniformHandle fParamUni; |
@@ -452,19 +452,19 @@ private: |
}; |
-const GrBackendEffectFactory& FocalOutside2PtConicalEffect::getFactory() const { |
- return GrTBackendEffectFactory<FocalOutside2PtConicalEffect>::getInstance(); |
+const GrBackendFragmentProcessorFactory& FocalOutside2PtConicalEffect::getFactory() const { |
+ return GrTBackendFragmentProcessorFactory<FocalOutside2PtConicalEffect>::getInstance(); |
} |
-GR_DEFINE_EFFECT_TEST(FocalOutside2PtConicalEffect); |
+GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalOutside2PtConicalEffect); |
/* |
* All Two point conical gradient test create functions may occasionally create edge case shaders |
*/ |
-GrEffect* FocalOutside2PtConicalEffect::TestCreate(SkRandom* random, |
- GrContext* context, |
- const GrDrawTargetCaps&, |
- GrTexture**) { |
+GrFragmentProcessor* FocalOutside2PtConicalEffect::TestCreate(SkRandom* random, |
+ GrContext* context, |
+ const GrDrawTargetCaps&, |
+ GrTexture**) { |
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()}; |
SkScalar radius1 = 0.f; |
SkPoint center2; |
@@ -488,25 +488,25 @@ GrEffect* FocalOutside2PtConicalEffect::TestCreate(SkRandom* random, |
colors, stops, colorCount, |
tm)); |
SkPaint paint; |
- GrEffect* effect; |
+ GrFragmentProcessor* effect; |
GrColor paintColor; |
- SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect)); |
+ SkAssertResult(shader->asFragmentProcessor(context, paint, NULL, &paintColor, &effect)); |
return effect; |
} |
-GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrBackendProcessorFactory& factory, |
+ const GrProcessor& processor) |
: INHERITED(factory) |
, fVSVaryingName(NULL) |
, fFSVaryingName(NULL) |
, fCachedFocal(SK_ScalarMax) { |
- const FocalOutside2PtConicalEffect& data = effect.cast<FocalOutside2PtConicalEffect>(); |
+ const FocalOutside2PtConicalEffect& data = processor.cast<FocalOutside2PtConicalEffect>(); |
fIsFlipped = data.isFlipped(); |
} |
void GLFocalOutside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect&, |
- const GrEffectKey& key, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray& coords, |
@@ -554,9 +554,9 @@ void GLFocalOutside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
} |
void GLFocalOutside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman, |
- const GrEffect& effect) { |
- INHERITED::setData(pdman, effect); |
- const FocalOutside2PtConicalEffect& data = effect.cast<FocalOutside2PtConicalEffect>(); |
+ const GrProcessor& processor) { |
+ INHERITED::setData(pdman, processor); |
+ const FocalOutside2PtConicalEffect& data = processor.cast<FocalOutside2PtConicalEffect>(); |
SkASSERT(data.isFlipped() == fIsFlipped); |
SkScalar focal = data.focal(); |
@@ -573,11 +573,11 @@ void GLFocalOutside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman |
} |
} |
-void GLFocalOutside2PtConicalEffect::GenKey(const GrEffect& effect, |
- const GrGLCaps&, GrEffectKeyBuilder* b) { |
+void GLFocalOutside2PtConicalEffect::GenKey(const GrProcessor& processor, |
+ const GrGLCaps&, GrProcessorKeyBuilder* b) { |
uint32_t* key = b->add32n(2); |
- key[0] = GenBaseGradientKey(effect); |
- key[1] = effect.cast<FocalOutside2PtConicalEffect>().isFlipped(); |
+ key[0] = GenBaseGradientKey(processor); |
+ key[1] = processor.cast<FocalOutside2PtConicalEffect>().isFlipped(); |
} |
////////////////////////////////////////////////////////////////////////////// |
@@ -587,25 +587,25 @@ class GLFocalInside2PtConicalEffect; |
class FocalInside2PtConicalEffect : public GrGradientEffect { |
public: |
- static GrEffect* Create(GrContext* ctx, |
- const SkTwoPointConicalGradient& shader, |
- const SkMatrix& matrix, |
- SkShader::TileMode tm, |
- SkScalar focalX) { |
+ static GrFragmentProcessor* Create(GrContext* ctx, |
+ const SkTwoPointConicalGradient& shader, |
+ const SkMatrix& matrix, |
+ SkShader::TileMode tm, |
+ SkScalar focalX) { |
return SkNEW_ARGS(FocalInside2PtConicalEffect, (ctx, shader, matrix, tm, focalX)); |
} |
virtual ~FocalInside2PtConicalEffect() {} |
static const char* Name() { return "Two-Point Conical Gradient Focal Inside"; } |
- virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
+ virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE; |
SkScalar focal() const { return fFocalX; } |
- typedef GLFocalInside2PtConicalEffect GLEffect; |
+ typedef GLFocalInside2PtConicalEffect GLProcessor; |
private: |
- virtual bool onIsEqual(const GrEffect& sBase) const SK_OVERRIDE { |
+ virtual bool onIsEqual(const GrProcessor& sBase) const SK_OVERRIDE { |
const FocalInside2PtConicalEffect& s = sBase.cast<FocalInside2PtConicalEffect>(); |
return (INHERITED::onIsEqual(sBase) && |
this->fFocalX == s.fFocalX); |
@@ -618,7 +618,7 @@ private: |
SkScalar focalX) |
: INHERITED(ctx, shader, matrix, tm), fFocalX(focalX) {} |
- GR_DECLARE_EFFECT_TEST; |
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
SkScalar fFocalX; |
@@ -627,19 +627,19 @@ private: |
class GLFocalInside2PtConicalEffect : public GrGLGradientEffect { |
public: |
- GLFocalInside2PtConicalEffect(const GrBackendEffectFactory& factory, const GrEffect&); |
+ GLFocalInside2PtConicalEffect(const GrBackendProcessorFactory& factory, const GrProcessor&); |
virtual ~GLFocalInside2PtConicalEffect() {} |
virtual void emitCode(GrGLProgramBuilder*, |
- const GrEffect&, |
- const GrEffectKey&, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey&, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray&) SK_OVERRIDE; |
- virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE; |
+ virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE; |
- static void GenKey(const GrEffect&, const GrGLCaps& caps, GrEffectKeyBuilder* b); |
+ static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b); |
protected: |
UniformHandle fFocalUni; |
@@ -659,19 +659,19 @@ private: |
}; |
-const GrBackendEffectFactory& FocalInside2PtConicalEffect::getFactory() const { |
- return GrTBackendEffectFactory<FocalInside2PtConicalEffect>::getInstance(); |
+const GrBackendFragmentProcessorFactory& FocalInside2PtConicalEffect::getFactory() const { |
+ return GrTBackendFragmentProcessorFactory<FocalInside2PtConicalEffect>::getInstance(); |
} |
-GR_DEFINE_EFFECT_TEST(FocalInside2PtConicalEffect); |
+GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalInside2PtConicalEffect); |
/* |
* All Two point conical gradient test create functions may occasionally create edge case shaders |
*/ |
-GrEffect* FocalInside2PtConicalEffect::TestCreate(SkRandom* random, |
- GrContext* context, |
- const GrDrawTargetCaps&, |
- GrTexture**) { |
+GrFragmentProcessor* FocalInside2PtConicalEffect::TestCreate(SkRandom* random, |
+ GrContext* context, |
+ const GrDrawTargetCaps&, |
+ GrTexture**) { |
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()}; |
SkScalar radius1 = 0.f; |
SkPoint center2; |
@@ -698,21 +698,21 @@ GrEffect* FocalInside2PtConicalEffect::TestCreate(SkRandom* random, |
tm)); |
SkPaint paint; |
GrColor paintColor; |
- GrEffect* effect; |
- SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect)); |
- return effect; |
+ GrFragmentProcessor* fp; |
+ SkAssertResult(shader->asFragmentProcessor(context, paint, NULL, &paintColor, &fp)); |
+ return fp; |
} |
-GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrBackendProcessorFactory& factory, |
+ const GrProcessor&) |
: INHERITED(factory) |
, fVSVaryingName(NULL) |
, fFSVaryingName(NULL) |
, fCachedFocal(SK_ScalarMax) {} |
void GLFocalInside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect&, |
- const GrEffectKey& key, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray& coords, |
@@ -740,9 +740,9 @@ void GLFocalInside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
} |
void GLFocalInside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman, |
- const GrEffect& effect) { |
- INHERITED::setData(pdman, effect); |
- const FocalInside2PtConicalEffect& data = effect.cast<FocalInside2PtConicalEffect>(); |
+ const GrProcessor& processor) { |
+ INHERITED::setData(pdman, processor); |
+ const FocalInside2PtConicalEffect& data = processor.cast<FocalInside2PtConicalEffect>(); |
SkScalar focal = data.focal(); |
if (fCachedFocal != focal) { |
@@ -751,9 +751,9 @@ void GLFocalInside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman, |
} |
} |
-void GLFocalInside2PtConicalEffect::GenKey(const GrEffect& effect, |
- const GrGLCaps&, GrEffectKeyBuilder* b) { |
- b->add32(GenBaseGradientKey(effect)); |
+void GLFocalInside2PtConicalEffect::GenKey(const GrProcessor& processor, |
+ const GrGLCaps&, GrProcessorKeyBuilder* b) { |
+ b->add32(GenBaseGradientKey(processor)); |
} |
////////////////////////////////////////////////////////////////////////////// |
@@ -825,18 +825,18 @@ class GLCircleInside2PtConicalEffect; |
class CircleInside2PtConicalEffect : public GrGradientEffect { |
public: |
- static GrEffect* Create(GrContext* ctx, |
- const SkTwoPointConicalGradient& shader, |
- const SkMatrix& matrix, |
- SkShader::TileMode tm, |
- const CircleConicalInfo& info) { |
+ static GrFragmentProcessor* Create(GrContext* ctx, |
+ const SkTwoPointConicalGradient& shader, |
+ const SkMatrix& matrix, |
+ SkShader::TileMode tm, |
+ const CircleConicalInfo& info) { |
return SkNEW_ARGS(CircleInside2PtConicalEffect, (ctx, shader, matrix, tm, info)); |
} |
virtual ~CircleInside2PtConicalEffect() {} |
static const char* Name() { return "Two-Point Conical Gradient Inside"; } |
- virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
+ virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE; |
SkScalar centerX() const { return fInfo.fCenterEnd.fX; } |
SkScalar centerY() const { return fInfo.fCenterEnd.fY; } |
@@ -844,10 +844,10 @@ public: |
SkScalar B() const { return fInfo.fB; } |
SkScalar C() const { return fInfo.fC; } |
- typedef GLCircleInside2PtConicalEffect GLEffect; |
+ typedef GLCircleInside2PtConicalEffect GLProcessor; |
private: |
- virtual bool onIsEqual(const GrEffect& sBase) const SK_OVERRIDE { |
+ virtual bool onIsEqual(const GrProcessor& sBase) const SK_OVERRIDE { |
const CircleInside2PtConicalEffect& s = sBase.cast<CircleInside2PtConicalEffect>(); |
return (INHERITED::onIsEqual(sBase) && |
this->fInfo.fCenterEnd == s.fInfo.fCenterEnd && |
@@ -863,7 +863,7 @@ private: |
const CircleConicalInfo& info) |
: INHERITED(ctx, shader, matrix, tm), fInfo(info) {} |
- GR_DECLARE_EFFECT_TEST; |
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
const CircleConicalInfo fInfo; |
@@ -872,19 +872,19 @@ private: |
class GLCircleInside2PtConicalEffect : public GrGLGradientEffect { |
public: |
- GLCircleInside2PtConicalEffect(const GrBackendEffectFactory& factory, const GrEffect&); |
+ GLCircleInside2PtConicalEffect(const GrBackendProcessorFactory& factory, const GrProcessor&); |
virtual ~GLCircleInside2PtConicalEffect() {} |
virtual void emitCode(GrGLProgramBuilder*, |
- const GrEffect&, |
- const GrEffectKey&, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey&, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray&) SK_OVERRIDE; |
- virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE; |
+ virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE; |
- static void GenKey(const GrEffect&, const GrGLCaps& caps, GrEffectKeyBuilder* b); |
+ static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b); |
protected: |
UniformHandle fCenterUni; |
@@ -909,19 +909,19 @@ private: |
}; |
-const GrBackendEffectFactory& CircleInside2PtConicalEffect::getFactory() const { |
- return GrTBackendEffectFactory<CircleInside2PtConicalEffect>::getInstance(); |
+const GrBackendFragmentProcessorFactory& CircleInside2PtConicalEffect::getFactory() const { |
+ return GrTBackendFragmentProcessorFactory<CircleInside2PtConicalEffect>::getInstance(); |
} |
-GR_DEFINE_EFFECT_TEST(CircleInside2PtConicalEffect); |
+GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleInside2PtConicalEffect); |
/* |
* All Two point conical gradient test create functions may occasionally create edge case shaders |
*/ |
-GrEffect* CircleInside2PtConicalEffect::TestCreate(SkRandom* random, |
- GrContext* context, |
- const GrDrawTargetCaps&, |
- GrTexture**) { |
+GrFragmentProcessor* CircleInside2PtConicalEffect::TestCreate(SkRandom* random, |
+ GrContext* context, |
+ const GrDrawTargetCaps&, |
+ GrTexture**) { |
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()}; |
SkScalar radius1 = random->nextUScalar1() + 0.0001f; // make sure radius1 != 0 |
SkPoint center2; |
@@ -947,13 +947,13 @@ GrEffect* CircleInside2PtConicalEffect::TestCreate(SkRandom* random, |
tm)); |
SkPaint paint; |
GrColor paintColor; |
- GrEffect* effect; |
- SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect)); |
- return effect; |
+ GrFragmentProcessor* processor; |
+ SkAssertResult(shader->asFragmentProcessor(context, paint, NULL, &paintColor, &processor)); |
+ return processor; |
} |
-GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrBackendProcessorFactory& factory, |
+ const GrProcessor& processor) |
: INHERITED(factory) |
, fVSVaryingName(NULL) |
, fFSVaryingName(NULL) |
@@ -964,8 +964,8 @@ GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrBackendEf |
, fCachedC(SK_ScalarMax) {} |
void GLCircleInside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect&, |
- const GrEffectKey& key, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray& coords, |
@@ -1007,9 +1007,9 @@ void GLCircleInside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
} |
void GLCircleInside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman, |
- const GrEffect& effect) { |
- INHERITED::setData(pdman, effect); |
- const CircleInside2PtConicalEffect& data = effect.cast<CircleInside2PtConicalEffect>(); |
+ const GrProcessor& processor) { |
+ INHERITED::setData(pdman, processor); |
+ const CircleInside2PtConicalEffect& data = processor.cast<CircleInside2PtConicalEffect>(); |
SkScalar centerX = data.centerX(); |
SkScalar centerY = data.centerY(); |
SkScalar A = data.A(); |
@@ -1030,9 +1030,9 @@ void GLCircleInside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman |
} |
} |
-void GLCircleInside2PtConicalEffect::GenKey(const GrEffect& effect, |
- const GrGLCaps&, GrEffectKeyBuilder* b) { |
- b->add32(GenBaseGradientKey(effect)); |
+void GLCircleInside2PtConicalEffect::GenKey(const GrProcessor& processor, |
+ const GrGLCaps&, GrProcessorKeyBuilder* b) { |
+ b->add32(GenBaseGradientKey(processor)); |
} |
////////////////////////////////////////////////////////////////////////////// |
@@ -1042,18 +1042,18 @@ class GLCircleOutside2PtConicalEffect; |
class CircleOutside2PtConicalEffect : public GrGradientEffect { |
public: |
- static GrEffect* Create(GrContext* ctx, |
- const SkTwoPointConicalGradient& shader, |
- const SkMatrix& matrix, |
- SkShader::TileMode tm, |
- const CircleConicalInfo& info) { |
+ static GrFragmentProcessor* Create(GrContext* ctx, |
+ const SkTwoPointConicalGradient& shader, |
+ const SkMatrix& matrix, |
+ SkShader::TileMode tm, |
+ const CircleConicalInfo& info) { |
return SkNEW_ARGS(CircleOutside2PtConicalEffect, (ctx, shader, matrix, tm, info)); |
} |
virtual ~CircleOutside2PtConicalEffect() {} |
static const char* Name() { return "Two-Point Conical Gradient Outside"; } |
- virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
+ virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE; |
SkScalar centerX() const { return fInfo.fCenterEnd.fX; } |
SkScalar centerY() const { return fInfo.fCenterEnd.fY; } |
@@ -1063,10 +1063,10 @@ public: |
SkScalar tLimit() const { return fTLimit; } |
bool isFlipped() const { return fIsFlipped; } |
- typedef GLCircleOutside2PtConicalEffect GLEffect; |
+ typedef GLCircleOutside2PtConicalEffect GLProcessor; |
private: |
- virtual bool onIsEqual(const GrEffect& sBase) const SK_OVERRIDE { |
+ virtual bool onIsEqual(const GrProcessor& sBase) const SK_OVERRIDE { |
const CircleOutside2PtConicalEffect& s = sBase.cast<CircleOutside2PtConicalEffect>(); |
return (INHERITED::onIsEqual(sBase) && |
this->fInfo.fCenterEnd == s.fInfo.fCenterEnd && |
@@ -1093,7 +1093,7 @@ private: |
fIsFlipped = shader.isFlippedGrad(); |
} |
- GR_DECLARE_EFFECT_TEST; |
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
const CircleConicalInfo fInfo; |
SkScalar fTLimit; |
@@ -1104,19 +1104,19 @@ private: |
class GLCircleOutside2PtConicalEffect : public GrGLGradientEffect { |
public: |
- GLCircleOutside2PtConicalEffect(const GrBackendEffectFactory& factory, const GrEffect&); |
+ GLCircleOutside2PtConicalEffect(const GrBackendProcessorFactory&, const GrProcessor&); |
virtual ~GLCircleOutside2PtConicalEffect() {} |
virtual void emitCode(GrGLProgramBuilder*, |
- const GrEffect&, |
- const GrEffectKey&, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey&, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray&) SK_OVERRIDE; |
- virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE; |
+ virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE; |
- static void GenKey(const GrEffect&, const GrGLCaps& caps, GrEffectKeyBuilder* b); |
+ static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b); |
protected: |
UniformHandle fCenterUni; |
@@ -1144,19 +1144,19 @@ private: |
}; |
-const GrBackendEffectFactory& CircleOutside2PtConicalEffect::getFactory() const { |
- return GrTBackendEffectFactory<CircleOutside2PtConicalEffect>::getInstance(); |
+const GrBackendFragmentProcessorFactory& CircleOutside2PtConicalEffect::getFactory() const { |
+ return GrTBackendFragmentProcessorFactory<CircleOutside2PtConicalEffect>::getInstance(); |
} |
-GR_DEFINE_EFFECT_TEST(CircleOutside2PtConicalEffect); |
+GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleOutside2PtConicalEffect); |
/* |
* All Two point conical gradient test create functions may occasionally create edge case shaders |
*/ |
-GrEffect* CircleOutside2PtConicalEffect::TestCreate(SkRandom* random, |
- GrContext* context, |
- const GrDrawTargetCaps&, |
- GrTexture**) { |
+GrFragmentProcessor* CircleOutside2PtConicalEffect::TestCreate(SkRandom* random, |
+ GrContext* context, |
+ const GrDrawTargetCaps&, |
+ GrTexture**) { |
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()}; |
SkScalar radius1 = random->nextUScalar1() + 0.0001f; // make sure radius1 != 0 |
SkPoint center2; |
@@ -1183,13 +1183,13 @@ GrEffect* CircleOutside2PtConicalEffect::TestCreate(SkRandom* random, |
tm)); |
SkPaint paint; |
GrColor paintColor; |
- GrEffect* effect; |
- SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect)); |
- return effect; |
+ GrFragmentProcessor* processor; |
+ SkAssertResult(shader->asFragmentProcessor(context, paint, NULL, &paintColor, &processor)); |
+ return processor; |
} |
-GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrBackendProcessorFactory& factory, |
+ const GrProcessor& processor) |
: INHERITED(factory) |
, fVSVaryingName(NULL) |
, fFSVaryingName(NULL) |
@@ -1199,13 +1199,13 @@ GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrBackend |
, fCachedB(SK_ScalarMax) |
, fCachedC(SK_ScalarMax) |
, fCachedTLimit(SK_ScalarMax) { |
- const CircleOutside2PtConicalEffect& data = effect.cast<CircleOutside2PtConicalEffect>(); |
+ const CircleOutside2PtConicalEffect& data = processor.cast<CircleOutside2PtConicalEffect>(); |
fIsFlipped = data.isFlipped(); |
} |
void GLCircleOutside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect&, |
- const GrEffectKey& key, |
+ const GrFragmentProcessor&, |
+ const GrProcessorKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray& coords, |
@@ -1263,9 +1263,9 @@ void GLCircleOutside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder, |
} |
void GLCircleOutside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman, |
- const GrEffect& effect) { |
- INHERITED::setData(pdman, effect); |
- const CircleOutside2PtConicalEffect& data = effect.cast<CircleOutside2PtConicalEffect>(); |
+ const GrProcessor& processor) { |
+ INHERITED::setData(pdman, processor); |
+ const CircleOutside2PtConicalEffect& data = processor.cast<CircleOutside2PtConicalEffect>(); |
SkASSERT(data.isFlipped() == fIsFlipped); |
SkScalar centerX = data.centerX(); |
SkScalar centerY = data.centerY(); |
@@ -1290,19 +1290,19 @@ void GLCircleOutside2PtConicalEffect::setData(const GrGLProgramDataManager& pdma |
} |
} |
-void GLCircleOutside2PtConicalEffect::GenKey(const GrEffect& effect, |
- const GrGLCaps&, GrEffectKeyBuilder* b) { |
+void GLCircleOutside2PtConicalEffect::GenKey(const GrProcessor& processor, |
+ const GrGLCaps&, GrProcessorKeyBuilder* b) { |
uint32_t* key = b->add32n(2); |
- key[0] = GenBaseGradientKey(effect); |
- key[1] = effect.cast<CircleOutside2PtConicalEffect>().isFlipped(); |
+ key[0] = GenBaseGradientKey(processor); |
+ key[1] = processor.cast<CircleOutside2PtConicalEffect>().isFlipped(); |
} |
////////////////////////////////////////////////////////////////////////////// |
-GrEffect* Gr2PtConicalGradientEffect::Create(GrContext* ctx, |
- const SkTwoPointConicalGradient& shader, |
- SkShader::TileMode tm, |
- const SkMatrix* localMatrix) { |
+GrFragmentProcessor* Gr2PtConicalGradientEffect::Create(GrContext* ctx, |
+ const SkTwoPointConicalGradient& shader, |
+ SkShader::TileMode tm, |
+ const SkMatrix* localMatrix) { |
SkMatrix matrix; |
if (!shader.getLocalMatrix().invert(&matrix)) { |
return NULL; |