SkPDF: PDFStream has-a not is-a PDFDict
Motivation:
SkPDFStream and SkPDFSharedStream now work the same.
Also:
- move SkPDFStream into SkPDFTypes (it's a fundamental PDF type).
- minor refactor of SkPDFSharedStream
- SkPDFSharedStream takes unique_ptr to represent ownership
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2190883003
Review-Url: https://codereview.chromium.org/2190883003
diff --git a/src/pdf/SkPDFGraphicState.cpp b/src/pdf/SkPDFGraphicState.cpp
index 3edf745..7b793e6 100644
--- a/src/pdf/SkPDFGraphicState.cpp
+++ b/src/pdf/SkPDFGraphicState.cpp
@@ -137,9 +137,9 @@
// Do not copy the trailing '\0' into the SkData.
auto invertFunction = sk_make_sp<SkPDFStream>(
SkData::MakeWithoutCopy(psInvert, strlen(psInvert)));
- invertFunction->insertInt("FunctionType", 4);
- invertFunction->insertObject("Domain", domainAndRange);
- invertFunction->insertObject("Range", std::move(domainAndRange));
+ invertFunction->dict()->insertInt("FunctionType", 4);
+ invertFunction->dict()->insertObject("Domain", domainAndRange);
+ invertFunction->dict()->insertObject("Range", std::move(domainAndRange));
return invertFunction;
}