OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
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 #ifndef SkPdfNativeTokenizer_DEFINED | 8 #ifndef SkPdfNativeTokenizer_DEFINED |
9 #define SkPdfNativeTokenizer_DEFINED | 9 #define SkPdfNativeTokenizer_DEFINED |
10 | 10 |
| 11 #include "SkPdfConfig.h" |
| 12 |
11 #include "SkTDArray.h" | 13 #include "SkTDArray.h" |
12 #include "SkTDict.h" | 14 #include "SkTDict.h" |
13 #include <math.h> | 15 #include <math.h> |
14 #include <string.h> | 16 #include <string.h> |
15 | 17 |
16 class SkPdfDictionary; | 18 class SkPdfDictionary; |
17 class SkPdfImageDictionary; | 19 class SkPdfImageDictionary; |
18 | 20 |
19 // White Spaces | 21 // White Spaces |
20 #define kNUL_PdfWhiteSpace '\x00' | 22 #define kNUL_PdfWhiteSpace '\x00' |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 fSizeInBytes += bytes; | 111 fSizeInBytes += bytes; |
110 return data; | 112 return data; |
111 } | 113 } |
112 | 114 |
113 size_t bytesUsed() const { | 115 size_t bytesUsed() const { |
114 return fSizeInBytes; | 116 return fSizeInBytes; |
115 } | 117 } |
116 }; | 118 }; |
117 | 119 |
118 class SkPdfNativeDoc; | 120 class SkPdfNativeDoc; |
119 const unsigned char* nextObject(int level, const unsigned char* start, const uns
igned char* end, SkPdfNativeObject* token, SkPdfAllocator* allocator, SkPdfNativ
eDoc* doc); | 121 const unsigned char* nextObject(int level, const unsigned char* start, const uns
igned char* end, SkPdfNativeObject* token, SkPdfAllocator* allocator, SkPdfNativ
eDoc* doc GET_TRACK_STREAM); |
120 | 122 |
121 enum SkPdfTokenType { | 123 enum SkPdfTokenType { |
122 kKeyword_TokenType, | 124 kKeyword_TokenType, |
123 kObject_TokenType, | 125 kObject_TokenType, |
124 }; | 126 }; |
125 | 127 |
126 struct PdfToken { | 128 struct PdfToken { |
127 const char* fKeyword; | 129 const char* fKeyword; |
128 size_t fKeywordLength; | 130 size_t fKeywordLength; |
129 SkPdfNativeObject* fObject; | 131 SkPdfNativeObject* fObject; |
(...skipping 18 matching lines...) Expand all Loading... |
148 SkPdfNativeDoc* fDoc; | 150 SkPdfNativeDoc* fDoc; |
149 SkPdfAllocator* fAllocator; | 151 SkPdfAllocator* fAllocator; |
150 | 152 |
151 const unsigned char* fUncompressedStreamStart; | 153 const unsigned char* fUncompressedStreamStart; |
152 const unsigned char* fUncompressedStream; | 154 const unsigned char* fUncompressedStream; |
153 const unsigned char* fUncompressedStreamEnd; | 155 const unsigned char* fUncompressedStreamEnd; |
154 | 156 |
155 bool fEmpty; | 157 bool fEmpty; |
156 bool fHasPutBack; | 158 bool fHasPutBack; |
157 PdfToken fPutBack; | 159 PdfToken fPutBack; |
| 160 |
| 161 #ifdef PDF_TRACK_STREAM_OFFSETS |
| 162 int fStreamId; |
| 163 #endif // PDF_TRACK_STREAM_OFFSETS |
158 }; | 164 }; |
159 | 165 |
160 #endif // SkPdfNativeTokenizer_DEFINED | 166 #endif // SkPdfNativeTokenizer_DEFINED |
OLD | NEW |