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

Side by Side Diff: gm/gmmain.cpp

Issue 14824003: Don't use writeData to write the document in GM. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698