OLD | NEW |
1 #ifndef __DEFINED__SkPdfUtils | 1 #ifndef __DEFINED__SkPdfUtils |
2 #define __DEFINED__SkPdfUtils | 2 #define __DEFINED__SkPdfUtils |
3 | 3 |
4 #include "SkMatrix.h" | 4 #include "SkMatrix.h" |
5 #include "SkRect.h" | 5 #include "SkRect.h" |
6 #include "SkPdfConfig.h" | 6 #include "SkPdfConfig.h" |
| 7 #include "SkString.h" |
7 | 8 |
8 class SkPdfArray; | 9 class SkPdfArray; |
9 class SkPdfContext; | 10 class SkPdfContext; |
10 class SkCanvas; | 11 class SkCanvas; |
11 class SkPdfNativeObject; | 12 class SkPdfNativeObject; |
12 | 13 |
13 // TODO(edisonn): temporary code, to report how much of the PDF we actually thin
k we rendered. | 14 // TODO(edisonn): temporary code, to report how much of the PDF we actually thin
k we rendered. |
14 enum SkPdfResult { | 15 enum SkPdfResult { |
15 kOK_SkPdfResult, | 16 kOK_SkPdfResult, |
16 kPartial_SkPdfResult, | 17 kPartial_SkPdfResult, |
(...skipping 18 matching lines...) Expand all Loading... |
35 str->fBuffer = (const unsigned char*)sz; | 36 str->fBuffer = (const unsigned char*)sz; |
36 str->fBytes = strlen(sz); | 37 str->fBytes = strlen(sz); |
37 } | 38 } |
38 | 39 |
39 bool equals(const char* sz) { | 40 bool equals(const char* sz) { |
40 return strncmp((const char*)fBuffer, sz, fBytes) == 0 && fBytes == strle
n(sz); | 41 return strncmp((const char*)fBuffer, sz, fBytes) == 0 && fBytes == strle
n(sz); |
41 | 42 |
42 } | 43 } |
43 }; | 44 }; |
44 | 45 |
| 46 // TODO(edisonn): hack to make code generation simpler. Alternatively we can upd
ate the |
| 47 // generate_code.py not to rely on != operator |
| 48 bool operator !=(const SkString& first, const char* second); |
| 49 |
45 SkMatrix SkMatrixFromPdfArray(SkPdfArray* pdfArray); | 50 SkMatrix SkMatrixFromPdfArray(SkPdfArray* pdfArray); |
46 | 51 |
47 SkPdfResult doType3Char(SkPdfContext* pdfContext, SkCanvas* canvas, const SkPdfN
ativeObject* skobj, SkRect bBox, SkMatrix matrix, double textSize); | 52 SkPdfResult doType3Char(SkPdfContext* pdfContext, SkCanvas* canvas, const SkPdfN
ativeObject* skobj, SkRect bBox, SkMatrix matrix, double textSize); |
48 | 53 |
49 ////////////////////////////////////////////////////////////////////////////////
//////////////////// | 54 ////////////////////////////////////////////////////////////////////////////////
//////////////////// |
50 // | 55 // |
51 // TRACE functions | 56 // TRACE functions |
52 // | 57 // |
53 #ifdef PDF_TRACE | 58 #ifdef PDF_TRACE |
54 void SkTraceMatrix(const SkMatrix& matrix, const char* sz); | 59 void SkTraceMatrix(const SkMatrix& matrix, const char* sz); |
55 void SkTraceRect(const SkRect& rect, const char* sz); | 60 void SkTraceRect(const SkRect& rect, const char* sz); |
56 #else | 61 #else |
57 #define SkTraceMatrix(a,b) | 62 #define SkTraceMatrix(a,b) |
58 #define SkTraceRect(a,b) | 63 #define SkTraceRect(a,b) |
59 #endif | 64 #endif |
60 | 65 |
61 #endif // __DEFINED__SkPdfUtils | 66 #endif // __DEFINED__SkPdfUtils |
OLD | NEW |