| 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 void GrLayerCache::purgeAll() { | 461 void GrLayerCache::purgeAll() { |
| 462 if (!fAtlas) { | 462 if (!fAtlas) { |
| 463 return; | 463 return; |
| 464 } | 464 } |
| 465 | 465 |
| 466 this->purgePlots(false); // clear them all out | 466 this->purgePlots(false); // clear them all out |
| 467 | 467 |
| 468 SkASSERT(0 == fPictureHash.count()); | 468 SkASSERT(0 == fPictureHash.count()); |
| 469 | 469 |
| 470 if (fAtlas->getTextureOrNull()) { | 470 if (fAtlas->getTextureOrNull()) { |
| 471 SkAutoTUnref<GrDrawContext> drawContext( | 471 sk_sp<GrDrawContext> drawContext( |
| 472 fContext->drawContext(fAtlas->getTexture()->
asRenderTarget())); | 472 fContext->drawContext(sk_ref_sp(fAtlas->getTexture()->asR
enderTarget()))); |
| 473 | 473 |
| 474 if (drawContext) { | 474 if (drawContext) { |
| 475 drawContext->discard(); | 475 drawContext->discard(); |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 } | 478 } |
| 479 #endif | 479 #endif |
| 480 | 480 |
| 481 void GrLayerCache::begin() { | 481 void GrLayerCache::begin() { |
| 482 if (!fAtlas) { | 482 if (!fAtlas) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |