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()); | |
249 layer->setTexture(NULL, GrIRect16::MakeEmpty()); | 248 layer->setTexture(NULL, GrIRect16::MakeEmpty()); |
250 } | 249 } |
251 | 250 |
252 layer->setLocked(false); | 251 layer->setLocked(false); |
253 } | 252 } |
254 | 253 |
255 #ifdef SK_DEBUG | 254 #ifdef SK_DEBUG |
256 void GrLayerCache::validate() const { | 255 void GrLayerCache::validate() const { |
257 int plotLocks[kNumPlotsX * kNumPlotsY]; | 256 int plotLocks[kNumPlotsX * kNumPlotsY]; |
258 memset(plotLocks, 0, sizeof(plotLocks)); | 257 memset(plotLocks, 0, sizeof(plotLocks)); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 417 |
419 void GrLayerCache::processDeletedPictures() { | 418 void GrLayerCache::processDeletedPictures() { |
420 SkTDArray<GrPictureDeletedMessage> deletedPictures; | 419 SkTDArray<GrPictureDeletedMessage> deletedPictures; |
421 fPictDeletionInbox.poll(&deletedPictures); | 420 fPictDeletionInbox.poll(&deletedPictures); |
422 | 421 |
423 for (int i = 0; i < deletedPictures.count(); i++) { | 422 for (int i = 0; i < deletedPictures.count(); i++) { |
424 this->purge(deletedPictures[i].pictureID); | 423 this->purge(deletedPictures[i].pictureID); |
425 } | 424 } |
426 } | 425 } |
427 | 426 |
OLD | NEW |