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

Unified Diff: src/gpu/GrOvalRenderer.cpp

Issue 749413003: get rid of static gps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup remove static procs 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/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/effects/GrBezierEffect.h » ('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 f392b909d786f438e1349a2a6e5bffeab4df3b92..4d7912ae6732625dd970a06d98dc031d627e36bc 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -60,16 +60,7 @@ inline bool circle_stays_circle(const SkMatrix& m) {
class CircleEdgeEffect : public GrGeometryProcessor {
public:
static GrGeometryProcessor* Create(bool stroke) {
- GR_CREATE_STATIC_PROCESSOR(gCircleStrokeEdge, CircleEdgeEffect, (true));
- GR_CREATE_STATIC_PROCESSOR(gCircleFillEdge, CircleEdgeEffect, (false));
-
- if (stroke) {
- gCircleStrokeEdge->ref();
- return gCircleStrokeEdge;
- } else {
- gCircleFillEdge->ref();
- return gCircleFillEdge;
- }
+ return SkNEW_ARGS(CircleEdgeEffect, (stroke));
}
const GrAttribute* inPosition() const { return fInPosition; }
@@ -188,16 +179,7 @@ GrGeometryProcessor* CircleEdgeEffect::TestCreate(SkRandom* random,
class EllipseEdgeEffect : public GrGeometryProcessor {
public:
static GrGeometryProcessor* Create(bool stroke) {
- GR_CREATE_STATIC_PROCESSOR(gEllipseStrokeEdge, EllipseEdgeEffect, (true));
- GR_CREATE_STATIC_PROCESSOR(gEllipseFillEdge, EllipseEdgeEffect, (false));
-
- if (stroke) {
- gEllipseStrokeEdge->ref();
- return gEllipseStrokeEdge;
- } else {
- gEllipseFillEdge->ref();
- return gEllipseFillEdge;
- }
+ return SkNEW_ARGS(EllipseEdgeEffect, (stroke));
}
virtual ~EllipseEdgeEffect() {}
@@ -347,20 +329,7 @@ public:
enum Mode { kStroke = 0, kHairline, kFill };
static GrGeometryProcessor* Create(Mode mode) {
- GR_CREATE_STATIC_PROCESSOR(gEllipseStrokeEdge, DIEllipseEdgeEffect, (kStroke));
- GR_CREATE_STATIC_PROCESSOR(gEllipseHairlineEdge, DIEllipseEdgeEffect, (kHairline));
- GR_CREATE_STATIC_PROCESSOR(gEllipseFillEdge, DIEllipseEdgeEffect, (kFill));
-
- if (kStroke == mode) {
- gEllipseStrokeEdge->ref();
- return gEllipseStrokeEdge;
- } else if (kHairline == mode) {
- gEllipseHairlineEdge->ref();
- return gEllipseHairlineEdge;
- } else {
- gEllipseFillEdge->ref();
- return gEllipseFillEdge;
- }
+ return SkNEW_ARGS(DIEllipseEdgeEffect, (mode));
}
virtual ~DIEllipseEdgeEffect() {}
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/effects/GrBezierEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698