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

Unified Diff: src/pdf/SkPDFGraphicState.cpp

Issue 870333002: Simplify reference management in SkPDF (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make Created 5 years, 10 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/SkPDFGraphicState.h ('k') | src/pdf/SkPDFImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFGraphicState.cpp
diff --git a/src/pdf/SkPDFGraphicState.cpp b/src/pdf/SkPDFGraphicState.cpp
index 0e0873d9f0c8cc60bfb12e510f47f50559f6f411..46aa1d1ea40aa3d85ba85fb72ea899eabefbd68d 100644
--- a/src/pdf/SkPDFGraphicState.cpp
+++ b/src/pdf/SkPDFGraphicState.cpp
@@ -117,13 +117,6 @@ SkPDFGraphicState::~SkPDFGraphicState() {
if (!fSMask) {
SkPDFCanon::GetCanon().removeGraphicState(this);
}
- fResources.unrefAll();
-}
-
-void SkPDFGraphicState::getResources(
- const SkTSet<SkPDFObject*>& knownResourceObjects,
- SkTSet<SkPDFObject*>* newResourceObjects) {
- GetResourcesHelper(&fResources, knownResourceObjects, newResourceObjects);
}
void SkPDFGraphicState::emitObject(SkWStream* stream, SkPDFCatalog* catalog) {
@@ -174,11 +167,6 @@ SK_DECLARE_STATIC_LAZY_PTR(SkPDFObject, invertFunction,
create_invert_function, unref<SkPDFObject>);
// static
-SkPDFObject* SkPDFGraphicState::GetInvertFunction() {
- return invertFunction.get();
-}
-
-// static
SkPDFGraphicState* SkPDFGraphicState::GetSMaskGraphicState(
SkPDFFormXObject* sMask, bool invert, SkPDFSMaskMode sMaskMode) {
// The practical chances of using the same mask more than once are unlikely
@@ -196,14 +184,9 @@ SkPDFGraphicState* SkPDFGraphicState::GetSMaskGraphicState(
result->fSMask = true;
result->insertName("Type", "ExtGState");
result->insert("SMask", sMaskDict.get());
- result->fResources.push(sMask);
- sMask->ref();
if (invert) {
- SkPDFObject* invertFunction = GetInvertFunction();
- result->fResources.push(invertFunction);
- invertFunction->ref();
- sMaskDict->insert("TR", new SkPDFObjRef(invertFunction))->unref();
+ sMaskDict->insert("TR", new SkPDFObjRef(invertFunction.get()))->unref();
}
return result;
« no previous file with comments | « src/pdf/SkPDFGraphicState.h ('k') | src/pdf/SkPDFImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698