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

Unified Diff: src/gpu/effects/GrDitherEffect.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/effects/GrDitherEffect.h ('k') | src/gpu/effects/GrMatrixConvolutionEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDitherEffect.cpp
diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
index 438fe2c60a479f5a65e4d70ef212cb1354c409e3..799d970601ae34c18ea79b05b72e1456a8d04478 100644
--- a/src/gpu/effects/GrDitherEffect.cpp
+++ b/src/gpu/effects/GrDitherEffect.cpp
@@ -5,19 +5,16 @@
* found in the LICENSE file.
*/
-#include "gl/builders/GrGLProgramBuilder.h"
#include "GrDitherEffect.h"
+#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
+#include "SkRect.h"
#include "gl/GrGLProcessor.h"
#include "gl/GrGLSL.h"
-#include "GrTBackendProcessorFactory.h"
-
-#include "SkRect.h"
+#include "gl/builders/GrGLProgramBuilder.h"
//////////////////////////////////////////////////////////////////////////////
-class GLDitherEffect;
-
class DitherEffect : public GrFragmentProcessor {
public:
static GrFragmentProcessor* Create() {
@@ -26,16 +23,16 @@ public:
}
virtual ~DitherEffect() {};
- static const char* Name() { return "Dither"; }
- typedef GLDitherEffect GLProcessor;
+ virtual const char* name() const SK_OVERRIDE { return "Dither"; }
- virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE {
- return GrTBackendFragmentProcessorFactory<DitherEffect>::getInstance();
- }
+ virtual void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const SK_OVERRIDE;
+
+ virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE;
private:
DitherEffect() {
+ this->initClassID<DitherEffect>();
this->setWillReadFragmentPosition();
}
@@ -68,7 +65,7 @@ GrFragmentProcessor* DitherEffect::TestCreate(SkRandom*,
class GLDitherEffect : public GrGLFragmentProcessor {
public:
- GLDitherEffect(const GrBackendProcessorFactory&, const GrProcessor&);
+ GLDitherEffect(const GrProcessor&);
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
@@ -81,9 +78,7 @@ private:
typedef GrGLFragmentProcessor INHERITED;
};
-GLDitherEffect::GLDitherEffect(const GrBackendProcessorFactory& factory,
- const GrProcessor&)
- : INHERITED (factory) {
+GLDitherEffect::GLDitherEffect(const GrProcessor&) {
}
void GLDitherEffect::emitCode(GrGLFPBuilder* builder,
@@ -111,4 +106,13 @@ void GLDitherEffect::emitCode(GrGLFPBuilder* builder,
//////////////////////////////////////////////////////////////////////////////
+void DitherEffect::getGLProcessorKey(const GrGLCaps& caps,
+ GrProcessorKeyBuilder* b) const {
+ GLDitherEffect::GenKey(*this, caps, b);
+}
+
+GrGLFragmentProcessor* DitherEffect::createGLInstance() const {
+ return SkNEW_ARGS(GLDitherEffect, (*this));
+}
+
GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); }
« no previous file with comments | « src/gpu/effects/GrDitherEffect.h ('k') | src/gpu/effects/GrMatrixConvolutionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698