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

Side by Side Diff: experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h

Issue 21096006: pdfviewer: load files with missing xref (we need in order to help with testing, as most good pdfx i… (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698