From 38f1f6f9e590fc20b81015ceca9d642cbe02a2d9 Mon Sep 17 00:00:00 2001 From: mdempsky Date: Thu, 27 Aug 2015 12:57:01 -0700 Subject: Remove overly complicated GR_CREATE_STATIC_PROCESSOR macro This macro was responsible for producing code like: static SkAlignedStorage g_gFoo_Storage; static Foo* gFoo = new(g_gFoo_Storage.get()) Foo; static SkAutoTDestroy 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 --- include/gpu/GrProcessor.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'include/gpu/GrProcessor.h') diff --git a/include/gpu/GrProcessor.h b/include/gpu/GrProcessor.h index c1f4aa0256..7c24f549f0 100644 --- a/include/gpu/GrProcessor.h +++ b/include/gpu/GrProcessor.h @@ -52,8 +52,7 @@ private: immutable: after being constructed, their fields may not change. Dynamically allocated GrProcessors are managed by a per-thread memory pool. The ref count of an - processor must reach 0 before the thread terminates and the pool is destroyed. To create a - static processor use the helper macro GR_CREATE_STATIC_PROCESSOR declared below. + processor must reach 0 before the thread terminates and the pool is destroyed. */ class GrProcessor : public GrProgramElement { public: @@ -143,13 +142,4 @@ private: typedef GrProgramElement INHERITED; }; -/** - * This creates a processor outside of the memory pool. The processor's destructor will be called - * at global destruction time. NAME will be the name of the created instance. - */ -#define GR_CREATE_STATIC_PROCESSOR(NAME, PROC_CLASS, ARGS) \ -static SkAlignedSStorage g_##NAME##_Storage; \ -static PROC_CLASS* NAME SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), PROC_CLASS, ARGS); \ -static SkAutoTDestroy NAME##_ad(NAME); - #endif -- cgit v1.2.3