Minimize allow_circular_includes_from entries for fxge.

Reduce the amount of circular dependencies allowed.

Change-Id: Iea83ab7e7cfe10eb17c584d7e1f1440bfcdb5cf6
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/54913
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/font/BUILD.gn b/core/fpdfapi/font/BUILD.gn
index c5ce882..ae873cb 100644
--- a/core/fpdfapi/font/BUILD.gn
+++ b/core/fpdfapi/font/BUILD.gn
@@ -52,7 +52,6 @@
     libs = [ "CoreFoundation.framework" ]
   }
   allow_circular_includes_from = [
-    "../../fxge",
     "../cmaps",
     "../parser",
   ]
diff --git a/core/fpdfapi/parser/BUILD.gn b/core/fpdfapi/parser/BUILD.gn
index b0384d7..2e3cebf 100644
--- a/core/fpdfapi/parser/BUILD.gn
+++ b/core/fpdfapi/parser/BUILD.gn
@@ -83,11 +83,12 @@
     "../../fxcrt",
     "../../fxge",
   ]
-  allow_circular_includes_from = [
-    "../../fxge",
-    "../../fxcodec",
-  ]
+  allow_circular_includes_from = [ "../../fxcodec" ]
   visibility = [ "../../../*" ]
+
+  if (pdf_use_skia || pdf_use_skia_paths) {
+    allow_circular_includes_from += [ "../../fxge" ]
+  }
 }
 
 pdfium_unittest_source_set("unittests") {
diff --git a/core/fxcodec/BUILD.gn b/core/fxcodec/BUILD.gn
index 66cfd71..5d49f82 100644
--- a/core/fxcodec/BUILD.gn
+++ b/core/fxcodec/BUILD.gn
@@ -77,7 +77,7 @@
     "../fxge",
     "//third_party:jpeg",
   ]
-  allow_circular_includes_from = [ "../fxge" ]
+  allow_circular_includes_from = []
 
   if (pdf_enable_xfa) {
     sources += [
@@ -123,6 +123,11 @@
       deps += [ "../../third_party:fx_tiff" ]
     }
   }
+
+  if (is_win) {
+    allow_circular_includes_from += [ "../fxge" ]
+  }
+
   visibility = [ "../../*" ]
 }