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

Unified Diff: src/effects/SkLumaColorFilter.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/SkLightingImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLumaColorFilter.cpp
diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp
index 9ad5797f352cc0d5b625d03cdb4edd705c41230e..47cc8f135f7f55c3cf2584e7014c68cd51c52d80 100644
--- a/src/effects/SkLumaColorFilter.cpp
+++ b/src/effects/SkLumaColorFilter.cpp
@@ -11,11 +11,10 @@
#include "SkString.h"
#if SK_SUPPORT_GPU
-#include "gl/GrGLProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
#include "GrContext.h"
#include "GrInvariantOutput.h"
-#include "GrTBackendProcessorFactory.h"
+#include "gl/GrGLProcessor.h"
+#include "gl/builders/GrGLProgramBuilder.h"
#endif
void SkLumaColorFilter::filterSpan(const SkPMColor src[], int count,
@@ -64,18 +63,20 @@ public:
return SkRef(gLumaEffect);
}
- static const char* Name() { return "Luminance-to-Alpha"; }
+ virtual const char* name() const SK_OVERRIDE { return "Luminance-to-Alpha"; }
- virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE {
- return GrTBackendFragmentProcessorFactory<LumaColorFilterEffect>::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));
}
class GLProcessor : public GrGLFragmentProcessor {
public:
- GLProcessor(const GrBackendProcessorFactory& factory,
- const GrProcessor&)
- : INHERITED(factory) {
- }
+ GLProcessor(const GrProcessor&) {}
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder* b) {}
@@ -105,6 +106,10 @@ public:
};
private:
+ LumaColorFilterEffect() {
+ this->initClassID<LumaColorFilterEffect>();
+ }
+
virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { return true; }
virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE {
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698