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

Unified Diff: src/gpu/GrOvalRenderer.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/GrGeometryProcessor.h ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index c6586120a9a902b02dfc4cbc0c0a69c618da690a..f392b909d786f438e1349a2a6e5bffeab4df3b92 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -7,24 +7,20 @@
#include "GrOvalRenderer.h"
-#include "gl/builders/GrGLProgramBuilder.h"
-#include "gl/GrGLProcessor.h"
-#include "gl/GrGLSL.h"
-#include "gl/GrGLGeometryProcessor.h"
#include "GrProcessor.h"
-#include "GrTBackendProcessorFactory.h"
-
#include "GrDrawState.h"
#include "GrDrawTarget.h"
+#include "GrGeometryProcessor.h"
#include "GrGpu.h"
#include "GrInvariantOutput.h"
-
#include "SkRRect.h"
#include "SkStrokeRec.h"
#include "SkTLazy.h"
-
-#include "GrGeometryProcessor.h"
#include "effects/GrRRectEffect.h"
+#include "gl/GrGLProcessor.h"
+#include "gl/GrGLSL.h"
+#include "gl/GrGLGeometryProcessor.h"
+#include "gl/builders/GrGLProgramBuilder.h"
namespace {
// TODO(joshualitt) add per vertex colors
@@ -78,23 +74,16 @@ public:
const GrAttribute* inPosition() const { return fInPosition; }
const GrAttribute* inCircleEdge() const { return fInCircleEdge; }
-
- virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERRIDE {
- return GrTBackendGeometryProcessorFactory<CircleEdgeEffect>::getInstance();
- }
-
virtual ~CircleEdgeEffect() {}
- static const char* Name() { return "CircleEdge"; }
+ virtual const char* name() const SK_OVERRIDE { return "CircleEdge"; }
inline bool isStroked() const { return fStroke; }
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 CircleEdgeEffect& ce = args.fGP.cast<CircleEdgeEffect>();
@@ -140,9 +129,19 @@ 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:
CircleEdgeEffect(bool stroke) {
+ this->initClassID<CircleEdgeEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInCircleEdge = &this->addVertexAttrib(GrAttribute("inCircleEdge",
kVec4f_GrVertexAttribType));
@@ -201,14 +200,9 @@ public:
}
}
- virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERRIDE {
- return GrTBackendGeometryProcessorFactory<EllipseEdgeEffect>::getInstance();
- }
-
virtual ~EllipseEdgeEffect() {}
- static const char* Name() { return "EllipseEdge"; }
-
+ virtual const char* name() const SK_OVERRIDE { return "EllipseEdge"; }
const GrAttribute* inPosition() const { return fInPosition; }
const GrAttribute* inEllipseOffset() const { return fInEllipseOffset; }
@@ -218,10 +212,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 EllipseEdgeEffect& ee = args.fGP.cast<EllipseEdgeEffect>();
@@ -290,8 +282,19 @@ 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:
EllipseEdgeEffect(bool stroke) {
+ this->initClassID<EllipseEdgeEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInEllipseOffset = &this->addVertexAttrib(GrAttribute("inEllipseOffset",
kVec2f_GrVertexAttribType));
@@ -360,13 +363,9 @@ public:
}
}
- virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERRIDE {
- return GrTBackendGeometryProcessorFactory<DIEllipseEdgeEffect>::getInstance();
- }
-
virtual ~DIEllipseEdgeEffect() {}
- static const char* Name() { return "DIEllipseEdge"; }
+ virtual const char* name() const SK_OVERRIDE { return "DIEllipseEdge"; }
const GrAttribute* inPosition() const { return fInPosition; }
const GrAttribute* inEllipseOffsets0() const { return fInEllipseOffsets0; }
@@ -376,10 +375,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 DIEllipseEdgeEffect& ee = args.fGP.cast<DIEllipseEdgeEffect>();
@@ -463,8 +460,19 @@ 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:
DIEllipseEdgeEffect(Mode mode) {
+ this->initClassID<DIEllipseEdgeEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInEllipseOffsets0 = &this->addVertexAttrib(GrAttribute("inEllipseOffsets0",
kVec2f_GrVertexAttribType));
« no previous file with comments | « src/gpu/GrGeometryProcessor.h ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698