summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2016-01-01 00:16:13 +0800
committerJun Fang <jun_fang@foxitsoftware.com>2016-01-01 00:16:13 +0800
commit054fc955c153eb5c581fd14946848b8b2a77136a (patch)
tree27113413aeed27d481236e645b1abb58c969b7f0
parent8f6f036678515a203051bb83c975472ed26b3203 (diff)
downloadpdfium-054fc955c153eb5c581fd14946848b8b2a77136a.tar.xz
Revert "Fix a partial rendering problem"
This reverts commit 84f6a5616be0a1988d361a4b54eb83fff8b8c59f. BUG=pdfium:336 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1554883002 .
-rw-r--r--samples/pdfium_test.cc9
-rw-r--r--testing/embedder_test.cpp7
2 files changed, 6 insertions, 10 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 89430f6dfd..1b3d82659c 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -15,7 +15,6 @@
#include "image_diff_png.h"
#include "public/fpdf_dataavail.h"
-#include "public/fpdf_edit.h"
#include "public/fpdf_ext.h"
#include "public/fpdf_formfill.h"
#include "public/fpdf_text.h"
@@ -351,14 +350,14 @@ bool RenderPage(const std::string& name,
}
int width = static_cast<int>(FPDF_GetPageWidth(page) * scale);
int height = static_cast<int>(FPDF_GetPageHeight(page) * scale);
- int alpha = FPDFPage_HasTransparency(page) ? 1 : 0;
- FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, alpha);
+
+ FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, 0);
if (!bitmap) {
fprintf(stderr, "Page was too large to be rendered.\n");
return false;
}
- FPDF_DWORD fill_color = alpha ? 0x00000000 : 0xFFFFFFFF;
- FPDFBitmap_FillRect(bitmap, 0, 0, width, height, fill_color);
+
+ FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 0xFFFFFFFF);
FPDF_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, 0);
FPDF_FFLDraw(form, bitmap, page, 0, 0, width, height, 0, 0);
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 33c72201a1..d4ce7eba5a 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -12,7 +12,6 @@
#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"
@@ -214,10 +213,8 @@ 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));
- 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_BITMAP bitmap = FPDFBitmap_Create(width, height, 0);
+ FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 0xFFFFFFFF);
FPDF_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, 0);
FPDF_FFLDraw(form_handle_, bitmap, page, 0, 0, width, height, 0, 0);
return bitmap;