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 SkAutoTUnref<GrDrawContext> drawContext(fContext->drawContext()); | 470 SkAutoTUnref<GrDrawContext> drawContext( |
| 471 fContext->drawContext(fAtlas->getTexture()->asRe
nderTarget())); |
471 | 472 |
472 if (drawContext) { | 473 if (drawContext) { |
473 drawContext->discard(fAtlas->getTexture()->asRenderTarget()); | 474 drawContext->discard(); |
474 } | 475 } |
475 } | 476 } |
476 #endif | 477 #endif |
477 | 478 |
478 void GrLayerCache::processDeletedPictures() { | 479 void GrLayerCache::processDeletedPictures() { |
479 SkTArray<SkPicture::DeletionMessage> deletedPictures; | 480 SkTArray<SkPicture::DeletionMessage> deletedPictures; |
480 fPictDeletionInbox.poll(&deletedPictures); | 481 fPictDeletionInbox.poll(&deletedPictures); |
481 | 482 |
482 for (int i = 0; i < deletedPictures.count(); i++) { | 483 for (int i = 0; i < deletedPictures.count(); i++) { |
483 this->purge(deletedPictures[i].fUniqueID); | 484 this->purge(deletedPictures[i].fUniqueID); |
(...skipping 25 matching lines...) Expand all Loading... |
509 fileName.appendf("\\%d", layer->fKey.pictureID()); | 510 fileName.appendf("\\%d", layer->fKey.pictureID()); |
510 for (int i = 0; i < layer->fKey.keySize(); ++i) { | 511 for (int i = 0; i < layer->fKey.keySize(); ++i) { |
511 fileName.appendf("-%d", layer->fKey.key()[i]); | 512 fileName.appendf("-%d", layer->fKey.key()[i]); |
512 } | 513 } |
513 fileName.appendf(".png"); | 514 fileName.appendf(".png"); |
514 | 515 |
515 layer->texture()->surfacePriv().savePixels(fileName.c_str()); | 516 layer->texture()->surfacePriv().savePixels(fileName.c_str()); |
516 } | 517 } |
517 } | 518 } |
518 #endif | 519 #endif |
OLD | NEW |