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

Unified Diff: src/pdf/SkPDFTypes.cpp

Issue 1038523004: SkPDF SkPDFObject::addResources signature simplified (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-03-25 (Wednesday) 15:53:41 EDT Created 5 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/SkPDFTypes.h ('k') | src/pdf/SkTSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFTypes.cpp
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp
index 8bb19360e121af8b34b075d65984ea7f251b5a48..02c5573360026a6274b4f80fe3fb9c55b37b95d0 100644
--- a/src/pdf/SkPDFTypes.cpp
+++ b/src/pdf/SkPDFTypes.cpp
@@ -31,12 +31,11 @@ void SkPDFObjRef::emitObject(SkWStream* stream, SkPDFCatalog* catalog) {
stream->writeText(" 0 R"); // Generation number is always 0.
}
-void SkPDFObjRef::addResources(SkTSet<SkPDFObject*>* resourceSet,
- SkPDFCatalog* catalog) const {
+void SkPDFObjRef::addResources(SkPDFCatalog* catalog) const {
SkPDFObject* obj = catalog->getSubstituteObject(fObj);
SkASSERT(obj);
- if (resourceSet->add(obj)) {
- obj->addResources(resourceSet, catalog);
+ if (catalog->addObject(obj)) {
+ obj->addResources(catalog);
}
}
@@ -257,11 +256,9 @@ void SkPDFArray::emitObject(SkWStream* stream, SkPDFCatalog* catalog) {
stream->writeText("]");
}
-void SkPDFArray::addResources(SkTSet<SkPDFObject*>* resourceSet,
- SkPDFCatalog* catalog) const {
+void SkPDFArray::addResources(SkPDFCatalog* catalog) const {
for (int i = 0; i < fValue.count(); i++) {
- catalog->getSubstituteObject(fValue[i])
- ->addResources(resourceSet, catalog);
+ catalog->getSubstituteObject(fValue[i])->addResources(catalog);
}
}
@@ -330,14 +327,12 @@ void SkPDFDict::emitObject(SkWStream* stream, SkPDFCatalog* catalog) {
stream->writeText(">>");
}
-void SkPDFDict::addResources(SkTSet<SkPDFObject*>* resourceSet,
- SkPDFCatalog* catalog) const {
+void SkPDFDict::addResources(SkPDFCatalog* catalog) const {
for (int i = 0; i < fValue.count(); i++) {
SkASSERT(fValue[i].key);
SkASSERT(fValue[i].value);
- fValue[i].key->addResources(resourceSet, catalog);
- catalog->getSubstituteObject(fValue[i].value)
- ->addResources(resourceSet, catalog);
+ fValue[i].key->addResources(catalog);
+ catalog->getSubstituteObject(fValue[i].value)->addResources(catalog);
}
}
« no previous file with comments | « src/pdf/SkPDFTypes.h ('k') | src/pdf/SkTSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698