| 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 |
| 70 void add(AtlasID id) { | 75 void add(AtlasID id) { |
| 71 int index = GrBatchAtlas::GetIndexFromID(id); | 76 int index = GrBatchAtlas::GetIndexFromID(id); |
| 72 if (!this->find(index)) { | 77 if (!this->find(index)) { |
| 73 this->set(index); | 78 this->set(index); |
| 74 } | 79 } |
| 75 } | 80 } |
| 76 | 81 |
| 77 void reset() { | 82 void reset() { |
| 78 fPlotsToUpdate.reset(); | 83 fPlotsToUpdate.reset(); |
| 79 fPlotAlreadyUpdated = 0; | 84 fPlotAlreadyUpdated = 0; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 }; | 141 }; |
| 137 | 142 |
| 138 SkTDArray<EvictionData> fEvictionCallbacks; | 143 SkTDArray<EvictionData> fEvictionCallbacks; |
| 139 // allocated array of GrBatchPlots | 144 // allocated array of GrBatchPlots |
| 140 SkAutoTUnref<BatchPlot>* fPlotArray; | 145 SkAutoTUnref<BatchPlot>* fPlotArray; |
| 141 // LRU list of GrPlots (MRU at head - LRU at tail) | 146 // LRU list of GrPlots (MRU at head - LRU at tail) |
| 142 GrBatchPlotList fPlotList; | 147 GrBatchPlotList fPlotList; |
| 143 }; | 148 }; |
| 144 | 149 |
| 145 #endif | 150 #endif |
| OLD | NEW |