Chromium Code Reviews| 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 |
| 11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
| 12 | 12 |
| 13 const char* severityName[] = { | 13 const char* severityName[] = { |
| 14 "Info", | 14 "Info", |
| 15 "CodeWarning", | 15 "CodeWarning", |
| 16 "Warning", | 16 "Warning", |
| 17 "IgnoreError", | 17 "IgnoreError", |
| 18 "Error", | 18 "Error", |
| 19 "FatalError", | 19 "FatalError", |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 const char* getSeverityName(SkPdfIssueSeverity sev); | |
| 22 const char* getSeverityName(SkPdfIssueSeverity sev) { | 23 const char* getSeverityName(SkPdfIssueSeverity sev) { |
|
edisonn
2013/11/06 14:10:06
Doesn't making the function static resolves the is
| |
| 23 if (0 <= sev && sev < _kCount__SkPdfIssueSeverity) { | 24 if (0 <= sev && sev < _kCount__SkPdfIssueSeverity) { |
| 24 return severityName[sev]; | 25 return severityName[sev]; |
| 25 } | 26 } |
| 26 SkASSERT(false); | 27 SkASSERT(false); |
| 27 return "UNKOWN SEVERITY"; | 28 return "UNKOWN SEVERITY"; |
| 28 } | 29 } |
| 29 | 30 |
| 30 // TODO(edisonn): add a flag to set the minimum warning level | 31 // 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): 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 // TODO(edisonn): build a html file based on warnings which would showe the orig inal pdf |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 57 void SkPdfReportUnexpectedType(SkPdfIssueSeverity sev, | 58 void SkPdfReportUnexpectedType(SkPdfIssueSeverity sev, |
| 58 const char* context, | 59 const char* context, |
| 59 const SkPdfNativeObject* obj, | 60 const SkPdfNativeObject* obj, |
| 60 int anyOfTypes, SkPdfContext* pdfContext) { | 61 int anyOfTypes, SkPdfContext* pdfContext) { |
| 61 if (sev >= kIgnoreError_SkPdfIssueSeverity) { | 62 if (sev >= kIgnoreError_SkPdfIssueSeverity) { |
| 62 printf("%s: %s\n", getSeverityName(sev), context); | 63 printf("%s: %s\n", getSeverityName(sev), context); |
| 63 } | 64 } |
| 64 } | 65 } |
| 65 | 66 |
| 66 #endif // PDF_REPORT | 67 #endif // PDF_REPORT |
| OLD | NEW |