| Index: src/effects/SkDisplacementMapEffect.cpp
|
| diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
|
| index d39240e012bdd8ee84d31f72885e543f75e91907..7bd077c7836e51d399c6b96ac492da030f61eb76 100644
|
| --- a/src/effects/SkDisplacementMapEffect.cpp
|
| +++ b/src/effects/SkDisplacementMapEffect.cpp
|
| @@ -16,7 +16,6 @@
|
| #include "GrInvariantOutput.h"
|
| #include "gl/GrGLProcessor.h"
|
| #include "gl/builders/GrGLProgramBuilder.h"
|
| -#include "GrTBackendProcessorFactory.h"
|
| #endif
|
|
|
| namespace {
|
| @@ -287,8 +286,7 @@ bool SkDisplacementMapEffect::onFilterBounds(const SkIRect& src, const SkMatrix&
|
| #if SK_SUPPORT_GPU
|
| class GrGLDisplacementMapEffect : public GrGLFragmentProcessor {
|
| public:
|
| - GrGLDisplacementMapEffect(const GrBackendProcessorFactory&,
|
| - const GrProcessor&);
|
| + GrGLDisplacementMapEffect(const GrProcessor&);
|
| virtual ~GrGLDisplacementMapEffect();
|
|
|
| virtual void emitCode(GrGLFPBuilder*,
|
| @@ -328,15 +326,27 @@ public:
|
|
|
| virtual ~GrDisplacementMapEffect();
|
|
|
| - virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE;
|
| + virtual void getGLProcessorKey(const GrGLCaps& caps,
|
| + GrProcessorKeyBuilder* b) const SK_OVERRIDE {
|
| + GrGLDisplacementMapEffect::GenKey(*this, caps, b);
|
| + }
|
| +
|
| + virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE {
|
| + return SkNEW_ARGS(GrGLDisplacementMapEffect, (*this));
|
| + }
|
| +
|
| SkDisplacementMapEffect::ChannelSelectorType xChannelSelector() const
|
| { return fXChannelSelector; }
|
| SkDisplacementMapEffect::ChannelSelectorType yChannelSelector() const
|
| { return fYChannelSelector; }
|
| const SkVector& scale() const { return fScale; }
|
|
|
| - typedef GrGLDisplacementMapEffect GLProcessor;
|
| - static const char* Name() { return "DisplacementMap"; }
|
| + virtual const char* name() const SK_OVERRIDE { return "DisplacementMap"; }
|
| +
|
| + virtual uint32_t classID() const {
|
| + static uint32_t id = GenClassID();
|
| + return id;
|
| + }
|
|
|
| private:
|
| virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE;
|
| @@ -472,10 +482,6 @@ bool GrDisplacementMapEffect::onIsEqual(const GrFragmentProcessor& sBase) const
|
| fScale == s.fScale;
|
| }
|
|
|
| -const GrBackendFragmentProcessorFactory& GrDisplacementMapEffect::getFactory() const {
|
| - return GrTBackendFragmentProcessorFactory<GrDisplacementMapEffect>::getInstance();
|
| -}
|
| -
|
| void GrDisplacementMapEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
|
| // Any displacement offset bringing a pixel out of bounds will output a color of (0,0,0,0),
|
| // so the only way we'd get a constant alpha is if the input color image has a constant alpha
|
| @@ -514,10 +520,8 @@ GrFragmentProcessor* GrDisplacementMapEffect::TestCreate(SkRandom* random,
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| -GrGLDisplacementMapEffect::GrGLDisplacementMapEffect(const GrBackendProcessorFactory& factory,
|
| - const GrProcessor& proc)
|
| - : INHERITED(factory)
|
| - , fXChannelSelector(proc.cast<GrDisplacementMapEffect>().xChannelSelector())
|
| +GrGLDisplacementMapEffect::GrGLDisplacementMapEffect(const GrProcessor& proc)
|
| + : fXChannelSelector(proc.cast<GrDisplacementMapEffect>().xChannelSelector())
|
| , fYChannelSelector(proc.cast<GrDisplacementMapEffect>().yChannelSelector()) {
|
| }
|
|
|
|
|