| OLD | NEW |
| 1 #ifndef EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFNATIVETOKENIZER_H_ | 1 #ifndef EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFNATIVETOKENIZER_H_ |
| 2 #define EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFNATIVETOKENIZER_H_ | 2 #define EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFNATIVETOKENIZER_H_ |
| 3 | 3 |
| 4 #include "SkTDArray.h" | 4 #include "SkTDArray.h" |
| 5 #include "SkTDict.h" | 5 #include "SkTDict.h" |
| 6 #include <math.h> | 6 #include <math.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 class SkPdfMapper; | 9 class SkPdfMapper; |
| 10 class SkPdfDictionary; | 10 class SkPdfDictionary; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 SkPdfObject* allocObject(); | 97 SkPdfObject* allocObject(); |
| 98 | 98 |
| 99 // TODO(edisonn): free this memory in destructor, track the usage? | 99 // TODO(edisonn): free this memory in destructor, track the usage? |
| 100 void* alloc(size_t bytes) { | 100 void* alloc(size_t bytes) { |
| 101 void* data = malloc(bytes); | 101 void* data = malloc(bytes); |
| 102 fHandles.push(data); | 102 fHandles.push(data); |
| 103 fSizeInBytes += bytes; | 103 fSizeInBytes += bytes; |
| 104 return data; | 104 return data; |
| 105 } | 105 } |
| 106 | 106 |
| 107 size_t bytesUsed() { | 107 size_t bytesUsed() const { |
| 108 return fSizeInBytes; | 108 return fSizeInBytes; |
| 109 } | 109 } |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 class SkNativeParsedPDF; | 112 class SkNativeParsedPDF; |
| 113 unsigned char* nextObject(unsigned char* start, unsigned char* end, SkPdfObject*
token, SkPdfAllocator* allocator, SkNativeParsedPDF* doc); | 113 unsigned char* nextObject(unsigned char* start, unsigned char* end, SkPdfObject*
token, SkPdfAllocator* allocator, SkNativeParsedPDF* doc); |
| 114 | 114 |
| 115 enum SkPdfTokenType { | 115 enum SkPdfTokenType { |
| 116 kKeyword_TokenType, | 116 kKeyword_TokenType, |
| 117 kObject_TokenType, | 117 kObject_TokenType, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 145 unsigned char* fUncompressedStreamStart; | 145 unsigned char* fUncompressedStreamStart; |
| 146 unsigned char* fUncompressedStream; | 146 unsigned char* fUncompressedStream; |
| 147 unsigned char* fUncompressedStreamEnd; | 147 unsigned char* fUncompressedStreamEnd; |
| 148 | 148 |
| 149 bool fEmpty; | 149 bool fEmpty; |
| 150 bool fHasPutBack; | 150 bool fHasPutBack; |
| 151 PdfToken fPutBack; | 151 PdfToken fPutBack; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 #endif // EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFNATIVETOKENIZER_H_ | 154 #endif // EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFNATIVETOKENIZER_H_ |
| OLD | NEW |