| OLD | NEW |
| 1 #ifndef EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKNATIVEPARSEDPDF_H_ | 1 #ifndef EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKNATIVEPARSEDPDF_H_ |
| 2 #define EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKNATIVEPARSEDPDF_H_ | 2 #define EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKNATIVEPARSEDPDF_H_ |
| 3 | 3 |
| 4 #include "SkRect.h" | 4 #include "SkRect.h" |
| 5 #include "SkTDArray.h" | 5 #include "SkTDArray.h" |
| 6 | 6 |
| 7 class SkCanvas; | 7 class SkCanvas; |
| 8 | 8 |
| 9 class SkPdfAllocator; | 9 class SkPdfAllocator; |
| 10 class SkPdfMapper; | 10 class SkPdfMapper; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 SkPdfObject* resolveReference(const SkPdfObject* ref); | 66 SkPdfObject* resolveReference(const SkPdfObject* ref); |
| 67 | 67 |
| 68 // Reports an approximation of all the memory usage. | 68 // Reports an approximation of all the memory usage. |
| 69 size_t bytesUsed() const; | 69 size_t bytesUsed() const; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 | 72 |
| 73 // Takes ownership of bytes. | 73 // Takes ownership of bytes. |
| 74 void init(const void* bytes, size_t length); | 74 void init(const void* bytes, size_t length); |
| 75 void loadWithoutXRef(); |
| 75 | 76 |
| 76 const unsigned char* readCrossReferenceSection(const unsigned char* xrefStar
t, const unsigned char* trailerEnd); | 77 const unsigned char* readCrossReferenceSection(const unsigned char* xrefStar
t, const unsigned char* trailerEnd); |
| 77 long readTrailer(const unsigned char* trailerStart, const unsigned char* tra
ilerEnd, bool storeCatalog); | 78 const unsigned char* readTrailer(const unsigned char* trailerStart, const un
signed char* trailerEnd, bool storeCatalog, long* prev, bool skipKeyword); |
| 78 | 79 |
| 79 // TODO(edisonn): updates not supported right now, generation ignored | 80 // TODO(edisonn): updates not supported right now, generation ignored |
| 80 void addCrossSectionInfo(int id, int generation, int offset, bool isFreed); | 81 void addCrossSectionInfo(int id, int generation, int offset, bool isFreed); |
| 81 static void reset(PublicObjectEntry* obj) { | 82 static void reset(PublicObjectEntry* obj) { |
| 82 obj->fObj = NULL; | 83 obj->fObj = NULL; |
| 83 obj->fResolvedReference = NULL; | 84 obj->fResolvedReference = NULL; |
| 84 obj->fOffset = -1; | 85 obj->fOffset = -1; |
| 85 } | 86 } |
| 86 | 87 |
| 87 SkPdfObject* readObject(int id/*, int generation*/); | 88 SkPdfObject* readObject(int id/*, int generation*/); |
| 88 | 89 |
| 89 void fillPages(SkPdfPageTreeNodeDictionary* tree); | 90 void fillPages(SkPdfPageTreeNodeDictionary* tree); |
| 90 | 91 |
| 91 // private fields | 92 // private fields |
| 92 SkPdfAllocator* fAllocator; | 93 SkPdfAllocator* fAllocator; |
| 93 SkPdfMapper* fMapper; | 94 SkPdfMapper* fMapper; |
| 94 const unsigned char* fFileContent; | 95 const unsigned char* fFileContent; |
| 95 size_t fContentLength; | 96 size_t fContentLength; |
| 96 const SkPdfObject* fRootCatalogRef; | 97 const SkPdfObject* fRootCatalogRef; |
| 97 SkPdfCatalogDictionary* fRootCatalog; | 98 SkPdfCatalogDictionary* fRootCatalog; |
| 98 | 99 |
| 99 mutable SkTDArray<PublicObjectEntry> fObjects; | 100 mutable SkTDArray<PublicObjectEntry> fObjects; |
| 100 SkTDArray<SkPdfPageObjectDictionary*> fPages; | 101 SkTDArray<SkPdfPageObjectDictionary*> fPages; |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 #endif // EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKNATIVEPARSEDPDF_H_ | 104 #endif // EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKNATIVEPARSEDPDF_H_ |
| OLD | NEW |