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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 this->purgePlot(plot); | 463 this->purgePlot(plot); |
464 } | 464 } |
465 | 465 |
466 SkASSERT(0 == fPictureHash.count()); | 466 SkASSERT(0 == fPictureHash.count()); |
467 | 467 |
468 fContext->discardRenderTarget(fAtlas->getTexture()->asRenderTarget()); | 468 fContext->discardRenderTarget(fAtlas->getTexture()->asRenderTarget()); |
469 } | 469 } |
470 #endif | 470 #endif |
471 | 471 |
472 void GrLayerCache::processDeletedPictures() { | 472 void GrLayerCache::processDeletedPictures() { |
473 SkTDArray<SkPicture::DeletionMessage> deletedPictures; | 473 SkTArray<SkPicture::DeletionMessage> deletedPictures; |
474 fPictDeletionInbox.poll(&deletedPictures); | 474 fPictDeletionInbox.poll(&deletedPictures); |
475 | 475 |
476 for (int i = 0; i < deletedPictures.count(); i++) { | 476 for (int i = 0; i < deletedPictures.count(); i++) { |
477 this->purge(deletedPictures[i].fUniqueID); | 477 this->purge(deletedPictures[i].fUniqueID); |
478 } | 478 } |
479 } | 479 } |
480 | 480 |
481 #ifdef SK_DEVELOPER | 481 #ifdef SK_DEVELOPER |
482 void GrLayerCache::writeLayersToDisk(const SkString& dirName) { | 482 void GrLayerCache::writeLayersToDisk(const SkString& dirName) { |
483 | 483 |
(...skipping 19 matching lines...) Expand all Loading... |
503 fileName.appendf("\\%d", layer->fKey.pictureID()); | 503 fileName.appendf("\\%d", layer->fKey.pictureID()); |
504 for (int i = 0; i < layer->fKey.keySize(); ++i) { | 504 for (int i = 0; i < layer->fKey.keySize(); ++i) { |
505 fileName.appendf("-%d", layer->fKey.key()[i]); | 505 fileName.appendf("-%d", layer->fKey.key()[i]); |
506 } | 506 } |
507 fileName.appendf(".png"); | 507 fileName.appendf(".png"); |
508 | 508 |
509 layer->texture()->surfacePriv().savePixels(fileName.c_str()); | 509 layer->texture()->surfacePriv().savePixels(fileName.c_str()); |
510 } | 510 } |
511 } | 511 } |
512 #endif | 512 #endif |
OLD | NEW |