| 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 | 8 |
| 9 #ifndef SkPdfReporter_DEFINED | 9 #ifndef SkPdfReporter_DEFINED |
| 10 #define SkPdfReporter_DEFINED | 10 #define SkPdfReporter_DEFINED |
| 11 | 11 |
| 12 #include "SkPdfConfig.h" | 12 #include "SkPdfConfig.h" |
| 13 | 13 |
| 14 class SkPdfNativeObject; | 14 class SkPdfNativeObject; |
| 15 class SkPdfContext; | 15 class SkPdfContext; |
| 16 | 16 |
| 17 // TODO(edisonn): ability to turn on asserts for known good files |
| 18 |
| 17 enum SkPdfIssueSeverity { | 19 enum SkPdfIssueSeverity { |
| 18 kInfo_SkPdfIssueSeverity, | 20 kInfo_SkPdfIssueSeverity, |
| 19 kCodeWarning_SkPdfIssueSeverity, // e.g. like NYI, which has nothing to do w
ith an error in the file | 21 kCodeWarning_SkPdfIssueSeverity, // e.g. like NYI, PDF file is Ok. |
| 20 kWarning_SkPdfIssueSeverity, | 22 kWarning_SkPdfIssueSeverity, |
| 21 kIgnoreError_SkPdfIssueSeverity, | 23 kIgnoreError_SkPdfIssueSeverity, |
| 22 kError_SkPdfIssueSeverity, | 24 kError_SkPdfIssueSeverity, |
| 23 kFatalError_SkPdfIssueSeverity, | 25 kFatalError_SkPdfIssueSeverity, |
| 24 | 26 |
| 25 _kCount__SkPdfIssueSeverity | 27 _kCount__SkPdfIssueSeverity |
| 26 }; | 28 }; |
| 27 | 29 |
| 28 enum SkPdfIssue { | 30 enum SkPdfIssue { |
| 29 kNoIssue_SkPdfIssue, | 31 kNoIssue_SkPdfIssue, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 44 kOutOfRange_SkPdfIssue, | 46 kOutOfRange_SkPdfIssue, |
| 45 kUnknownBlendMode_SkPdfIssue, | 47 kUnknownBlendMode_SkPdfIssue, |
| 46 kMissingExtGState_SkPdfIssue, | 48 kMissingExtGState_SkPdfIssue, |
| 47 kMissingXObject_SkPdfIssue, | 49 kMissingXObject_SkPdfIssue, |
| 48 kReadStreamError_SkPdfIssue, | 50 kReadStreamError_SkPdfIssue, |
| 49 kMissingToken_SkPdfIssue, | 51 kMissingToken_SkPdfIssue, |
| 50 kBadReference_SkPdfIssue, | 52 kBadReference_SkPdfIssue, |
| 51 kNoFlateLibrary_SkPdfIssue, | 53 kNoFlateLibrary_SkPdfIssue, |
| 52 kBadStream_SkPdfIssue, | 54 kBadStream_SkPdfIssue, |
| 53 | 55 |
| 54 | |
| 55 _kCount__SkPdfIssue | 56 _kCount__SkPdfIssue |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 #ifdef PDF_REPORT | 59 #ifdef PDF_REPORT |
| 59 | 60 |
| 60 void SkPdfReportIf(bool report, SkPdfIssueSeverity sev, SkPdfIssue issue, const
char* context, const SkPdfNativeObject* obj, SkPdfContext* pdfCo
ntext); | 61 void SkPdfReportIf(bool report, |
| 61 void SkPdfReport( SkPdfIssueSeverity sev, SkPdfIssue issue, const
char* context, const SkPdfNativeObject* obj, SkPdfContext* pdfCo
ntext); | 62 SkPdfIssueSeverity sev, SkPdfIssue issue, |
| 62 void SkPdfReportUnexpectedType( SkPdfIssueSeverity sev, const
char* context, const SkPdfNativeObject* obj, int anyOfTypes, SkPdfContext* pdfCo
ntext); | 63 const char* context, |
| 64 const SkPdfNativeObject* obj, |
| 65 SkPdfContext* pdfContext); |
| 66 void SkPdfReport(SkPdfIssueSeverity sev, SkPdfIssue issue, |
| 67 const char* context, |
| 68 const SkPdfNativeObject* obj, |
| 69 SkPdfContext* pdfContext); |
| 70 void SkPdfReportUnexpectedType(SkPdfIssueSeverity sev, |
| 71 const char* context, |
| 72 const SkPdfNativeObject* obj, int anyOfTypes, |
| 73 SkPdfContext* pdfContext); |
| 63 #define SkPdfREPORTCODE(code) code | 74 #define SkPdfREPORTCODE(code) code |
| 64 | 75 |
| 65 #else // !PDF_REPORT | 76 #else // !PDF_REPORT |
| 66 | 77 |
| 67 #define SkPdfReportIf(a,b,c,d,e,f) | 78 #define SkPdfReportIf(a,b,c,d,e,f) |
| 68 #define SkPdfReport(a,b,c,d,e) | 79 #define SkPdfReport(a,b,c,d,e) |
| 69 #define SkPdfReportUnexpectedType(a,b,c,d,e) | 80 #define SkPdfReportUnexpectedType(a,b,c,d,e) |
| 70 #define SkPdfREPORTCODE(code) | 81 #define SkPdfREPORTCODE(code) |
| 71 | 82 |
| 72 #endif // PDF_REPORT | 83 #endif // PDF_REPORT |
| 73 | 84 |
| 74 #endif // SkPdfReporter_DEFINED | 85 #endif // SkPdfReporter_DEFINED |
| OLD | NEW |