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

Side by Side Diff: gm/gmmain.cpp

Issue 12753007: Update gm so it doe not write the size of the pdf (writeData writes the length of the data too) (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 gm_fprintf(stderr, "\t\t%s pixel_error\n", fFailedTests[i].fName .c_str()); 274 gm_fprintf(stderr, "\t\t%s pixel_error\n", fFailedTests[i].fName .c_str());
275 } else { 275 } else {
276 gm_fprintf(stderr, "\t\t%s\n", fFailedTests[i].fName.c_str()); 276 gm_fprintf(stderr, "\t\t%s\n", fFailedTests[i].fName.c_str());
277 } 277 }
278 } 278 }
279 } 279 }
280 280
281 static bool write_document(const SkString& path, 281 static bool write_document(const SkString& path,
282 const SkDynamicMemoryWStream& document) { 282 const SkDynamicMemoryWStream& document) {
283 SkFILEWStream stream(path.c_str()); 283 SkFILEWStream stream(path.c_str());
284 SkAutoDataUnref data(document.copyToData()); 284 SkAutoDataUnref data(document.copyToData());
epoger 2013/03/15 17:01:46 Filed https://code.google.com/p/skia/issues/detail
285 return stream.writeData(data.get()); 285 return stream.write(data.get()->data(), data.get()->size());
epoger 2013/03/15 17:01:46 Also, Mike... does stream.write() guarantee that i
epoger 2013/03/28 20:20:44 The last question here is whether write() is guara
286 } 286 }
287 287
288 /** 288 /**
289 * Prepare an SkBitmap to render a GM into. 289 * Prepare an SkBitmap to render a GM into.
290 * 290 *
291 * After you've rendered the GM into the SkBitmap, you must call 291 * After you've rendered the GM into the SkBitmap, you must call
292 * complete_bitmap()! 292 * complete_bitmap()!
293 * 293 *
294 * @todo thudson 22 April 2011 - could refactor this to take in 294 * @todo thudson 22 April 2011 - could refactor this to take in
295 * a factory to generate the context, always call readPixels() 295 * a factory to generate the context, always call readPixels()
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 SkGraphics::Term(); 1722 SkGraphics::Term();
1723 1723
1724 return (0 == testsFailed) ? 0 : -1; 1724 return (0 == testsFailed) ? 0 : -1;
1725 } 1725 }
1726 1726
1727 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 1727 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
1728 int main(int argc, char * const argv[]) { 1728 int main(int argc, char * const argv[]) {
1729 return tool_main(argc, (char**) argv); 1729 return tool_main(argc, (char**) argv);
1730 } 1730 }
1731 #endif 1731 #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