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

Unified Diff: src/gpu/effects/GrConvolutionEffect.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/GrConvolutionEffect.h ('k') | src/gpu/effects/GrCustomCoordsTextureEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConvolutionEffect.cpp
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 6e1f3c4ce7b64500d93caf9008691a67bb4af40b..e4ac4ce381037186501ba97859e8860f4ad98385 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -5,19 +5,18 @@
* found in the LICENSE file.
*/
-#include "gl/builders/GrGLProgramBuilder.h"
#include "GrConvolutionEffect.h"
#include "gl/GrGLProcessor.h"
#include "gl/GrGLSL.h"
#include "gl/GrGLTexture.h"
-#include "GrTBackendProcessorFactory.h"
+#include "gl/builders/GrGLProgramBuilder.h"
// For brevity
typedef GrGLProgramDataManager::UniformHandle UniformHandle;
class GrGLConvolutionEffect : public GrGLFragmentProcessor {
public:
- GrGLConvolutionEffect(const GrBackendProcessorFactory&, const GrProcessor&);
+ GrGLConvolutionEffect(const GrProcessor&);
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
@@ -45,9 +44,7 @@ private:
typedef GrGLFragmentProcessor INHERITED;
};
-GrGLConvolutionEffect::GrGLConvolutionEffect(const GrBackendProcessorFactory& factory,
- const GrProcessor& processor)
- : INHERITED(factory) {
+GrGLConvolutionEffect::GrGLConvolutionEffect(const GrProcessor& processor) {
const GrConvolutionEffect& c = processor.cast<GrConvolutionEffect>();
fRadius = c.radius();
fUseBounds = c.useBounds();
@@ -155,6 +152,7 @@ GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
bool useBounds,
float bounds[2])
: Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
+ this->initClassID<GrConvolutionEffect>();
SkASSERT(radius <= kMaxKernelRadius);
SkASSERT(kernel);
int width = this->width();
@@ -171,6 +169,7 @@ GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
bool useBounds,
float bounds[2])
: Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
+ this->initClassID<GrConvolutionEffect>();
SkASSERT(radius <= kMaxKernelRadius);
int width = this->width();
@@ -194,8 +193,13 @@ GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
GrConvolutionEffect::~GrConvolutionEffect() {
}
-const GrBackendFragmentProcessorFactory& GrConvolutionEffect::getFactory() const {
- return GrTBackendFragmentProcessorFactory<GrConvolutionEffect>::getInstance();
+void GrConvolutionEffect::getGLProcessorKey(const GrGLCaps& caps,
+ GrProcessorKeyBuilder* b) const {
+ GrGLConvolutionEffect::GenKey(*this, caps, b);
+}
+
+GrGLFragmentProcessor* GrConvolutionEffect::createGLInstance() const {
+ return SkNEW_ARGS(GrGLConvolutionEffect, (*this));
}
bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.h ('k') | src/gpu/effects/GrCustomCoordsTextureEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698