aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFShader.cpp
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-06-28 13:14:03 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-28 19:09:09 +0000
commitc02de0b844fdb04e28e45ed5bbdd5eb0935c42d2 (patch)
tree7af66bdd955540e1040b4d3fead2027bb433031c /src/pdf/SkPDFShader.cpp
parent89cd35795f7cc3042084fb14fec27102c6e67f2c (diff)
SkPDF: Clean up
- Use clearMaskOnGraphicState() - SkPDFGraphicState::MakeNoSmaskGraphicState now moved to only caller. - Get rid of clunky SkPDFUtils::GetCachedT Change-Id: If76a1e915fc31e3ce2654fbe620ff44c1820c0e7 Reviewed-on: https://skia-review.googlesource.com/21142 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/pdf/SkPDFShader.cpp')
-rw-r--r--src/pdf/SkPDFShader.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index 9cf40d42e6..235d66341b 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -934,10 +934,13 @@ static sk_sp<SkPDFDict> make_function_shader(SkPDFCanon* canon,
pdfShader->insertObject("Domain", domain);
std::unique_ptr<SkStreamAsset> functionStream(functionCode.detachAsStream());
- sk_sp<SkPDFArray> rangeObject =
- SkPDFUtils::GetCachedT(&canon->fRangeObject, &make_range_object);
+
+ sk_sp<SkPDFArray>& rangeObject = canon->fRangeObject;
+ if (!rangeObject) {
+ rangeObject = make_range_object();
+ }
sk_sp<SkPDFStream> function = make_ps_function(std::move(functionStream), std::move(domain),
- std::move(rangeObject));
+ rangeObject);
pdfShader->insertObjRef("Function", std::move(function));
}