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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 for (int typeInt = 0; typeInt <= kLast_ErrorType; typeInt++) { | 351 for (int typeInt = 0; typeInt <= kLast_ErrorType; typeInt++) { |
352 this->DisplayResultTypeSummary(static_cast<ErrorType>(typeInt), verb
ose); | 352 this->DisplayResultTypeSummary(static_cast<ErrorType>(typeInt), verb
ose); |
353 } | 353 } |
354 gm_fprintf(stdout, "(results marked with [*] will cause nonzero return v
alue)\n"); | 354 gm_fprintf(stdout, "(results marked with [*] will cause nonzero return v
alue)\n"); |
355 } | 355 } |
356 | 356 |
357 static bool write_document(const SkString& path, | 357 static bool write_document(const SkString& path, |
358 const SkDynamicMemoryWStream& document) { | 358 const SkDynamicMemoryWStream& document) { |
359 SkFILEWStream stream(path.c_str()); | 359 SkFILEWStream stream(path.c_str()); |
360 SkAutoDataUnref data(document.copyToData()); | 360 SkAutoDataUnref data(document.copyToData()); |
361 return stream.writeData(data.get()); | 361 return stream.write(data->data(), data->size()); |
362 } | 362 } |
363 | 363 |
364 /** | 364 /** |
365 * Prepare an SkBitmap to render a GM into. | 365 * Prepare an SkBitmap to render a GM into. |
366 * | 366 * |
367 * After you've rendered the GM into the SkBitmap, you must call | 367 * After you've rendered the GM into the SkBitmap, you must call |
368 * complete_bitmap()! | 368 * complete_bitmap()! |
369 * | 369 * |
370 * @todo thudson 22 April 2011 - could refactor this to take in | 370 * @todo thudson 22 April 2011 - could refactor this to take in |
371 * a factory to generate the context, always call readPixels() | 371 * a factory to generate the context, always call readPixels() |
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 if (FLAGS_forceBWtext) { | 2008 if (FLAGS_forceBWtext) { |
2009 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2009 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
2010 } | 2010 } |
2011 } | 2011 } |
2012 | 2012 |
2013 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2013 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
2014 int main(int argc, char * const argv[]) { | 2014 int main(int argc, char * const argv[]) { |
2015 return tool_main(argc, (char**) argv); | 2015 return tool_main(argc, (char**) argv); |
2016 } | 2016 } |
2017 #endif | 2017 #endif |
OLD | NEW |