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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 className::SkInstanceCountHelper::gChildren = NULL; | 116 className::SkInstanceCountHelper::gChildren = NULL; |
117 | 117 |
118 #define SK_DEFINE_INST_COUNT_TEMPLATE(templateInfo, className) \ | 118 #define SK_DEFINE_INST_COUNT_TEMPLATE(templateInfo, className) \ |
119 templateInfo int32_t className::SkInstanceCountHelper::gInstanceCount = 0;\ | 119 templateInfo int32_t className::SkInstanceCountHelper::gInstanceCount = 0;\ |
120 templateInfo bool className::SkInstanceCountHelper::gInited = false; \ | 120 templateInfo bool className::SkInstanceCountHelper::gInited = false; \ |
121 templateInfo \ | 121 templateInfo \ |
122 SkTArray<typename className::SkInstanceCountHelper::PFCheckInstCnt>*\ | 122 SkTArray<typename className::SkInstanceCountHelper::PFCheckInstCnt>*\ |
123 className::SkInstanceCountHelper::gChildren = NULL; | 123 className::SkInstanceCountHelper::gChildren = NULL; |
124 | 124 |
125 #else | 125 #else |
126 #define SK_DECLARE_INST_COUNT(className) | 126 #define SK_DECLARE_INST_COUNT(className) static void AddInstChild() { INHERITED: :AddInstChild(); } |
bsalomon
2013/12/02 15:19:45
nice, should we have a comment explaining why this
| |
127 #define SK_DECLARE_INST_COUNT_TEMPLATE(className) | 127 #define SK_DECLARE_INST_COUNT_TEMPLATE(className) static void AddInstChild() { I NHERITED::AddInstChild(); } |
128 #define SK_DECLARE_INST_COUNT_ROOT(className) | 128 #define SK_DECLARE_INST_COUNT_ROOT(className) static void AddInstChild() { } |
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 |