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

Side by Side Diff: gm/gmmain.cpp

Issue 103213007: [PDF] PDF rasterizers fed garbage data in release mode. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 } else { 1069 } else {
1070 SkAutoTUnref<SkStreamAsset> documentStream(document.detachAsStre am()); 1070 SkAutoTUnref<SkStreamAsset> documentStream(document.detachAsStre am());
1071 if (writePath && (gRec.fFlags & kWrite_ConfigFlag)) { 1071 if (writePath && (gRec.fFlags & kWrite_ConfigFlag)) {
1072 path = make_filename(writePath, gm->shortName(), gRec.fName, "", "pdf"); 1072 path = make_filename(writePath, gm->shortName(), gRec.fName, "", "pdf");
1073 errors.add(write_document(path, documentStream)); 1073 errors.add(write_document(path, documentStream));
1074 } 1074 }
1075 1075
1076 if (!(gm->getFlags() & GM::kSkipPDFRasterization_Flag)) { 1076 if (!(gm->getFlags() & GM::kSkipPDFRasterization_Flag)) {
1077 for (int i = 0; i < pdfRasterizers.count(); i++) { 1077 for (int i = 0; i < pdfRasterizers.count(); i++) {
1078 SkBitmap pdfBitmap; 1078 SkBitmap pdfBitmap;
1079 SkASSERT(documentStream->rewind()); 1079 documentStream->rewind();
epoger 2013/12/11 17:32:57 yikes!
1080 bool success = (*pdfRasterizers[i]->fRasterizerFunction) ( 1080 bool success = (*pdfRasterizers[i]->fRasterizerFunction) (
1081 documentStream.get(), &pdfBitmap); 1081 documentStream.get(), &pdfBitmap);
1082 if (!success) { 1082 if (!success) {
1083 gm_fprintf(stderr, "FAILED to render PDF for %s usin g renderer %s\n", 1083 gm_fprintf(stderr, "FAILED to render PDF for %s usin g renderer %s\n",
1084 gm->shortName(), 1084 gm->shortName(),
1085 pdfRasterizers[i]->fName); 1085 pdfRasterizers[i]->fName);
1086 continue; 1086 continue;
1087 } 1087 }
1088 1088
1089 SkString configName(gRec.fName); 1089 SkString configName(gRec.fName);
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2376 if (FLAGS_forceBWtext) { 2376 if (FLAGS_forceBWtext) {
2377 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); 2377 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref();
2378 } 2378 }
2379 } 2379 }
2380 2380
2381 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 2381 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
2382 int main(int argc, char * const argv[]) { 2382 int main(int argc, char * const argv[]) {
2383 return tool_main(argc, (char**) argv); 2383 return tool_main(argc, (char**) argv);
2384 } 2384 }
2385 #endif 2385 #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