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