| Index: tools/skimage_main.cpp
|
| diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp
|
| index a2d353c25de695fa5d63f96c657688227f836f44..3ed0d8de961b3db796f1d269970505ffc3dba932 100644
|
| --- a/tools/skimage_main.cpp
|
| +++ b/tools/skimage_main.cpp
|
| @@ -6,6 +6,7 @@
|
| */
|
|
|
| #include "gm_expectations.h"
|
| +#include "picture_utils.h"
|
| #include "SkBitmap.h"
|
| #include "SkColorPriv.h"
|
| #include "SkCommandLineFlags.h"
|
| @@ -463,24 +464,6 @@ static void test_stream_without_length(const char srcPath[], SkImageDecoder* cod
|
| }
|
| #endif // defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_UNIX)
|
|
|
| -/**
|
| - * Replaces all instances of oldChar with newChar in str.
|
| - *
|
| - * TODO: This function appears here and in picture_utils.[cpp|h] ;
|
| - * we should add the implementation to src/core/SkString.cpp, write tests for it,
|
| - * and remove it from elsewhere.
|
| - */
|
| -static void replace_char(SkString* str, const char oldChar, const char newChar) {
|
| - if (NULL == str) {
|
| - return;
|
| - }
|
| - for (size_t i = 0; i < str->size(); ++i) {
|
| - if (oldChar == str->operator[](i)) {
|
| - str->operator[](i) = newChar;
|
| - }
|
| - }
|
| -}
|
| -
|
| static void decodeFileAndWrite(const char srcPath[], const SkString* writePath) {
|
| SkBitmap bitmap;
|
| SkFILEStream stream(srcPath);
|
| @@ -504,10 +487,10 @@ static void decodeFileAndWrite(const char srcPath[], const SkString* writePath)
|
| // Create a string representing just the filename itself, for use in json expectations.
|
| SkString basename = SkOSPath::Basename(srcPath);
|
| // Replace '_' with '-', so that the names can fit gm_json.py's IMAGE_FILENAME_PATTERN
|
| - replace_char(&basename, '_', '-');
|
| + sk_tools::replace_char(&basename, '_', '-');
|
| // Replace '.' with '-', so the output filename can still retain the original file extension,
|
| // but still end up with only one '.', which denotes the actual extension of the final file.
|
| - replace_char(&basename, '.', '-');
|
| + sk_tools::replace_char(&basename, '.', '-');
|
| const char* filename = basename.c_str();
|
|
|
| if (!codec->decode(&stream, &bitmap, gPrefColorType, SkImageDecoder::kDecodePixels_Mode)) {
|
|
|