OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |