OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "Test.h" | 8 #include "Test.h" |
9 // This is a GPU-backend specific test | 9 // This is a GPU-backend specific test |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 26 matching lines...) Expand all Loading... |
37 } | 37 } |
38 | 38 |
39 void operator delete(void* p) { | 39 void operator delete(void* p) { |
40 if (!gPool.get()) { | 40 if (!gPool.get()) { |
41 ::operator delete(p); | 41 ::operator delete(p); |
42 } else { | 42 } else { |
43 return gPool->release(p); | 43 return gPool->release(p); |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 SK_DECLARE_INST_COUNT_ROOT(A); | 47 SK_DECLARE_INST_COUNT(A); |
48 | 48 |
49 static A* Create(SkRandom* r); | 49 static A* Create(SkRandom* r); |
50 | 50 |
51 static void SetAllocator(size_t preallocSize, size_t minAllocSize) { | 51 static void SetAllocator(size_t preallocSize, size_t minAllocSize) { |
52 #if SK_ENABLE_INST_COUNT | 52 #if SK_ENABLE_INST_COUNT |
53 SkASSERT(0 == GetInstanceCount()); | 53 SkASSERT(0 == GetInstanceCount()); |
54 #endif | 54 #endif |
55 GrMemoryPool* pool = new GrMemoryPool(preallocSize, minAllocSize); | 55 GrMemoryPool* pool = new GrMemoryPool(preallocSize, minAllocSize); |
56 gPool.reset(pool); | 56 gPool.reset(pool); |
57 } | 57 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 delete rec.fInstance; | 233 delete rec.fInstance; |
234 } | 234 } |
235 #if SK_ENABLE_INST_COUNT | 235 #if SK_ENABLE_INST_COUNT |
236 REPORTER_ASSERT(reporter, !A::GetInstanceCount()); | 236 REPORTER_ASSERT(reporter, !A::GetInstanceCount()); |
237 #endif | 237 #endif |
238 } | 238 } |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 #endif | 242 #endif |
OLD | NEW |