Bring pdfium file in sync with chrome, fix mac build

This permits PDFium to build on the Mac with Skia as the backend. It builds on Linux and Windows as well.

R=dsinclair@chromium.org,bungeman@google.com

Review-Url: https://codereview.chromium.org/1995003002
diff --git a/BUILD.gn b/BUILD.gn
index 5426860..f622f05 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -662,7 +662,6 @@
     "core/fxge/android/fx_android_font.h",
     "core/fxge/android/fx_android_imp.cpp",
     "core/fxge/apple/apple_int.h",
-    "core/fxge/apple/fx_apple_platform.cpp",
     "core/fxge/apple/fx_mac_imp.cpp",
     "core/fxge/apple/fx_quartz_device.cpp",
     "core/fxge/dib/dib_int.h",
@@ -721,6 +720,7 @@
     sources += [
       "core/fxge/agg/fx_agg_driver.cpp",
       "core/fxge/agg/fx_agg_driver.h",
+      "core/fxge/apple/fx_apple_platform.cpp",
     ]
     deps = [
       "third_party:fx_agg",
diff --git a/DEPS b/DEPS
index 771aac0..1f263b8 100644
--- a/DEPS
+++ b/DEPS
@@ -15,7 +15,7 @@
   'gtest_revision': '8245545b6dc9c4703e6496d1efd19e975ad2b038',
   'icu_revision': 'a5f86adbb0a58d04c035a5d1228747b1823cd485',
   'pdfium_tests_revision': 'd307839b3d4c8e521208172155718c945af696e0',
-  'skia_revision': '7942f22c607caf826a6a609b89338a569d0a30e7',
+  'skia_revision': '7d46f4af7dc759002537a172af121f2bfe200981',
   'tools_memory_revision': '427f10475e1a8d72424c29d00bf689122b738e5d',
   'trace_event_revision': '54b8455be9505c2cb0cf5c26bb86739c236471aa',
   'v8_revision': '75f10f91b1b0b392d2a29a7a480bf079db6f43fa',
diff --git a/core/fxge/ge/fx_ge_font.cpp b/core/fxge/ge/fx_ge_font.cpp
index fd6f8a2..bd0bb0e 100644
--- a/core/fxge/ge/fx_ge_font.cpp
+++ b/core/fxge/ge/fx_ge_font.cpp
@@ -118,7 +118,7 @@
   FX_Free(m_pOwnedStream);
 #endif  // PDF_ENABLE_XFA
   FX_Free(m_pGsubData);
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && !defined _SKIA_SUPPORT_
   ReleasePlatformResource();
 #endif
 }
diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp
index 1a0c14e..db86d65 100644
--- a/core/fxge/ge/fx_ge_text.cpp
+++ b/core/fxge/ge/fx_ge_text.cpp
@@ -851,7 +851,7 @@
   }
 #endif
   CFX_ByteString FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
-#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_
   return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index,
                            bFontStyle, dest_width, anti_alias);
 #else
diff --git a/skia/BUILD.gn b/skia/BUILD.gn
index c5c2796..01acf58 100644
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -330,11 +330,7 @@
       "//third_party/skia/src/ports/SkFontMgr_android_parser.cpp",
     ]
   }
-  if (!is_mac) {
-    sources -= [ "//third_party/skia/src/ports/SkFontHost_mac.cpp" ]
-  }
-
-  if (!is_linux && !is_android && !is_win) {
+  if (!is_linux && !is_android && !is_win && !is_mac) {
     sources -= [
       "//third_party/skia/src/ports/SkFontHost_FreeType.cpp",
       "//third_party/skia/src/ports/SkFontHost_FreeType_common.cpp",
diff --git a/skia/skia_gn_files.gypi b/skia/skia_gn_files.gypi
index 062460b..a3aca21 100644
--- a/skia/skia_gn_files.gypi
+++ b/skia/skia_gn_files.gypi
@@ -9,7 +9,6 @@
     '<(skia_src_path)/fonts/SkRemotableFontMgr.cpp',
     '<(skia_src_path)/ports/SkFontHost_FreeType_common.cpp',
     '<(skia_src_path)/ports/SkFontHost_FreeType.cpp',
-    '<(skia_src_path)/ports/SkFontHost_mac.cpp',
     '<(skia_src_path)/ports/SkFontHost_win.cpp',
     '<(skia_src_path)/ports/SkFontMgr_android.cpp',
     '<(skia_src_path)/ports/SkFontMgr_android_factory.cpp',
diff --git a/skia/skia_library.gypi b/skia/skia_library.gypi
index 5757be2..e933732 100644
--- a/skia/skia_library.gypi
+++ b/skia/skia_library.gypi
@@ -41,7 +41,6 @@
 
     '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
     '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
-    '../third_party/skia/src/ports/SkFontHost_mac.cpp',
     '../third_party/skia/src/ports/SkFontHost_win.cpp',
     "../third_party/skia/src/ports/SkFontMgr_android.cpp",
     "../third_party/skia/src/ports/SkFontMgr_android_factory.cpp",