OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrBatch.h" | 8 #include "GrBatch.h" |
9 | 9 |
10 #include "GrMemoryPool.h" | 10 #include "GrMemoryPool.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 GrBATCH_SPEW(int32_t GrBatch::gCurrBatchUniqueID = GrBatch::kIllegalBatchID;) | 39 GrBATCH_SPEW(int32_t GrBatch::gCurrBatchUniqueID = GrBatch::kIllegalBatchID;) |
40 | 40 |
41 void* GrBatch::operator new(size_t size) { | 41 void* GrBatch::operator new(size_t size) { |
42 return MemoryPoolAccessor().pool()->allocate(size); | 42 return MemoryPoolAccessor().pool()->allocate(size); |
43 } | 43 } |
44 | 44 |
45 void GrBatch::operator delete(void* target) { | 45 void GrBatch::operator delete(void* target) { |
46 return MemoryPoolAccessor().pool()->release(target); | 46 return MemoryPoolAccessor().pool()->release(target); |
47 } | 47 } |
48 | 48 |
49 GrBatch::GrBatch(uint32_t classID) | 49 GrBatch::GrBatch() |
50 : fClassID(classID) | 50 : fClassID(kIllegalBatchID) |
51 #if GR_BATCH_SPEW | 51 #if GR_BATCH_SPEW |
52 , fUniqueID(GenBatchID()) | 52 , fUniqueID(GenID(&gCurrBatchUniqueID)) |
53 #endif | 53 #endif |
54 { | 54 { |
55 SkDEBUGCODE(fUsed = false;) | 55 SkDEBUGCODE(fUsed = false;) |
56 } | 56 } |
57 | 57 |
58 GrBatch::~GrBatch() {} | 58 GrBatch::~GrBatch() {} |
OLD | NEW |