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

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

Issue 1266093003: Remove experimental/PdfViewer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-03 (Monday) 10:43:56 EDT Created 5 years, 4 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
« no previous file with comments | « experimental/PdfViewer/SkPdfReporter.h ('k') | experimental/PdfViewer/SkPdfUtils.h » ('j') | 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 #ifdef PDF_REPORT
9
10 #include "SkPdfReporter.h"
11
12 #include "SkTypes.h"
13
14 const char* severityName[] = {
15 "Info",
16 "CodeWarning",
17 "Warning",
18 "IgnoreError",
19 "Error",
20 "FatalError",
21 };
22
23 const char* getSeverityName(SkPdfIssueSeverity sev) {
24 if (0 <= sev && sev < _kCount__SkPdfIssueSeverity) {
25 return severityName[sev];
26 }
27 SkASSERT(false);
28 return "UNKOWN SEVERITY";
29 }
30
31 // TODO(edisonn): add a flag to set the minimum warning level
32 // TODO(edisonn): get the address in the file, and report it.
33 // TODO(edisonn): build a html file based on warnings which would showe the orig inal pdf
34 // content, with tooltips where warnings/errors were reported.
35
36
37 void SkPdfReport(SkPdfIssueSeverity sev, SkPdfIssue issue,
38 const char* context,
39 const SkPdfNativeObject* obj,
40 SkPdfContext* pdfContext) {
41 if (sev >= kIgnoreError_SkPdfIssueSeverity) {
42 printf("%s: %s\n", getSeverityName(sev), context);
43 }
44 }
45
46 void SkPdfReportIf(bool report,
47 SkPdfIssueSeverity sev, SkPdfIssue issue,
48 const char* context,
49 const SkPdfNativeObject* obj,
50 SkPdfContext* pdfContext) {
51 if (!report) {
52 return;
53 }
54 SkPdfReport(sev, issue, context, obj, pdfContext);
55 }
56
57 void SkPdfReportUnexpectedType(SkPdfIssueSeverity sev,
58 const char* context,
59 const SkPdfNativeObject* obj,
60 int anyOfTypes, SkPdfContext* pdfContext) {
61 if (sev >= kIgnoreError_SkPdfIssueSeverity) {
62 printf("%s: %s\n", getSeverityName(sev), context);
63 }
64 }
65
66 #endif // PDF_REPORT
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfReporter.h ('k') | experimental/PdfViewer/SkPdfUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698