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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 gm_fprintf(stdout, "%s\n", summary.c_str()); | 404 gm_fprintf(stdout, "%s\n", summary.c_str()); |
405 | 405 |
406 // Now, for each failure type, list the tests that failed that way. | 406 // Now, for each failure type, list the tests that failed that way. |
407 for (int typeInt = 0; typeInt <= kLast_ErrorType; typeInt++) { | 407 for (int typeInt = 0; typeInt <= kLast_ErrorType; typeInt++) { |
408 this->DisplayResultTypeSummary(static_cast<ErrorType>(typeInt), verb
ose); | 408 this->DisplayResultTypeSummary(static_cast<ErrorType>(typeInt), verb
ose); |
409 } | 409 } |
410 gm_fprintf(stdout, "(results marked with [*] will cause nonzero return v
alue)\n"); | 410 gm_fprintf(stdout, "(results marked with [*] will cause nonzero return v
alue)\n"); |
411 } | 411 } |
412 | 412 |
413 static bool write_document(const SkString& path, | 413 static bool write_document(const SkString& path, |
414 const SkDynamicMemoryWStream& document) { | 414 SkDynamicMemoryWStream& document) { |
415 SkFILEWStream stream(path.c_str()); | 415 SkFILEWStream stream(path.c_str()); |
416 SkAutoDataUnref data(document.copyToData()); | 416 SkAutoTUnref<SkStreamAsset> data(document.detatchAsStream()); |
417 return stream.write(data->data(), data->size()); | 417 return stream.writeStream(data.get(), data->getLength()); |
418 } | 418 } |
419 | 419 |
420 /** | 420 /** |
421 * Prepare an SkBitmap to render a GM into. | 421 * Prepare an SkBitmap to render a GM into. |
422 * | 422 * |
423 * After you've rendered the GM into the SkBitmap, you must call | 423 * After you've rendered the GM into the SkBitmap, you must call |
424 * complete_bitmap()! | 424 * complete_bitmap()! |
425 * | 425 * |
426 * @todo thudson 22 April 2011 - could refactor this to take in | 426 * @todo thudson 22 April 2011 - could refactor this to take in |
427 * a factory to generate the context, always call readPixels() | 427 * a factory to generate the context, always call readPixels() |
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2174 if (FLAGS_forceBWtext) { | 2174 if (FLAGS_forceBWtext) { |
2175 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2175 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
2176 } | 2176 } |
2177 } | 2177 } |
2178 | 2178 |
2179 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2179 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
2180 int main(int argc, char * const argv[]) { | 2180 int main(int argc, char * const argv[]) { |
2181 return tool_main(argc, (char**) argv); | 2181 return tool_main(argc, (char**) argv); |
2182 } | 2182 } |
2183 #endif | 2183 #endif |
OLD | NEW |