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 #ifndef GrBatchAtlas_DEFINED | 8 #ifndef GrBatchAtlas_DEFINED |
9 #define GrBatchAtlas_DEFINED | 9 #define GrBatchAtlas_DEFINED |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } else { | 95 } else { |
96 // This case will almost never happen | 96 // This case will almost never happen |
97 fAllocated = fCount << 1; | 97 fAllocated = fCount << 1; |
98 fPlotsToUpdate.realloc(fAllocated); | 98 fPlotsToUpdate.realloc(fAllocated); |
99 fPlotsToUpdate[fCount++] = index; | 99 fPlotsToUpdate[fCount++] = index; |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 static const int kMinItems = 4; | 103 static const int kMinItems = 4; |
104 static const int kMaxPlots = 32; | 104 static const int kMaxPlots = 32; |
| 105 SkAutoSTMalloc<kMinItems, int> fPlotsToUpdate; |
105 uint32_t fPlotAlreadyUpdated; | 106 uint32_t fPlotAlreadyUpdated; |
106 SkAutoSTMalloc<kMinItems, int> fPlotsToUpdate; | |
107 int fCount; | 107 int fCount; |
108 int fAllocated; | 108 int fAllocated; |
109 | 109 |
110 friend class GrBatchAtlas; | 110 friend class GrBatchAtlas; |
111 }; | 111 }; |
112 | 112 |
113 void setLastUseTokenBulk(const BulkUseTokenUpdater& reffer, BatchToken); | 113 void setLastUseTokenBulk(const BulkUseTokenUpdater& reffer, BatchToken); |
114 | 114 |
115 private: | 115 private: |
116 static int GetIndexFromID(AtlasID id) { | 116 static int GetIndexFromID(AtlasID id) { |
(...skipping 24 matching lines...) Expand all Loading... |
141 }; | 141 }; |
142 | 142 |
143 SkTDArray<EvictionData> fEvictionCallbacks; | 143 SkTDArray<EvictionData> fEvictionCallbacks; |
144 // allocated array of GrBatchPlots | 144 // allocated array of GrBatchPlots |
145 SkAutoTUnref<BatchPlot>* fPlotArray; | 145 SkAutoTUnref<BatchPlot>* fPlotArray; |
146 // LRU list of GrPlots (MRU at head - LRU at tail) | 146 // LRU list of GrPlots (MRU at head - LRU at tail) |
147 GrBatchPlotList fPlotList; | 147 GrBatchPlotList fPlotList; |
148 }; | 148 }; |
149 | 149 |
150 #endif | 150 #endif |
OLD | NEW |