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

Side by Side Diff: tools/CopyTilesRenderer.cpp

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

Powered by Google App Engine
This is Rietveld 408576698