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

Side by Side Diff: tools/PictureRenderer.cpp

Issue 646213002: Eliminate one copy of replace_char() function. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: bad... Created 6 years, 1 month 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
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 "PictureRenderer.h" 8 #include "PictureRenderer.h"
9 #include "picture_utils.h" 9 #include "picture_utils.h"
10 #include "SamplePipeControllers.h" 10 #include "SamplePipeControllers.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 295
296 SkBitmap bitmap; 296 SkBitmap bitmap;
297 SkISize size = canvas->getDeviceSize(); 297 SkISize size = canvas->getDeviceSize();
298 setup_bitmap(&bitmap, size.width(), size.height()); 298 setup_bitmap(&bitmap, size.width(), size.height());
299 299
300 canvas->readPixels(&bitmap, 0, 0); 300 canvas->readPixels(&bitmap, 0, 0);
301 force_all_opaque(bitmap); 301 force_all_opaque(bitmap);
302 BitmapAndDigest bitmapAndDigest(bitmap); 302 BitmapAndDigest bitmapAndDigest(bitmap);
303 303
304 SkString escapedInputFilename(inputFilename); 304 SkString escapedInputFilename(inputFilename);
305 replace_char(&escapedInputFilename, '.', '_'); 305 escapedInputFilename.replace('.', '_');
306 306
307 // TODO(epoger): what about including the config type within outputFilename? That way, 307 // TODO(epoger): what about including the config type within outputFilename? That way,
308 // we could combine results of different config types without conflicting fi lenames. 308 // we could combine results of different config types without conflicting fi lenames.
309 SkString outputFilename; 309 SkString outputFilename;
310 const char *outputSubdirPtr = NULL; 310 const char *outputSubdirPtr = NULL;
311 if (useChecksumBasedFilenames) { 311 if (useChecksumBasedFilenames) {
312 ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr(); 312 ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr();
313 outputSubdirPtr = escapedInputFilename.c_str(); 313 outputSubdirPtr = escapedInputFilename.c_str();
314 outputFilename.set(imageDigestPtr->getHashType()); 314 outputFilename.set(imageDigestPtr->getHashType());
315 outputFilename.append("_"); 315 outputFilename.append("_");
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts) { 853 PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts) {
854 return SkNEW_ARGS(GatherRenderer, (opts)); 854 return SkNEW_ARGS(GatherRenderer, (opts));
855 } 855 }
856 #else 856 #else
857 PictureRenderer* CreateGatherPixelRefsRenderer() { 857 PictureRenderer* CreateGatherPixelRefsRenderer() {
858 return SkNEW(GatherRenderer); 858 return SkNEW(GatherRenderer);
859 } 859 }
860 #endif 860 #endif
861 861
862 } // namespace sk_tools 862 } // namespace sk_tools
OLDNEW
« tests/StringTest.cpp ('K') | « tests/StringTest.cpp ('k') | tools/picture_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698