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

Side by Side Diff: tests/PDFJpegEmbedTest.cpp

Issue 1025773002: PDF: Correctly embed JPEG images directly into PDF output. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-04-17 (Friday) 16:19:22 EDT Created 5 years, 8 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
« no previous file with comments | « src/pdf/SkPDFBitmap.cpp ('k') | 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 2014 Google Inc. 2 * Copyright 2014 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 #include "SkDocument.h" 8 #include "SkDocument.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImageGenerator.h" 10 #include "SkImageGenerator.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 SkBitmap bm2(bitmap_from_data(cmykData)); 74 SkBitmap bm2(bitmap_from_data(cmykData));
75 canvas->drawBitmap(bm2, 0.0, 512.0, NULL); 75 canvas->drawBitmap(bm2, 0.0, 512.0, NULL);
76 76
77 canvas->flush(); 77 canvas->flush();
78 document->endPage(); 78 document->endPage();
79 document->close(); 79 document->close();
80 SkAutoTUnref<SkData> pdfData(pdf.copyToData()); 80 SkAutoTUnref<SkData> pdfData(pdf.copyToData());
81 SkASSERT(pdfData); 81 SkASSERT(pdfData);
82 pdf.reset(); 82 pdf.reset();
83 83
84 // Test disabled, waiting on resolution to http://skbug.com/3180 84 REPORTER_ASSERT(r, is_subset_of(mandrillData, pdfData));
85 // REPORTER_ASSERT(r, is_subset_of(mandrillData, pdfData));
86 85
87 // This JPEG uses a nonstandard colorspace - it can not be 86 // This JPEG uses a nonstandard colorspace - it can not be
88 // embedded into the PDF directly. 87 // embedded into the PDF directly.
89 REPORTER_ASSERT(r, !is_subset_of(cmykData, pdfData)); 88 REPORTER_ASSERT(r, !is_subset_of(cmykData, pdfData));
90
91 // The following is for debugging purposes only.
92 const char* outputPath = getenv("SKIA_TESTS_PDF_JPEG_EMBED_OUTPUT_PATH");
93 if (outputPath) {
94 SkFILEWStream output(outputPath);
95 if (output.isValid()) {
96 output.write(pdfData->data(), pdfData->size());
97 }
98 }
99 } 89 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFBitmap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698