aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFResourceDict.h
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-04-09 13:27:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-09 13:27:40 -0700
commit2b86155b42c2493ff0c558ce105a464769962274 (patch)
tree1a4a5d3b1613662902dbb1e96c29c61b11cb98dc /src/pdf/SkPDFResourceDict.h
parent29be7958de367a7067a3a236c5a23f88ce8e53a4 (diff)
SkPDF: ResourceDict replaced by factory function
Motivation: Having a class here was unnecessary, since the only thing that set this class apart was how it is created, not how it behaves. BUG=skia:3585 Review URL: https://codereview.chromium.org/1068343003
Diffstat (limited to 'src/pdf/SkPDFResourceDict.h')
-rw-r--r--src/pdf/SkPDFResourceDict.h48
1 files changed, 10 insertions, 38 deletions
diff --git a/src/pdf/SkPDFResourceDict.h b/src/pdf/SkPDFResourceDict.h
index 22173719fe..291377903f 100644
--- a/src/pdf/SkPDFResourceDict.h
+++ b/src/pdf/SkPDFResourceDict.h
@@ -18,11 +18,9 @@
allows generation of a list of referenced SkPDFObjects inserted with
insertResourceAsRef.
*/
-class SkPDFResourceDict : public SkPDFDict {
+class SkPDFResourceDict {
public:
- SK_DECLARE_INST_COUNT(SkPDFResourceDict)
-
- enum SkPDFResourceType{
+ enum SkPDFResourceType {
kExtGState_ResourceType,
kPattern_ResourceType,
kXObject_ResourceType,
@@ -30,28 +28,19 @@ public:
// These additional types are defined by the spec, but not
// currently used by Skia: ColorSpace, Shading, Properties
kResourceTypeCount
- };
+ };
/** Create a PDF resource dictionary.
* The full set of ProcSet entries is automatically created for backwards
* compatibility, as recommended by the PDF spec.
+ *
+ * Any arguments can be NULL.
*/
- SkPDFResourceDict();
-
- /** Add the value SkPDFObject as a reference to the resource dictionary
- * with the give type and key.
- * The relevant sub-dicts will be automatically generated, and the
- * resource will be named by concatenating a type-specific prefix and
- * the input key.
- * This object will be part of the resource list when requested later.
- * @param type The type of resource being entered, like
- * kPattern_ResourceType or kExtGState_ResourceType.
- * @param key The resource key, should be unique within its type.
- * @param value The resource itself.
- * @return The value argument is returned.
- */
- SkPDFObject* insertResourceAsReference(SkPDFResourceType type, int key,
- SkPDFObject* value);
+ static SkPDFDict* Create(
+ const SkTDArray<SkPDFObject*>* gStateResources,
+ const SkTDArray<SkPDFObject*>* patternResources,
+ const SkTDArray<SkPDFObject*>* xObjectResources,
+ const SkTDArray<SkPDFObject*>* fontResources);
/**
* Returns the name for the resource that will be generated by the resource
@@ -62,23 +51,6 @@ public:
* @param key The resource key, should be unique within its type.
*/
static SkString getResourceName(SkPDFResourceType type, int key);
-
-private:
- /** Add the value to the dictionary with the given key. Refs value.
- * The relevant sub-dicts will be automatically generated, and the
- * resource will be named by concatenating a type-specific prefix and
- * the input key.
- * The object will NOT be part of the resource list when requested later.
- * @param type The type of resource being entered.
- * @param key The resource key, should be unique within its type.
- * @param value The resource itself.
- * @return The value argument is returned.
- */
- SkPDFObject* insertResource(SkPDFResourceType type, int key,
- SkPDFObject* value);
-
- SkTDArray<SkPDFDict*> fTypes;
- typedef SkPDFDict INHERITED;
};
#endif