aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFTypes.h
diff options
context:
space:
mode:
authorGravatar edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-19 17:19:05 +0000
committerGravatar edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-19 17:19:05 +0000
commit66bedbb02dbd252f46c1fad862d0561a0bb3f94b (patch)
tree79627a69234e8df7883dfbc9243c7120aba2952e /src/pdf/SkPDFTypes.h
parentf315451f78760e6e2066c09da3644ce93e0580e6 (diff)
resubmit https://code.google.com/p/skia/source/detail?r=7883 (in the meantime we added capability to collect minidump and callstack if buildbot fails with heap coruption in windows. a few minor conflicts have been resolved)
Review URL: https://codereview.chromium.org/12840004 git-svn-id: http://skia.googlecode.com/svn/trunk@8233 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf/SkPDFTypes.h')
-rw-r--r--src/pdf/SkPDFTypes.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/pdf/SkPDFTypes.h b/src/pdf/SkPDFTypes.h
index 98223aeb56..5ed6386bdd 100644
--- a/src/pdf/SkPDFTypes.h
+++ b/src/pdf/SkPDFTypes.h
@@ -14,6 +14,7 @@
#include "SkScalar.h"
#include "SkString.h"
#include "SkTDArray.h"
+#include "SkTSet.h"
#include "SkTypes.h"
class SkPDFCatalog;
@@ -38,13 +39,16 @@ public:
virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect);
/** For non-primitive objects (i.e. objects defined outside this file),
- * this method will add to resourceList any objects that this method
- * depends on. This operates recursively so if this object depends on
- * another object and that object depends on two more, all three objects
- * will be added.
- * @param resourceList The list to append dependant resources to.
+ * this method will add to newResourceObjects any objects that this method
+ * depends on, but not already in knownResourceObjects. This operates
+ * recursively so if this object depends on another object and that object
+ * depends on two more, all three objects will be added.
+ *
+ * @param knownResourceObjects The set of resources to be ignored.
+ * @param newResourceObjects The set to append dependant resources to.
*/
- virtual void getResources(SkTDArray<SkPDFObject*>* resourceList);
+ virtual void getResources(const SkTSet<SkPDFObject*>& knownResourceObjects,
+ SkTSet<SkPDFObject*>* newResourceObjects);
/** Emit this object unless the catalog has a substitute object, in which
* case emit that.
@@ -74,10 +78,16 @@ public:
/** Static helper function to copy and reference the resources (and all
* their subresources) into a new list.
* @param resources The resource list.
- * @param result The list to add to.
- */
- static void GetResourcesHelper(SkTDArray<SkPDFObject*>* resources,
- SkTDArray<SkPDFObject*>* result);
+ * @param newResourceObjects All the resource objects (recursively) used on
+ * the page are added to this array. This gives
+ * the caller a chance to deduplicate resources
+ * across pages.
+ * @param knownResourceObjects The set of resources to be ignored.
+ */
+ static void GetResourcesHelper(
+ const SkTDArray<SkPDFObject*>* resources,
+ const SkTSet<SkPDFObject*>& knownResourceObjects,
+ SkTSet<SkPDFObject*>* newResourceObjects);
protected:
/** Subclasses must implement this method to print the object to the