| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 /* | 8 /* |
| 9 * Code for the "gm" (Golden Master) rendering comparison tool. | 9 * Code for the "gm" (Golden Master) rendering comparison tool. |
| 10 * | 10 * |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 */ | 230 */ |
| 231 SkString make_filename(const char *path, | 231 SkString make_filename(const char *path, |
| 232 const char *shortName, | 232 const char *shortName, |
| 233 const char *configName, | 233 const char *configName, |
| 234 const char *renderModeDescriptor, | 234 const char *renderModeDescriptor, |
| 235 const char *suffix) { | 235 const char *suffix) { |
| 236 SkString filename = make_shortname_plus_config(shortName, configName); | 236 SkString filename = make_shortname_plus_config(shortName, configName); |
| 237 filename.append(renderModeDescriptor); | 237 filename.append(renderModeDescriptor); |
| 238 filename.appendUnichar('.'); | 238 filename.appendUnichar('.'); |
| 239 filename.append(suffix); | 239 filename.append(suffix); |
| 240 return SkOSPath::SkPathJoin(path, filename.c_str()); | 240 return SkOSPath::Join(path, filename.c_str()); |
| 241 } | 241 } |
| 242 | 242 |
| 243 /** | 243 /** |
| 244 * Assemble filename suitable for writing out an SkBitmap. | 244 * Assemble filename suitable for writing out an SkBitmap. |
| 245 */ | 245 */ |
| 246 SkString make_bitmap_filename(const char *path, | 246 SkString make_bitmap_filename(const char *path, |
| 247 const char *shortName, | 247 const char *shortName, |
| 248 const char *configName, | 248 const char *configName, |
| 249 const char *renderModeDescriptor, | 249 const char *renderModeDescriptor, |
| 250 const GmResultDigest &bitmapDigest) { | 250 const GmResultDigest &bitmapDigest) { |
| 251 if (fWriteChecksumBasedFilenames) { | 251 if (fWriteChecksumBasedFilenames) { |
| 252 SkString filename; | 252 SkString filename; |
| 253 filename.append(bitmapDigest.getHashType()); | 253 filename.append(bitmapDigest.getHashType()); |
| 254 filename.appendUnichar('_'); | 254 filename.appendUnichar('_'); |
| 255 filename.append(shortName); | 255 filename.append(shortName); |
| 256 filename.appendUnichar('_'); | 256 filename.appendUnichar('_'); |
| 257 filename.append(bitmapDigest.getDigestValue()); | 257 filename.append(bitmapDigest.getDigestValue()); |
| 258 filename.appendUnichar('.'); | 258 filename.appendUnichar('.'); |
| 259 filename.append(kPNG_FileExtension); | 259 filename.append(kPNG_FileExtension); |
| 260 return SkOSPath::SkPathJoin(path, filename.c_str()); | 260 return SkOSPath::Join(path, filename.c_str()); |
| 261 } else { | 261 } else { |
| 262 return make_filename(path, shortName, configName, renderModeDescript
or, | 262 return make_filename(path, shortName, configName, renderModeDescript
or, |
| 263 kPNG_FileExtension); | 263 kPNG_FileExtension); |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 | 266 |
| 267 /* since PNG insists on unpremultiplying our alpha, we take no | 267 /* since PNG insists on unpremultiplying our alpha, we take no |
| 268 precision chances and force all pixels to be 100% opaque, | 268 precision chances and force all pixels to be 100% opaque, |
| 269 otherwise on compare we may not get a perfect match. | 269 otherwise on compare we may not get a perfect match. |
| 270 */ | 270 */ |
| (...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2494 if (FLAGS_forceBWtext) { | 2494 if (FLAGS_forceBWtext) { |
| 2495 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2495 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
| 2496 } | 2496 } |
| 2497 } | 2497 } |
| 2498 | 2498 |
| 2499 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2499 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 2500 int main(int argc, char * const argv[]) { | 2500 int main(int argc, char * const argv[]) { |
| 2501 return tool_main(argc, (char**) argv); | 2501 return tool_main(argc, (char**) argv); |
| 2502 } | 2502 } |
| 2503 #endif | 2503 #endif |
| OLD | NEW |