| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 //////////////////////////////////////////////////////////////////////////////// | 203 //////////////////////////////////////////////////////////////////////////////// |
| 204 | 204 |
| 205 class GrPlotUploader : public GrBatchTarget::Uploader { | 205 class GrPlotUploader : public GrBatchTarget::Uploader { |
| 206 public: | 206 public: |
| 207 GrPlotUploader(BatchPlot* plot) | 207 GrPlotUploader(BatchPlot* plot) |
| 208 : INHERITED(plot->lastUploadToken()) | 208 : INHERITED(plot->lastUploadToken()) |
| 209 , fPlot(SkRef(plot)) { | 209 , fPlot(SkRef(plot)) { |
| 210 SkASSERT(plot); | 210 SkASSERT(plot); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void upload(GrBatchTarget::TextureUploader uploader) SK_OVERRIDE { | 213 void upload(GrBatchTarget::TextureUploader uploader) override { |
| 214 fPlot->uploadToTexture(uploader); | 214 fPlot->uploadToTexture(uploader); |
| 215 } | 215 } |
| 216 | 216 |
| 217 private: | 217 private: |
| 218 SkAutoTUnref<BatchPlot> fPlot; | 218 SkAutoTUnref<BatchPlot> fPlot; |
| 219 | 219 |
| 220 typedef GrBatchTarget::Uploader INHERITED; | 220 typedef GrBatchTarget::Uploader INHERITED; |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 /////////////////////////////////////////////////////////////////////////////// | 223 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 SkASSERT(index < fNumPlotsX * fNumPlotsY); | 360 SkASSERT(index < fNumPlotsX * fNumPlotsY); |
| 361 return fPlotArray[index]->genID() == this->getGenerationFromID(id); | 361 return fPlotArray[index]->genID() == this->getGenerationFromID(id); |
| 362 } | 362 } |
| 363 | 363 |
| 364 void GrBatchAtlas::setLastRefToken(AtlasID id, BatchToken batchToken) { | 364 void GrBatchAtlas::setLastRefToken(AtlasID id, BatchToken batchToken) { |
| 365 SkASSERT(this->hasID(id)); | 365 SkASSERT(this->hasID(id)); |
| 366 int index = this->getIndexFromID(id); | 366 int index = this->getIndexFromID(id); |
| 367 this->makeMRU(fPlotArray[index]); | 367 this->makeMRU(fPlotArray[index]); |
| 368 fPlotArray[index]->setLastRefToken(batchToken); | 368 fPlotArray[index]->setLastRefToken(batchToken); |
| 369 } | 369 } |
| OLD | NEW |