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 SkPdfUtils_DEFINED | 8 #ifndef SkPdfUtils_DEFINED |
9 #define SkPdfUtils_DEFINED | 9 #define SkPdfUtils_DEFINED |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 kOK_SkPdfResult, | 23 kOK_SkPdfResult, |
24 kPartial_SkPdfResult, | 24 kPartial_SkPdfResult, |
25 kNYI_SkPdfResult, | 25 kNYI_SkPdfResult, |
26 kIgnoreError_SkPdfResult, | 26 kIgnoreError_SkPdfResult, |
27 kError_SkPdfResult, | 27 kError_SkPdfResult, |
28 kUnsupported_SkPdfResult, | 28 kUnsupported_SkPdfResult, |
29 | 29 |
30 kCount_SkPdfResult | 30 kCount_SkPdfResult |
31 }; | 31 }; |
32 | 32 |
| 33 // In order to operate fast, when we parse the pdf, we try not to allocate many
new strings, |
| 34 // and if possible we refer the string in the pdf stream. |
33 struct NotOwnedString { | 35 struct NotOwnedString { |
34 const unsigned char* fBuffer; | 36 const unsigned char* fBuffer; |
35 // TODO(edisonn): clean up, the last two bytes are used to signal if compres
sion is used | 37 // TODO(edisonn): clean up, the last two bytes are used to signal if compres
sion is used |
36 size_t fBytes; | 38 size_t fBytes; |
37 | 39 |
38 static void init(NotOwnedString* str) { | 40 static void init(NotOwnedString* str) { |
39 str->fBuffer = NULL; | 41 str->fBuffer = NULL; |
40 str->fBytes = 0; | 42 str->fBytes = 0; |
41 } | 43 } |
42 | 44 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 112 |
111 #else | 113 #else |
112 #define TRACE_COMMENT(ch) | 114 #define TRACE_COMMENT(ch) |
113 #define TRACE_TK(ch) | 115 #define TRACE_TK(ch) |
114 #define TRACE_NAME(start,end) | 116 #define TRACE_NAME(start,end) |
115 #define TRACE_STRING(start,end) | 117 #define TRACE_STRING(start,end) |
116 #define TRACE_HEXSTRING(start,end) | 118 #define TRACE_HEXSTRING(start,end) |
117 #endif | 119 #endif |
118 | 120 |
119 #endif // SkPdfUtils_DEFINED | 121 #endif // SkPdfUtils_DEFINED |
OLD | NEW |