edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 1 | #ifndef __DEFINED__SkPdfConfig |
| 2 | #define __DEFINED__SkPdfConfig |
| 3 | |
| 4 | //#define PDF_TRACE |
edisonn@google.com | 2ccc3af | 2013-07-23 17:43:18 +0000 | [diff] [blame^] | 5 | //#define PDF_TRACE_READ_TOKEN |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 6 | //#define PDF_TRACE_DIFF_IN_PNG |
| 7 | //#define PDF_DEBUG_NO_CLIPING |
| 8 | //#define PDF_DEBUG_NO_PAGE_CLIPING |
| 9 | //#define PDF_DEBUG_3X |
| 10 | |
| 11 | // TODO(edisonn): move in trace util. |
| 12 | #ifdef PDF_TRACE |
| 13 | void SkTraceMatrix(const SkMatrix& matrix, const char* sz); |
| 14 | void SkTraceRect(const SkRect& rect, const char* sz); |
| 15 | #else |
| 16 | #define SkTraceMatrix(a,b) |
| 17 | #define SkTraceRect(a,b) |
| 18 | #endif |
| 19 | |
edisonn@google.com | 2ccc3af | 2013-07-23 17:43:18 +0000 | [diff] [blame^] | 20 | struct NotOwnedString { |
| 21 | const unsigned char* fBuffer; |
| 22 | size_t fBytes; |
| 23 | |
| 24 | static void init(NotOwnedString* str) { |
| 25 | str->fBuffer = NULL; |
| 26 | str->fBytes = 0; |
| 27 | } |
| 28 | |
| 29 | static void init(NotOwnedString* str, const char* sz) { |
| 30 | str->fBuffer = (const unsigned char*)sz; |
| 31 | str->fBytes = strlen(sz); |
| 32 | } |
| 33 | |
| 34 | bool equals(const char* sz) { |
| 35 | return strncmp((const char*)fBuffer, sz, fBytes) == 0 && fBytes == strlen(sz); |
| 36 | |
| 37 | } |
| 38 | }; |
| 39 | |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 40 | #endif // __DEFINED__SkPdfConfig |