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

Unified Diff: src/gpu/GrOvalRenderer.cpp

Issue 14081016: Remove static effects from the effect memory pool. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months 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
« include/gpu/GrEffect.h ('K') | « src/gpu/GrAARectRenderer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
===================================================================
--- src/gpu/GrOvalRenderer.cpp (revision 8808)
+++ src/gpu/GrOvalRenderer.cpp (working copy)
@@ -51,18 +51,15 @@
class CircleEdgeEffect : public GrEffect {
public:
static GrEffectRef* Create(bool stroke) {
- // we go through this so we only have one copy of each effect (stroked/filled)
- static SkAutoTUnref<GrEffectRef> gCircleStrokeEdgeEffectRef(
- CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(CircleEdgeEffect, (true)))));
- static SkAutoTUnref<GrEffectRef> gCircleFillEdgeEffectRef(
- CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(CircleEdgeEffect, (false)))));
+ GR_CREATE_STATIC_EFFECT(gCircleStrokeEdge, CircleEdgeEffect, (true));
+ GR_CREATE_STATIC_EFFECT(gCircleFillEdge, CircleEdgeEffect, (false));
if (stroke) {
- gCircleStrokeEdgeEffectRef.get()->ref();
- return gCircleStrokeEdgeEffectRef;
+ gCircleStrokeEdge->ref();
+ return gCircleStrokeEdge;
} else {
- gCircleFillEdgeEffectRef.get()->ref();
- return gCircleFillEdgeEffectRef;
+ gCircleFillEdge->ref();
+ return gCircleFillEdge;
}
}
@@ -162,18 +159,15 @@
class EllipseEdgeEffect : public GrEffect {
public:
static GrEffectRef* Create(bool stroke) {
- // we go through this so we only have one copy of each effect (stroked/filled)
- static SkAutoTUnref<GrEffectRef> gEllipseStrokeEdgeEffectRef(
- CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(EllipseEdgeEffect, (true)))));
- static SkAutoTUnref<GrEffectRef> gEllipseFillEdgeEffectRef(
- CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(EllipseEdgeEffect, (false)))));
+ GR_CREATE_STATIC_EFFECT(gEllipseStrokeEdge, EllipseEdgeEffect, (true));
+ GR_CREATE_STATIC_EFFECT(gEllipseFillEdge, EllipseEdgeEffect, (false));
if (stroke) {
- gEllipseStrokeEdgeEffectRef.get()->ref();
- return gEllipseStrokeEdgeEffectRef;
+ gEllipseStrokeEdge->ref();
+ return gEllipseStrokeEdge;
} else {
- gEllipseFillEdgeEffectRef.get()->ref();
- return gEllipseFillEdgeEffectRef;
+ gEllipseFillEdge->ref();
+ return gEllipseFillEdge;
}
}
« include/gpu/GrEffect.h ('K') | « src/gpu/GrAARectRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698