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 "GrBatchAtlas.h" | 8 #include "GrBatchAtlas.h" |
9 #include "GrBatchTarget.h" | 9 #include "GrBatchTarget.h" |
10 #include "GrGpu.h" | 10 #include "GrGpu.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 359 |
360 void GrBatchAtlas::setLastUseToken(AtlasID id, BatchToken batchToken) { | 360 void GrBatchAtlas::setLastUseToken(AtlasID id, BatchToken batchToken) { |
361 SkASSERT(this->hasID(id)); | 361 SkASSERT(this->hasID(id)); |
362 int index = GetIndexFromID(id); | 362 int index = GetIndexFromID(id); |
363 SkASSERT(index < fNumPlotsX * fNumPlotsY); | 363 SkASSERT(index < fNumPlotsX * fNumPlotsY); |
364 this->makeMRU(fPlotArray[index]); | 364 this->makeMRU(fPlotArray[index]); |
365 fPlotArray[index]->setLastUseToken(batchToken); | 365 fPlotArray[index]->setLastUseToken(batchToken); |
366 } | 366 } |
367 | 367 |
368 void GrBatchAtlas::setLastUseTokenBulk(const BulkUseTokenUpdater& updater, Batch
Token batchToken) { | 368 void GrBatchAtlas::setLastUseTokenBulk(const BulkUseTokenUpdater& updater, Batch
Token batchToken) { |
369 for (int i = 0; i < updater.fCount; i++) { | 369 int count = updater.fPlotsToUpdate.count(); |
| 370 for (int i = 0; i < count; i++) { |
370 BatchPlot* plot = fPlotArray[updater.fPlotsToUpdate[i]]; | 371 BatchPlot* plot = fPlotArray[updater.fPlotsToUpdate[i]]; |
371 this->makeMRU(plot); | 372 this->makeMRU(plot); |
372 plot->setLastUseToken(batchToken); | 373 plot->setLastUseToken(batchToken); |
373 } | 374 } |
374 } | 375 } |
OLD | NEW |