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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 1788263002: SkPDF: remove all globally references SkPDFObjects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add explanatory comments Created 4 years, 9 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/SkPDFCanon.cpp ('k') | src/pdf/SkPDFGraphicState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 744d42d25ea169dc4628c6fedbcb29555f928b68..e349ce42fb843ad0c5172547a8cd633fbe1abd6a 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1742,8 +1742,8 @@ void SkPDFDevice::drawFormXObjectWithMask(int xObjectIndex,
return;
}
- sk_sp<SkPDFObject> sMaskGS(SkPDFGraphicState::GetSMaskGraphicState(
- mask, invertClip, SkPDFGraphicState::kAlpha_SMaskMode));
+ auto sMaskGS = SkPDFGraphicState::GetSMaskGraphicState(
+ mask, invertClip, SkPDFGraphicState::kAlpha_SMaskMode, fCanon);
SkMatrix identity;
identity.reset();
@@ -1757,7 +1757,10 @@ void SkPDFDevice::drawFormXObjectWithMask(int xObjectIndex,
&content.entry()->fContent);
SkPDFUtils::DrawFormXObject(xObjectIndex, &content.entry()->fContent);
- sMaskGS.reset(SkPDFGraphicState::GetNoSMaskGraphicState());
+ // Call makeNoSmaskGraphicState() instead of
+ // SkPDFGraphicState::MakeNoSmaskGraphicState so that the canon
+ // can deduplicate.
+ sMaskGS = fCanon->makeNoSmaskGraphicState();
SkPDFUtils::ApplyGraphicState(addGraphicStateResource(sMaskGS.get()),
&content.entry()->fContent);
}
« no previous file with comments | « src/pdf/SkPDFCanon.cpp ('k') | src/pdf/SkPDFGraphicState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698