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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 , fAtlas(NULL) | 140 , fAtlas(NULL) |
141 , fBytesPerPixel(1) | 141 , fBytesPerPixel(1) |
142 #ifdef SK_DEBUG | 142 #ifdef SK_DEBUG |
143 , fDirty(false) | 143 , fDirty(false) |
144 #endif | 144 #endif |
145 { | 145 { |
146 fOffset.set(0, 0); | 146 fOffset.set(0, 0); |
147 } | 147 } |
148 | 148 |
149 ~BatchPlot() { | 149 ~BatchPlot() { |
150 SkDELETE_ARRAY(fData); | 150 sk_free(fData); |
151 fData = NULL; | 151 fData = NULL; |
152 delete fRects; | 152 delete fRects; |
153 } | 153 } |
154 | 154 |
155 void init(GrBatchAtlas* atlas, GrTexture* texture, int index, uint32_t gener
ation, | 155 void init(GrBatchAtlas* atlas, GrTexture* texture, int index, uint32_t gener
ation, |
156 int offX, int offY, int width, int height, size_t bpp) { | 156 int offX, int offY, int width, int height, size_t bpp) { |
157 fIndex = index; | 157 fIndex = index; |
158 fGenID = generation; | 158 fGenID = generation; |
159 fID = create_id(index, generation); | 159 fID = create_id(index, generation); |
160 fWidth = width; | 160 fWidth = width; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 } | 365 } |
366 | 366 |
367 void GrBatchAtlas::setLastUseTokenBulk(const BulkUseTokenUpdater& updater, Batch
Token batchToken) { | 367 void GrBatchAtlas::setLastUseTokenBulk(const BulkUseTokenUpdater& updater, Batch
Token batchToken) { |
368 int count = updater.fPlotsToUpdate.count(); | 368 int count = updater.fPlotsToUpdate.count(); |
369 for (int i = 0; i < count; i++) { | 369 for (int i = 0; i < count; i++) { |
370 BatchPlot* plot = fPlotArray[updater.fPlotsToUpdate[i]]; | 370 BatchPlot* plot = fPlotArray[updater.fPlotsToUpdate[i]]; |
371 this->makeMRU(plot); | 371 this->makeMRU(plot); |
372 plot->setLastUseToken(batchToken); | 372 plot->setLastUseToken(batchToken); |
373 } | 373 } |
374 } | 374 } |
OLD | NEW |