| 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 #include "SkPdfReporter.h" | 9 #include "SkPdfReporter.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 const char* getSeverityName(SkPdfIssueSeverity sev) { | 22 const char* getSeverityName(SkPdfIssueSeverity sev) { |
| 23 if (0 <= sev && sev < _kCount__SkPdfIssueSeverity) { | 23 if (0 <= sev && sev < _kCount__SkPdfIssueSeverity) { |
| 24 return severityName[sev]; | 24 return severityName[sev]; |
| 25 } | 25 } |
| 26 SkASSERT(false); | 26 SkASSERT(false); |
| 27 return "UNKOWN SEVERITY"; | 27 return "UNKOWN SEVERITY"; |
| 28 } | 28 } |
| 29 | 29 |
| 30 // TODO(edisonn): add a flag to set the minimum warning level | 30 // TODO(edisonn): add a flag to set the minimum warning level |
| 31 // TODO(edisonn): get the address in the file, and report it. |
| 32 // TODO(edisonn): build a html file based on warnings which would showe the orig
inal pdf |
| 33 // content, with tooltips where warnings/errors were reported. |
| 34 |
| 31 | 35 |
| 32 #ifdef PDF_REPORT | 36 #ifdef PDF_REPORT |
| 33 void SkPdfReport(SkPdfIssueSeverity sev, SkPdfIssue issue, | 37 void SkPdfReport(SkPdfIssueSeverity sev, SkPdfIssue issue, |
| 34 const char* context, | 38 const char* context, |
| 35 const SkPdfNativeObject* obj, | 39 const SkPdfNativeObject* obj, |
| 36 SkPdfContext* pdfContext) { | 40 SkPdfContext* pdfContext) { |
| 37 if (sev >= kIgnoreError_SkPdfIssueSeverity) { | 41 if (sev >= kIgnoreError_SkPdfIssueSeverity) { |
| 38 printf("%s: %s\n", getSeverityName(sev), context); | 42 printf("%s: %s\n", getSeverityName(sev), context); |
| 39 } | 43 } |
| 40 } | 44 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 53 void SkPdfReportUnexpectedType(SkPdfIssueSeverity sev, | 57 void SkPdfReportUnexpectedType(SkPdfIssueSeverity sev, |
| 54 const char* context, | 58 const char* context, |
| 55 const SkPdfNativeObject* obj, | 59 const SkPdfNativeObject* obj, |
| 56 int anyOfTypes, SkPdfContext* pdfContext) { | 60 int anyOfTypes, SkPdfContext* pdfContext) { |
| 57 if (sev >= kIgnoreError_SkPdfIssueSeverity) { | 61 if (sev >= kIgnoreError_SkPdfIssueSeverity) { |
| 58 printf("%s: %s\n", getSeverityName(sev), context); | 62 printf("%s: %s\n", getSeverityName(sev), context); |
| 59 } | 63 } |
| 60 } | 64 } |
| 61 | 65 |
| 62 #endif // PDF_REPORT | 66 #endif // PDF_REPORT |
| OLD | NEW |