| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 | 8 |
| 9 #ifndef SkInstCnt_DEFINED | 9 #ifndef SkInstCnt_DEFINED |
| 10 #define SkInstCnt_DEFINED | 10 #define SkInstCnt_DEFINED |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 typedef int (*PFCheckInstCnt)(int level, bool cleanUp); \ | 48 typedef int (*PFCheckInstCnt)(int level, bool cleanUp); \ |
| 49 SkInstanceCountHelper() { \ | 49 SkInstanceCountHelper() { \ |
| 50 if (!gInited) { \ | 50 if (!gInited) { \ |
| 51 initStep \ | 51 initStep \ |
| 52 gChildren = new SkTArray<PFCheckInstCnt>; \ | 52 gChildren = new SkTArray<PFCheckInstCnt>; \ |
| 53 gInited = true; \ | 53 gInited = true; \ |
| 54 } \ | 54 } \ |
| 55 sk_atomic_inc(&gInstanceCount); \ | 55 sk_atomic_inc(&gInstanceCount); \ |
| 56 } \ | 56 } \ |
| 57 \ | 57 \ |
| 58 SkInstanceCountHelper(const SkInstanceCountHelper& other) { \ | 58 SkInstanceCountHelper(const SkInstanceCountHelper&) { \ |
| 59 sk_atomic_inc(&gInstanceCount); \ | 59 sk_atomic_inc(&gInstanceCount); \ |
| 60 } \ | 60 } \ |
| 61 \ | 61 \ |
| 62 ~SkInstanceCountHelper() { \ | 62 ~SkInstanceCountHelper() { \ |
| 63 sk_atomic_dec(&gInstanceCount); \ | 63 sk_atomic_dec(&gInstanceCount); \ |
| 64 } \ | 64 } \ |
| 65 \ | 65 \ |
| 66 static int32_t gInstanceCount; \ | 66 static int32_t gInstanceCount; \ |
| 67 static bool gInited; \ | 67 static bool gInited; \ |
| 68 static SkTArray<PFCheckInstCnt>* gChildren; \ | 68 static SkTArray<PFCheckInstCnt>* gChildren; \ |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 #else | 125 #else |
| 126 #define SK_DECLARE_INST_COUNT(className) | 126 #define SK_DECLARE_INST_COUNT(className) |
| 127 #define SK_DECLARE_INST_COUNT_TEMPLATE(className) | 127 #define SK_DECLARE_INST_COUNT_TEMPLATE(className) |
| 128 #define SK_DECLARE_INST_COUNT_ROOT(className) | 128 #define SK_DECLARE_INST_COUNT_ROOT(className) |
| 129 #define SK_DEFINE_INST_COUNT(className) | 129 #define SK_DEFINE_INST_COUNT(className) |
| 130 #define SK_DEFINE_INST_COUNT_TEMPLATE(templateInfo, className) | 130 #define SK_DEFINE_INST_COUNT_TEMPLATE(templateInfo, className) |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 #endif // SkInstCnt_DEFINED | 133 #endif // SkInstCnt_DEFINED |
| OLD | NEW |