Added EmbedderTest::RenderPageWithFlags()
Currently, in embedder tests, pages can only be rendered with no flags
specified. With the addition of annotation APIs and corresponding
embedder tests, it is helpful to add a test method to allow flags to be
passed in when rendering pages in embedder tests.
This CL adds such a method.
Bug=pdfium:737
Change-Id: I277831cb2e228154e9a65b078a241b8e61220664
Reviewed-on: https://pdfium-review.googlesource.com/6711
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 6cea598..f818091 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -255,13 +255,17 @@
}
FPDF_BITMAP EmbedderTest::RenderPage(FPDF_PAGE page) {
+ return RenderPageWithFlags(page, 0);
+}
+
+FPDF_BITMAP EmbedderTest::RenderPageWithFlags(FPDF_PAGE page, int flags) {
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_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, 0);
+ FPDF_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, flags);
FPDF_FFLDraw(form_handle_, bitmap, page, 0, 0, width, height, 0, 0);
return bitmap;
}