pdfviewer: set the default background to transparent (to match render_picture default), and fix a bug a with corrupt diffs
Review URL: https://codereview.chromium.org/20526002 git-svn-id: http://skia.googlecode.com/svn/trunk@10376 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
aaa9b29ed8
commit
ac4bedcb10
@ -363,13 +363,13 @@ public:
|
||||
|
||||
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 @@ public:
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ static bool make_output_filepath(SkString* path, const SkString& dir,
|
||||
PNG_FILE_EXTENSION);
|
||||
}
|
||||
|
||||
static void setup_bitmap(SkBitmap* bitmap, int width, int height, SkColor color = SK_ColorWHITE) {
|
||||
static void setup_bitmap(SkBitmap* bitmap, int width, int height, SkColor color = SK_ColorTRANSPARENT) {
|
||||
bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height);
|
||||
|
||||
bitmap->allocPixels();
|
||||
|
Loading…
Reference in New Issue
Block a user