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

Unified Diff: src/pdf/SkPDFFormXObject.cpp

Issue 18977002: Add SkPDFResourceDict class, refactor existing code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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
Index: src/pdf/SkPDFFormXObject.cpp
diff --git a/src/pdf/SkPDFFormXObject.cpp b/src/pdf/SkPDFFormXObject.cpp
index 5384a0419537062f16a7d39c75ae775cefa7179c..f31b90b79c389be4c46952261f59de25b16921b3 100644
--- a/src/pdf/SkPDFFormXObject.cpp
+++ b/src/pdf/SkPDFFormXObject.cpp
@@ -13,6 +13,7 @@
#include "SkMatrix.h"
#include "SkPDFCatalog.h"
#include "SkPDFDevice.h"
+#include "SkPDFResourceDict.h"
#include "SkPDFUtils.h"
#include "SkTypes.h"
@@ -21,7 +22,8 @@ SkPDFFormXObject::SkPDFFormXObject(SkPDFDevice* device) {
// of content, so reference or copy everything we need (content and
// resources).
SkTSet<SkPDFObject*> emptySet;
- device->getResources(emptySet, &fResources, false);
+ SkPDFResourceDict* resourceDict = device->getResourceDict();
+ resourceDict->getResources(emptySet, &fResources, false);
SkAutoTUnref<SkData> content(device->copyContentToData());
setData(content.get());
@@ -29,7 +31,7 @@ SkPDFFormXObject::SkPDFFormXObject(SkPDFDevice* device) {
insertName("Type", "XObject");
insertName("Subtype", "Form");
SkSafeUnref(this->insert("BBox", device->copyMediaBox()));
- insert("Resources", device->getResourceDict());
+ insert("Resources", resourceDict);
// We invert the initial transform and apply that to the xobject so that
// it doesn't get applied twice. We can't just undo it because it's

Powered by Google App Engine
This is Rietveld 408576698