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

Unified Diff: src/effects/SkMorphologyImageFilter.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/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 3d27d10ee12197d52d9cf9ffd4d3f2f369ec9b12..f89675164ac357ddd599d92063374554ac883249 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -16,10 +16,9 @@
#include "GrContext.h"
#include "GrInvariantOutput.h"
#include "GrTexture.h"
-#include "GrTBackendProcessorFactory.h"
+#include "effects/Gr1DKernelEffect.h"
#include "gl/GrGLProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
-#include "effects/Gr1DKernelEffect.h"
#endif
SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX,
@@ -268,9 +267,6 @@ SkFlattenable* SkDilateImageFilter::CreateProc(SkReadBuffer& buffer) {
#if SK_SUPPORT_GPU
///////////////////////////////////////////////////////////////////////////////
-
-class GrGLMorphologyEffect;
-
/**
* Morphology effects. Depending upon the type of morphology, either the
* component-wise min (Erode_Type) or max (Dilate_Type) of all pixels in the
@@ -295,11 +291,11 @@ public:
MorphologyType type() const { return fType; }
- static const char* Name() { return "Morphology"; }
+ virtual const char* name() const SK_OVERRIDE { return "Morphology"; }
- typedef GrGLMorphologyEffect GLProcessor;
+ virtual void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const SK_OVERRIDE;
- virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE;
+ virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE;
protected:
@@ -321,7 +317,7 @@ private:
class GrGLMorphologyEffect : public GrGLFragmentProcessor {
public:
- GrGLMorphologyEffect (const GrBackendProcessorFactory&, const GrProcessor&);
+ GrGLMorphologyEffect(const GrProcessor&);
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
@@ -344,9 +340,7 @@ private:
typedef GrGLFragmentProcessor INHERITED;
};
-GrGLMorphologyEffect::GrGLMorphologyEffect(const GrBackendProcessorFactory& factory,
- const GrProcessor& proc)
- : INHERITED(factory) {
+GrGLMorphologyEffect::GrGLMorphologyEffect(const GrProcessor& proc) {
const GrMorphologyEffect& m = proc.cast<GrMorphologyEffect>();
fRadius = m.radius();
fType = m.type();
@@ -428,15 +422,19 @@ GrMorphologyEffect::GrMorphologyEffect(GrTexture* texture,
MorphologyType type)
: Gr1DKernelEffect(texture, direction, radius)
, fType(type) {
+ this->initClassID<GrMorphologyEffect>();
}
GrMorphologyEffect::~GrMorphologyEffect() {
}
-const GrBackendFragmentProcessorFactory& GrMorphologyEffect::getFactory() const {
- return GrTBackendFragmentProcessorFactory<GrMorphologyEffect>::getInstance();
+void GrMorphologyEffect::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
+ GrGLMorphologyEffect::GenKey(*this, caps, b);
}
+GrGLFragmentProcessor* GrMorphologyEffect::createGLInstance() const {
+ return SkNEW_ARGS(GrGLMorphologyEffect, (*this));
+}
bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
const GrMorphologyEffect& s = sBase.cast<GrMorphologyEffect>();
return (this->radius() == s.radius() &&
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698