Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: src/gpu/batches/GrBatch.cpp

Issue 1772023003: Lazy init batch unique ID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 18 matching lines...) Expand all
29 29
30 GrMemoryPool* pool() const { 30 GrMemoryPool* pool() const {
31 static GrMemoryPool gPool(16384, 16384); 31 static GrMemoryPool gPool(16384, 16384);
32 return &gPool; 32 return &gPool;
33 } 33 }
34 }; 34 };
35 } 35 }
36 36
37 int32_t GrBatch::gCurrBatchClassID = GrBatch::kIllegalBatchID; 37 int32_t GrBatch::gCurrBatchClassID = GrBatch::kIllegalBatchID;
38 38
39 GrBATCH_SPEW(int32_t GrBatch::gCurrBatchUniqueID = GrBatch::kIllegalBatchID;) 39 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(uint32_t classID)
50 : fClassID(classID) 50 : fClassID(classID)
51 #if GR_BATCH_SPEW 51 , fUniqueID(kIllegalBatchID) {
52 , fUniqueID(GenBatchID())
53 #endif
54 {
55 SkDEBUGCODE(fUsed = false;) 52 SkDEBUGCODE(fUsed = false;)
56 } 53 }
57 54
58 GrBatch::~GrBatch() {} 55 GrBatch::~GrBatch() {}
OLDNEW
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698