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

Unified Diff: src/effects/SkColorMatrixFilter.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/SkColorFilters.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorMatrixFilter.cpp
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 27231b1466312402ae4930f34db39ed7ed85a79f..c4976559268b4a78c379552bdd5b5fc162f02072 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -325,7 +325,6 @@ bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) const {
#if SK_SUPPORT_GPU
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
-#include "GrTBackendProcessorFactory.h"
#include "gl/GrGLProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
@@ -335,12 +334,18 @@ public:
return SkNEW_ARGS(ColorMatrixEffect, (matrix));
}
- static const char* Name() { return "Color Matrix"; }
+ virtual const char* name() const SK_OVERRIDE { return "Color Matrix"; }
- virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE {
- return GrTBackendFragmentProcessorFactory<ColorMatrixEffect>::getInstance();
+ virtual void getGLProcessorKey(const GrGLCaps& caps,
+ GrProcessorKeyBuilder* b) const SK_OVERRIDE {
+ GLProcessor::GenKey(*this, caps, b);
}
+ virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE {
+ return SkNEW_ARGS(GLProcessor, (*this));
+ }
+
+
GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
class GLProcessor : public GrGLFragmentProcessor {
@@ -348,10 +353,7 @@ public:
// this class always generates the same code.
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder* b) {}
- GLProcessor(const GrBackendProcessorFactory& factory,
- const GrProcessor&)
- : INHERITED(factory) {
- }
+ GLProcessor(const GrProcessor&) {}
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
@@ -410,7 +412,9 @@ public:
};
private:
- ColorMatrixEffect(const SkColorMatrix& matrix) : fMatrix(matrix) {}
+ ColorMatrixEffect(const SkColorMatrix& matrix) : fMatrix(matrix) {
+ this->initClassID<ColorMatrixEffect>();
+ }
virtual bool onIsEqual(const GrFragmentProcessor& s) const {
const ColorMatrixEffect& cme = s.cast<ColorMatrixEffect>();
« no previous file with comments | « src/effects/SkColorFilters.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698