aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFShader.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-07-29 10:13:18 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-29 10:13:18 -0700
commitfa25106f02f26d7a149cfe57c1d4756372e0755c (patch)
tree01736ac9c78333d51ababc1cf2f48422979319e1 /src/pdf/SkPDFShader.cpp
parentd05a8752738f84b0115678b3cdad89237173e904 (diff)
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
Diffstat (limited to 'src/pdf/SkPDFShader.cpp')
-rw-r--r--src/pdf/SkPDFShader.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index 612ff87074..31af569fe9 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -743,8 +743,9 @@ SkPDFAlphaFunctionShader* SkPDFAlphaFunctionShader::Create(
create_pattern_fill_content(0, bbox));
alphaFunctionShader->setData(std::move(colorStream));
- populate_tiling_pattern_dict(alphaFunctionShader, bbox, resourceDict.get(),
- SkMatrix::I());
+ populate_tiling_pattern_dict(
+ alphaFunctionShader->dict(), bbox, resourceDict.get(),
+ SkMatrix::I());
doc->canon()->addAlphaShader(alphaFunctionShader);
return alphaFunctionShader;
}
@@ -804,9 +805,9 @@ static sk_sp<SkPDFStream> make_ps_function(
SkPDFArray* domain,
sk_sp<SkPDFObject> range) {
auto result = sk_make_sp<SkPDFStream>(std::move(psCode));
- result->insertInt("FunctionType", 4);
- result->insertObject("Domain", sk_ref_sp(domain));
- result->insertObject("Range", std::move(range));
+ result->dict()->insertInt("FunctionType", 4);
+ result->dict()->insertObject("Domain", sk_ref_sp(domain));
+ result->dict()->insertObject("Range", std::move(range));
return result;
}
@@ -1213,7 +1214,7 @@ SkPDFImageShader* SkPDFImageShader::Create(
imageShader->setData(patternDevice->content());
auto resourceDict = patternDevice->makeResourceDict();
- populate_tiling_pattern_dict(imageShader, patternBBox,
+ populate_tiling_pattern_dict(imageShader->dict(), patternBBox,
resourceDict.get(), finalMatrix);
imageShader->fShaderState->fImage.unlockPixels();