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

Side by Side Diff: tools/CopyTilesRenderer.cpp

Issue 327403002: Cleanup: Delete sk_tools::make_filepath() in favor of SkOSPath::SkPathJoin(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixes Created 6 years, 6 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 | « tests/PictureUtilsTest.cpp ('k') | tools/bench_pictures_main.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 2012 Google Inc. 2 * Copyright 2012 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 "picture_utils.h" 8 #include "picture_utils.h"
9 #include "CopyTilesRenderer.h" 9 #include "CopyTilesRenderer.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 subset.set(tileX, tileY, tileX + this->getTileWidth(), 64 subset.set(tileX, tileY, tileX + this->getTileWidth(),
65 tileY + this->getTileHeight()); 65 tileY + this->getTileHeight());
66 SkDEBUGCODE(bool extracted =) 66 SkDEBUGCODE(bool extracted =)
67 baseBitmap.extractSubset(&dst, subset); 67 baseBitmap.extractSubset(&dst, subset);
68 SkASSERT(extracted); 68 SkASSERT(extracted);
69 if (!fWritePath.isEmpty()) { 69 if (!fWritePath.isEmpty()) {
70 // Similar to write() in PictureRenderer.cpp, but ju st encodes 70 // Similar to write() in PictureRenderer.cpp, but ju st encodes
71 // a bitmap directly. 71 // a bitmap directly.
72 // TODO: Share more common code with write() to do t his, to properly 72 // TODO: Share more common code with write() to do t his, to properly
73 // write out the JSON summary, etc. 73 // write out the JSON summary, etc.
74 SkString pathWithNumber; 74 SkString pathWithNumber = SkOSPath::SkPathJoin(fWrit ePath.c_str(),
75 make_filepath(&pathWithNumber, fWritePath, fInputFil ename); 75 fInpu tFilename.c_str());
76 pathWithNumber.remove(pathWithNumber.size() - 4, 4); 76 pathWithNumber.remove(pathWithNumber.size() - 4, 4);
77 pathWithNumber.appendf("%i.png", i++); 77 pathWithNumber.appendf("%i.png", i++);
78 SkBitmap copy; 78 SkBitmap copy;
79 #if SK_SUPPORT_GPU 79 #if SK_SUPPORT_GPU
80 if (isUsingGpuDevice()) { 80 if (isUsingGpuDevice()) {
81 dst.pixelRef()->readPixels(&copy, &subset); 81 dst.pixelRef()->readPixels(&copy, &subset);
82 } else { 82 } else {
83 #endif 83 #endif
84 dst.copyTo(&copy); 84 dst.copyTo(&copy);
85 #if SK_SUPPORT_GPU 85 #if SK_SUPPORT_GPU
86 } 86 }
87 #endif 87 #endif
88 success &= SkImageEncoder::EncodeFile(pathWithNumber .c_str(), copy, 88 success &= SkImageEncoder::EncodeFile(pathWithNumber .c_str(), copy,
89 SkImageEncoder ::kPNG_Type, 100); 89 SkImageEncoder ::kPNG_Type, 100);
90 } 90 }
91 } 91 }
92 } 92 }
93 } 93 }
94 } 94 }
95 return success; 95 return success;
96 } 96 }
97 97
98 SkString CopyTilesRenderer::getConfigNameInternal() { 98 SkString CopyTilesRenderer::getConfigNameInternal() {
99 return SkString("copy_tiles"); 99 return SkString("copy_tiles");
100 } 100 }
101 } 101 }
OLDNEW
« no previous file with comments | « tests/PictureUtilsTest.cpp ('k') | tools/bench_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698