| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
| 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 | 8 |
| 9 #ifndef SkPDFTypes_DEFINED | 9 #ifndef SkPDFTypes_DEFINED |
| 10 #define SkPDFTypes_DEFINED | 10 #define SkPDFTypes_DEFINED |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 /** \class SkPDFObject | 24 /** \class SkPDFObject |
| 25 | 25 |
| 26 A PDF Object is the base class for primitive elements in a PDF file. A | 26 A PDF Object is the base class for primitive elements in a PDF file. A |
| 27 common subtype is used to ease the use of indirect object references, | 27 common subtype is used to ease the use of indirect object references, |
| 28 which are common in the PDF format. | 28 which are common in the PDF format. |
| 29 | 29 |
| 30 */ | 30 */ |
| 31 class SkPDFObject : public SkRefCnt { | 31 class SkPDFObject : public SkRefCnt { |
| 32 public: | 32 public: |
| 33 SK_DECLARE_INST_COUNT(SkPDFObject); | 33 |
| 34 | 34 |
| 35 /** Subclasses must implement this method to print the object to the | 35 /** Subclasses must implement this method to print the object to the |
| 36 * PDF file. | 36 * PDF file. |
| 37 * @param catalog The object catalog to use. | 37 * @param catalog The object catalog to use. |
| 38 * @param stream The writable output stream to send the output to. | 38 * @param stream The writable output stream to send the output to. |
| 39 */ | 39 */ |
| 40 // TODO(halcanary): make this method const | 40 // TODO(halcanary): make this method const |
| 41 virtual void emitObject(SkWStream* stream, | 41 virtual void emitObject(SkWStream* stream, |
| 42 const SkPDFObjNumMap& objNumMap, | 42 const SkPDFObjNumMap& objNumMap, |
| 43 const SkPDFSubstituteMap& substitutes) = 0; | 43 const SkPDFSubstituteMap& substitutes) = 0; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 #endif // 0 | 181 #endif // 0 |
| 182 | 182 |
| 183 //////////////////////////////////////////////////////////////////////////////// | 183 //////////////////////////////////////////////////////////////////////////////// |
| 184 | 184 |
| 185 /** \class SkPDFArray | 185 /** \class SkPDFArray |
| 186 | 186 |
| 187 An array object in a PDF. | 187 An array object in a PDF. |
| 188 */ | 188 */ |
| 189 class SkPDFArray : public SkPDFObject { | 189 class SkPDFArray : public SkPDFObject { |
| 190 public: | 190 public: |
| 191 SK_DECLARE_INST_COUNT(SkPDFArray) | 191 |
| 192 | 192 |
| 193 static const int kMaxLen = 8191; | 193 static const int kMaxLen = 8191; |
| 194 | 194 |
| 195 /** Create a PDF array. Maximum length is 8191. | 195 /** Create a PDF array. Maximum length is 8191. |
| 196 */ | 196 */ |
| 197 SkPDFArray(); | 197 SkPDFArray(); |
| 198 virtual ~SkPDFArray(); | 198 virtual ~SkPDFArray(); |
| 199 | 199 |
| 200 // The SkPDFObject interface. | 200 // The SkPDFObject interface. |
| 201 void emitObject(SkWStream* stream, | 201 void emitObject(SkWStream* stream, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 232 void append(SkPDFUnion&& value); | 232 void append(SkPDFUnion&& value); |
| 233 typedef SkPDFObject INHERITED; | 233 typedef SkPDFObject INHERITED; |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 /** \class SkPDFDict | 236 /** \class SkPDFDict |
| 237 | 237 |
| 238 A dictionary object in a PDF. | 238 A dictionary object in a PDF. |
| 239 */ | 239 */ |
| 240 class SkPDFDict : public SkPDFObject { | 240 class SkPDFDict : public SkPDFObject { |
| 241 public: | 241 public: |
| 242 SK_DECLARE_INST_COUNT(SkPDFDict) | 242 |
| 243 | 243 |
| 244 /** Create a PDF dictionary. Maximum number of entries is 4095. | 244 /** Create a PDF dictionary. Maximum number of entries is 4095. |
| 245 */ | 245 */ |
| 246 SkPDFDict(); | 246 SkPDFDict(); |
| 247 | 247 |
| 248 /** Create a PDF dictionary with a Type entry. | 248 /** Create a PDF dictionary with a Type entry. |
| 249 * @param type The value of the Type entry. | 249 * @param type The value of the Type entry. |
| 250 */ | 250 */ |
| 251 explicit SkPDFDict(const char type[]); | 251 explicit SkPDFDict(const char type[]); |
| 252 | 252 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 352 |
| 353 SkPDFObject* operator()(SkPDFObject* o) const { | 353 SkPDFObject* operator()(SkPDFObject* o) const { |
| 354 return this->getSubstitute(o); | 354 return this->getSubstitute(o); |
| 355 } | 355 } |
| 356 | 356 |
| 357 private: | 357 private: |
| 358 SkTHashMap<SkPDFObject*, SkPDFObject*> fSubstituteMap; | 358 SkTHashMap<SkPDFObject*, SkPDFObject*> fSubstituteMap; |
| 359 }; | 359 }; |
| 360 | 360 |
| 361 #endif | 361 #endif |
| OLD | NEW |