OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrAtlas.h" | 8 #include "GrAtlas.h" |
9 #include "GrGpu.h" | 9 #include "GrGpu.h" |
10 #include "GrLayerCache.h" | 10 #include "GrLayerCache.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID()); | 238 GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID()); |
239 SkASSERT(pictInfo); | 239 SkASSERT(pictInfo); |
240 | 240 |
241 GrAtlas::RemovePlot(&pictInfo->fPlotUsage, layer->plot()); | 241 GrAtlas::RemovePlot(&pictInfo->fPlotUsage, layer->plot()); |
242 | 242 |
243 layer->setPlot(NULL); | 243 layer->setPlot(NULL); |
244 layer->setTexture(NULL, GrIRect16::MakeEmpty()); | 244 layer->setTexture(NULL, GrIRect16::MakeEmpty()); |
245 #endif | 245 #endif |
246 | 246 |
247 } else { | 247 } else { |
| 248 fContext->unlockScratchTexture(layer->texture()); |
248 layer->setTexture(NULL, GrIRect16::MakeEmpty()); | 249 layer->setTexture(NULL, GrIRect16::MakeEmpty()); |
249 } | 250 } |
250 | 251 |
251 layer->setLocked(false); | 252 layer->setLocked(false); |
252 } | 253 } |
253 | 254 |
254 #ifdef SK_DEBUG | 255 #ifdef SK_DEBUG |
255 void GrLayerCache::validate() const { | 256 void GrLayerCache::validate() const { |
256 int plotLocks[kNumPlotsX * kNumPlotsY]; | 257 int plotLocks[kNumPlotsX * kNumPlotsY]; |
257 memset(plotLocks, 0, sizeof(plotLocks)); | 258 memset(plotLocks, 0, sizeof(plotLocks)); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 | 416 |
416 void GrLayerCache::processDeletedPictures() { | 417 void GrLayerCache::processDeletedPictures() { |
417 SkTDArray<GrPictureDeletedMessage> deletedPictures; | 418 SkTDArray<GrPictureDeletedMessage> deletedPictures; |
418 fPictDeletionInbox.poll(&deletedPictures); | 419 fPictDeletionInbox.poll(&deletedPictures); |
419 | 420 |
420 for (int i = 0; i < deletedPictures.count(); i++) { | 421 for (int i = 0; i < deletedPictures.count(); i++) { |
421 this->purge(deletedPictures[i].pictureID); | 422 this->purge(deletedPictures[i].pictureID); |
422 } | 423 } |
423 } | 424 } |
424 | 425 |
OLD | NEW |