Index: src/pdf/SkPDFBitmap.cpp |
diff --git a/src/pdf/SkPDFBitmap.cpp b/src/pdf/SkPDFBitmap.cpp |
index 772745ca50aa29e05fc4435e04a556746fc841d2..2d789d04d8dca92891e439d0bb22be661d21f1e0 100644 |
--- a/src/pdf/SkPDFBitmap.cpp |
+++ b/src/pdf/SkPDFBitmap.cpp |
@@ -346,8 +346,7 @@ static void emit_image_xobject(SkWStream* stream, |
const SkImage* image, |
bool alpha, |
const sk_sp<SkPDFObject>& smask, |
- const SkPDFObjNumMap& objNumMap, |
- const SkPDFSubstituteMap& substitutes) { |
+ const SkPDFObjNumMap& objNumMap) { |
SkBitmap bitmap; |
image_get_ro_pixels(image, &bitmap); // TODO(halcanary): test |
SkAutoLockPixels autoLockPixels(bitmap); // with malformed images. |
@@ -385,7 +384,7 @@ static void emit_image_xobject(SkWStream* stream, |
pdfDict.insertInt("BitsPerComponent", 8); |
pdfDict.insertName("Filter", "FlateDecode"); |
pdfDict.insertInt("Length", asset->getLength()); |
- pdfDict.emitObject(stream, objNumMap, substitutes); |
+ pdfDict.emitObject(stream, objNumMap); |
pdf_stream_begin(stream); |
stream->writeStream(asset.get(), asset->getLength()); |
@@ -400,10 +399,9 @@ class PDFAlphaBitmap final : public SkPDFObject { |
public: |
PDFAlphaBitmap(sk_sp<SkImage> image) : fImage(std::move(image)) { SkASSERT(fImage); } |
void emitObject(SkWStream* stream, |
- const SkPDFObjNumMap& objNumMap, |
- const SkPDFSubstituteMap& subs) const override { |
+ const SkPDFObjNumMap& objNumMap) const override { |
SkASSERT(fImage); |
- emit_image_xobject(stream, fImage.get(), true, nullptr, objNumMap, subs); |
+ emit_image_xobject(stream, fImage.get(), true, nullptr, objNumMap); |
} |
void drop() override { fImage = nullptr; } |
@@ -419,19 +417,12 @@ namespace { |
class PDFDefaultBitmap final : public SkPDFObject { |
public: |
void emitObject(SkWStream* stream, |
- const SkPDFObjNumMap& objNumMap, |
- const SkPDFSubstituteMap& subs) const override { |
+ const SkPDFObjNumMap& objNumMap) const override { |
SkASSERT(fImage); |
- emit_image_xobject(stream, fImage.get(), false, fSMask, objNumMap, subs); |
+ emit_image_xobject(stream, fImage.get(), false, fSMask, objNumMap); |
} |
- void addResources(SkPDFObjNumMap* catalog, |
- const SkPDFSubstituteMap& subs) const override { |
- SkASSERT(fImage); |
- if (fSMask.get()) { |
- SkPDFObject* obj = subs.getSubstitute(fSMask.get()); |
- SkASSERT(obj); |
- catalog->addObjectRecursively(obj, subs); |
- } |
+ void addResources(SkPDFObjNumMap* catalog) const override { |
+ catalog->addObjectRecursively(fSMask.get()); |
} |
void drop() override { fImage = nullptr; fSMask = nullptr; } |
PDFDefaultBitmap(sk_sp<SkImage> image, sk_sp<SkPDFObject> smask) |
@@ -458,15 +449,12 @@ public: |
bool fIsYUV; |
PDFJpegBitmap(SkISize size, SkData* data, bool isYUV) |
: fSize(size), fData(SkRef(data)), fIsYUV(isYUV) { SkASSERT(data); } |
- void emitObject(SkWStream*, |
- const SkPDFObjNumMap&, |
- const SkPDFSubstituteMap&) const override; |
+ void emitObject(SkWStream*, const SkPDFObjNumMap&) const override; |
void drop() override { fData = nullptr; } |
}; |
void PDFJpegBitmap::emitObject(SkWStream* stream, |
- const SkPDFObjNumMap& objNumMap, |
- const SkPDFSubstituteMap& substituteMap) const { |
+ const SkPDFObjNumMap& objNumMap) const { |
SkASSERT(fData); |
SkPDFDict pdfDict("XObject"); |
pdfDict.insertName("Subtype", "Image"); |
@@ -481,7 +469,7 @@ void PDFJpegBitmap::emitObject(SkWStream* stream, |
pdfDict.insertName("Filter", "DCTDecode"); |
pdfDict.insertInt("ColorTransform", 0); |
pdfDict.insertInt("Length", SkToInt(fData->size())); |
- pdfDict.emitObject(stream, objNumMap, substituteMap); |
+ pdfDict.emitObject(stream, objNumMap); |
pdf_stream_begin(stream); |
stream->write(fData->data(), fData->size()); |
pdf_stream_end(stream); |