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

Unified Diff: src/gpu/GrDefaultGeoProcFactory.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/GrAARectRenderer.cpp ('k') | src/gpu/GrGeometryProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultGeoProcFactory.cpp
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp
index ddaa809f067bbcd07fcd14fe7362f80a43583638..0df519dd8f7450e662ec63af903a94fb28e1bfc8 100644
--- a/src/gpu/GrDefaultGeoProcFactory.cpp
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp
@@ -9,7 +9,6 @@
#include "GrDrawState.h"
#include "GrInvariantOutput.h"
-#include "GrTBackendProcessorFactory.h"
#include "gl/GrGLGeometryProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
@@ -62,11 +61,7 @@ public:
}
}
- static const char* Name() { return "DefaultGeometryProcessor"; }
-
- virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERRIDE {
- return GrTBackendGeometryProcessorFactory<DefaultGeoProc>::getInstance();
- }
+ virtual const char* name() const SK_OVERRIDE { return "DefaultGeometryProcessor"; }
const GrAttribute* inPosition() const { return fInPosition; }
const GrAttribute* inColor() const { return fInColor; }
@@ -75,10 +70,8 @@ public:
class GLProcessor : public GrGLGeometryProcessor {
public:
- GLProcessor(const GrBackendProcessorFactory& factory,
- const GrGeometryProcessor&,
- const GrBatchTracker&)
- : INHERITED (factory) {}
+ GLProcessor(const GrGeometryProcessor&,
+ const GrBatchTracker&) {}
virtual void emitCode(const EmitArgs& args) SK_OVERRIDE {
const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>();
@@ -127,6 +120,16 @@ public:
typedef GrGLGeometryProcessor INHERITED;
};
+ virtual void getGLProcessorKey(const GrBatchTracker& bt,
+ const GrGLCaps& caps,
+ GrProcessorKeyBuilder* b) const SK_OVERRIDE {
+ GLProcessor::GenKey(*this, bt, caps, b);
+ }
+
+ virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_OVERRIDE {
+ return SkNEW_ARGS(GLProcessor, (*this, bt));
+ }
+
private:
DefaultGeoProc(uint32_t gpTypeFlags)
: fInPosition(NULL)
@@ -134,6 +137,7 @@ private:
, fInLocalCoords(NULL)
, fInCoverage(NULL)
, fFlags(gpTypeFlags) {
+ this->initClassID<DefaultGeoProc>();
bool hasColor = SkToBool(gpTypeFlags & GrDefaultGeoProcFactory::kColor_GPType);
bool hasLocalCoord = SkToBool(gpTypeFlags & GrDefaultGeoProcFactory::kLocalCoord_GPType);
bool hasCoverage = SkToBool(gpTypeFlags & GrDefaultGeoProcFactory::kCoverage_GPType);
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrGeometryProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698