| 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" |
| 11 #include "GrRectanizer.h" | 11 #include "GrRectanizer.h" |
| 12 #include "GrTracing.h" | 12 #include "GrTracing.h" |
| 13 #include "GrVertexBuffer.h" |
| 13 | 14 |
| 14 static inline void adjust_for_offset(SkIPoint16* loc, const SkIPoint16& offset)
{ | 15 static inline void adjust_for_offset(SkIPoint16* loc, const SkIPoint16& offset)
{ |
| 15 loc->fX += offset.fX; | 16 loc->fX += offset.fX; |
| 16 loc->fY += offset.fY; | 17 loc->fY += offset.fY; |
| 17 } | 18 } |
| 18 | 19 |
| 19 static GrBatchAtlas::AtlasID create_id(int index, int generation) { | 20 static GrBatchAtlas::AtlasID create_id(int index, int generation) { |
| 20 // Generation ID can roll over because we only check for equality | 21 // Generation ID can roll over because we only check for equality |
| 21 SkASSERT(index < (1 << 16)); | 22 SkASSERT(index < (1 << 16)); |
| 22 return generation << 16 | index; | 23 return generation << 16 | index; |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 366 } |
| 366 | 367 |
| 367 void GrBatchAtlas::setLastUseTokenBulk(const BulkUseTokenUpdater& updater, Batch
Token batchToken) { | 368 void GrBatchAtlas::setLastUseTokenBulk(const BulkUseTokenUpdater& updater, Batch
Token batchToken) { |
| 368 int count = updater.fPlotsToUpdate.count(); | 369 int count = updater.fPlotsToUpdate.count(); |
| 369 for (int i = 0; i < count; i++) { | 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 |