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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 | 61 |
62 /* | 62 /* |
63 * A class which can be handed back to GrBatchAtlas for updating in bulk las
t use tokens. The | 63 * A class which can be handed back to GrBatchAtlas for updating in bulk las
t use tokens. The |
64 * current max number of plots the GrBatchAtlas can handle is 32, if in the
future this is | 64 * current max number of plots the GrBatchAtlas can handle is 32, if in the
future this is |
65 * insufficient then we can move to a 64 bit int | 65 * insufficient then we can move to a 64 bit int |
66 */ | 66 */ |
67 class BulkUseTokenUpdater { | 67 class BulkUseTokenUpdater { |
68 public: | 68 public: |
69 BulkUseTokenUpdater() : fPlotAlreadyUpdated(0) {} | 69 BulkUseTokenUpdater() : fPlotAlreadyUpdated(0) {} |
70 BulkUseTokenUpdater(const BulkUseTokenUpdater& that) | |
71 : fPlotsToUpdate(that.fPlotsToUpdate) | |
72 , fPlotAlreadyUpdated(that.fPlotAlreadyUpdated) { | |
73 } | |
74 | |
75 void add(AtlasID id) { | 70 void add(AtlasID id) { |
76 int index = GrBatchAtlas::GetIndexFromID(id); | 71 int index = GrBatchAtlas::GetIndexFromID(id); |
77 if (!this->find(index)) { | 72 if (!this->find(index)) { |
78 this->set(index); | 73 this->set(index); |
79 } | 74 } |
80 } | 75 } |
81 | 76 |
82 void reset() { | 77 void reset() { |
83 fPlotsToUpdate.reset(); | 78 fPlotsToUpdate.reset(); |
84 fPlotAlreadyUpdated = 0; | 79 fPlotAlreadyUpdated = 0; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 }; | 136 }; |
142 | 137 |
143 SkTDArray<EvictionData> fEvictionCallbacks; | 138 SkTDArray<EvictionData> fEvictionCallbacks; |
144 // allocated array of GrBatchPlots | 139 // allocated array of GrBatchPlots |
145 SkAutoTUnref<BatchPlot>* fPlotArray; | 140 SkAutoTUnref<BatchPlot>* fPlotArray; |
146 // LRU list of GrPlots (MRU at head - LRU at tail) | 141 // LRU list of GrPlots (MRU at head - LRU at tail) |
147 GrBatchPlotList fPlotList; | 142 GrBatchPlotList fPlotList; |
148 }; | 143 }; |
149 | 144 |
150 #endif | 145 #endif |
OLD | NEW |