diff options
author | Hal Canary <halcanary@google.com> | 2014-12-05 13:31:51 -0500 |
---|---|---|
committer | Hal Canary <halcanary@google.com> | 2014-12-05 13:31:51 -0500 |
commit | 79584c008d58d5f3497a88871bf66e1b5f64fcc3 (patch) | |
tree | d2473c0cc16b6fa476f67ca3a542e1666a00060b | |
parent | 2e74f758f8379338f75898f28128ade1dfcf3702 (diff) | |
download | skia-79584c008d58d5f3497a88871bf66e1b5f64fcc3.tar.gz |
Remove PDF JPEG shortcut, since it fails on grayscale JPEGs.
BUG=436079
Review URL: https://codereview.chromium.org/767343002
Review URL: https://codereview.chromium.org/782023002
-rw-r--r-- | src/pdf/SkPDFImage.cpp | 6 | ||||
-rw-r--r-- | tests/PDFJpegEmbedTest.cpp | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/pdf/SkPDFImage.cpp b/src/pdf/SkPDFImage.cpp index 0c9b7417a..122d2f214 100644 --- a/src/pdf/SkPDFImage.cpp +++ b/src/pdf/SkPDFImage.cpp @@ -629,6 +629,7 @@ bool SkPDFImage::populate(SkPDFCatalog* catalog) { return true; } +#if 0 // reenable when we can figure out the JPEG colorspace namespace { /** * This PDFObject assumes that its constructor was handed @@ -657,7 +658,7 @@ public: "/Subtype /Image\n" "/Width %d\n" "/Height %d\n" - "/ColorSpace /DeviceRGB\n" + "/ColorSpace /DeviceRGB\n" // or DeviceGray "/BitsPerComponent 8\n" "/Filter /DCTDecode\n" "/ColorTransform 0\n" @@ -702,11 +703,13 @@ static bool is_jfif_jpeg(SkData* data) { sizeof(bytesSixToTen)))); } } // namespace +#endif SkPDFObject* SkPDFCreateImageObject( const SkBitmap& bitmap, const SkIRect& subset, SkPicture::EncodeBitmap encoder) { +#if 0 // reenable when we can figure out the JPEG colorspace if (SkIRect::MakeWH(bitmap.width(), bitmap.height()) == subset) { SkAutoTUnref<SkData> encodedData(ref_encoded_data(bitmap)); if (is_jfif_jpeg(encodedData)) { @@ -714,5 +717,6 @@ SkPDFObject* SkPDFCreateImageObject( (encodedData, bitmap.width(), bitmap.height())); } } +#endif return SkPDFImage::CreateImage(bitmap, subset, encoder); } diff --git a/tests/PDFJpegEmbedTest.cpp b/tests/PDFJpegEmbedTest.cpp index c1d0ea845..422b59a18 100644 --- a/tests/PDFJpegEmbedTest.cpp +++ b/tests/PDFJpegEmbedTest.cpp @@ -84,7 +84,8 @@ DEF_TEST(PDFJpegEmbedTest, r) { SkASSERT(pdfData); pdf.reset(); - REPORTER_ASSERT(r, is_subset_of(mandrillData, pdfData)); + // Test disabled, waiting on resolution to http://skbug.com/3180 + // REPORTER_ASSERT(r, is_subset_of(mandrillData, pdfData)); // This JPEG uses a nonstandard colorspace - it can not be // embedded into the PDF directly. |