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 11 matching lines...) Expand all Loading... |
22 #if SK_ENABLE_INST_COUNT | 22 #if SK_ENABLE_INST_COUNT |
23 // Static variables inside member functions below may be defined multiple times | 23 // Static variables inside member functions below may be defined multiple times |
24 // if Skia is being used as a dynamic library. Instance counting should be on | 24 // if Skia is being used as a dynamic library. Instance counting should be on |
25 // only for static builds. See bug skia:2058. | 25 // only for static builds. See bug skia:2058. |
26 #if defined(SKIA_DLL) | 26 #if defined(SKIA_DLL) |
27 #error Instance counting works only when Skia is built as a static library. | 27 #error Instance counting works only when Skia is built as a static library. |
28 #endif | 28 #endif |
29 | 29 |
30 #include "SkOnce.h" | 30 #include "SkOnce.h" |
31 #include "SkTArray.h" | 31 #include "SkTArray.h" |
32 #include "../../src/core/SkThread.h" | 32 #include "SkThread.h" |
33 extern bool gPrintInstCount; | 33 extern bool gPrintInstCount; |
34 | 34 |
35 // The non-root classes just register themselves with their parent | 35 // The non-root classes just register themselves with their parent |
36 #define SK_DECLARE_INST_COUNT(className) \ | 36 #define SK_DECLARE_INST_COUNT(className) \ |
37 SK_DECLARE_INST_COUNT_INTERNAL(className, \ | 37 SK_DECLARE_INST_COUNT_INTERNAL(className, \ |
38 INHERITED::AddInstChild(CheckInstanceCount);) | 38 INHERITED::AddInstChild(CheckInstanceCount);) |
39 | 39 |
40 // The root classes registers a function to print out the memory stats when | 40 // The root classes registers a function to print out the memory stats when |
41 // the app ends | 41 // the app ends |
42 #define SK_DECLARE_INST_COUNT_ROOT(className) \ | 42 #define SK_DECLARE_INST_COUNT_ROOT(className) \ |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 #define SK_DECLARE_INST_COUNT(className) static void AddInstChild() { INHERITED:
:AddInstChild(); } | 133 #define SK_DECLARE_INST_COUNT(className) static void AddInstChild() { INHERITED:
:AddInstChild(); } |
134 #define SK_DECLARE_INST_COUNT_ROOT(className) static void AddInstChild() { } | 134 #define SK_DECLARE_INST_COUNT_ROOT(className) static void AddInstChild() { } |
135 #endif | 135 #endif |
136 | 136 |
137 // Following are deprecated. They are defined only for backwards API compatibili
ty. | 137 // Following are deprecated. They are defined only for backwards API compatibili
ty. |
138 #define SK_DECLARE_INST_COUNT_TEMPLATE(className) SK_DECLARE_INST_COUNT(classNam
e) | 138 #define SK_DECLARE_INST_COUNT_TEMPLATE(className) SK_DECLARE_INST_COUNT(classNam
e) |
139 #define SK_DEFINE_INST_COUNT(className) | 139 #define SK_DEFINE_INST_COUNT(className) |
140 #define SK_DEFINE_INST_COUNT_TEMPLATE(templateInfo, className) | 140 #define SK_DEFINE_INST_COUNT_TEMPLATE(templateInfo, className) |
141 | 141 |
142 #endif // SkInstCnt_DEFINED | 142 #endif // SkInstCnt_DEFINED |
OLD | NEW |