aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAAHairLinePathRenderer.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-02 20:48:38 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-02 20:48:38 +0000
commit5d01bec07a0740b30e4ebc51eec9057009a09bc2 (patch)
tree3638ec56aca69591ce83c2385c5640a9f2fecd07 /src/gpu/GrAAHairLinePathRenderer.cpp
parent00aae979fac24e223b7110cace06f2735071a5e0 (diff)
Fix for effect cache key.
Adds the additional shift needed to incorporate the attribKeyBits. Also simplifies the creation of the static globals for the edge effects. Author: jvanverth@google.com Reviewed By: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/13465019 git-svn-id: http://skia.googlecode.com/svn/trunk@8498 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrAAHairLinePathRenderer.cpp')
-rw-r--r--src/gpu/GrAAHairLinePathRenderer.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index fdb6009857..08a4111a24 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -509,11 +509,10 @@ public:
static GrEffectRef* Create() {
// we go through this so we only have one copy of each effect
- static GrEffectRef* gHairQuadEdgeEffectRef =
- CreateEffectRef(AutoEffectUnref(SkNEW(HairQuadEdgeEffect)));
- static SkAutoTUnref<GrEffectRef> gUnref(gHairQuadEdgeEffectRef);
-
- gHairQuadEdgeEffectRef->ref();
+ static SkAutoTUnref<GrEffectRef> gHairQuadEdgeEffectRef(
+ CreateEffectRef(AutoEffectUnref(SkNEW(HairQuadEdgeEffect))));
+
+ gHairQuadEdgeEffectRef.get()->ref();
return gHairQuadEdgeEffectRef;
}
@@ -611,11 +610,10 @@ public:
static GrEffectRef* Create() {
// we go through this so we only have one copy of each effect
- static GrEffectRef* gHairLineEdgeEffectRef =
- CreateEffectRef(AutoEffectUnref(SkNEW(HairLineEdgeEffect)));
- static SkAutoTUnref<GrEffectRef> gUnref(gHairLineEdgeEffectRef);
-
- gHairLineEdgeEffectRef->ref();
+ static SkAutoTUnref<GrEffectRef> gHairLineEdgeEffectRef(
+ CreateEffectRef(AutoEffectUnref(SkNEW(HairLineEdgeEffect))));
+
+ gHairLineEdgeEffectRef.get()->ref();
return gHairLineEdgeEffectRef;
}