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 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 class SkPdfNativeTokenizer { | 158 class SkPdfNativeTokenizer { |
159 public: | 159 public: |
160 SkPdfNativeTokenizer(SkPdfNativeObject* objWithStream, | 160 SkPdfNativeTokenizer(SkPdfNativeObject* objWithStream, |
161 SkPdfAllocator* allocator, SkPdfNativeDoc* doc); | 161 SkPdfAllocator* allocator, SkPdfNativeDoc* doc); |
162 SkPdfNativeTokenizer(const unsigned char* buffer, int len, | 162 SkPdfNativeTokenizer(const unsigned char* buffer, int len, |
163 SkPdfAllocator* allocator, SkPdfNativeDoc* doc); | 163 SkPdfAllocator* allocator, SkPdfNativeDoc* doc); |
164 | 164 |
165 virtual ~SkPdfNativeTokenizer(); | 165 virtual ~SkPdfNativeTokenizer(); |
166 | 166 |
167 // Reads one token. Returns false if there are no more tokens. | 167 // Reads one token. Returns false if there are no more tokens. |
168 bool readToken(PdfToken* token); | 168 // If writeDiff is true, and a token was read, create a PNG highlighting |
| 169 // the difference caused by this command in /tmp/log_step_by_step. |
| 170 // If PDF_TRACE_DIFF_IN_PNG is not defined, writeDiff does nothing. |
| 171 bool readToken(PdfToken* token, bool writeDiff = false); |
169 | 172 |
170 // Put back a token to be read in the nextToken read. Only one token is allo
wed to be put | 173 // Put back a token to be read in the nextToken read. Only one token is allo
wed to be put |
171 // back. Must not necesaarely be the last token read. | 174 // back. Must not necesaarely be the last token read. |
172 void PutBack(PdfToken token); | 175 void PutBack(PdfToken token); |
173 | 176 |
174 // Reads the inline image that is present in the stream. At this point we ju
st consumed the ID | 177 // Reads the inline image that is present in the stream. At this point we ju
st consumed the ID |
175 // token already. | 178 // token already. |
176 SkPdfImageDictionary* readInlineImage(); | 179 SkPdfImageDictionary* readInlineImage(); |
177 | 180 |
178 private: | 181 private: |
(...skipping 10 matching lines...) Expand all Loading... |
189 bool fHasPutBack; | 192 bool fHasPutBack; |
190 PdfToken fPutBack; | 193 PdfToken fPutBack; |
191 }; | 194 }; |
192 | 195 |
193 const unsigned char* nextObject(const unsigned char* start, const unsigned char*
end, | 196 const unsigned char* nextObject(const unsigned char* start, const unsigned char*
end, |
194 SkPdfNativeObject* token, | 197 SkPdfNativeObject* token, |
195 SkPdfAllocator* allocator, | 198 SkPdfAllocator* allocator, |
196 SkPdfNativeDoc* doc); | 199 SkPdfNativeDoc* doc); |
197 | 200 |
198 #endif // SkPdfNativeTokenizer_DEFINED | 201 #endif // SkPdfNativeTokenizer_DEFINED |
OLD | NEW |