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

Unified Diff: experimental/PdfViewer/SkPdfFont.h

Issue 20526002: pdfviewer: set the default background to transparent (to match render_picture default), and fix a b… (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | experimental/PdfViewer/pdf_viewer_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/SkPdfFont.h
===================================================================
--- experimental/PdfViewer/SkPdfFont.h (revision 10357)
+++ experimental/PdfViewer/SkPdfFont.h (working copy)
@@ -363,13 +363,13 @@
memset(fChars, 0, sizeof(fChars[0]) * (fLastChar - fFirstChar + 1));
-
const SkPdfArray* widths = dict->Widths(parsed);
for (unsigned int i = 0 ; i < widths->size(); i++) {
- if ((fFirstChar + i) < fFirstChar || (fFirstChar + i) > fLastChar) {
- printf("break; error 1\n");
+ if ((fFirstChar + i) >= fFirstChar && (fFirstChar + i) <= fLastChar) {
+ fChars[i].fWidth = (*widths)[i]->numberValue();
+ } else {
+ // TODO(edisonn): report pdf corruption
}
- fChars[i].fWidth = (*widths)[i]->numberValue();
}
const SkPdfArray* diffs = fEncodingDict->Differences(parsed);
@@ -378,13 +378,14 @@
if ((*diffs)[i]->isInteger()) {
j = (unsigned int)(*diffs)[i]->intValue();
} else if ((*diffs)[i]->isName()) {
- if (j < fFirstChar || j > fLastChar) {
- printf("break; error 2\n");
+ if (j >= fFirstChar && j <= fLastChar) {
+ fChars[j - fFirstChar].fObj = fCharProcs->get((*diffs)[i]);
+ } else {
+ // TODO(edisonn): report pdf corruption
}
- fChars[j - fFirstChar].fObj = fCharProcs->get((*diffs)[i]);
j++;
} else {
- // err
+ // TODO(edisonn): report bad pdf
}
}
}
« no previous file with comments | « no previous file | experimental/PdfViewer/pdf_viewer_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698