Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: experimental/PdfViewer/SkPdfReporter.cpp

Issue 26271002: pdf report files (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « experimental/PdfViewer/SkPdfReporter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8
9 #include "SkPdfReporter.h"
10
11 #include "SkTypes.h"
12
13 const char* severityName[] = {
14 "Info",
15 "CodeWarning",
16 "Warning",
17 "IgnoreError",
18 "Error",
19 "FatalError",
20 };
21
22 const char* getSeverityName(SkPdfIssueSeverity sev) {
23 if (0 <= sev && sev < _kCount__SkPdfIssueSeverity) {
24 return severityName[sev];
25 }
26 SkASSERT(false);
27 return "UNKOWN SEVERITY";
28 }
29
30 // TODO(edisonn): add a flag to set the minimum warning level
31
32 #ifdef PDF_REPORT
33 void SkPdfReport( SkPdfIssueSeverity sev, SkPdfIssue issue, const char* context, const SkPdfNativeObject* obj, SkPdfContext* pdfCo ntext) {
34 if (sev >= kIgnoreError_SkPdfIssueSeverity) {
35 printf("%s: %s\n", getSeverityName(sev), context);
36 }
37 }
38
39 void SkPdfReportUnexpectedType(SkPdfIssueSeverity sev, const char* context, cons t SkPdfNativeObject* obj, int anyOfTypes, SkPdfContext* pdfContext) {
40 if (sev >= kIgnoreError_SkPdfIssueSeverity) {
41 printf("%s: %s\n", getSeverityName(sev), context);
42 }
43 }
44
45 void SkPdfReportIf(bool report, SkPdfIssueSeverity sev, SkPdfIssue issue, const char* context, const SkPdfNativeObject* obj, SkPdfContext* pdfCo ntext) {
46 if (!report) {
47 return;
48 }
49 SkPdfReport(sev, issue, context, obj, pdfContext);
50 }
51 #endif // PDF_REPORT
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfReporter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698