Index: src/pdf/SkPDFTypes.cpp |
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp |
index 4cd48f4757e55a5f081ee517d3ae6bbb03b3838b..faa08372e5e8c591b533526632dd691c033c6d83 100644 |
--- a/src/pdf/SkPDFTypes.cpp |
+++ b/src/pdf/SkPDFTypes.cpp |
@@ -177,9 +177,7 @@ void SkPDFUnion::addResources(SkPDFObjNumMap* objNumMap, |
return; // These have no resources. |
case Type::kObjRef: { |
SkPDFObject* obj = substituteMap.getSubstitute(fObject); |
- if (objNumMap->addObject(obj)) { |
- obj->addResources(objNumMap, substituteMap); |
- } |
+ objNumMap->addObjectRecursively(obj, substituteMap); |
return; |
} |
case Type::kObject: |
@@ -500,6 +498,13 @@ bool SkPDFObjNumMap::addObject(SkPDFObject* obj) { |
return true; |
} |
+void SkPDFObjNumMap::addObjectRecursively(SkPDFObject* obj, |
+ const SkPDFSubstituteMap& subs) { |
+ if (obj && this->addObject(obj)) { |
+ obj->addResources(this, subs); |
+ } |
+} |
+ |
int32_t SkPDFObjNumMap::getObjectNumber(SkPDFObject* obj) const { |
int32_t* objectNumberFound = fObjectNumbers.find(obj); |
SkASSERT(objectNumberFound); |