Fix pdfium_test build inside Chromium.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/925763003
diff --git a/samples/BUILD.gn b/samples/BUILD.gn
index 6bd2a81..ca7cafa 100644
--- a/samples/BUILD.gn
+++ b/samples/BUILD.gn
@@ -8,6 +8,14 @@
   ]
 }
 
+config("pdfium_samples_config") {
+  defines = [
+    "PNG_PREFIX",
+    "PNGPREFIX_H",
+    "PNG_USE_READ_MACROS",
+  ]
+}
+
 executable("pdfium_test") {
   sources = [
     "image_diff_png.cc",
@@ -21,6 +29,7 @@
     "//v8",
     "//v8/include",
   ]
+  configs += [ ":pdfium_samples_config" ]
 }
 
 executable("pdfium_diff") {
@@ -32,4 +41,5 @@
   deps = [
     "//third_party/pdfium",
   ]
+  configs += [ ":pdfium_samples_config" ]
 }
diff --git a/samples/samples.gyp b/samples/samples.gyp
index c972142..97497ee 100644
--- a/samples/samples.gyp
+++ b/samples/samples.gyp
@@ -14,6 +14,11 @@
       '<(DEPTH)/v8',
       '<(DEPTH)/v8/include',
     ],
+    'defines' : [
+      'PNG_PREFIX',
+      'PNGPREFIX_H',
+      'PNG_USE_READ_MACROS',
+    ],
   },
   'targets': [
     {