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 "GrLayerAtlas.h" | 8 #include "GrLayerAtlas.h" |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 516 |
517 void GrLayerCache::processDeletedPictures() { | 517 void GrLayerCache::processDeletedPictures() { |
518 SkTArray<SkPicture::DeletionMessage> deletedPictures; | 518 SkTArray<SkPicture::DeletionMessage> deletedPictures; |
519 fPictDeletionInbox.poll(&deletedPictures); | 519 fPictDeletionInbox.poll(&deletedPictures); |
520 | 520 |
521 for (int i = 0; i < deletedPictures.count(); i++) { | 521 for (int i = 0; i < deletedPictures.count(); i++) { |
522 this->purge(deletedPictures[i].fUniqueID); | 522 this->purge(deletedPictures[i].fUniqueID); |
523 } | 523 } |
524 } | 524 } |
525 | 525 |
526 #ifdef SK_DEBUG | 526 #ifdef SK_DEVELOPER |
527 void GrLayerCache::writeLayersToDisk(const SkString& dirName) { | 527 void GrLayerCache::writeLayersToDisk(const SkString& dirName) { |
528 | 528 |
529 if (fAtlas) { | 529 if (fAtlas) { |
530 GrTexture* atlasTexture = fAtlas->getTextureOrNull(); | 530 GrTexture* atlasTexture = fAtlas->getTextureOrNull(); |
531 if (nullptr != atlasTexture) { | 531 if (nullptr != atlasTexture) { |
532 SkString fileName(dirName); | 532 SkString fileName(dirName); |
533 fileName.append("\\atlas.png"); | 533 fileName.append("\\atlas.png"); |
534 | 534 |
535 atlasTexture->surfacePriv().savePixels(fileName.c_str()); | 535 atlasTexture->surfacePriv().savePixels(fileName.c_str()); |
536 } | 536 } |
(...skipping 11 matching lines...) Expand all Loading... |
548 fileName.appendf("\\%d", layer->fKey.pictureID()); | 548 fileName.appendf("\\%d", layer->fKey.pictureID()); |
549 for (int i = 0; i < layer->fKey.keySize(); ++i) { | 549 for (int i = 0; i < layer->fKey.keySize(); ++i) { |
550 fileName.appendf("-%d", layer->fKey.key()[i]); | 550 fileName.appendf("-%d", layer->fKey.key()[i]); |
551 } | 551 } |
552 fileName.appendf(".png"); | 552 fileName.appendf(".png"); |
553 | 553 |
554 layer->texture()->surfacePriv().savePixels(fileName.c_str()); | 554 layer->texture()->surfacePriv().savePixels(fileName.c_str()); |
555 } | 555 } |
556 } | 556 } |
557 #endif | 557 #endif |
OLD | NEW |