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

Unified Diff: src/gpu/effects/GrMatrixConvolutionEffect.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/GrMatrixConvolutionEffect.h ('k') | src/gpu/effects/GrOvalEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrMatrixConvolutionEffect.cpp
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index 698b7050ef0a134c54775c7f0aef851817a5d79a..3cd3588a4c4c3548e351febe2e7508b56af3c670 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -4,17 +4,15 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include "gl/builders/GrGLProgramBuilder.h"
#include "GrMatrixConvolutionEffect.h"
#include "gl/GrGLProcessor.h"
#include "gl/GrGLSL.h"
#include "gl/GrGLTexture.h"
-#include "GrTBackendProcessorFactory.h"
+#include "gl/builders/GrGLProgramBuilder.h"
class GrGLMatrixConvolutionEffect : public GrGLFragmentProcessor {
public:
- GrGLMatrixConvolutionEffect(const GrBackendProcessorFactory& factory,
- const GrProcessor&);
+ GrGLMatrixConvolutionEffect(const GrProcessor&);
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const char* outputColor,
@@ -42,9 +40,7 @@ private:
typedef GrGLFragmentProcessor INHERITED;
};
-GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrBackendProcessorFactory& factory,
- const GrProcessor& processor)
- : INHERITED(factory) {
+GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrProcessor& processor) {
const GrMatrixConvolutionEffect& m = processor.cast<GrMatrixConvolutionEffect>();
fKernelSize = m.kernelSize();
fConvolveAlpha = m.convolveAlpha();
@@ -160,6 +156,7 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture,
fBias(SkScalarToFloat(bias) / 255.0f),
fConvolveAlpha(convolveAlpha),
fDomain(GrTextureDomain::MakeTexelDomain(texture, bounds), tileMode) {
+ this->initClassID<GrMatrixConvolutionEffect>();
for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) {
fKernel[i] = SkScalarToFloat(kernel[i]);
}
@@ -170,8 +167,13 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture,
GrMatrixConvolutionEffect::~GrMatrixConvolutionEffect() {
}
-const GrBackendFragmentProcessorFactory& GrMatrixConvolutionEffect::getFactory() const {
- return GrTBackendFragmentProcessorFactory<GrMatrixConvolutionEffect>::getInstance();
+void GrMatrixConvolutionEffect::getGLProcessorKey(const GrGLCaps& caps,
+ GrProcessorKeyBuilder* b) const {
+ GrGLMatrixConvolutionEffect::GenKey(*this, caps, b);
+}
+
+GrGLFragmentProcessor* GrMatrixConvolutionEffect::createGLInstance() const {
+ return SkNEW_ARGS(GrGLMatrixConvolutionEffect, (*this));
}
bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
« no previous file with comments | « src/gpu/effects/GrMatrixConvolutionEffect.h ('k') | src/gpu/effects/GrOvalEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698