Index: tests/GLProgramsTest.cpp |
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp |
index 7b73fdc510dd36306c1baf0518806eb7b19a8a72..18c14c45be477f310db42639ce4091505fe766b1 100644 |
--- a/tests/GLProgramsTest.cpp |
+++ b/tests/GLProgramsTest.cpp |
@@ -15,7 +15,6 @@ |
#include "GrContextFactory.h" |
#include "GrInvariantOutput.h" |
#include "GrOptDrawState.h" |
-#include "GrTBackendProcessorFactory.h" |
#include "GrTest.h" |
#include "SkChecksum.h" |
#include "SkRandom.h" |
@@ -31,7 +30,26 @@ |
*/ |
static const uint32_t kMaxKeySize = 1024; |
-class GLBigKeyProcessor; |
+class GLBigKeyProcessor : public GrGLFragmentProcessor { |
+public: |
+ GLBigKeyProcessor(const GrProcessor&) {} |
+ |
+ virtual void emitCode(GrGLFPBuilder* builder, |
+ const GrFragmentProcessor& fp, |
+ const char* outputColor, |
+ const char* inputColor, |
+ const TransformedCoordsArray&, |
+ const TextureSamplerArray&) {} |
+ |
+ static void GenKey(const GrProcessor& processor, const GrGLCaps&, GrProcessorKeyBuilder* b) { |
+ for (uint32_t i = 0; i < kMaxKeySize; i++) { |
+ b->add32(i); |
+ } |
+ } |
+ |
+private: |
+ typedef GrGLFragmentProcessor INHERITED; |
+}; |
class BigKeyProcessor : public GrFragmentProcessor { |
public: |
@@ -40,16 +58,21 @@ public: |
return SkRef(gBigKeyProcessor); |
} |
- static const char* Name() { return "Big ol' Key"; } |
+ virtual const char* name() const SK_OVERRIDE { return "Big Ole Key"; } |
- virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE { |
- return GrTBackendFragmentProcessorFactory<BigKeyProcessor>::getInstance(); |
+ virtual void getGLProcessorKey(const GrGLCaps& caps, |
+ GrProcessorKeyBuilder* b) const SK_OVERRIDE { |
+ GLBigKeyProcessor::GenKey(*this, caps, b); |
} |
- typedef GLBigKeyProcessor GLProcessor; |
+ virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE { |
+ return SkNEW_ARGS(GLBigKeyProcessor, (*this)); |
+ } |
private: |
- BigKeyProcessor() { } |
+ BigKeyProcessor() { |
+ this->initClassID<BigKeyProcessor>(); |
+ } |
virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { return true; } |
virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE { } |
@@ -67,28 +90,6 @@ GrFragmentProcessor* BigKeyProcessor::TestCreate(SkRandom*, |
return BigKeyProcessor::Create(); |
} |
-class GLBigKeyProcessor : public GrGLFragmentProcessor { |
-public: |
- GLBigKeyProcessor(const GrBackendProcessorFactory& factory, const GrProcessor&) |
- : INHERITED(factory) {} |
- |
- virtual void emitCode(GrGLFPBuilder* builder, |
- const GrFragmentProcessor& fp, |
- const char* outputColor, |
- const char* inputColor, |
- const TransformedCoordsArray&, |
- const TextureSamplerArray&) {} |
- |
- static void GenKey(const GrProcessor& processor, const GrGLCaps&, GrProcessorKeyBuilder* b) { |
- for (uint32_t i = 0; i < kMaxKeySize; i++) { |
- b->add32(i); |
- } |
- } |
- |
-private: |
- typedef GrGLFragmentProcessor INHERITED; |
-}; |
- |
/* |
* Begin test code |
*/ |