Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(637)

Unified Diff: tests/GLProgramsTest.cpp

Issue 778453002: Remove backend factories (Closed) Base URL: https://skia.googlesource.com/skia.git@unichoice
Patch Set: more clang warnings Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
*/
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698