diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-31 13:13:10 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-31 13:13:10 -0800 |
commit | 453d96b5458db02591aeb0f23ea700f00f0dfd71 (patch) | |
tree | c71c883f07d75bd85aa9ba581ed890036a3fd25e /testing | |
parent | 1aeeceb45d785fc9cfbc69510220655fdcc9dd63 (diff) | |
download | pdfium-453d96b5458db02591aeb0f23ea700f00f0dfd71.tar.xz |
Merge to XFA: Reapply "Fix a partial rendering problem"
This reverts commit 054fc955c153eb5c581fd14946848b8b2a77136a.
Additionally, this rolls DEPS for the testing corpus to update test
expectations.
BUG=pdfium:336
TBR=jun_fang@foxitsoftware.com
Review URL: https://codereview.chromium.org/1555833002 .
(cherry picked from commit 5594538fcc96c38db34f336223140cf703e3cca0)
Review URL: https://codereview.chromium.org/1553013002 .
Diffstat (limited to 'testing')
-rw-r--r-- | testing/embedder_test.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp index 23b15a47d1..8d4682eacf 100644 --- a/testing/embedder_test.cpp +++ b/testing/embedder_test.cpp @@ -12,6 +12,7 @@ #include <vector> #include "public/fpdf_dataavail.h" +#include "public/fpdf_edit.h" #include "public/fpdf_text.h" #include "public/fpdfview.h" #include "testing/gmock/include/gmock/gmock.h" @@ -234,8 +235,10 @@ FPDF_PAGE EmbedderTest::LoadAndCachePage(int page_number) { FPDF_BITMAP EmbedderTest::RenderPage(FPDF_PAGE page) { int width = static_cast<int>(FPDF_GetPageWidth(page)); int height = static_cast<int>(FPDF_GetPageHeight(page)); - FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, 0); - FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 0xFFFFFFFF); + int alpha = FPDFPage_HasTransparency(page) ? 1 : 0; + FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, alpha); + FPDF_DWORD fill_color = alpha ? 0x00000000 : 0xFFFFFFFF; + FPDFBitmap_FillRect(bitmap, 0, 0, width, height, fill_color); FPDF_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, 0); FPDF_FFLDraw(form_handle_, bitmap, page, 0, 0, width, height, 0, 0); return bitmap; |