aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkLumaColorFilter.cpp
diff options
context:
space:
mode:
authorGravatar mdempsky <mdempsky@chromium.org>2015-08-27 12:57:01 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-27 12:57:01 -0700
commit38f1f6f9e590fc20b81015ceca9d642cbe02a2d9 (patch)
treecbcb747c29596ed5202c1745b568fdd7d97776d7 /src/effects/SkLumaColorFilter.cpp
parent6904d1d3f1a2903fcaa4c4bd17b07d5f10af2e8e (diff)
Remove overly complicated GR_CREATE_STATIC_PROCESSOR macro
This macro was responsible for producing code like: static SkAlignedStorage<sizeof(Foo)> g_gFoo_Storage; static Foo* gFoo = new(g_gFoo_Storage.get()) Foo; static SkAutoTDestroy<Foo> gFoo_ad(gFoo); which would allocate static storage for an object of type Foo (g_gFoo_Storage), lazily instantiate the object in that memory (via gFoo's initializer), and then ensure that at global destruction time the object is destroyed (via gFoo_Ad's destructor). However, the exact same effect is achieved by just writing: static Foo gFoo; Review URL: https://codereview.chromium.org/1314763009
Diffstat (limited to 'src/effects/SkLumaColorFilter.cpp')
-rw-r--r--src/effects/SkLumaColorFilter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp
index 21f7c0528d..e161d170b2 100644
--- a/src/effects/SkLumaColorFilter.cpp
+++ b/src/effects/SkLumaColorFilter.cpp
@@ -55,8 +55,8 @@ void SkLumaColorFilter::toString(SkString* str) const {
class LumaColorFilterEffect : public GrFragmentProcessor {
public:
static GrFragmentProcessor* Create() {
- GR_CREATE_STATIC_PROCESSOR(gLumaEffect, LumaColorFilterEffect, ());
- return SkRef(gLumaEffect);
+ static LumaColorFilterEffect gLumaEffect;
+ return SkRef(&gLumaEffect);
}
const char* name() const override { return "Luminance-to-Alpha"; }