Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: src/gpu/GrLayerCache.cpp

Issue 665913002: Move code to dump GrSurface as a png to helper files (Closed) Base URL: https://skia.googlesource.com/skia.git@separate-image-encoder-01-skimage
Patch Set: address review comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrSurface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 436 }
437 437
438 #ifdef SK_DEVELOPER 438 #ifdef SK_DEVELOPER
439 void GrLayerCache::writeLayersToDisk(const SkString& dirName) { 439 void GrLayerCache::writeLayersToDisk(const SkString& dirName) {
440 440
441 GrTexture* atlasTexture = fAtlas->getTexture(); 441 GrTexture* atlasTexture = fAtlas->getTexture();
442 if (NULL != atlasTexture) { 442 if (NULL != atlasTexture) {
443 SkString fileName(dirName); 443 SkString fileName(dirName);
444 fileName.append("\\atlas.png"); 444 fileName.append("\\atlas.png");
445 445
446 atlasTexture->surfacePriv().savePixels(fileName.c_str()); 446 SkSaveGrSurfacePixelsAsPNG(atlasTexture, fileName.c_str());
447 } 447 }
448 448
449 SkTDynamicHash<GrCachedLayer, GrCachedLayer::Key>::Iter iter(&fLayerHash); 449 SkTDynamicHash<GrCachedLayer, GrCachedLayer::Key>::Iter iter(&fLayerHash);
450 for (; !iter.done(); ++iter) { 450 for (; !iter.done(); ++iter) {
451 GrCachedLayer* layer = &(*iter); 451 GrCachedLayer* layer = &(*iter);
452 452
453 if (layer->isAtlased() || !layer->texture()) { 453 if (layer->isAtlased() || !layer->texture()) {
454 continue; 454 continue;
455 } 455 }
456 456
457 SkString fileName(dirName); 457 SkString fileName(dirName);
458 fileName.append("\\"); 458 fileName.append("\\");
459 fileName.appendU32(layer->fKey.pictureID()); 459 fileName.appendU32(layer->fKey.pictureID());
460 fileName.append("-"); 460 fileName.append("-");
461 fileName.appendU32(layer->fKey.start()); 461 fileName.appendU32(layer->fKey.start());
462 fileName.append(".png"); 462 fileName.append(".png");
463 463
464 layer->texture()->surfacePriv().savePixels(fileName.c_str()); 464 SkSaveGrSurfacePixelsAsPNG(layer->texture(), fileName.c_str());
465 } 465 }
466 } 466 }
467 #endif 467 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698