OLD | NEW |
1 | 1 |
2 #include "SkPdfNativeTokenizer.h" | 2 #include "SkPdfNativeTokenizer.h" |
3 #include "SkPdfObject.h" | 3 #include "SkPdfObject.h" |
4 #include "SkPdfConfig.h" | 4 #include "SkPdfConfig.h" |
5 | 5 |
6 #include "SkPdfStreamCommonDictionary_autogen.h" | 6 #include "SkPdfStreamCommonDictionary_autogen.h" |
7 #include "SkPdfImageDictionary_autogen.h" | 7 #include "SkPdfImageDictionary_autogen.h" |
8 | 8 |
9 // TODO(edisonn): perf!!! | 9 // TODO(edisonn): perf!!! |
10 // there could be 0s between start and end! but not in the needle. | 10 // there could be 0s between start and end! but not in the needle. |
(...skipping 10 matching lines...) Expand all Loading... |
21 if (isPdfWhiteSpaceOrPdfDelimiter(*(hayStart-1)) && | 21 if (isPdfWhiteSpaceOrPdfDelimiter(*(hayStart-1)) && |
22 (isPdfWhiteSpaceOrPdfDelimiter(*(hayStart+needleLen)) || (haySta
rt+needleLen == hayEnd)) && | 22 (isPdfWhiteSpaceOrPdfDelimiter(*(hayStart+needleLen)) || (haySta
rt+needleLen == hayEnd)) && |
23 strncmp(hayStart, needle, needleLen) == 0) { | 23 strncmp(hayStart, needle, needleLen) == 0) { |
24 return hayStart; | 24 return hayStart; |
25 } | 25 } |
26 hayStart++; | 26 hayStart++; |
27 } | 27 } |
28 return NULL; | 28 return NULL; |
29 } | 29 } |
30 | 30 |
31 #ifdef PDF_TRACE | 31 #ifdef PDF_TRACE_TOKENIZER |
32 static void TRACE_INDENT(int level, const char* type) { | 32 static void TRACE_INDENT(int level, const char* type) { |
33 static int id = 0; | 33 static int id = 0; |
34 id++; | 34 id++; |
35 if (478613 == id) { | 35 if (478613 == id) { |
36 printf("break;\n"); | 36 printf("break;\n"); |
37 } | 37 } |
38 // all types should have 2 letters, so the text is alligned nicely | 38 // all types should have 2 letters, so the text is alligned nicely |
39 printf("\n%10i %15s: ", id, type); | 39 printf("\n%10i %15s: ", id, type); |
40 for (int i = 0 ; i < level; i++) { | 40 for (int i = 0 ; i < level; i++) { |
41 printf(" "); | 41 printf(" "); |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 SkPdfObject* obj = fAllocator->allocObject(); | 1084 SkPdfObject* obj = fAllocator->allocObject(); |
1085 fUncompressedStream = nextObject(0, fUncompressedStream, fUncompress
edStreamEnd, obj, fAllocator, fDoc); | 1085 fUncompressedStream = nextObject(0, fUncompressedStream, fUncompress
edStreamEnd, obj, fAllocator, fDoc); |
1086 // TODO(edisonn): perf maybe we should not expand abreviation like t
his | 1086 // TODO(edisonn): perf maybe we should not expand abreviation like t
his |
1087 inlineImage->set(inlineImageKeyAbbreviationExpand(key), | 1087 inlineImage->set(inlineImageKeyAbbreviationExpand(key), |
1088 inlineImageValueAbbreviationExpand(obj)); | 1088 inlineImageValueAbbreviationExpand(obj)); |
1089 } | 1089 } |
1090 } | 1090 } |
1091 // TODO(edisonn): report end of data with inline image without an EI | 1091 // TODO(edisonn): report end of data with inline image without an EI |
1092 return inlineImage; | 1092 return inlineImage; |
1093 } | 1093 } |
OLD | NEW |