| 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 |
| 11 | 11 |
| 12 /* | 12 /* |
| 13 * The instance counting system consists of three macros that create the | 13 * The instance counting system consists of three macros that create the |
| 14 * instance counting machinery. A class is added to the system by adding: | 14 * instance counting machinery. A class is added to the system by adding: |
| 15 * SK_DECLARE_INST_COUNT at the top of its declaration for derived classes | 15 * SK_DECLARE_INST_COUNT at the top of its declaration for derived classes |
| 16 * SK_DECLARE_INST_COUNT_ROOT at the top of its declaration for a root class | 16 * SK_DECLARE_INST_COUNT_ROOT at the top of its declaration for a root class |
| 17 * SK_DEFINE_INST_COUNT at the top of its .cpp file (for both kinds). | 17 * SK_DEFINE_INST_COUNT at the top of its .cpp file (for both kinds). |
| 18 * At the end of an application a call to all the "root" objects' | 18 * At the end of an application a call to all the "root" objects' |
| 19 * CheckInstanceCount methods should be made | 19 * CheckInstanceCount methods should be made |
| 20 */ | 20 */ |
| 21 #include "SkTypes.h" | 21 #include "SkTypes.h" |
| 22 | 22 |
| 23 #if SK_ENABLE_INST_COUNT | 23 #if SK_ENABLE_INST_COUNT |
| 24 #include "SkTArray.h" | 24 #include "SkTArray.h" |
| 25 #include "SkThread_platform.h" | 25 #include "SkThread.h" |
| 26 | 26 |
| 27 extern bool gPrintInstCount; | 27 extern bool gPrintInstCount; |
| 28 | 28 |
| 29 // The non-root classes just register themselves with their parent | 29 // The non-root classes just register themselves with their parent |
| 30 #define SK_DECLARE_INST_COUNT(className) \ | 30 #define SK_DECLARE_INST_COUNT(className) \ |
| 31 SK_DECLARE_INST_COUNT_INTERNAL(className, \ | 31 SK_DECLARE_INST_COUNT_INTERNAL(className, \ |
| 32 INHERITED::AddInstChild(CheckInstanceCount);,\ | 32 INHERITED::AddInstChild(CheckInstanceCount);,\ |
| 33 /**/) | 33 /**/) |
| 34 | 34 |
| 35 #define SK_DECLARE_INST_COUNT_TEMPLATE(className) \ | 35 #define SK_DECLARE_INST_COUNT_TEMPLATE(className) \ |
| (...skipping 88 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 |