| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkPDFPage_DEFINED | 10 #ifndef SkPDFPage_DEFINED |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 */ | 49 */ |
| 50 void finalizePage(SkPDFCatalog* catalog, bool firstPage, | 50 void finalizePage(SkPDFCatalog* catalog, bool firstPage, |
| 51 const SkTSet<SkPDFObject*>& knownResourceObjects, | 51 const SkTSet<SkPDFObject*>& knownResourceObjects, |
| 52 SkTSet<SkPDFObject*>* newResourceObjects); | 52 SkTSet<SkPDFObject*>* newResourceObjects); |
| 53 | 53 |
| 54 /** Add destinations for this page to the supplied dictionary. | 54 /** Add destinations for this page to the supplied dictionary. |
| 55 * @param dict Dictionary to add destinations to. | 55 * @param dict Dictionary to add destinations to. |
| 56 */ | 56 */ |
| 57 void appendDestinations(SkPDFDict* dict); | 57 void appendDestinations(SkPDFDict* dict); |
| 58 | 58 |
| 59 /** Determine the size of the page content and store to the catalog | |
| 60 * the offsets of all nonresource-indirect objects that make up the page | |
| 61 * content. This must be called before emitPage(), but after finalizePage. | |
| 62 * @param catalog The catalog to add the object offsets to. | |
| 63 * @param fileOffset The file offset where the page content will be | |
| 64 * emitted. | |
| 65 */ | |
| 66 off_t getPageSize(SkPDFCatalog* catalog, off_t fileOffset); | |
| 67 | |
| 68 /** Output the page content to the passed stream. | |
| 69 * @param stream The writable output stream to send the content to. | |
| 70 * @param catalog The active object catalog. | |
| 71 */ | |
| 72 void emitPage(SkWStream* stream, SkPDFCatalog* catalog); | |
| 73 | |
| 74 /** Generate a page tree for the passed vector of pages. New objects are | 59 /** Generate a page tree for the passed vector of pages. New objects are |
| 75 * added to the catalog. The pageTree vector is populated with all of | 60 * added to the catalog. The pageTree vector is populated with all of |
| 76 * the 'Pages' dictionaries as well as the 'Page' objects. Page trees | 61 * the 'Pages' dictionaries as well as the 'Page' objects. Page trees |
| 77 * have both parent and children links, creating reference cycles, so | 62 * have both parent and children links, creating reference cycles, so |
| 78 * it must be torn down explicitly. The first page is not added to | 63 * it must be torn down explicitly. The first page is not added to |
| 79 * the pageTree dictionary array so the caller can handle it specially. | 64 * the pageTree dictionary array so the caller can handle it specially. |
| 80 * @param pages The ordered vector of page objects. | 65 * @param pages The ordered vector of page objects. |
| 81 * @param catalog The catalog to add new objects into. | 66 * @param catalog The catalog to add new objects into. |
| 82 * @param pageTree An output vector with all of the internal and leaf | 67 * @param pageTree An output vector with all of the internal and leaf |
| 83 * nodes of the pageTree. | 68 * nodes of the pageTree. |
| 84 * @param rootNode An output parameter set to the root node. | 69 * @param rootNode An output parameter set to the root node. |
| 85 */ | 70 */ |
| 86 static void GeneratePageTree(const SkTDArray<SkPDFPage*>& pages, | 71 static void GeneratePageTree(const SkTDArray<SkPDFPage*>& pages, |
| 87 SkPDFCatalog* catalog, | 72 SkPDFCatalog* catalog, |
| 88 SkTDArray<SkPDFDict*>* pageTree, | 73 SkTDArray<SkPDFDict*>* pageTree, |
| 89 SkPDFDict** rootNode); | 74 SkPDFDict** rootNode); |
| 90 | 75 |
| 91 /** Get the fonts used on this page. | 76 /** Get the fonts used on this page. |
| 92 */ | 77 */ |
| 93 const SkTDArray<SkPDFFont*>& getFontResources() const; | 78 const SkTDArray<SkPDFFont*>& getFontResources() const; |
| 94 | 79 |
| 95 /** Returns a SkPDFGlyphSetMap which represents glyph usage of every font | 80 /** Returns a SkPDFGlyphSetMap which represents glyph usage of every font |
| 96 * that shows on this page. | 81 * that shows on this page. |
| 97 */ | 82 */ |
| 98 const SkPDFGlyphSetMap& getFontGlyphUsage() const; | 83 const SkPDFGlyphSetMap& getFontGlyphUsage() const; |
| 99 | 84 |
| 85 SkPDFObject* getContentStream() const; |
| 86 |
| 100 private: | 87 private: |
| 101 // Multiple pages may reference the content. | 88 // Multiple pages may reference the content. |
| 102 SkAutoTUnref<SkPDFDevice> fDevice; | 89 SkAutoTUnref<SkPDFDevice> fDevice; |
| 103 | 90 |
| 104 // Once the content is finalized, put it into a stream for output. | 91 // Once the content is finalized, put it into a stream for output. |
| 105 SkAutoTUnref<SkPDFStream> fContentStream; | 92 SkAutoTUnref<SkPDFStream> fContentStream; |
| 106 typedef SkPDFDict INHERITED; | 93 typedef SkPDFDict INHERITED; |
| 107 }; | 94 }; |
| 108 | 95 |
| 109 #endif | 96 #endif |
| OLD | NEW |