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
Original Review URL: https://codereview.chromium.org/1555773003

Review URL: https://codereview.chromium.org/1555833002 .
diff --git a/DEPS b/DEPS
index ab27df0..04a3cb6 100644
--- a/DEPS
+++ b/DEPS
@@ -8,7 +8,7 @@
     "https://chromium.googlesource.com/chromium/buildtools.git@c2f259809d5ede3275df5ea0842f0431990c4f98",
 
   "testing/corpus":
-     "https://pdfium.googlesource.com/pdfium_tests@45f88c6914fcac26ad930bb0ebbfa468c21db0a5",
+     "https://pdfium.googlesource.com/pdfium_tests@cc132ff8921c76ea69888cae4bb00e01dd1ce0b3",
 
   "testing/gmock":
      "https://chromium.googlesource.com/external/googlemock.git@29763965ab52f24565299976b936d1265cb6a271",
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 1b3d826..89430f6 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -15,6 +15,7 @@
 
 #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"
@@ -350,14 +351,14 @@
   }
   int width = static_cast<int>(FPDF_GetPageWidth(page) * scale);
   int height = static_cast<int>(FPDF_GetPageHeight(page) * scale);
-
-  FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, 0);
+  int alpha = FPDFPage_HasTransparency(page) ? 1 : 0;
+  FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, alpha);
   if (!bitmap) {
     fprintf(stderr, "Page was too large to be rendered.\n");
     return false;
   }
-
-  FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 0xFFFFFFFF);
+  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, bitmap, page, 0, 0, width, height, 0, 0);
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index d4ce7eb..33c7220 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"
@@ -213,8 +214,10 @@
 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;