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() {} |