Index: tests/PDFJpegEmbedTest.cpp |
diff --git a/tests/PDFJpegEmbedTest.cpp b/tests/PDFJpegEmbedTest.cpp |
index 812fd3b2c3392279bc40450f77efde9fa1595f07..5185eb7bd4169efa97fe1772d2dd87c0a081856b 100644 |
--- a/tests/PDFJpegEmbedTest.cpp |
+++ b/tests/PDFJpegEmbedTest.cpp |
@@ -62,7 +62,7 @@ DEF_TEST(PDFJpegEmbedTest, r) { |
if (!mandrillData || !cmykData) { |
return; |
} |
- |
+ //////////////////////////////////////////////////////////////////////////// |
SkDynamicMemoryWStream pdf; |
SkAutoTUnref<SkDocument> document(SkDocument::CreatePDF(&pdf)); |
SkCanvas* canvas = document->beginPage(642, 1028); |
@@ -86,6 +86,30 @@ DEF_TEST(PDFJpegEmbedTest, r) { |
// This JPEG uses a nonstandard colorspace - it can not be |
// embedded into the PDF directly. |
REPORTER_ASSERT(r, !is_subset_of(cmykData, pdfData)); |
+ //////////////////////////////////////////////////////////////////////////// |
+ pdf.reset(); |
+ document.reset(SkDocument::CreatePDF(&pdf)); |
+ canvas = document->beginPage(642, 1028); |
+ |
+ canvas->clear(SK_ColorLTGRAY); |
+ |
+ SkAutoTUnref<SkImage> im1(SkImage::NewFromEncoded(mandrillData)); |
+ canvas->drawImage(im1, 65.0, 0.0, nullptr); |
+ SkAutoTUnref<SkImage> im2(SkImage::NewFromEncoded(cmykData)); |
+ canvas->drawImage(im2, 0.0, 512.0, nullptr); |
+ |
+ canvas->flush(); |
+ document->endPage(); |
+ document->close(); |
+ pdfData.reset(pdf.copyToData()); |
+ SkASSERT(pdfData); |
+ pdf.reset(); |
+ |
+ REPORTER_ASSERT(r, is_subset_of(mandrillData, pdfData)); |
+ |
+ // This JPEG uses a nonstandard colorspace - it can not be |
+ // embedded into the PDF directly. |
+ REPORTER_ASSERT(r, !is_subset_of(cmykData, pdfData)); |
} |
#include "SkJpegInfo.h" |
@@ -121,7 +145,7 @@ DEF_TEST(JpegIdentification, r) { |
} |
if (r->verbose()) { |
SkDebugf("\nJpegIdentification: %s [%d x %d]\n", kTests[i].path, |
- info.fWidth, info.fHeight); |
+ info.fSize.width(), info.fSize.height()); |
} |
} |
} |