| 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 "GrContext.h" | 9 #include "GrContext.h" |
| 10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 for (plot = fAtlas->iterInit(&iter, GrAtlas::kLRUFirst_IterOrder); | 460 for (plot = fAtlas->iterInit(&iter, GrAtlas::kLRUFirst_IterOrder); |
| 461 plot; | 461 plot; |
| 462 plot = iter.prev()) { | 462 plot = iter.prev()) { |
| 463 SkASSERT(0 == fPlotLocks[plot->id()]); | 463 SkASSERT(0 == fPlotLocks[plot->id()]); |
| 464 | 464 |
| 465 this->purgePlot(plot); | 465 this->purgePlot(plot); |
| 466 } | 466 } |
| 467 | 467 |
| 468 SkASSERT(0 == fPictureHash.count()); | 468 SkASSERT(0 == fPictureHash.count()); |
| 469 | 469 |
| 470 GrDrawContext* drawContext = fContext->drawContext(); | 470 SkAutoTUnref<GrDrawContext> drawContext(fContext->drawContext()); |
| 471 | 471 |
| 472 if (drawContext) { | 472 if (drawContext) { |
| 473 drawContext->discard(fAtlas->getTexture()->asRenderTarget()); | 473 drawContext->discard(fAtlas->getTexture()->asRenderTarget()); |
| 474 } | 474 } |
| 475 } | 475 } |
| 476 #endif | 476 #endif |
| 477 | 477 |
| 478 void GrLayerCache::processDeletedPictures() { | 478 void GrLayerCache::processDeletedPictures() { |
| 479 SkTArray<SkPicture::DeletionMessage> deletedPictures; | 479 SkTArray<SkPicture::DeletionMessage> deletedPictures; |
| 480 fPictDeletionInbox.poll(&deletedPictures); | 480 fPictDeletionInbox.poll(&deletedPictures); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 509 fileName.appendf("\\%d", layer->fKey.pictureID()); | 509 fileName.appendf("\\%d", layer->fKey.pictureID()); |
| 510 for (int i = 0; i < layer->fKey.keySize(); ++i) { | 510 for (int i = 0; i < layer->fKey.keySize(); ++i) { |
| 511 fileName.appendf("-%d", layer->fKey.key()[i]); | 511 fileName.appendf("-%d", layer->fKey.key()[i]); |
| 512 } | 512 } |
| 513 fileName.appendf(".png"); | 513 fileName.appendf(".png"); |
| 514 | 514 |
| 515 layer->texture()->surfacePriv().savePixels(fileName.c_str()); | 515 layer->texture()->surfacePriv().savePixels(fileName.c_str()); |
| 516 } | 516 } |
| 517 } | 517 } |
| 518 #endif | 518 #endif |
| OLD | NEW |