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

Side by Side Diff: src/pdf/SkPDFResourceDict.h

Issue 870333002: Simplify reference management in SkPDF (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFPage.cpp ('k') | src/pdf/SkPDFResourceDict.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPDFResourceDict_DEFINED 8 #ifndef SkPDFResourceDict_DEFINED
9 #define SkPDFResourceDict_DEFINED 9 #define SkPDFResourceDict_DEFINED
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 * @param type The type of resource being entered, like 48 * @param type The type of resource being entered, like
49 * kPattern_ResourceType or kExtGState_ResourceType. 49 * kPattern_ResourceType or kExtGState_ResourceType.
50 * @param key The resource key, should be unique within its type. 50 * @param key The resource key, should be unique within its type.
51 * @param value The resource itself. 51 * @param value The resource itself.
52 * @return The value argument is returned. 52 * @return The value argument is returned.
53 */ 53 */
54 SkPDFObject* insertResourceAsReference(SkPDFResourceType type, int key, 54 SkPDFObject* insertResourceAsReference(SkPDFResourceType type, int key,
55 SkPDFObject* value); 55 SkPDFObject* value);
56 56
57 /** 57 /**
58 * Gets resources inserted into this dictionary as a reference.
59 *
60 * @param knownResourceObjects Set containing currently known resources.
61 * Resources in the dict and this set will not be added to the output.
62 * @param newResourceObjects Output set to which non-preexisting resources
63 * will be added.
64 * @param recursive Whether or not to add resources of resources.
65 */
66 void getReferencedResources(
67 const SkTSet<SkPDFObject*>& knownResourceObjects,
68 SkTSet<SkPDFObject*>* newResourceObjects,
69 bool recursive) const;
70
71 /**
72 * Returns the name for the resource that will be generated by the resource 58 * Returns the name for the resource that will be generated by the resource
73 * dict. 59 * dict.
74 * 60 *
75 * @param type The type of resource being entered, like 61 * @param type The type of resource being entered, like
76 * kPattern_ResourceType or kExtGState_ResourceType. 62 * kPattern_ResourceType or kExtGState_ResourceType.
77 * @param key The resource key, should be unique within its type. 63 * @param key The resource key, should be unique within its type.
78 */ 64 */
79 static SkString getResourceName(SkPDFResourceType type, int key); 65 static SkString getResourceName(SkPDFResourceType type, int key);
80 66
81 private: 67 private:
(...skipping 10 matching lines...) Expand all
92 SkPDFObject* insertResource(SkPDFResourceType type, int key, 78 SkPDFObject* insertResource(SkPDFResourceType type, int key,
93 SkPDFObject* value); 79 SkPDFObject* value);
94 80
95 SkTSet<SkPDFObject*> fResources; 81 SkTSet<SkPDFObject*> fResources;
96 82
97 SkTDArray<SkPDFDict*> fTypes; 83 SkTDArray<SkPDFDict*> fTypes;
98 typedef SkPDFDict INHERITED; 84 typedef SkPDFDict INHERITED;
99 }; 85 };
100 86
101 #endif 87 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFPage.cpp ('k') | src/pdf/SkPDFResourceDict.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698