OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 #ifndef SkUtils_DEFINED | 8 #ifndef SkUtils_DEFINED |
9 #define SkUtils_DEFINED | 9 #define SkUtils_DEFINED |
10 | 10 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 SkAutoTrace(const char label[]) : fLabel(label) { | 107 SkAutoTrace(const char label[]) : fLabel(label) { |
108 SkDebugf("--- trace: %s Enter\n", fLabel); | 108 SkDebugf("--- trace: %s Enter\n", fLabel); |
109 } | 109 } |
110 ~SkAutoTrace() { | 110 ~SkAutoTrace() { |
111 SkDebugf("--- trace: %s Leave\n", fLabel); | 111 SkDebugf("--- trace: %s Leave\n", fLabel); |
112 } | 112 } |
113 private: | 113 private: |
114 const char* fLabel; | 114 const char* fLabel; |
115 }; | 115 }; |
116 | 116 |
117 /////////////////////////////////////////////////////////////////////////////// | |
118 | |
119 class SkAutoMemoryUsageProbe { | |
120 public: | |
121 /** Record memory usage in constructor, and dump the result | |
122 (delta and current total) in the destructor, with the optional | |
123 label. NOTE: label contents are not copied, just the ptr is | |
124 retained, so DON'T DELETE IT. | |
125 */ | |
126 SkAutoMemoryUsageProbe(const char label[]); | |
127 ~SkAutoMemoryUsageProbe(); | |
128 private: | |
129 const char* fLabel; | |
130 size_t fBytesAllocated; | |
131 }; | |
132 | |
133 #endif | 117 #endif |
OLD | NEW |