Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1588)

Unified Diff: src/pdf/SkPDFShader.cpp

Issue 2188623004: SkPDF: SkPDFStream takes a unique_ptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFFormXObject.cpp ('k') | src/pdf/SkPDFStream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFShader.cpp
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index 37df2962803afed87160a4dc2e0f5f71e5f9a9f3..13b4479dec3be37ddbfecebb89e0081538c69187 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -704,7 +704,7 @@ static sk_sp<SkPDFObject> create_smask_graphic_state(
get_gradient_resource_dict(luminosityShader.get(), nullptr);
sk_sp<SkPDFFormXObject> alphaMask(
- new SkPDFFormXObject(alphaStream.get(), bbox, resources.get()));
+ new SkPDFFormXObject(std::move(alphaStream), bbox, resources.get()));
return SkPDFGraphicState::GetSMaskGraphicState(
alphaMask.get(), false,
@@ -739,7 +739,7 @@ SkPDFAlphaFunctionShader* SkPDFAlphaFunctionShader::Create(
std::unique_ptr<SkStreamAsset> colorStream(
create_pattern_fill_content(0, bbox));
- alphaFunctionShader->setData(colorStream.get());
+ alphaFunctionShader->setData(std::move(colorStream));
populate_tiling_pattern_dict(alphaFunctionShader, bbox, resourceDict.get(),
SkMatrix::I());
@@ -801,7 +801,7 @@ static sk_sp<SkPDFStream> make_ps_function(
std::unique_ptr<SkStreamAsset> psCode,
SkPDFArray* domain,
sk_sp<SkPDFObject> range) {
- auto result = sk_make_sp<SkPDFStream>(psCode.get());
+ 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));
@@ -1207,10 +1207,8 @@ SkPDFImageShader* SkPDFImageShader::Create(
}
// Put the canvas into the pattern stream (fContent).
- auto content = patternDevice->content();
-
SkPDFImageShader* imageShader = new SkPDFImageShader(autoState->release());
- imageShader->setData(content.get());
+ imageShader->setData(patternDevice->content());
auto resourceDict = patternDevice->makeResourceDict();
populate_tiling_pattern_dict(imageShader, patternBBox,
« no previous file with comments | « src/pdf/SkPDFFormXObject.cpp ('k') | src/pdf/SkPDFStream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698