Move xfa/fxgraphics to xfa/fgas/graphics.

Then rename classes to CFGAS_GE* so to make them visually
distinguishable from the rest of CFXA_, which ought to be
garbage collected (this lower level library knows not of GC).

Change-Id: I4171e868f9ed22a99341732e87c8038db8ad85a3
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/74991
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/DEPS b/fpdfsdk/DEPS
index 733e072..eb290eb 100644
--- a/fpdfsdk/DEPS
+++ b/fpdfsdk/DEPS
@@ -3,7 +3,7 @@
   '+fxjs',
   '+public',
   '+v8',
+  '+xfa/fgas/graphics',
   '+xfa/fwl',
   '+xfa/fxfa',
-  '+xfa/fxgraphics',
 ]
diff --git a/fpdfsdk/fpdfxfa/BUILD.gn b/fpdfsdk/fpdfxfa/BUILD.gn
index d806232..41b9765 100644
--- a/fpdfsdk/fpdfxfa/BUILD.gn
+++ b/fpdfsdk/fpdfxfa/BUILD.gn
@@ -30,10 +30,10 @@
     "../../fxjs",
     "../../fxjs:gc",
     "../../xfa/fgas",
+    "../../xfa/fgas/graphics",
     "../../xfa/fwl",
     "../../xfa/fxfa",
     "../../xfa/fxfa/parser",
-    "../../xfa/fxgraphics",
   ]
   configs += [ "../../:pdfium_core_config" ]
   visibility = [ "../../*" ]
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
index c7dc95c..372d597 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
@@ -15,11 +15,11 @@
 #include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
 #include "fpdfsdk/fpdfxfa/cpdfxfa_widget.h"
 #include "third_party/base/notreached.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 #include "xfa/fxfa/cxfa_ffdocview.h"
 #include "xfa/fxfa/cxfa_ffpageview.h"
 #include "xfa/fxfa/cxfa_ffwidget.h"
 #include "xfa/fxfa/cxfa_ffwidgethandler.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
 
 namespace {
 
@@ -262,7 +262,7 @@
                                   const CFX_Matrix& mtUser2Device,
                                   const FX_RECT& rtClip) {
   CFX_RectF rectClip(rtClip);
-  CXFA_Graphics gs(pDevice);
+  CFGAS_GEGraphics gs(pDevice);
   gs.SetClipRect(rectClip);
 
   CXFA_FFPageView* xfaView = GetXFAPageView();
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp
index ab0ef57..86c7f34 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp
@@ -13,6 +13,7 @@
 #include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
 #include "fpdfsdk/fpdfxfa/cpdfxfa_widget.h"
 #include "public/fpdf_fwlevent.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 #include "xfa/fwl/cfwl_app.h"
 #include "xfa/fwl/fwl_widgetdef.h"
 #include "xfa/fwl/fwl_widgethit.h"
@@ -22,7 +23,6 @@
 #include "xfa/fxfa/cxfa_ffwidgethandler.h"
 #include "xfa/fxfa/fxfa_basic.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
 
 #define CHECK_FWL_VKEY_ENUM____(name)                                   \
   static_assert(static_cast<int>(name) == static_cast<int>(XFA_##name), \
@@ -239,7 +239,7 @@
   if (pPageView->GetFormFillEnv()->GetFocusAnnot() != pAnnot)
     bIsHighlight = true;
 
-  CXFA_Graphics gs(pDevice);
+  CFGAS_GEGraphics gs(pDevice);
   GetXFAFFWidgetHandler(pXFAWidget)
       ->RenderWidget(pXFAWidget->GetXFAFFWidget(), &gs, mtUser2Device,
                      bIsHighlight);
diff --git a/xfa/fgas/graphics/BUILD.gn b/xfa/fgas/graphics/BUILD.gn
new file mode 100644
index 0000000..5dbe3ce
--- /dev/null
+++ b/xfa/fgas/graphics/BUILD.gn
@@ -0,0 +1,31 @@
+# Copyright 2018 The PDFium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("../../../pdfium.gni")
+
+assert(pdf_enable_xfa)
+
+source_set("graphics") {
+  sources = [
+    "cfgas_gecolor.cpp",
+    "cfgas_gecolor.h",
+    "cfgas_gegraphics.cpp",
+    "cfgas_gegraphics.h",
+    "cfgas_gepath.cpp",
+    "cfgas_gepath.h",
+    "cfgas_gepattern.cpp",
+    "cfgas_gepattern.h",
+    "cfgas_geshading.cpp",
+    "cfgas_geshading.h",
+  ]
+  configs += [
+    "../../../:pdfium_core_config",
+    "../../:xfa_warnings",
+  ]
+  deps = [
+    "../../../core/fxcrt",
+    "../../../core/fxge",
+  ]
+  visibility = [ "../../../*" ]
+}
diff --git a/xfa/fgas/graphics/cfgas_gecolor.cpp b/xfa/fgas/graphics/cfgas_gecolor.cpp
new file mode 100644
index 0000000..8db330d
--- /dev/null
+++ b/xfa/fgas/graphics/cfgas_gecolor.cpp
@@ -0,0 +1,22 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+
+CFGAS_GEColor::CFGAS_GEColor(const FX_ARGB argb)
+    : m_type(Solid), m_argb(argb) {}
+
+CFGAS_GEColor::CFGAS_GEColor(CFGAS_GEPattern* pattern, const FX_ARGB argb)
+    : m_type(Pattern), m_argb(argb), m_pPattern(pattern) {}
+
+CFGAS_GEColor::CFGAS_GEColor(CFGAS_GEShading* shading)
+    : m_type(Shading), m_pShading(shading) {}
+
+CFGAS_GEColor::CFGAS_GEColor(const CFGAS_GEColor& that) = default;
+
+CFGAS_GEColor::~CFGAS_GEColor() = default;
+
+CFGAS_GEColor& CFGAS_GEColor::operator=(const CFGAS_GEColor& that) = default;
diff --git a/xfa/fgas/graphics/cfgas_gecolor.h b/xfa/fgas/graphics/cfgas_gecolor.h
new file mode 100644
index 0000000..0a47234
--- /dev/null
+++ b/xfa/fgas/graphics/cfgas_gecolor.h
@@ -0,0 +1,50 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef XFA_FGAS_GRAPHICS_CFGAS_GECOLOR_H_
+#define XFA_FGAS_GRAPHICS_CFGAS_GECOLOR_H_
+
+#include "core/fxcrt/unowned_ptr.h"
+#include "core/fxge/fx_dib.h"
+#include "third_party/base/check.h"
+
+class CFGAS_GEPattern;
+class CFGAS_GEShading;
+
+class CFGAS_GEColor {
+ public:
+  enum Type { Invalid, Solid, Pattern, Shading };
+
+  explicit CFGAS_GEColor(const FX_ARGB argb);
+  explicit CFGAS_GEColor(CFGAS_GEShading* shading);
+  CFGAS_GEColor(CFGAS_GEPattern* pattern, const FX_ARGB argb);
+  CFGAS_GEColor(const CFGAS_GEColor& that);
+  ~CFGAS_GEColor();
+
+  Type GetType() const { return m_type; }
+  FX_ARGB GetArgb() const {
+    DCHECK(m_type == Solid || m_type == Pattern);
+    return m_argb;
+  }
+  CFGAS_GEPattern* GetPattern() const {
+    DCHECK(m_type == Pattern);
+    return m_pPattern.Get();
+  }
+  CFGAS_GEShading* GetShading() const {
+    DCHECK(m_type == Shading);
+    return m_pShading.Get();
+  }
+
+  CFGAS_GEColor& operator=(const CFGAS_GEColor& that);
+
+ private:
+  Type m_type = Invalid;
+  FX_ARGB m_argb = 0;
+  UnownedPtr<CFGAS_GEPattern> m_pPattern;
+  UnownedPtr<CFGAS_GEShading> m_pShading;
+};
+
+#endif  // XFA_FGAS_GRAPHICS_CFGAS_GECOLOR_H_
diff --git a/xfa/fxgraphics/cxfa_graphics.cpp b/xfa/fgas/graphics/cfgas_gegraphics.cpp
similarity index 84%
rename from xfa/fxgraphics/cxfa_graphics.cpp
rename to xfa/fgas/graphics/cfgas_gegraphics.cpp
index 589b181..79cb365 100644
--- a/xfa/fxgraphics/cxfa_graphics.cpp
+++ b/xfa/fgas/graphics/cfgas_gegraphics.cpp
@@ -4,7 +4,7 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "xfa/fxgraphics/cxfa_graphics.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 
 #include <cmath>
 #include <memory>
@@ -15,10 +15,10 @@
 #include "core/fxge/dib/cfx_dibitmap.h"
 #include "third_party/base/check.h"
 #include "third_party/base/stl_util.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
-#include "xfa/fxgraphics/cxfa_gepattern.h"
-#include "xfa/fxgraphics/cxfa_geshading.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
+#include "xfa/fgas/graphics/cfgas_gepattern.h"
+#include "xfa/fgas/graphics/cfgas_geshading.h"
 
 namespace {
 
@@ -110,19 +110,19 @@
 
 }  // namespace
 
-CXFA_Graphics::CXFA_Graphics(CFX_RenderDevice* renderDevice)
+CFGAS_GEGraphics::CFGAS_GEGraphics(CFX_RenderDevice* renderDevice)
     : m_renderDevice(renderDevice) {
   DCHECK(m_renderDevice);
 }
 
-CXFA_Graphics::~CXFA_Graphics() = default;
+CFGAS_GEGraphics::~CFGAS_GEGraphics() = default;
 
-void CXFA_Graphics::SaveGraphState() {
+void CFGAS_GEGraphics::SaveGraphState() {
   m_renderDevice->SaveState();
   m_infoStack.push_back(std::make_unique<TInfo>(m_info));
 }
 
-void CXFA_Graphics::RestoreGraphState() {
+void CFGAS_GEGraphics::RestoreGraphState() {
   m_renderDevice->RestoreState(false);
   if (m_infoStack.empty())
     return;
@@ -132,12 +132,12 @@
   return;
 }
 
-void CXFA_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) {
+void CFGAS_GEGraphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) {
   m_info.graphState.m_LineCap = lineCap;
 }
 
-void CXFA_Graphics::SetLineDash(float dashPhase,
-                                pdfium::span<const float> dashArray) {
+void CFGAS_GEGraphics::SetLineDash(float dashPhase,
+                                   pdfium::span<const float> dashArray) {
   DCHECK(!dashArray.empty());
   float scale = m_info.isActOnDash ? m_info.graphState.m_LineWidth : 1.0;
   m_info.graphState.m_DashPhase = dashPhase;
@@ -146,65 +146,66 @@
     m_info.graphState.m_DashArray[i] = dashArray[i] * scale;
 }
 
-void CXFA_Graphics::SetSolidLineDash() {
+void CFGAS_GEGraphics::SetSolidLineDash() {
   m_info.graphState.m_DashArray.clear();
 }
 
-void CXFA_Graphics::SetLineWidth(float lineWidth) {
+void CFGAS_GEGraphics::SetLineWidth(float lineWidth) {
   m_info.graphState.m_LineWidth = lineWidth;
 }
 
-void CXFA_Graphics::EnableActOnDash() {
+void CFGAS_GEGraphics::EnableActOnDash() {
   m_info.isActOnDash = true;
 }
 
-void CXFA_Graphics::SetStrokeColor(const CXFA_GEColor& color) {
+void CFGAS_GEGraphics::SetStrokeColor(const CFGAS_GEColor& color) {
   m_info.strokeColor = color;
 }
 
-void CXFA_Graphics::SetFillColor(const CXFA_GEColor& color) {
+void CFGAS_GEGraphics::SetFillColor(const CFGAS_GEColor& color) {
   m_info.fillColor = color;
 }
 
-void CXFA_Graphics::StrokePath(CXFA_GEPath* path, const CFX_Matrix* matrix) {
+void CFGAS_GEGraphics::StrokePath(CFGAS_GEPath* path,
+                                  const CFX_Matrix* matrix) {
   if (path)
     RenderDeviceStrokePath(path, matrix);
 }
 
-void CXFA_Graphics::FillPath(CXFA_GEPath* path,
-                             CFX_FillRenderOptions::FillType fill_type,
-                             const CFX_Matrix* matrix) {
+void CFGAS_GEGraphics::FillPath(CFGAS_GEPath* path,
+                                CFX_FillRenderOptions::FillType fill_type,
+                                const CFX_Matrix* matrix) {
   if (path)
     RenderDeviceFillPath(path, fill_type, matrix);
 }
 
-void CXFA_Graphics::ConcatMatrix(const CFX_Matrix* matrix) {
+void CFGAS_GEGraphics::ConcatMatrix(const CFX_Matrix* matrix) {
   if (matrix)
     m_info.CTM.Concat(*matrix);
 }
 
-const CFX_Matrix* CXFA_Graphics::GetMatrix() const {
+const CFX_Matrix* CFGAS_GEGraphics::GetMatrix() const {
   return &m_info.CTM;
 }
 
-CFX_RectF CXFA_Graphics::GetClipRect() const {
+CFX_RectF CFGAS_GEGraphics::GetClipRect() const {
   FX_RECT r = m_renderDevice->GetClipBox();
   return CFX_RectF(r.left, r.top, r.Width(), r.Height());
 }
 
-void CXFA_Graphics::SetClipRect(const CFX_RectF& rect) {
+void CFGAS_GEGraphics::SetClipRect(const CFX_RectF& rect) {
   m_renderDevice->SetClip_Rect(
       FX_RECT(FXSYS_roundf(rect.left), FXSYS_roundf(rect.top),
               FXSYS_roundf(rect.right()), FXSYS_roundf(rect.bottom())));
 }
 
-CFX_RenderDevice* CXFA_Graphics::GetRenderDevice() {
+CFX_RenderDevice* CFGAS_GEGraphics::GetRenderDevice() {
   return m_renderDevice;
 }
 
-void CXFA_Graphics::RenderDeviceStrokePath(const CXFA_GEPath* path,
-                                           const CFX_Matrix* matrix) {
-  if (m_info.strokeColor.GetType() != CXFA_GEColor::Solid)
+void CFGAS_GEGraphics::RenderDeviceStrokePath(const CFGAS_GEPath* path,
+                                              const CFX_Matrix* matrix) {
+  if (m_info.strokeColor.GetType() != CFGAS_GEColor::Solid)
     return;
 
   CFX_Matrix m = m_info.CTM;
@@ -216,8 +217,8 @@
                            CFX_FillRenderOptions());
 }
 
-void CXFA_Graphics::RenderDeviceFillPath(
-    const CXFA_GEPath* path,
+void CFGAS_GEGraphics::RenderDeviceFillPath(
+    const CFGAS_GEPath* path,
     CFX_FillRenderOptions::FillType fill_type,
     const CFX_Matrix* matrix) {
   CFX_Matrix m = m_info.CTM;
@@ -226,14 +227,14 @@
 
   const CFX_FillRenderOptions fill_options(fill_type);
   switch (m_info.fillColor.GetType()) {
-    case CXFA_GEColor::Solid:
+    case CFGAS_GEColor::Solid:
       m_renderDevice->DrawPath(path->GetPathData(), &m, &m_info.graphState,
                                m_info.fillColor.GetArgb(), 0x0, fill_options);
       return;
-    case CXFA_GEColor::Pattern:
+    case CFGAS_GEColor::Pattern:
       FillPathWithPattern(path, fill_options, m);
       return;
-    case CXFA_GEColor::Shading:
+    case CFGAS_GEColor::Shading:
       FillPathWithShading(path, fill_options, m);
       return;
     default:
@@ -241,8 +242,8 @@
   }
 }
 
-void CXFA_Graphics::FillPathWithPattern(
-    const CXFA_GEPath* path,
+void CFGAS_GEGraphics::FillPathWithPattern(
+    const CFGAS_GEPath* path,
     const CFX_FillRenderOptions& fill_options,
     const CFX_Matrix& matrix) {
   RetainPtr<CFX_DIBitmap> bitmap = m_renderDevice->GetBitmap();
@@ -275,8 +276,8 @@
   SetDIBitsWithMatrix(bmp, CFX_Matrix());
 }
 
-void CXFA_Graphics::FillPathWithShading(
-    const CXFA_GEPath* path,
+void CFGAS_GEGraphics::FillPathWithShading(
+    const CFGAS_GEPath* path,
     const CFX_FillRenderOptions& fill_options,
     const CFX_Matrix& matrix) {
   RetainPtr<CFX_DIBitmap> bitmap = m_renderDevice->GetBitmap();
@@ -395,8 +396,8 @@
   }
 }
 
-void CXFA_Graphics::SetDIBitsWithMatrix(const RetainPtr<CFX_DIBBase>& source,
-                                        const CFX_Matrix& matrix) {
+void CFGAS_GEGraphics::SetDIBitsWithMatrix(const RetainPtr<CFX_DIBBase>& source,
+                                           const CFX_Matrix& matrix) {
   if (matrix.IsIdentity()) {
     m_renderDevice->SetDIBits(source, 0, 0);
   } else {
@@ -411,16 +412,17 @@
   }
 }
 
-CXFA_Graphics::TInfo::TInfo() = default;
+CFGAS_GEGraphics::TInfo::TInfo() = default;
 
-CXFA_Graphics::TInfo::TInfo(const TInfo& info)
+CFGAS_GEGraphics::TInfo::TInfo(const TInfo& info)
     : graphState(info.graphState),
       CTM(info.CTM),
       isActOnDash(info.isActOnDash),
       strokeColor(info.strokeColor),
       fillColor(info.fillColor) {}
 
-CXFA_Graphics::TInfo& CXFA_Graphics::TInfo::operator=(const TInfo& other) {
+CFGAS_GEGraphics::TInfo& CFGAS_GEGraphics::TInfo::operator=(
+    const TInfo& other) {
   graphState = other.graphState;
   CTM = other.CTM;
   isActOnDash = other.isActOnDash;
diff --git a/xfa/fxgraphics/cxfa_graphics.h b/xfa/fgas/graphics/cfgas_gegraphics.h
similarity index 71%
rename from xfa/fxgraphics/cxfa_graphics.h
rename to xfa/fgas/graphics/cfgas_gegraphics.h
index c3ac626..395c425 100644
--- a/xfa/fxgraphics/cxfa_graphics.h
+++ b/xfa/fgas/graphics/cfgas_gegraphics.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_FXGRAPHICS_CXFA_GRAPHICS_H_
-#define XFA_FXGRAPHICS_CXFA_GRAPHICS_H_
+#ifndef XFA_FGAS_GRAPHICS_CFGAS_GEGRAPHICS_H_
+#define XFA_FGAS_GRAPHICS_CFGAS_GEGRAPHICS_H_
 
 #include <memory>
 #include <vector>
@@ -14,7 +14,7 @@
 #include "core/fxge/cfx_fillrenderoptions.h"
 #include "core/fxge/cfx_graphstatedata.h"
 #include "third_party/base/span.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
 
 enum class FX_HatchStyle {
   Horizontal = 0,
@@ -25,14 +25,14 @@
   DiagonalCross = 5
 };
 
+class CFGAS_GEPath;
 class CFX_DIBBase;
 class CFX_RenderDevice;
-class CXFA_GEPath;
 
-class CXFA_Graphics {
+class CFGAS_GEGraphics {
  public:
-  explicit CXFA_Graphics(CFX_RenderDevice* renderDevice);
-  ~CXFA_Graphics();
+  explicit CFGAS_GEGraphics(CFX_RenderDevice* renderDevice);
+  ~CFGAS_GEGraphics();
 
   void SaveGraphState();
   void RestoreGraphState();
@@ -46,11 +46,11 @@
   void SetSolidLineDash();
   void SetLineWidth(float lineWidth);
   void EnableActOnDash();
-  void SetStrokeColor(const CXFA_GEColor& color);
-  void SetFillColor(const CXFA_GEColor& color);
+  void SetStrokeColor(const CFGAS_GEColor& color);
+  void SetFillColor(const CFGAS_GEColor& color);
   void SetClipRect(const CFX_RectF& rect);
-  void StrokePath(CXFA_GEPath* path, const CFX_Matrix* matrix);
-  void FillPath(CXFA_GEPath* path,
+  void StrokePath(CFGAS_GEPath* path, const CFX_Matrix* matrix);
+  void FillPath(CFGAS_GEPath* path,
                 CFX_FillRenderOptions::FillType fill_type,
                 const CFX_Matrix* matrix);
   void ConcatMatrix(const CFX_Matrix* matrix);
@@ -64,19 +64,19 @@
     CFX_GraphStateData graphState;
     CFX_Matrix CTM;
     bool isActOnDash = false;
-    CXFA_GEColor strokeColor{nullptr};
-    CXFA_GEColor fillColor{nullptr};
+    CFGAS_GEColor strokeColor{nullptr};
+    CFGAS_GEColor fillColor{nullptr};
   };
 
-  void RenderDeviceStrokePath(const CXFA_GEPath* path,
+  void RenderDeviceStrokePath(const CFGAS_GEPath* path,
                               const CFX_Matrix* matrix);
-  void RenderDeviceFillPath(const CXFA_GEPath* path,
+  void RenderDeviceFillPath(const CFGAS_GEPath* path,
                             CFX_FillRenderOptions::FillType fill_type,
                             const CFX_Matrix* matrix);
-  void FillPathWithPattern(const CXFA_GEPath* path,
+  void FillPathWithPattern(const CFGAS_GEPath* path,
                            const CFX_FillRenderOptions& fill_options,
                            const CFX_Matrix& matrix);
-  void FillPathWithShading(const CXFA_GEPath* path,
+  void FillPathWithShading(const CFGAS_GEPath* path,
                            const CFX_FillRenderOptions& fill_options,
                            const CFX_Matrix& matrix);
   void SetDIBitsWithMatrix(const RetainPtr<CFX_DIBBase>& source,
@@ -87,4 +87,4 @@
   std::vector<std::unique_ptr<TInfo>> m_infoStack;
 };
 
-#endif  // XFA_FXGRAPHICS_CXFA_GRAPHICS_H_
+#endif  // XFA_FGAS_GRAPHICS_CFGAS_GEGRAPHICS_H_
diff --git a/xfa/fxgraphics/cxfa_gepath.cpp b/xfa/fgas/graphics/cfgas_gepath.cpp
similarity index 71%
rename from xfa/fxgraphics/cxfa_gepath.cpp
rename to xfa/fgas/graphics/cfgas_gepath.cpp
index 0f5cd96..1619e17 100644
--- a/xfa/fxgraphics/cxfa_gepath.cpp
+++ b/xfa/fgas/graphics/cfgas_gepath.cpp
@@ -4,51 +4,51 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "xfa/fxgraphics/cxfa_gepath.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 
 #include "core/fxge/cfx_pathdata.h"
 
-CXFA_GEPath::CXFA_GEPath() = default;
+CFGAS_GEPath::CFGAS_GEPath() = default;
 
-CXFA_GEPath::~CXFA_GEPath() = default;
+CFGAS_GEPath::~CFGAS_GEPath() = default;
 
-void CXFA_GEPath::Clear() {
+void CFGAS_GEPath::Clear() {
   data_.Clear();
 }
 
-void CXFA_GEPath::Close() {
+void CFGAS_GEPath::Close() {
   data_.ClosePath();
 }
 
-void CXFA_GEPath::MoveTo(const CFX_PointF& point) {
+void CFGAS_GEPath::MoveTo(const CFX_PointF& point) {
   data_.AppendPoint(point, FXPT_TYPE::MoveTo);
 }
 
-void CXFA_GEPath::LineTo(const CFX_PointF& point) {
+void CFGAS_GEPath::LineTo(const CFX_PointF& point) {
   data_.AppendPoint(point, FXPT_TYPE::LineTo);
 }
 
-void CXFA_GEPath::BezierTo(const CFX_PointF& c1,
-                           const CFX_PointF& c2,
-                           const CFX_PointF& to) {
+void CFGAS_GEPath::BezierTo(const CFX_PointF& c1,
+                            const CFX_PointF& c2,
+                            const CFX_PointF& to) {
   data_.AppendPoint(c1, FXPT_TYPE::BezierTo);
   data_.AppendPoint(c2, FXPT_TYPE::BezierTo);
   data_.AppendPoint(to, FXPT_TYPE::BezierTo);
 }
 
-void CXFA_GEPath::ArcTo(const CFX_PointF& pos,
-                        const CFX_SizeF& size,
-                        float start_angle,
-                        float sweep_angle) {
+void CFGAS_GEPath::ArcTo(const CFX_PointF& pos,
+                         const CFX_SizeF& size,
+                         float start_angle,
+                         float sweep_angle) {
   CFX_SizeF new_size = size / 2.0f;
   ArcToInternal(CFX_PointF(pos.x + new_size.width, pos.y + new_size.height),
                 new_size, start_angle, sweep_angle);
 }
 
-void CXFA_GEPath::ArcToInternal(const CFX_PointF& pos,
-                                const CFX_SizeF& size,
-                                float start_angle,
-                                float sweep_angle) {
+void CFGAS_GEPath::ArcToInternal(const CFX_PointF& pos,
+                                 const CFX_SizeF& size,
+                                 float start_angle,
+                                 float sweep_angle) {
   float x0 = cos(sweep_angle / 2);
   float y0 = sin(sweep_angle / 2);
   float tx = ((1.0f - x0) * 4) / (3 * 1.0f);
@@ -72,26 +72,26 @@
   data_.AppendPoint(bezier, FXPT_TYPE::BezierTo);
 }
 
-void CXFA_GEPath::AddLine(const CFX_PointF& p1, const CFX_PointF& p2) {
+void CFGAS_GEPath::AddLine(const CFX_PointF& p1, const CFX_PointF& p2) {
   data_.AppendPoint(p1, FXPT_TYPE::MoveTo);
   data_.AppendPoint(p2, FXPT_TYPE::LineTo);
 }
 
-void CXFA_GEPath::AddRectangle(float left,
-                               float top,
-                               float width,
-                               float height) {
+void CFGAS_GEPath::AddRectangle(float left,
+                                float top,
+                                float width,
+                                float height) {
   data_.AppendRect(left, top, left + width, top + height);
 }
 
-void CXFA_GEPath::AddEllipse(const CFX_RectF& rect) {
+void CFGAS_GEPath::AddEllipse(const CFX_RectF& rect) {
   AddArc(rect.TopLeft(), rect.Size(), 0, FX_PI * 2);
 }
 
-void CXFA_GEPath::AddArc(const CFX_PointF& original_pos,
-                         const CFX_SizeF& original_size,
-                         float start_angle,
-                         float sweep_angle) {
+void CFGAS_GEPath::AddArc(const CFX_PointF& original_pos,
+                          const CFX_SizeF& original_size,
+                          float start_angle,
+                          float sweep_angle) {
   if (sweep_angle == 0)
     return;
 
@@ -139,12 +139,12 @@
   } while (!done);
 }
 
-void CXFA_GEPath::AddSubpath(CXFA_GEPath* path) {
+void CFGAS_GEPath::AddSubpath(CFGAS_GEPath* path) {
   if (!path)
     return;
   data_.Append(&path->data_, nullptr);
 }
 
-void CXFA_GEPath::TransformBy(const CFX_Matrix& mt) {
+void CFGAS_GEPath::TransformBy(const CFX_Matrix& mt) {
   data_.Transform(mt);
 }
diff --git a/xfa/fxgraphics/cxfa_gepath.h b/xfa/fgas/graphics/cfgas_gepath.h
similarity index 82%
rename from xfa/fxgraphics/cxfa_gepath.h
rename to xfa/fgas/graphics/cfgas_gepath.h
index 0c3afc4..8f843cc 100644
--- a/xfa/fxgraphics/cxfa_gepath.h
+++ b/xfa/fgas/graphics/cfgas_gepath.h
@@ -4,17 +4,17 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_FXGRAPHICS_CXFA_GEPATH_H_
-#define XFA_FXGRAPHICS_CXFA_GEPATH_H_
+#ifndef XFA_FGAS_GRAPHICS_CFGAS_GEPATH_H_
+#define XFA_FGAS_GRAPHICS_CFGAS_GEPATH_H_
 
 #include "core/fxcrt/fx_system.h"
 #include "core/fxge/cfx_pathdata.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 
-class CXFA_GEPath final {
+class CFGAS_GEPath final {
  public:
-  CXFA_GEPath();
-  ~CXFA_GEPath();
+  CFGAS_GEPath();
+  ~CFGAS_GEPath();
 
   const CFX_PathData* GetPathData() const { return &data_; }
 
@@ -41,7 +41,7 @@
               float startAngle,
               float sweepAngle);
 
-  void AddSubpath(CXFA_GEPath* path);
+  void AddSubpath(CFGAS_GEPath* path);
 
  private:
   void ArcToInternal(const CFX_PointF& pos,
@@ -52,4 +52,4 @@
   CFX_PathData data_;
 };
 
-#endif  // XFA_FXGRAPHICS_CXFA_GEPATH_H_
+#endif  // XFA_FGAS_GRAPHICS_CFGAS_GEPATH_H_
diff --git a/xfa/fgas/graphics/cfgas_gepattern.cpp b/xfa/fgas/graphics/cfgas_gepattern.cpp
new file mode 100644
index 0000000..0fe96fd
--- /dev/null
+++ b/xfa/fgas/graphics/cfgas_gepattern.cpp
@@ -0,0 +1,14 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "xfa/fgas/graphics/cfgas_gepattern.h"
+
+CFGAS_GEPattern::CFGAS_GEPattern(FX_HatchStyle hatchStyle,
+                                 const FX_ARGB foreArgb,
+                                 const FX_ARGB backArgb)
+    : m_hatchStyle(hatchStyle), m_foreArgb(foreArgb), m_backArgb(backArgb) {}
+
+CFGAS_GEPattern::~CFGAS_GEPattern() = default;
diff --git a/xfa/fgas/graphics/cfgas_gepattern.h b/xfa/fgas/graphics/cfgas_gepattern.h
new file mode 100644
index 0000000..8d3b3eb
--- /dev/null
+++ b/xfa/fgas/graphics/cfgas_gepattern.h
@@ -0,0 +1,33 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef XFA_FGAS_GRAPHICS_CFGAS_GEPATTERN_H_
+#define XFA_FGAS_GRAPHICS_CFGAS_GEPATTERN_H_
+
+#include "core/fxcrt/fx_coordinates.h"
+#include "core/fxcrt/fx_system.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
+
+class CFX_DIBitmap;
+class CFX_Matrix;
+
+class CFGAS_GEPattern final {
+ public:
+  CFGAS_GEPattern(FX_HatchStyle hatchStyle,
+                  const FX_ARGB foreArgb,
+                  const FX_ARGB backArgb);
+
+  ~CFGAS_GEPattern();
+
+ private:
+  friend class CFGAS_GEGraphics;
+
+  const FX_HatchStyle m_hatchStyle;
+  const FX_ARGB m_foreArgb;
+  const FX_ARGB m_backArgb;
+};
+
+#endif  // XFA_FGAS_GRAPHICS_CFGAS_GEPATTERN_H_
diff --git a/xfa/fxgraphics/cxfa_geshading.cpp b/xfa/fgas/graphics/cfgas_geshading.cpp
similarity index 64%
rename from xfa/fxgraphics/cxfa_geshading.cpp
rename to xfa/fgas/graphics/cfgas_geshading.cpp
index 3a2e4c9..2fd9a8a 100644
--- a/xfa/fxgraphics/cxfa_geshading.cpp
+++ b/xfa/fgas/graphics/cfgas_geshading.cpp
@@ -4,14 +4,14 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "xfa/fxgraphics/cxfa_geshading.h"
+#include "xfa/fgas/graphics/cfgas_geshading.h"
 
-CXFA_GEShading::CXFA_GEShading(const CFX_PointF& beginPoint,
-                               const CFX_PointF& endPoint,
-                               bool isExtendedBegin,
-                               bool isExtendedEnd,
-                               const FX_ARGB beginArgb,
-                               const FX_ARGB endArgb)
+CFGAS_GEShading::CFGAS_GEShading(const CFX_PointF& beginPoint,
+                                 const CFX_PointF& endPoint,
+                                 bool isExtendedBegin,
+                                 bool isExtendedEnd,
+                                 const FX_ARGB beginArgb,
+                                 const FX_ARGB endArgb)
     : m_type(FX_SHADING_Axial),
       m_beginPoint(beginPoint),
       m_endPoint(endPoint),
@@ -24,14 +24,14 @@
   InitArgbArray();
 }
 
-CXFA_GEShading::CXFA_GEShading(const CFX_PointF& beginPoint,
-                               const CFX_PointF& endPoint,
-                               const float beginRadius,
-                               const float endRadius,
-                               bool isExtendedBegin,
-                               bool isExtendedEnd,
-                               const FX_ARGB beginArgb,
-                               const FX_ARGB endArgb)
+CFGAS_GEShading::CFGAS_GEShading(const CFX_PointF& beginPoint,
+                                 const CFX_PointF& endPoint,
+                                 const float beginRadius,
+                                 const float endRadius,
+                                 bool isExtendedBegin,
+                                 bool isExtendedEnd,
+                                 const FX_ARGB beginArgb,
+                                 const FX_ARGB endArgb)
     : m_type(FX_SHADING_Radial),
       m_beginPoint(beginPoint),
       m_endPoint(endPoint),
@@ -44,9 +44,9 @@
   InitArgbArray();
 }
 
-CXFA_GEShading::~CXFA_GEShading() = default;
+CFGAS_GEShading::~CFGAS_GEShading() = default;
 
-void CXFA_GEShading::InitArgbArray() {
+void CFGAS_GEShading::InitArgbArray() {
   int32_t a1;
   int32_t r1;
   int32_t g1;
diff --git a/xfa/fgas/graphics/cfgas_geshading.h b/xfa/fgas/graphics/cfgas_geshading.h
new file mode 100644
index 0000000..741e82e
--- /dev/null
+++ b/xfa/fgas/graphics/cfgas_geshading.h
@@ -0,0 +1,57 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef XFA_FGAS_GRAPHICS_CFGAS_GESHADING_H_
+#define XFA_FGAS_GRAPHICS_CFGAS_GESHADING_H_
+
+#include "core/fxcrt/fx_coordinates.h"
+#include "core/fxcrt/fx_system.h"
+#include "core/fxge/fx_dib.h"
+
+#define FX_SHADING_Steps 256
+
+enum CFGAS_GEShading_Type { FX_SHADING_Axial = 1, FX_SHADING_Radial };
+
+class CFGAS_GEShading final {
+ public:
+  // Axial shading.
+  CFGAS_GEShading(const CFX_PointF& beginPoint,
+                  const CFX_PointF& endPoint,
+                  bool isExtendedBegin,
+                  bool isExtendedEnd,
+                  const FX_ARGB beginArgb,
+                  const FX_ARGB endArgb);
+
+  // Radial shading.
+  CFGAS_GEShading(const CFX_PointF& beginPoint,
+                  const CFX_PointF& endPoint,
+                  const float beginRadius,
+                  const float endRadius,
+                  bool isExtendedBegin,
+                  bool isExtendedEnd,
+                  const FX_ARGB beginArgb,
+                  const FX_ARGB endArgb);
+
+  ~CFGAS_GEShading();
+
+ private:
+  friend class CFGAS_GEGraphics;
+
+  void InitArgbArray();
+
+  const CFGAS_GEShading_Type m_type;
+  const CFX_PointF m_beginPoint;
+  const CFX_PointF m_endPoint;
+  const float m_beginRadius;
+  const float m_endRadius;
+  const bool m_isExtendedBegin;
+  const bool m_isExtendedEnd;
+  const FX_ARGB m_beginArgb;
+  const FX_ARGB m_endArgb;
+  FX_ARGB m_argbArray[FX_SHADING_Steps];
+};
+
+#endif  // XFA_FGAS_GRAPHICS_CFGAS_GESHADING_H_
diff --git a/xfa/fwl/BUILD.gn b/xfa/fwl/BUILD.gn
index 58a3b3c..ae42174 100644
--- a/xfa/fwl/BUILD.gn
+++ b/xfa/fwl/BUILD.gn
@@ -113,7 +113,7 @@
     "../../fxjs:gc",
     "../fde",
     "../fgas",
-    "../fxgraphics",
+    "../fgas/graphics",
   ]
   configs += [
     "../../:pdfium_core_config",
diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp
index 923e5c9..8a4cbfb 100644
--- a/xfa/fwl/cfwl_barcode.cpp
+++ b/xfa/fwl/cfwl_barcode.cpp
@@ -30,7 +30,7 @@
   GenerateBarcodeImageCache();
 }
 
-void CFWL_Barcode::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_Barcode::DrawWidget(CFGAS_GEGraphics* pGraphics,
                               const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
diff --git a/xfa/fwl/cfwl_barcode.h b/xfa/fwl/cfwl_barcode.h
index 0af87fd..31aca8e 100644
--- a/xfa/fwl/cfwl_barcode.h
+++ b/xfa/fwl/cfwl_barcode.h
@@ -37,7 +37,8 @@
   // CFWL_Widget
   FWL_Type GetClassID() const override;
   void Update() override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
 
   // CFWL_Edit
diff --git a/xfa/fwl/cfwl_caret.cpp b/xfa/fwl/cfwl_caret.cpp
index 589046a..8503872 100644
--- a/xfa/fwl/cfwl_caret.cpp
+++ b/xfa/fwl/cfwl_caret.cpp
@@ -37,7 +37,7 @@
 
 void CFWL_Caret::Update() {}
 
-void CFWL_Caret::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_Caret::DrawWidget(CFGAS_GEGraphics* pGraphics,
                             const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
@@ -57,7 +57,7 @@
   SetStates(FWL_WGTSTATE_Invisible);
 }
 
-void CFWL_Caret::DrawCaretBK(CXFA_Graphics* pGraphics,
+void CFWL_Caret::DrawCaretBK(CFGAS_GEGraphics* pGraphics,
                              const CFX_Matrix* pMatrix) {
   if (!(m_Properties.m_dwStates & kStateHighlight))
     return;
@@ -76,7 +76,7 @@
 
 void CFWL_Caret::OnProcessMessage(CFWL_Message* pMessage) {}
 
-void CFWL_Caret::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_Caret::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                               const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_caret.h b/xfa/fwl/cfwl_caret.h
index a4dac04..b59637e 100644
--- a/xfa/fwl/cfwl_caret.h
+++ b/xfa/fwl/cfwl_caret.h
@@ -10,8 +10,8 @@
 #include <memory>
 
 #include "core/fxcrt/cfx_timer.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
 #include "xfa/fwl/cfwl_widget.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
 
 class CFWL_Caret final : public CFWL_Widget, public CFX_Timer::CallbackIface {
  public:
@@ -20,9 +20,10 @@
 
   // CFWL_Widget:
   FWL_Type GetClassID() const override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
   void Update() override;
 
@@ -35,7 +36,7 @@
  private:
   CFWL_Caret(CFWL_App* app, const Properties& properties, CFWL_Widget* pOuter);
 
-  void DrawCaretBK(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawCaretBK(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
 
   std::unique_ptr<CFX_Timer> m_pTimer;
 };
diff --git a/xfa/fwl/cfwl_checkbox.cpp b/xfa/fwl/cfwl_checkbox.cpp
index bb7dc57..01160b6 100644
--- a/xfa/fwl/cfwl_checkbox.cpp
+++ b/xfa/fwl/cfwl_checkbox.cpp
@@ -50,7 +50,7 @@
   Layout();
 }
 
-void CFWL_CheckBox::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_CheckBox::DrawWidget(CFGAS_GEGraphics* pGraphics,
                                const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
@@ -227,7 +227,7 @@
     CFWL_Widget::OnProcessMessage(pMessage);
 }
 
-void CFWL_CheckBox::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_CheckBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                  const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_checkbox.h b/xfa/fwl/cfwl_checkbox.h
index 46f4bfe..6a17a09 100644
--- a/xfa/fwl/cfwl_checkbox.h
+++ b/xfa/fwl/cfwl_checkbox.h
@@ -36,10 +36,11 @@
   // CFWL_Widget
   FWL_Type GetClassID() const override;
   void Update() override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
 
   void OnProcessMessage(CFWL_Message* pMessage) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   void SetBoxSize(float fHeight);
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp
index 1145fd6..8ef8fd8 100644
--- a/xfa/fwl/cfwl_combobox.cpp
+++ b/xfa/fwl/cfwl_combobox.cpp
@@ -101,7 +101,7 @@
   return FWL_WidgetHit::Unknown;
 }
 
-void CFWL_ComboBox::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_ComboBox::DrawWidget(CFGAS_GEGraphics* pGraphics,
                                const CFX_Matrix& matrix) {
   pGraphics->SaveGraphState();
   pGraphics->ConcatMatrix(&matrix);
@@ -448,7 +448,7 @@
   }
 }
 
-void CFWL_ComboBox::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_ComboBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                  const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_combobox.h b/xfa/fwl/cfwl_combobox.h
index a849d1c..4b4ac7e 100644
--- a/xfa/fwl/cfwl_combobox.h
+++ b/xfa/fwl/cfwl_combobox.h
@@ -7,11 +7,11 @@
 #ifndef XFA_FWL_CFWL_COMBOBOX_H_
 #define XFA_FWL_CFWL_COMBOBOX_H_
 
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 #include "xfa/fwl/cfwl_comboedit.h"
 #include "xfa/fwl/cfwl_combolist.h"
 #include "xfa/fwl/cfwl_listbox.h"
 #include "xfa/fwl/cfwl_widget.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
 
 class CFWL_ComboBox;
 class CFWL_ListBox;
@@ -46,10 +46,11 @@
   void RemoveStates(uint32_t dwStates) override;
   void Update() override;
   FWL_WidgetHit HitTest(const CFX_PointF& point) override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   WideString GetTextByIndex(int32_t iIndex) const;
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp
index 243d692..03b50ca 100644
--- a/xfa/fwl/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/cfwl_datetimepicker.cpp
@@ -92,7 +92,7 @@
   return FWL_WidgetHit::Unknown;
 }
 
-void CFWL_DateTimePicker::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_DateTimePicker::DrawWidget(CFGAS_GEGraphics* pGraphics,
                                      const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
@@ -179,7 +179,7 @@
   m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
 }
 
-void CFWL_DateTimePicker::DrawDropDownButton(CXFA_Graphics* pGraphics,
+void CFWL_DateTimePicker::DrawDropDownButton(CFGAS_GEGraphics* pGraphics,
                                              const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground param;
   param.m_pWidget = this;
@@ -347,7 +347,7 @@
     CFWL_Widget::OnProcessMessage(pMessage);
 }
 
-void CFWL_DateTimePicker::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_DateTimePicker::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                        const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_datetimepicker.h b/xfa/fwl/cfwl_datetimepicker.h
index 50a40ed..5a3f6c4 100644
--- a/xfa/fwl/cfwl_datetimepicker.h
+++ b/xfa/fwl/cfwl_datetimepicker.h
@@ -39,9 +39,10 @@
   FWL_Type GetClassID() const override;
   void Update() override;
   FWL_WidgetHit HitTest(const CFX_PointF& point) override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
@@ -78,7 +79,8 @@
  private:
   explicit CFWL_DateTimePicker(CFWL_App* pApp);
 
-  void DrawDropDownButton(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawDropDownButton(CFGAS_GEGraphics* pGraphics,
+                          const CFX_Matrix* pMatrix);
   WideString FormatDateString(int32_t iYear, int32_t iMonth, int32_t iDay);
   void ResetEditAlignment();
   void GetPopupPos(float fMinHeight,
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index c4aacc9..696be7e 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -19,6 +19,7 @@
 #include "v8/include/cppgc/visitor.h"
 #include "xfa/fde/cfde_textout.h"
 #include "xfa/fgas/font/cfgas_gefont.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_app.h"
 #include "xfa/fwl/cfwl_caret.h"
 #include "xfa/fwl/cfwl_event.h"
@@ -32,7 +33,6 @@
 #include "xfa/fwl/fwl_widgetdef.h"
 #include "xfa/fwl/ifwl_themeprovider.h"
 #include "xfa/fwl/theme/cfwl_utils.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 namespace {
 
@@ -140,7 +140,8 @@
   return FWL_WidgetHit::Unknown;
 }
 
-void CFWL_Edit::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) {
+void CFWL_Edit::DrawWidget(CFGAS_GEGraphics* pGraphics,
+                           const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
 
@@ -321,7 +322,7 @@
   m_fScrollOffsetY = fScrollOffset;
 }
 
-void CFWL_Edit::DrawTextBk(CXFA_Graphics* pGraphics,
+void CFWL_Edit::DrawTextBk(CFGAS_GEGraphics* pGraphics,
                            const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground param;
   param.m_pWidget = this;
@@ -352,7 +353,7 @@
   GetThemeProvider()->DrawBackground(param);
 }
 
-void CFWL_Edit::DrawContent(CXFA_Graphics* pGraphics,
+void CFWL_Edit::DrawContent(CFGAS_GEGraphics* pGraphics,
                             const CFX_Matrix* pMatrix) {
   pGraphics->SaveGraphState();
   if (m_Properties.m_dwStyleExes & FWL_STYLEEXT_EDT_CombText)
@@ -376,7 +377,7 @@
     std::vector<CFX_RectF> rects =
         m_pEditEngine->GetCharacterRectsInRange(sel_start, count);
 
-    CXFA_GEPath path;
+    CFGAS_GEPath path;
     for (auto& rect : rects) {
       rect.left += fOffSetX;
       rect.top += fOffSetY;
@@ -399,7 +400,7 @@
   if (m_Properties.m_dwStyleExes & FWL_STYLEEXT_EDT_CombText) {
     pGraphics->RestoreGraphState();
 
-    CXFA_GEPath path;
+    CFGAS_GEPath path;
     int32_t iLimit = m_nLimit > 0 ? m_nLimit : 1;
     float fStep = m_EngineRect.width / iLimit;
     float fLeft = m_EngineRect.left + 1;
@@ -1028,7 +1029,7 @@
   }
 }
 
-void CFWL_Edit::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_Edit::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                              const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_edit.h b/xfa/fwl/cfwl_edit.h
index e123a0f..f6f6fec 100644
--- a/xfa/fwl/cfwl_edit.h
+++ b/xfa/fwl/cfwl_edit.h
@@ -11,10 +11,10 @@
 #include <utility>
 
 #include "xfa/fde/cfde_texteditengine.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_event.h"
 #include "xfa/fwl/cfwl_scrollbar.h"
 #include "xfa/fwl/cfwl_widget.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0)
 #define FWL_STYLEEXT_EDT_MultiLine (1L << 1)
@@ -56,10 +56,11 @@
   void Update() override;
   FWL_WidgetHit HitTest(const CFX_PointF& point) override;
   void SetStates(uint32_t dwStates) override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   virtual void SetText(const WideString& wsText);
@@ -107,10 +108,8 @@
   void RenderText(CFX_RenderDevice* pRenderDev,
                   const CFX_RectF& clipRect,
                   const CFX_Matrix& mt);
-  void DrawTextBk(CXFA_Graphics* pGraphics,
-                  const CFX_Matrix* pMatrix);
-  void DrawContent(CXFA_Graphics* pGraphics,
-                   const CFX_Matrix* pMatrix);
+  void DrawTextBk(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawContent(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
 
   void UpdateEditEngine();
   void UpdateEditParams();
diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp
index b4eaac2..fdb3536 100644
--- a/xfa/fwl/cfwl_listbox.cpp
+++ b/xfa/fwl/cfwl_listbox.cpp
@@ -83,7 +83,7 @@
   return FWL_WidgetHit::Unknown;
 }
 
-void CFWL_ListBox::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_ListBox::DrawWidget(CFGAS_GEGraphics* pGraphics,
                               const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
@@ -327,7 +327,7 @@
   return true;
 }
 
-void CFWL_ListBox::DrawBkground(CXFA_Graphics* pGraphics,
+void CFWL_ListBox::DrawBkground(CFGAS_GEGraphics* pGraphics,
                                 const CFX_Matrix* pMatrix) {
   if (!pGraphics)
     return;
@@ -346,7 +346,7 @@
   GetThemeProvider()->DrawBackground(param);
 }
 
-void CFWL_ListBox::DrawItems(CXFA_Graphics* pGraphics,
+void CFWL_ListBox::DrawItems(CFGAS_GEGraphics* pGraphics,
                              const CFX_Matrix* pMatrix) {
   float fPosX = 0.0f;
   if (m_pHorzScrollBar)
@@ -378,7 +378,7 @@
   }
 }
 
-void CFWL_ListBox::DrawItem(CXFA_Graphics* pGraphics,
+void CFWL_ListBox::DrawItem(CFGAS_GEGraphics* pGraphics,
                             Item* pItem,
                             int32_t Index,
                             const CFX_RectF& rtItem,
@@ -669,7 +669,7 @@
   }
 }
 
-void CFWL_ListBox::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_ListBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                 const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_listbox.h b/xfa/fwl/cfwl_listbox.h
index 1443246..79b5732 100644
--- a/xfa/fwl/cfwl_listbox.h
+++ b/xfa/fwl/cfwl_listbox.h
@@ -56,10 +56,11 @@
   FWL_Type GetClassID() const override;
   void Update() override;
   FWL_WidgetHit HitTest(const CFX_PointF& point) override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   int32_t CountItems(const CFWL_Widget* pWidget) const;
@@ -99,14 +100,14 @@
   void SelectAll();
   Item* GetFocusedItem();
   void SetFocusItem(Item* hItem);
-  void DrawBkground(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix);
-  void DrawItems(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix);
-  void DrawItem(CXFA_Graphics* pGraphics,
+  void DrawBkground(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawItems(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawItem(CFGAS_GEGraphics* pGraphics,
                 Item* hItem,
                 int32_t Index,
                 const CFX_RectF& rtItem,
                 const CFX_Matrix* pMatrix);
-  void DrawStatic(CXFA_Graphics* pGraphics);
+  void DrawStatic(CFGAS_GEGraphics* pGraphics);
   CFX_SizeF CalcSize(bool bAutoSize);
   void UpdateItemSize(Item* hItem,
                       CFX_SizeF& size,
diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp
index eb780de..61f4992 100644
--- a/xfa/fwl/cfwl_monthcalendar.cpp
+++ b/xfa/fwl/cfwl_monthcalendar.cpp
@@ -118,7 +118,7 @@
   Layout();
 }
 
-void CFWL_MonthCalendar::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawWidget(CFGAS_GEGraphics* pGraphics,
                                     const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
@@ -147,7 +147,7 @@
   AddSelDay(iDay);
 }
 
-void CFWL_MonthCalendar::DrawBackground(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawBackground(CFGAS_GEGraphics* pGraphics,
                                         const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground params;
   params.m_pWidget = this;
@@ -160,7 +160,7 @@
   GetThemeProvider()->DrawBackground(params);
 }
 
-void CFWL_MonthCalendar::DrawHeadBK(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawHeadBK(CFGAS_GEGraphics* pGraphics,
                                     const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground params;
   params.m_pWidget = this;
@@ -173,7 +173,7 @@
   GetThemeProvider()->DrawBackground(params);
 }
 
-void CFWL_MonthCalendar::DrawLButton(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawLButton(CFGAS_GEGraphics* pGraphics,
                                      const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground params;
   params.m_pWidget = this;
@@ -186,7 +186,7 @@
   GetThemeProvider()->DrawBackground(params);
 }
 
-void CFWL_MonthCalendar::DrawRButton(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawRButton(CFGAS_GEGraphics* pGraphics,
                                      const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground params;
   params.m_pWidget = this;
@@ -199,7 +199,7 @@
   GetThemeProvider()->DrawBackground(params);
 }
 
-void CFWL_MonthCalendar::DrawCaption(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawCaption(CFGAS_GEGraphics* pGraphics,
                                      const CFX_Matrix* pMatrix) {
   CFWL_ThemeText textParam;
   textParam.m_pWidget = this;
@@ -217,7 +217,7 @@
   GetThemeProvider()->DrawText(textParam);
 }
 
-void CFWL_MonthCalendar::DrawSeparator(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawSeparator(CFGAS_GEGraphics* pGraphics,
                                        const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground params;
   params.m_pWidget = this;
@@ -230,7 +230,7 @@
   GetThemeProvider()->DrawBackground(params);
 }
 
-void CFWL_MonthCalendar::DrawDatesInBK(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawDatesInBK(CFGAS_GEGraphics* pGraphics,
                                        const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground params;
   params.m_pWidget = this;
@@ -260,7 +260,7 @@
   }
 }
 
-void CFWL_MonthCalendar::DrawWeek(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawWeek(CFGAS_GEGraphics* pGraphics,
                                   const CFX_Matrix* pMatrix) {
   CFWL_ThemeText params;
   params.m_pWidget = this;
@@ -286,7 +286,7 @@
   }
 }
 
-void CFWL_MonthCalendar::DrawToday(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawToday(CFGAS_GEGraphics* pGraphics,
                                    const CFX_Matrix* pMatrix) {
   CFWL_ThemeText params;
   params.m_pWidget = this;
@@ -304,7 +304,7 @@
   GetThemeProvider()->DrawText(params);
 }
 
-void CFWL_MonthCalendar::DrawDatesIn(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawDatesIn(CFGAS_GEGraphics* pGraphics,
                                      const CFX_Matrix* pMatrix) {
   CFWL_ThemeText params;
   params.m_pWidget = this;
@@ -330,7 +330,7 @@
   }
 }
 
-void CFWL_MonthCalendar::DrawDatesOut(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawDatesOut(CFGAS_GEGraphics* pGraphics,
                                       const CFX_Matrix* pMatrix) {
   CFWL_ThemeText params;
   params.m_pWidget = this;
@@ -343,7 +343,7 @@
   GetThemeProvider()->DrawText(params);
 }
 
-void CFWL_MonthCalendar::DrawDatesInCircle(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::DrawDatesInCircle(CFGAS_GEGraphics* pGraphics,
                                            const CFX_Matrix* pMatrix) {
   if (m_iMonth != m_iCurMonth || m_iYear != m_iCurYear)
     return;
@@ -681,7 +681,7 @@
     CFWL_Widget::OnProcessMessage(pMessage);
 }
 
-void CFWL_MonthCalendar::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_MonthCalendar::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                       const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_monthcalendar.h b/xfa/fwl/cfwl_monthcalendar.h
index b23217d..c044511 100644
--- a/xfa/fwl/cfwl_monthcalendar.h
+++ b/xfa/fwl/cfwl_monthcalendar.h
@@ -28,9 +28,10 @@
   FWL_Type GetClassID() const override;
   CFX_RectF GetAutosizedWidgetRect() override;
   void Update() override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   void SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay);
@@ -89,29 +90,18 @@
                      const Properties& properties,
                      CFWL_Widget* pOuter);
 
-  void DrawBackground(CXFA_Graphics* pGraphics,
-                      const CFX_Matrix* pMatrix);
-  void DrawHeadBK(CXFA_Graphics* pGraphics,
-                  const CFX_Matrix* pMatrix);
-  void DrawLButton(CXFA_Graphics* pGraphics,
-                   const CFX_Matrix* pMatrix);
-  void DrawRButton(CXFA_Graphics* pGraphics,
-                   const CFX_Matrix* pMatrix);
-  void DrawCaption(CXFA_Graphics* pGraphics,
-                   const CFX_Matrix* pMatrix);
-  void DrawSeparator(CXFA_Graphics* pGraphics,
-                     const CFX_Matrix* pMatrix);
-  void DrawDatesInBK(CXFA_Graphics* pGraphics,
-                     const CFX_Matrix* pMatrix);
-  void DrawWeek(CXFA_Graphics* pGraphics,
-                const CFX_Matrix* pMatrix);
-  void DrawToday(CXFA_Graphics* pGraphics,
-                 const CFX_Matrix* pMatrix);
-  void DrawDatesIn(CXFA_Graphics* pGraphics,
-                   const CFX_Matrix* pMatrix);
-  void DrawDatesOut(CXFA_Graphics* pGraphics,
-                    const CFX_Matrix* pMatrix);
-  void DrawDatesInCircle(CXFA_Graphics* pGraphics,
+  void DrawBackground(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawHeadBK(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawLButton(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawRButton(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawCaption(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawSeparator(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawDatesInBK(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawWeek(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawToday(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawDatesIn(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawDatesOut(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawDatesInCircle(CFGAS_GEGraphics* pGraphics,
                          const CFX_Matrix* pMatrix);
   CFX_SizeF CalcSize();
   void Layout();
diff --git a/xfa/fwl/cfwl_notedriver.h b/xfa/fwl/cfwl_notedriver.h
index 2fe2360..91ba765 100644
--- a/xfa/fwl/cfwl_notedriver.h
+++ b/xfa/fwl/cfwl_notedriver.h
@@ -15,8 +15,8 @@
 #include "v8/include/cppgc/garbage-collected.h"
 #include "v8/include/cppgc/member.h"
 #include "v8/include/cppgc/visitor.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 #include "xfa/fwl/cfwl_widget.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
 
 class CFWL_Event;
 
diff --git a/xfa/fwl/cfwl_picturebox.cpp b/xfa/fwl/cfwl_picturebox.cpp
index 9532ceb..de4e2ba 100644
--- a/xfa/fwl/cfwl_picturebox.cpp
+++ b/xfa/fwl/cfwl_picturebox.cpp
@@ -22,7 +22,7 @@
   m_ClientRect = GetClientRect();
 }
 
-void CFWL_PictureBox::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_PictureBox::DrawWidget(CFGAS_GEGraphics* pGraphics,
                                  const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
@@ -31,7 +31,7 @@
     DrawBorder(pGraphics, CFWL_Part::Border, matrix);
 }
 
-void CFWL_PictureBox::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_PictureBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                    const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_picturebox.h b/xfa/fwl/cfwl_picturebox.h
index 43f1c7a..68cebef 100644
--- a/xfa/fwl/cfwl_picturebox.h
+++ b/xfa/fwl/cfwl_picturebox.h
@@ -20,8 +20,9 @@
   // CFWL_Widget
   FWL_Type GetClassID() const override;
   void Update() override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
  private:
diff --git a/xfa/fwl/cfwl_pushbutton.cpp b/xfa/fwl/cfwl_pushbutton.cpp
index 4a82cc0..7f8e6e4 100644
--- a/xfa/fwl/cfwl_pushbutton.cpp
+++ b/xfa/fwl/cfwl_pushbutton.cpp
@@ -42,7 +42,7 @@
   m_CaptionRect = m_ClientRect;
 }
 
-void CFWL_PushButton::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_PushButton::DrawWidget(CFGAS_GEGraphics* pGraphics,
                                  const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
@@ -53,7 +53,7 @@
   DrawBkground(pGraphics, &matrix);
 }
 
-void CFWL_PushButton::DrawBkground(CXFA_Graphics* pGraphics,
+void CFWL_PushButton::DrawBkground(CFGAS_GEGraphics* pGraphics,
                                    const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground param;
   param.m_pWidget = this;
@@ -126,7 +126,7 @@
     CFWL_Widget::OnProcessMessage(pMessage);
 }
 
-void CFWL_PushButton::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_PushButton::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                    const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_pushbutton.h b/xfa/fwl/cfwl_pushbutton.h
index 07de454..823096c 100644
--- a/xfa/fwl/cfwl_pushbutton.h
+++ b/xfa/fwl/cfwl_pushbutton.h
@@ -25,16 +25,16 @@
   FWL_Type GetClassID() const override;
   void SetStates(uint32_t dwStates) override;
   void Update() override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
  private:
   explicit CFWL_PushButton(CFWL_App* pApp);
 
-  void DrawBkground(CXFA_Graphics* pGraphics,
-                    const CFX_Matrix* pMatrix);
+  void DrawBkground(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
   uint32_t GetPartStates();
   void UpdateTextOutStyles();
   void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
diff --git a/xfa/fwl/cfwl_scrollbar.cpp b/xfa/fwl/cfwl_scrollbar.cpp
index 5bfb988..e564331 100644
--- a/xfa/fwl/cfwl_scrollbar.cpp
+++ b/xfa/fwl/cfwl_scrollbar.cpp
@@ -45,7 +45,7 @@
   Layout();
 }
 
-void CFWL_ScrollBar::DrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_ScrollBar::DrawWidget(CFGAS_GEGraphics* pGraphics,
                                 const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
@@ -73,7 +73,7 @@
   return OnScroll(dwCode, fPos);
 }
 
-void CFWL_ScrollBar::DrawTrack(CXFA_Graphics* pGraphics,
+void CFWL_ScrollBar::DrawTrack(CFGAS_GEGraphics* pGraphics,
                                bool bLower,
                                const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground param;
@@ -88,7 +88,7 @@
   GetThemeProvider()->DrawBackground(param);
 }
 
-void CFWL_ScrollBar::DrawArrowBtn(CXFA_Graphics* pGraphics,
+void CFWL_ScrollBar::DrawArrowBtn(CFGAS_GEGraphics* pGraphics,
                                   bool bMinBtn,
                                   const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground param;
@@ -104,7 +104,7 @@
     GetThemeProvider()->DrawBackground(param);
 }
 
-void CFWL_ScrollBar::DrawThumb(CXFA_Graphics* pGraphics,
+void CFWL_ScrollBar::DrawThumb(CFGAS_GEGraphics* pGraphics,
                                const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground param;
   param.m_pWidget = this;
@@ -318,7 +318,7 @@
   }
 }
 
-void CFWL_ScrollBar::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_ScrollBar::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                   const CFX_Matrix& matrix) {
   DrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fwl/cfwl_scrollbar.h b/xfa/fwl/cfwl_scrollbar.h
index 04cdba8..31fb4c9 100644
--- a/xfa/fwl/cfwl_scrollbar.h
+++ b/xfa/fwl/cfwl_scrollbar.h
@@ -27,9 +27,10 @@
   // CFWL_Widget:
   FWL_Type GetClassID() const override;
   void Update() override;
-  void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override;
+  void DrawWidget(CFGAS_GEGraphics* pGraphics,
+                  const CFX_Matrix& matrix) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   // CFX_Timer::CallbackIface:
@@ -61,13 +62,13 @@
   bool IsVertical() const {
     return !!(m_Properties.m_dwStyleExes & FWL_STYLEEXT_SCB_Vert);
   }
-  void DrawTrack(CXFA_Graphics* pGraphics,
+  void DrawTrack(CFGAS_GEGraphics* pGraphics,
                  bool bLower,
                  const CFX_Matrix* pMatrix);
-  void DrawArrowBtn(CXFA_Graphics* pGraphics,
+  void DrawArrowBtn(CFGAS_GEGraphics* pGraphics,
                     bool bMinBtn,
                     const CFX_Matrix* pMatrix);
-  void DrawThumb(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix);
+  void DrawThumb(CFGAS_GEGraphics* pGraphics, const CFX_Matrix* pMatrix);
   void Layout();
   void CalcButtonLen();
   CFX_RectF CalcMinButtonRect();
diff --git a/xfa/fwl/cfwl_themebackground.h b/xfa/fwl/cfwl_themebackground.h
index 46df73c..fd09ca2 100644
--- a/xfa/fwl/cfwl_themebackground.h
+++ b/xfa/fwl/cfwl_themebackground.h
@@ -10,16 +10,16 @@
 #include "core/fxcrt/unowned_ptr.h"
 #include "xfa/fwl/cfwl_themepart.h"
 
-class CXFA_Graphics;
-class CXFA_GEPath;
+class CFGAS_GEGraphics;
+class CFGAS_GEPath;
 
 class CFWL_ThemeBackground final : public CFWL_ThemePart {
  public:
   CFWL_ThemeBackground();
   ~CFWL_ThemeBackground();
 
-  UnownedPtr<CXFA_Graphics> m_pGraphics;
-  UnownedPtr<CXFA_GEPath> m_pPath;
+  UnownedPtr<CFGAS_GEGraphics> m_pGraphics;
+  UnownedPtr<CFGAS_GEPath> m_pPath;
 };
 
 inline CFWL_ThemeBackground::CFWL_ThemeBackground() = default;
diff --git a/xfa/fwl/cfwl_themetext.h b/xfa/fwl/cfwl_themetext.h
index f0cfaa7..cb1b770 100644
--- a/xfa/fwl/cfwl_themetext.h
+++ b/xfa/fwl/cfwl_themetext.h
@@ -16,7 +16,7 @@
   CFWL_ThemeText() = default;
 
   FDE_TextAlignment m_iTTOAlign = FDE_TextAlignment::kTopLeft;
-  CXFA_Graphics* m_pGraphics = nullptr;
+  CFGAS_GEGraphics* m_pGraphics = nullptr;
   WideString m_wsText;
   FDE_TextStyle m_dwTTOStyles;
 };
diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp
index 0401501..0f3ee5c 100644
--- a/xfa/fwl/cfwl_widget.cpp
+++ b/xfa/fwl/cfwl_widget.cpp
@@ -280,7 +280,7 @@
   m_pWidgetMgr->RepaintWidget(this, pRect);
 }
 
-void CFWL_Widget::DrawBackground(CXFA_Graphics* pGraphics,
+void CFWL_Widget::DrawBackground(CFGAS_GEGraphics* pGraphics,
                                  CFWL_Part iPartBk,
                                  const CFX_Matrix* pMatrix) {
   CFWL_ThemeBackground param;
@@ -293,7 +293,7 @@
   GetThemeProvider()->DrawBackground(param);
 }
 
-void CFWL_Widget::DrawBorder(CXFA_Graphics* pGraphics,
+void CFWL_Widget::DrawBorder(CFGAS_GEGraphics* pGraphics,
                              CFWL_Part iPartBorder,
                              const CFX_Matrix& matrix) {
   CFWL_ThemeBackground param;
@@ -355,7 +355,7 @@
 
 void CFWL_Widget::OnProcessEvent(CFWL_Event* pEvent) {}
 
-void CFWL_Widget::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CFWL_Widget::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                const CFX_Matrix& matrix) {}
 
 CFWL_Widget::ScopedUpdateLock::ScopedUpdateLock(CFWL_Widget* widget)
diff --git a/xfa/fwl/cfwl_widget.h b/xfa/fwl/cfwl_widget.h
index aeef2dc..2d30bc6 100644
--- a/xfa/fwl/cfwl_widget.h
+++ b/xfa/fwl/cfwl_widget.h
@@ -99,13 +99,13 @@
   virtual void RemoveStates(uint32_t dwStates);
   virtual void Update() = 0;
   virtual FWL_WidgetHit HitTest(const CFX_PointF& point);
-  virtual void DrawWidget(CXFA_Graphics* pGraphics,
+  virtual void DrawWidget(CFGAS_GEGraphics* pGraphics,
                           const CFX_Matrix& matrix) = 0;
 
   // IFWL_WidgetDelegate:
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   void InflateWidgetRect(CFX_RectF& rect);
@@ -163,7 +163,7 @@
   void RegisterEventTarget(CFWL_Widget* pEventSource);
   void UnregisterEventTarget();
   void DispatchEvent(CFWL_Event* pEvent);
-  void DrawBorder(CXFA_Graphics* pGraphics,
+  void DrawBorder(CFGAS_GEGraphics* pGraphics,
                   CFWL_Part iPartBorder,
                   const CFX_Matrix& pMatrix);
 
@@ -179,7 +179,7 @@
 
   CFWL_Widget* GetParent() const { return m_pWidgetMgr->GetParentWidget(this); }
   CFX_SizeF GetOffsetFromParent(CFWL_Widget* pParent);
-  void DrawBackground(CXFA_Graphics* pGraphics,
+  void DrawBackground(CFGAS_GEGraphics* pGraphics,
                       CFWL_Part iPartBk,
                       const CFX_Matrix* pMatrix);
   void NotifyDriver();
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp
index d290346..5014192 100644
--- a/xfa/fwl/cfwl_widgetmgr.cpp
+++ b/xfa/fwl/cfwl_widgetmgr.cpp
@@ -190,7 +190,7 @@
 }
 
 void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget,
-                                  CXFA_Graphics* pGraphics,
+                                  CFGAS_GEGraphics* pGraphics,
                                   const CFX_Matrix& matrix) {
   if (!pWidget || !pGraphics)
     return;
@@ -204,7 +204,7 @@
 
 void CFWL_WidgetMgr::DrawChildren(CFWL_Widget* parent,
                                   const CFX_RectF& rtClip,
-                                  CXFA_Graphics* pGraphics,
+                                  CFGAS_GEGraphics* pGraphics,
                                   const CFX_Matrix* pMatrix) {
   if (!parent)
     return;
diff --git a/xfa/fwl/cfwl_widgetmgr.h b/xfa/fwl/cfwl_widgetmgr.h
index 34867ba..a3a8982 100644
--- a/xfa/fwl/cfwl_widgetmgr.h
+++ b/xfa/fwl/cfwl_widgetmgr.h
@@ -16,13 +16,13 @@
 #include "v8/include/cppgc/garbage-collected.h"
 #include "v8/include/cppgc/member.h"
 #include "v8/include/cppgc/visitor.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 
-class CFWL_Message;
-class CXFA_Graphics;
-class CFX_Matrix;
+class CFGAS_GEGraphics;
 class CFWL_App;
+class CFWL_Message;
 class CFWL_Widget;
+class CFX_Matrix;
 
 class CFWL_WidgetMgr final : public cppgc::GarbageCollected<CFWL_WidgetMgr> {
  public:
@@ -44,7 +44,7 @@
 
   void OnProcessMessageToForm(CFWL_Message* pMessage);
   void OnDrawWidget(CFWL_Widget* pWidget,
-                    CXFA_Graphics* pGraphics,
+                    CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix);
 
   CFWL_Widget* GetParentWidget(const CFWL_Widget* pWidget) const;
@@ -92,7 +92,7 @@
 
   void DrawChildren(CFWL_Widget* pParent,
                     const CFX_RectF& rtClip,
-                    CXFA_Graphics* pGraphics,
+                    CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix* pMatrix);
 
   cppgc::Member<AdapterIface> const m_pAdapter;
diff --git a/xfa/fwl/ifwl_widgetdelegate.h b/xfa/fwl/ifwl_widgetdelegate.h
index d6403c9..ba659d2 100644
--- a/xfa/fwl/ifwl_widgetdelegate.h
+++ b/xfa/fwl/ifwl_widgetdelegate.h
@@ -9,9 +9,9 @@
 
 #include "v8/include/cppgc/garbage-collected.h"
 
+class CFGAS_GEGraphics;
 class CFWL_Event;
 class CFWL_Message;
-class CXFA_Graphics;
 class CFX_Matrix;
 
 class IFWL_WidgetDelegate : public cppgc::GarbageCollectedMixin {
@@ -20,7 +20,7 @@
 
   virtual void OnProcessMessage(CFWL_Message* pMessage) = 0;
   virtual void OnProcessEvent(CFWL_Event* pEvent) = 0;
-  virtual void OnDrawWidget(CXFA_Graphics* pGraphics,
+  virtual void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                             const CFX_Matrix& matrix) = 0;
 };
 
diff --git a/xfa/fwl/theme/cfwl_carettp.cpp b/xfa/fwl/theme/cfwl_carettp.cpp
index bd7db65..5c4d99b 100644
--- a/xfa/fwl/theme/cfwl_carettp.cpp
+++ b/xfa/fwl/theme/cfwl_carettp.cpp
@@ -6,11 +6,11 @@
 
 #include "xfa/fwl/theme/cfwl_carettp.h"
 
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_caret.h"
 #include "xfa/fwl/cfwl_themebackground.h"
 #include "xfa/fwl/cfwl_widget.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 CFWL_CaretTP::CFWL_CaretTP() = default;
 
@@ -31,13 +31,13 @@
   }
 }
 
-void CFWL_CaretTP::DrawCaretBK(CXFA_Graphics* pGraphics,
+void CFWL_CaretTP::DrawCaretBK(CFGAS_GEGraphics* pGraphics,
                                uint32_t dwStates,
                                const CFX_RectF& rect,
                                const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
-  pGraphics->SetFillColor(CXFA_GEColor(ArgbEncode(255, 0, 0, 0)));
+  pGraphics->SetFillColor(CFGAS_GEColor(ArgbEncode(255, 0, 0, 0)));
   pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding,
                       &matrix);
 }
diff --git a/xfa/fwl/theme/cfwl_carettp.h b/xfa/fwl/theme/cfwl_carettp.h
index 36075c6..071a0be 100644
--- a/xfa/fwl/theme/cfwl_carettp.h
+++ b/xfa/fwl/theme/cfwl_carettp.h
@@ -21,7 +21,7 @@
  private:
   CFWL_CaretTP();
 
-  void DrawCaretBK(CXFA_Graphics* pGraphics,
+  void DrawCaretBK(CFGAS_GEGraphics* pGraphics,
                    uint32_t dwStates,
                    const CFX_RectF& rect,
                    const CFX_Matrix& matrix);
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index 301f47f..ee4dfca 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -9,12 +9,12 @@
 #include "core/fxge/cfx_pathdata.h"
 #include "third_party/base/stl_util.h"
 #include "xfa/fde/cfde_textout.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_checkbox.h"
 #include "xfa/fwl/cfwl_themebackground.h"
 #include "xfa/fwl/cfwl_themetext.h"
 #include "xfa/fwl/cfwl_widget.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 namespace {
 
@@ -41,7 +41,7 @@
   CFWL_WidgetTP::DrawText(pParams);
 }
 
-void CFWL_CheckBoxTP::DrawSignCheck(CXFA_Graphics* pGraphics,
+void CFWL_CheckBoxTP::DrawSignCheck(CFGAS_GEGraphics* pGraphics,
                                     const CFX_RectF& rtSign,
                                     FX_ARGB argbFill,
                                     const CFX_Matrix& matrix) {
@@ -52,30 +52,30 @@
   mt.Translate(rtSign.left, rtSign.top);
   mt.Concat(matrix);
   pGraphics->SaveGraphState();
-  pGraphics->SetFillColor(CXFA_GEColor(argbFill));
+  pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
   pGraphics->FillPath(m_pCheckPath.get(),
                       CFX_FillRenderOptions::FillType::kWinding, &mt);
   pGraphics->RestoreGraphState();
 }
 
-void CFWL_CheckBoxTP::DrawSignCircle(CXFA_Graphics* pGraphics,
+void CFWL_CheckBoxTP::DrawSignCircle(CFGAS_GEGraphics* pGraphics,
                                      const CFX_RectF& rtSign,
                                      FX_ARGB argbFill,
                                      const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddEllipse(rtSign);
   pGraphics->SaveGraphState();
-  pGraphics->SetFillColor(CXFA_GEColor(argbFill));
+  pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
   pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding,
                       &matrix);
   pGraphics->RestoreGraphState();
 }
 
-void CFWL_CheckBoxTP::DrawSignCross(CXFA_Graphics* pGraphics,
+void CFWL_CheckBoxTP::DrawSignCross(CFGAS_GEGraphics* pGraphics,
                                     const CFX_RectF& rtSign,
                                     FX_ARGB argbFill,
                                     const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   float fRight = rtSign.right();
   float fBottom = rtSign.bottom();
   path.AddLine(rtSign.TopLeft(), CFX_PointF(fRight, fBottom));
@@ -83,17 +83,17 @@
                CFX_PointF(fRight, rtSign.top));
 
   pGraphics->SaveGraphState();
-  pGraphics->SetStrokeColor(CXFA_GEColor(argbFill));
+  pGraphics->SetStrokeColor(CFGAS_GEColor(argbFill));
   pGraphics->SetLineWidth(1.0f);
   pGraphics->StrokePath(&path, &matrix);
   pGraphics->RestoreGraphState();
 }
 
-void CFWL_CheckBoxTP::DrawSignDiamond(CXFA_Graphics* pGraphics,
+void CFWL_CheckBoxTP::DrawSignDiamond(CFGAS_GEGraphics* pGraphics,
                                       const CFX_RectF& rtSign,
                                       FX_ARGB argbFill,
                                       const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   float fWidth = rtSign.width;
   float fHeight = rtSign.height;
   float fBottom = rtSign.bottom();
@@ -104,30 +104,30 @@
   path.LineTo(CFX_PointF(rtSign.left + fWidth / 2, rtSign.top));
 
   pGraphics->SaveGraphState();
-  pGraphics->SetFillColor(CXFA_GEColor(argbFill));
+  pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
   pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding,
                       &matrix);
   pGraphics->RestoreGraphState();
 }
 
-void CFWL_CheckBoxTP::DrawSignSquare(CXFA_Graphics* pGraphics,
+void CFWL_CheckBoxTP::DrawSignSquare(CFGAS_GEGraphics* pGraphics,
                                      const CFX_RectF& rtSign,
                                      FX_ARGB argbFill,
                                      const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(rtSign.left, rtSign.top, rtSign.width, rtSign.height);
   pGraphics->SaveGraphState();
-  pGraphics->SetFillColor(CXFA_GEColor(argbFill));
+  pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
   pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding,
                       &matrix);
   pGraphics->RestoreGraphState();
 }
 
-void CFWL_CheckBoxTP::DrawSignStar(CXFA_Graphics* pGraphics,
+void CFWL_CheckBoxTP::DrawSignStar(CFGAS_GEGraphics* pGraphics,
                                    const CFX_RectF& rtSign,
                                    FX_ARGB argbFill,
                                    const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   float fBottom = rtSign.bottom();
   float fRadius = (rtSign.top - fBottom) / (1 + cosf(FX_PI / 5.0f));
   CFX_PointF ptCenter((rtSign.left + rtSign.right()) / 2.0f,
@@ -148,7 +148,7 @@
     path.LineTo(points[next]);
   }
   pGraphics->SaveGraphState();
-  pGraphics->SetFillColor(CXFA_GEColor(argbFill));
+  pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
   pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding,
                       &matrix);
   pGraphics->RestoreGraphState();
@@ -156,7 +156,7 @@
 
 void CFWL_CheckBoxTP::InitCheckPath(float fCheckLen) {
   if (!m_pCheckPath) {
-    m_pCheckPath = std::make_unique<CXFA_GEPath>();
+    m_pCheckPath = std::make_unique<CFGAS_GEPath>();
 
     float fWidth = kSignPath;
     float fHeight = -kSignPath;
@@ -220,7 +220,7 @@
 }
 
 void CFWL_CheckBoxTP::DrawCheckSign(CFWL_Widget* pWidget,
-                                    CXFA_Graphics* pGraphics,
+                                    CFGAS_GEGraphics* pGraphics,
                                     const CFX_RectF& pRtBox,
                                     int32_t iState,
                                     const CFX_Matrix& matrix) {
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.h b/xfa/fwl/theme/cfwl_checkboxtp.h
index 5d472be..d3727b1 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.h
+++ b/xfa/fwl/theme/cfwl_checkboxtp.h
@@ -12,8 +12,8 @@
 #include "fxjs/gc/heap.h"
 #include "xfa/fwl/theme/cfwl_widgettp.h"
 
+class CFGAS_GEPath;
 class CFWL_Widget;
-class CXFA_GEPath;
 
 class CFWL_CheckBoxTP final : public CFWL_WidgetTP {
  public:
@@ -28,38 +28,38 @@
   CFWL_CheckBoxTP();
 
   void DrawCheckSign(CFWL_Widget* pWidget,
-                     CXFA_Graphics* pGraphics,
+                     CFGAS_GEGraphics* pGraphics,
                      const CFX_RectF& pRtBox,
                      int32_t iState,
                      const CFX_Matrix& matrix);
-  void DrawSignCheck(CXFA_Graphics* pGraphics,
+  void DrawSignCheck(CFGAS_GEGraphics* pGraphics,
                      const CFX_RectF& rtSign,
                      FX_ARGB argbFill,
                      const CFX_Matrix& matrix);
-  void DrawSignCircle(CXFA_Graphics* pGraphics,
+  void DrawSignCircle(CFGAS_GEGraphics* pGraphics,
                       const CFX_RectF& rtSign,
                       FX_ARGB argbFill,
                       const CFX_Matrix& matrix);
-  void DrawSignCross(CXFA_Graphics* pGraphics,
+  void DrawSignCross(CFGAS_GEGraphics* pGraphics,
                      const CFX_RectF& rtSign,
                      FX_ARGB argbFill,
                      const CFX_Matrix& matrix);
-  void DrawSignDiamond(CXFA_Graphics* pGraphics,
+  void DrawSignDiamond(CFGAS_GEGraphics* pGraphics,
                        const CFX_RectF& rtSign,
                        FX_ARGB argbFill,
                        const CFX_Matrix& matrix);
-  void DrawSignSquare(CXFA_Graphics* pGraphics,
+  void DrawSignSquare(CFGAS_GEGraphics* pGraphics,
                       const CFX_RectF& rtSign,
                       FX_ARGB argbFill,
                       const CFX_Matrix& matrix);
-  void DrawSignStar(CXFA_Graphics* pGraphics,
+  void DrawSignStar(CFGAS_GEGraphics* pGraphics,
                     const CFX_RectF& rtSign,
                     FX_ARGB argbFill,
                     const CFX_Matrix& matrix);
 
   void InitCheckPath(float fCheckLen);
 
-  std::unique_ptr<CXFA_GEPath> m_pCheckPath;
+  std::unique_ptr<CFGAS_GEPath> m_pCheckPath;
 };
 
 #endif  // XFA_FWL_THEME_CFWL_CHECKBOXTP_H_
diff --git a/xfa/fwl/theme/cfwl_comboboxtp.cpp b/xfa/fwl/theme/cfwl_comboboxtp.cpp
index 1805130..662027a 100644
--- a/xfa/fwl/theme/cfwl_comboboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_comboboxtp.cpp
@@ -6,12 +6,12 @@
 
 #include "xfa/fwl/theme/cfwl_comboboxtp.h"
 
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_combobox.h"
 #include "xfa/fwl/cfwl_themebackground.h"
 #include "xfa/fwl/cfwl_widget.h"
 #include "xfa/fwl/ifwl_themeprovider.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 CFWL_ComboBoxTP::CFWL_ComboBoxTP() = default;
 
@@ -25,7 +25,7 @@
       break;
     }
     case CFWL_Part::Background: {
-      CXFA_GEPath path;
+      CFGAS_GEPath path;
       const CFX_RectF& rect = pParams.m_PartRect;
       path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
       FX_ARGB argb_color;
@@ -40,7 +40,7 @@
           argb_color = 0xFFFFFFFF;
       }
       pParams.m_pGraphics->SaveGraphState();
-      pParams.m_pGraphics->SetFillColor(CXFA_GEColor(argb_color));
+      pParams.m_pGraphics->SetFillColor(CFGAS_GEColor(argb_color));
       pParams.m_pGraphics->FillPath(
           &path, CFX_FillRenderOptions::FillType::kWinding, &pParams.m_matrix);
       pParams.m_pGraphics->RestoreGraphState();
diff --git a/xfa/fwl/theme/cfwl_edittp.cpp b/xfa/fwl/theme/cfwl_edittp.cpp
index ca37dff..d808a13 100644
--- a/xfa/fwl/theme/cfwl_edittp.cpp
+++ b/xfa/fwl/theme/cfwl_edittp.cpp
@@ -6,11 +6,11 @@
 
 #include "xfa/fwl/theme/cfwl_edittp.h"
 
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_edit.h"
 #include "xfa/fwl/cfwl_themebackground.h"
 #include "xfa/fwl/cfwl_widget.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 CFWL_EditTP::CFWL_EditTP() = default;
 
@@ -23,7 +23,7 @@
     FX_ARGB cr = 0xFF000000;
     float fWidth = 1.0f;
     pWidget->GetBorderColorAndThickness(&cr, &fWidth);
-    pParams.m_pGraphics->SetStrokeColor(CXFA_GEColor(cr));
+    pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(cr));
     pParams.m_pGraphics->SetLineWidth(fWidth);
     pParams.m_pGraphics->StrokePath(pParams.m_pPath.Get(), &pParams.m_matrix);
     return;
@@ -37,25 +37,25 @@
     }
     case CFWL_Part::Background: {
       if (pParams.m_pPath) {
-        CXFA_Graphics* pGraphics = pParams.m_pGraphics.Get();
+        CFGAS_GEGraphics* pGraphics = pParams.m_pGraphics.Get();
         pGraphics->SaveGraphState();
-        pGraphics->SetFillColor(CXFA_GEColor(FWLTHEME_COLOR_BKSelected));
+        pGraphics->SetFillColor(CFGAS_GEColor(FWLTHEME_COLOR_BKSelected));
         pGraphics->FillPath(pParams.m_pPath.Get(),
                             CFX_FillRenderOptions::FillType::kWinding,
                             &pParams.m_matrix);
         pGraphics->RestoreGraphState();
       } else {
-        CXFA_GEPath path;
+        CFGAS_GEPath path;
         path.AddRectangle(pParams.m_PartRect.left, pParams.m_PartRect.top,
                           pParams.m_PartRect.width, pParams.m_PartRect.height);
-        CXFA_GEColor cr(FWLTHEME_COLOR_Background);
+        CFGAS_GEColor cr(FWLTHEME_COLOR_Background);
         if (!pParams.m_bStaticBackground) {
           if (pParams.m_dwStates & CFWL_PartState_Disabled)
-            cr = CXFA_GEColor(FWLTHEME_COLOR_EDGERB1);
+            cr = CFGAS_GEColor(FWLTHEME_COLOR_EDGERB1);
           else if (pParams.m_dwStates & CFWL_PartState_ReadOnly)
-            cr = CXFA_GEColor(ArgbEncode(255, 236, 233, 216));
+            cr = CFGAS_GEColor(ArgbEncode(255, 236, 233, 216));
           else
-            cr = CXFA_GEColor(0xFFFFFFFF);
+            cr = CFGAS_GEColor(0xFFFFFFFF);
         }
         pParams.m_pGraphics->SaveGraphState();
         pParams.m_pGraphics->SetFillColor(cr);
@@ -67,7 +67,7 @@
       break;
     }
     case CFWL_Part::CombTextLine: {
-      pParams.m_pGraphics->SetStrokeColor(CXFA_GEColor(0xFF000000));
+      pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(0xFF000000));
       pParams.m_pGraphics->SetLineWidth(1.0f);
       pParams.m_pGraphics->StrokePath(pParams.m_pPath.Get(), &pParams.m_matrix);
       break;
diff --git a/xfa/fwl/theme/cfwl_listboxtp.cpp b/xfa/fwl/theme/cfwl_listboxtp.cpp
index 290d06f..a5737c5 100644
--- a/xfa/fwl/theme/cfwl_listboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_listboxtp.cpp
@@ -7,11 +7,11 @@
 #include "xfa/fwl/theme/cfwl_listboxtp.h"
 
 #include "build/build_config.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_listbox.h"
 #include "xfa/fwl/cfwl_themebackground.h"
 #include "xfa/fwl/cfwl_widget.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 CFWL_ListBoxTP::CFWL_ListBoxTP() = default;
 
@@ -54,15 +54,15 @@
   }
 }
 
-void CFWL_ListBoxTP::DrawListBoxItem(CXFA_Graphics* pGraphics,
+void CFWL_ListBoxTP::DrawListBoxItem(CFGAS_GEGraphics* pGraphics,
                                      uint32_t dwStates,
                                      const CFX_RectF& rtItem,
                                      const CFX_RectF* pData,
                                      const CFX_Matrix& matrix) {
   if (dwStates & CFWL_PartState_Selected) {
     pGraphics->SaveGraphState();
-    pGraphics->SetFillColor(CXFA_GEColor(FWLTHEME_COLOR_BKSelected));
-    CXFA_GEPath path;
+    pGraphics->SetFillColor(CFGAS_GEColor(FWLTHEME_COLOR_BKSelected));
+    CFGAS_GEPath path;
 #if defined(OS_APPLE)
     path.AddRectangle(rtItem.left, rtItem.top, rtItem.width - 1,
                       rtItem.height - 1);
diff --git a/xfa/fwl/theme/cfwl_listboxtp.h b/xfa/fwl/theme/cfwl_listboxtp.h
index 0af98cd..5f5a5bb 100644
--- a/xfa/fwl/theme/cfwl_listboxtp.h
+++ b/xfa/fwl/theme/cfwl_listboxtp.h
@@ -21,7 +21,7 @@
  private:
   CFWL_ListBoxTP();
 
-  void DrawListBoxItem(CXFA_Graphics* pGraphics,
+  void DrawListBoxItem(CFGAS_GEGraphics* pGraphics,
                        uint32_t dwStates,
                        const CFX_RectF& rtItem,
                        const CFX_RectF* pData,
diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
index 0f4e874..aeb2c75 100644
--- a/xfa/fwl/theme/cfwl_monthcalendartp.cpp
+++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
@@ -7,13 +7,13 @@
 #include "xfa/fwl/theme/cfwl_monthcalendartp.h"
 
 #include "xfa/fde/cfde_textout.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_monthcalendar.h"
 #include "xfa/fwl/cfwl_themebackground.h"
 #include "xfa/fwl/cfwl_themetext.h"
 #include "xfa/fwl/cfwl_widget.h"
 #include "xfa/fwl/ifwl_themeprovider.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 namespace {
 
@@ -100,11 +100,11 @@
 
 void CFWL_MonthCalendarTP::DrawTotalBK(const CFWL_ThemeBackground& pParams,
                                        const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   CFX_RectF rtTotal(pParams.m_PartRect);
   path.AddRectangle(rtTotal.left, rtTotal.top, rtTotal.width, rtTotal.height);
   pParams.m_pGraphics->SaveGraphState();
-  pParams.m_pGraphics->SetFillColor(CXFA_GEColor(kBackgroundColor));
+  pParams.m_pGraphics->SetFillColor(CFGAS_GEColor(kBackgroundColor));
   pParams.m_pGraphics->FillPath(
       &path, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
@@ -112,11 +112,11 @@
 
 void CFWL_MonthCalendarTP::DrawHeadBk(const CFWL_ThemeBackground& pParams,
                                       const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   CFX_RectF rtHead = pParams.m_PartRect;
   path.AddRectangle(rtHead.left, rtHead.top, rtHead.width, rtHead.height);
   pParams.m_pGraphics->SaveGraphState();
-  pParams.m_pGraphics->SetFillColor(CXFA_GEColor(kBackgroundColor));
+  pParams.m_pGraphics->SetFillColor(CFGAS_GEColor(kBackgroundColor));
   pParams.m_pGraphics->FillPath(
       &path, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
@@ -124,21 +124,21 @@
 
 void CFWL_MonthCalendarTP::DrawLButton(const CFWL_ThemeBackground& pParams,
                                        const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   CFX_RectF rtLBtn = pParams.m_PartRect;
   path.AddRectangle(rtLBtn.left, rtLBtn.top, rtLBtn.width, rtLBtn.height);
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(
-      CXFA_GEColor(ArgbEncode(0xff, 205, 219, 243)));
+      CFGAS_GEColor(ArgbEncode(0xff, 205, 219, 243)));
   pParams.m_pGraphics->StrokePath(&path, &matrix);
   if (pParams.m_dwStates & CFWL_PartState_Pressed) {
     pParams.m_pGraphics->SetFillColor(
-        CXFA_GEColor(ArgbEncode(0xff, 174, 198, 242)));
+        CFGAS_GEColor(ArgbEncode(0xff, 174, 198, 242)));
     pParams.m_pGraphics->FillPath(
         &path, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   } else {
     pParams.m_pGraphics->SetFillColor(
-        CXFA_GEColor(ArgbEncode(0xff, 227, 235, 249)));
+        CFGAS_GEColor(ArgbEncode(0xff, 227, 235, 249)));
     pParams.m_pGraphics->FillPath(
         &path, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   }
@@ -152,28 +152,28 @@
                          rtLBtn.bottom() - rtLBtn.height / 4));
 
   pParams.m_pGraphics->SetStrokeColor(
-      CXFA_GEColor(ArgbEncode(0xff, 50, 104, 205)));
+      CFGAS_GEColor(ArgbEncode(0xff, 50, 104, 205)));
   pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawRButton(const CFWL_ThemeBackground& pParams,
                                        const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   CFX_RectF rtRBtn = pParams.m_PartRect;
   path.AddRectangle(rtRBtn.left, rtRBtn.top, rtRBtn.width, rtRBtn.height);
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(
-      CXFA_GEColor(ArgbEncode(0xff, 205, 219, 243)));
+      CFGAS_GEColor(ArgbEncode(0xff, 205, 219, 243)));
   pParams.m_pGraphics->StrokePath(&path, &matrix);
   if (pParams.m_dwStates & CFWL_PartState_Pressed) {
     pParams.m_pGraphics->SetFillColor(
-        CXFA_GEColor(ArgbEncode(0xff, 174, 198, 242)));
+        CFGAS_GEColor(ArgbEncode(0xff, 174, 198, 242)));
     pParams.m_pGraphics->FillPath(
         &path, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   } else {
     pParams.m_pGraphics->SetFillColor(
-        CXFA_GEColor(ArgbEncode(0xff, 227, 235, 249)));
+        CFGAS_GEColor(ArgbEncode(0xff, 227, 235, 249)));
     pParams.m_pGraphics->FillPath(
         &path, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   }
@@ -187,31 +187,31 @@
                          rtRBtn.bottom() - rtRBtn.height / 4));
 
   pParams.m_pGraphics->SetStrokeColor(
-      CXFA_GEColor(ArgbEncode(0xff, 50, 104, 205)));
+      CFGAS_GEColor(ArgbEncode(0xff, 50, 104, 205)));
   pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawHSeparator(const CFWL_ThemeBackground& pParams,
                                           const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   CFX_RectF rtHSep = pParams.m_PartRect;
   path.MoveTo(CFX_PointF(rtHSep.left, rtHSep.top + rtHSep.height / 2));
   path.LineTo(CFX_PointF(rtHSep.right(), rtHSep.top + rtHSep.height / 2));
   pParams.m_pGraphics->SaveGraphState();
-  pParams.m_pGraphics->SetStrokeColor(CXFA_GEColor(kSeparatorColor));
+  pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(kSeparatorColor));
   pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawWeekNumSep(const CFWL_ThemeBackground& pParams,
                                           const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   CFX_RectF rtWeekSep = pParams.m_PartRect;
   path.MoveTo(rtWeekSep.TopLeft());
   path.LineTo(rtWeekSep.BottomLeft());
   pParams.m_pGraphics->SaveGraphState();
-  pParams.m_pGraphics->SetStrokeColor(CXFA_GEColor(kSeparatorColor));
+  pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(kSeparatorColor));
   pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
@@ -220,20 +220,21 @@
                                          const CFX_Matrix& matrix) {
   pParams.m_pGraphics->SaveGraphState();
   if (pParams.m_dwStates & CFWL_PartState_Selected) {
-    CXFA_GEPath path;
+    CFGAS_GEPath path;
     CFX_RectF rtSelDay = pParams.m_PartRect;
     path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width,
                       rtSelDay.height);
     pParams.m_pGraphics->SetFillColor(
-        CXFA_GEColor(kDatesSelectedBackgroundColor));
+        CFGAS_GEColor(kDatesSelectedBackgroundColor));
     pParams.m_pGraphics->FillPath(
         &path, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   } else if (pParams.m_dwStates & CFWL_PartState_Hovered) {
-    CXFA_GEPath path;
+    CFGAS_GEPath path;
     CFX_RectF rtSelDay = pParams.m_PartRect;
     path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width,
                       rtSelDay.height);
-    pParams.m_pGraphics->SetFillColor(CXFA_GEColor(kDatesHoverBackgroundColor));
+    pParams.m_pGraphics->SetFillColor(
+        CFGAS_GEColor(kDatesHoverBackgroundColor));
     pParams.m_pGraphics->FillPath(
         &path, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   }
@@ -243,24 +244,24 @@
 void CFWL_MonthCalendarTP::DrawDatesInCircle(
     const CFWL_ThemeBackground& pParams,
     const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   CFX_RectF rtSelDay = pParams.m_PartRect;
   path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width,
                     rtSelDay.height);
   pParams.m_pGraphics->SaveGraphState();
-  pParams.m_pGraphics->SetStrokeColor(CXFA_GEColor(kDatesCircleColor));
+  pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(kDatesCircleColor));
   pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawTodayCircle(const CFWL_ThemeBackground& pParams,
                                            const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   CFX_RectF rtTodayCircle = pParams.m_PartRect;
   path.AddRectangle(rtTodayCircle.left, rtTodayCircle.top, rtTodayCircle.width,
                     rtTodayCircle.height);
   pParams.m_pGraphics->SaveGraphState();
-  pParams.m_pGraphics->SetStrokeColor(CXFA_GEColor(kDatesCircleColor));
+  pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(kDatesCircleColor));
   pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.cpp b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
index 491727e..fdbbdab 100644
--- a/xfa/fwl/theme/cfwl_pushbuttontp.cpp
+++ b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
@@ -6,12 +6,12 @@
 
 #include "xfa/fwl/theme/cfwl_pushbuttontp.h"
 
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_pushbutton.h"
 #include "xfa/fwl/cfwl_themebackground.h"
 #include "xfa/fwl/cfwl_widget.h"
 #include "xfa/fwl/ifwl_themeprovider.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 #define PUSHBUTTON_SIZE_Corner 2
 
@@ -33,7 +33,7 @@
       float fRight = rect.right();
       float fBottom = rect.bottom();
 
-      CXFA_GEPath strokePath;
+      CFGAS_GEPath strokePath;
       strokePath.MoveTo(
           CFX_PointF(rect.left + PUSHBUTTON_SIZE_Corner, rect.top));
       strokePath.LineTo(CFX_PointF(fRight - PUSHBUTTON_SIZE_Corner, rect.top));
@@ -49,10 +49,10 @@
       strokePath.LineTo(
           CFX_PointF(rect.left + PUSHBUTTON_SIZE_Corner, rect.top));
 
-      CXFA_GEPath fillPath;
+      CFGAS_GEPath fillPath;
       fillPath.AddSubpath(&strokePath);
 
-      CXFA_Graphics* pGraphics = pParams.m_pGraphics.Get();
+      CFGAS_GEGraphics* pGraphics = pParams.m_pGraphics.Get();
       pGraphics->SaveGraphState();
 
       CFX_RectF rtInner(rect);
@@ -65,14 +65,14 @@
       FillSolidRect(pGraphics, m_pThemeData->clrEnd[iColor], rect,
                     pParams.m_matrix);
 
-      pGraphics->SetStrokeColor(CXFA_GEColor(m_pThemeData->clrBorder[iColor]));
+      pGraphics->SetStrokeColor(CFGAS_GEColor(m_pThemeData->clrBorder[iColor]));
       pGraphics->StrokePath(&strokePath, &pParams.m_matrix);
 
       fillPath.Clear();
       fillPath.AddRectangle(rtInner.left, rtInner.top, rtInner.width,
                             rtInner.height);
 
-      pGraphics->SetFillColor(CXFA_GEColor(m_pThemeData->clrFill[iColor]));
+      pGraphics->SetFillColor(CFGAS_GEColor(m_pThemeData->clrFill[iColor]));
       pGraphics->FillPath(&fillPath, CFX_FillRenderOptions::FillType::kWinding,
                           &pParams.m_matrix);
       if (pParams.m_dwStates & CFWL_PartState_Focused) {
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp
index 630ead8..b56935e 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.cpp
+++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp
@@ -6,12 +6,12 @@
 
 #include "xfa/fwl/theme/cfwl_scrollbartp.h"
 
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_scrollbar.h"
 #include "xfa/fwl/cfwl_themebackground.h"
 #include "xfa/fwl/cfwl_widget.h"
 #include "xfa/fwl/ifwl_themeprovider.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 namespace {
 
@@ -35,7 +35,7 @@
   else if (pParams.m_dwStates & CFWL_PartState_Disabled)
     eState = FWLTHEME_STATE_Disable;
 
-  CXFA_Graphics* pGraphics = pParams.m_pGraphics.Get();
+  CFGAS_GEGraphics* pGraphics = pParams.m_pGraphics.Get();
   bool bVert = !!pWidget->GetStylesEx();
   switch (pParams.m_iPart) {
     case CFWL_Part::ForeArrow: {
@@ -70,7 +70,7 @@
   }
 }
 
-void CFWL_ScrollBarTP::DrawThumbBtn(CXFA_Graphics* pGraphics,
+void CFWL_ScrollBarTP::DrawThumbBtn(CFGAS_GEGraphics* pGraphics,
                                     const CFX_RectF& input_rect,
                                     bool bVert,
                                     FWLTHEME_STATE eState,
@@ -92,20 +92,20 @@
 
   pGraphics->SaveGraphState();
 
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
   pGraphics->SetStrokeColor(
-      CXFA_GEColor(m_pThemeData->clrBtnBorder[eState - 1]));
+      CFGAS_GEColor(m_pThemeData->clrBtnBorder[eState - 1]));
   pGraphics->StrokePath(&path, &matrix);
   pGraphics->RestoreGraphState();
 }
 
-void CFWL_ScrollBarTP::DrawPaw(CXFA_Graphics* pGraphics,
+void CFWL_ScrollBarTP::DrawPaw(CFGAS_GEGraphics* pGraphics,
                                const CFX_RectF& rect,
                                bool bVert,
                                FWLTHEME_STATE eState,
                                const CFX_Matrix& matrix) {
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   if (bVert) {
     float fPawLen = kPawLength;
     if (rect.width / 2 <= fPawLen) {
@@ -125,7 +125,7 @@
 
     pGraphics->SetLineWidth(1);
     pGraphics->SetStrokeColor(
-        CXFA_GEColor(m_pThemeData->clrPawColorLight[eState - 1]));
+        CFGAS_GEColor(m_pThemeData->clrPawColorLight[eState - 1]));
     pGraphics->StrokePath(&path, nullptr);
     fX++;
 
@@ -141,7 +141,7 @@
 
     pGraphics->SetLineWidth(1);
     pGraphics->SetStrokeColor(
-        CXFA_GEColor(m_pThemeData->clrPawColorDark[eState - 1]));
+        CFGAS_GEColor(m_pThemeData->clrPawColorDark[eState - 1]));
     pGraphics->StrokePath(&path, &matrix);
   } else {
     float fPawLen = kPawLength;
@@ -162,7 +162,7 @@
 
     pGraphics->SetLineWidth(1);
     pGraphics->SetStrokeColor(
-        CXFA_GEColor(m_pThemeData->clrPawColorLight[eState - 1]));
+        CFGAS_GEColor(m_pThemeData->clrPawColorLight[eState - 1]));
     pGraphics->StrokePath(&path, &matrix);
     fY++;
 
@@ -178,12 +178,12 @@
 
     pGraphics->SetLineWidth(1);
     pGraphics->SetStrokeColor(
-        CXFA_GEColor(m_pThemeData->clrPawColorDark[eState - 1]));
+        CFGAS_GEColor(m_pThemeData->clrPawColorDark[eState - 1]));
     pGraphics->StrokePath(&path, &matrix);
   }
 }
 
-void CFWL_ScrollBarTP::DrawTrack(CXFA_Graphics* pGraphics,
+void CFWL_ScrollBarTP::DrawTrack(CFGAS_GEGraphics* pGraphics,
                                  const CFX_RectF& rect,
                                  bool bVert,
                                  FWLTHEME_STATE eState,
@@ -193,7 +193,7 @@
     return;
 
   pGraphics->SaveGraphState();
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   float fRight = rect.right();
   float fBottom = rect.bottom();
   if (bVert) {
@@ -203,7 +203,7 @@
     path.AddRectangle(rect.left, rect.top, rect.width, 1);
     path.AddRectangle(rect.left, fBottom - 1, rect.width, 1);
   }
-  pGraphics->SetFillColor(CXFA_GEColor(ArgbEncode(255, 238, 237, 229)));
+  pGraphics->SetFillColor(CFGAS_GEColor(ArgbEncode(255, 238, 237, 229)));
   pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding,
                       &matrix);
   path.Clear();
@@ -212,7 +212,7 @@
   FillSolidRect(pGraphics, m_pThemeData->clrTrackBKEnd, rect, matrix);
 }
 
-void CFWL_ScrollBarTP::DrawMaxMinBtn(CXFA_Graphics* pGraphics,
+void CFWL_ScrollBarTP::DrawMaxMinBtn(CFGAS_GEGraphics* pGraphics,
                                      const CFX_RectF& rect,
                                      FWLTHEME_DIRECTION eDict,
                                      FWLTHEME_STATE eState,
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.h b/xfa/fwl/theme/cfwl_scrollbartp.h
index 61de1b8..2ddd136 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.h
+++ b/xfa/fwl/theme/cfwl_scrollbartp.h
@@ -32,24 +32,24 @@
 
   CFWL_ScrollBarTP();
 
-  void DrawThumbBtn(CXFA_Graphics* pGraphics,
+  void DrawThumbBtn(CFGAS_GEGraphics* pGraphics,
                     const CFX_RectF& rect,
                     bool bVert,
                     FWLTHEME_STATE eState,
                     bool bPawButton,
                     const CFX_Matrix& matrix);
-  void DrawTrack(CXFA_Graphics* pGraphics,
+  void DrawTrack(CFGAS_GEGraphics* pGraphics,
                  const CFX_RectF& rect,
                  bool bVert,
                  FWLTHEME_STATE eState,
                  bool bLowerTrack,
                  const CFX_Matrix& matrix);
-  void DrawMaxMinBtn(CXFA_Graphics* pGraphics,
+  void DrawMaxMinBtn(CFGAS_GEGraphics* pGraphics,
                      const CFX_RectF& rect,
                      FWLTHEME_DIRECTION eDict,
                      FWLTHEME_STATE eState,
                      const CFX_Matrix& matrix);
-  void DrawPaw(CXFA_Graphics* pGraphics,
+  void DrawPaw(CFGAS_GEGraphics* pGraphics,
                const CFX_RectF& rect,
                bool bVert,
                FWLTHEME_STATE eState,
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 8878a2d..a6cdf1e 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -11,6 +11,8 @@
 
 #include "xfa/fde/cfde_textout.h"
 #include "xfa/fgas/font/cfgas_gefont.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_themebackground.h"
 #include "xfa/fwl/cfwl_themepart.h"
 #include "xfa/fwl/cfwl_themetext.h"
@@ -18,8 +20,6 @@
 #include "xfa/fwl/cfwl_widgetmgr.h"
 #include "xfa/fwl/ifwl_themeprovider.h"
 #include "xfa/fwl/theme/cfwl_fontmanager.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 CFWL_WidgetTP::CFWL_WidgetTP() = default;
 
@@ -35,7 +35,7 @@
   if (iLen <= 0)
     return;
 
-  CXFA_Graphics* pGraphics = pParams.m_pGraphics;
+  CFGAS_GEGraphics* pGraphics = pParams.m_pGraphics;
   m_pTextOut->SetStyles(pParams.m_dwTTOStyles);
   m_pTextOut->SetAlignment(pParams.m_iTTOAlign);
 
@@ -85,62 +85,62 @@
   m_pTextOut->SetTextColor(FWLTHEME_CAPACITY_TextColor);
 }
 
-void CFWL_WidgetTP::DrawBorder(CXFA_Graphics* pGraphics,
+void CFWL_WidgetTP::DrawBorder(CFGAS_GEGraphics* pGraphics,
                                const CFX_RectF& rect,
                                const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
 
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
   path.AddRectangle(rect.left + 1, rect.top + 1, rect.width - 2,
                     rect.height - 2);
   pGraphics->SaveGraphState();
-  pGraphics->SetFillColor(CXFA_GEColor(ArgbEncode(255, 0, 0, 0)));
+  pGraphics->SetFillColor(CFGAS_GEColor(ArgbEncode(255, 0, 0, 0)));
   pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kEvenOdd,
                       &matrix);
   pGraphics->RestoreGraphState();
 }
 
-void CFWL_WidgetTP::FillBackground(CXFA_Graphics* pGraphics,
+void CFWL_WidgetTP::FillBackground(CFGAS_GEGraphics* pGraphics,
                                    const CFX_RectF& rect,
                                    const CFX_Matrix& matrix) {
   FillSolidRect(pGraphics, FWLTHEME_COLOR_Background, rect, matrix);
 }
 
-void CFWL_WidgetTP::FillSolidRect(CXFA_Graphics* pGraphics,
+void CFWL_WidgetTP::FillSolidRect(CFGAS_GEGraphics* pGraphics,
                                   FX_ARGB fillColor,
                                   const CFX_RectF& rect,
                                   const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
 
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
   pGraphics->SaveGraphState();
-  pGraphics->SetFillColor(CXFA_GEColor(fillColor));
+  pGraphics->SetFillColor(CFGAS_GEColor(fillColor));
   pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding,
                       &matrix);
   pGraphics->RestoreGraphState();
 }
 
-void CFWL_WidgetTP::DrawFocus(CXFA_Graphics* pGraphics,
+void CFWL_WidgetTP::DrawFocus(CFGAS_GEGraphics* pGraphics,
                               const CFX_RectF& rect,
                               const CFX_Matrix& matrix) {
   if (!pGraphics)
     return;
 
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
   pGraphics->SaveGraphState();
-  pGraphics->SetStrokeColor(CXFA_GEColor(0xFF000000));
+  pGraphics->SetStrokeColor(CFGAS_GEColor(0xFF000000));
   static constexpr float kDashPattern[2] = {1, 1};
   pGraphics->SetLineDash(0.0f, kDashPattern);
   pGraphics->StrokePath(&path, &matrix);
   pGraphics->RestoreGraphState();
 }
 
-void CFWL_WidgetTP::DrawArrow(CXFA_Graphics* pGraphics,
+void CFWL_WidgetTP::DrawArrow(CFGAS_GEGraphics* pGraphics,
                               const CFX_RectF& rect,
                               FWLTHEME_DIRECTION eDict,
                               FX_ARGB argSign,
@@ -149,7 +149,7 @@
       (eDict == FWLTHEME_DIRECTION_Up || eDict == FWLTHEME_DIRECTION_Down);
   float fLeft = ((rect.width - (bVert ? 9 : 6)) / 2 + rect.left) + 0.5f;
   float fTop = ((rect.height - (bVert ? 6 : 9)) / 2 + rect.top) + 0.5f;
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   switch (eDict) {
     case FWLTHEME_DIRECTION_Down: {
       path.MoveTo(CFX_PointF(fLeft, fTop + 1));
@@ -188,25 +188,25 @@
       break;
     }
   }
-  pGraphics->SetFillColor(CXFA_GEColor(argSign));
+  pGraphics->SetFillColor(CFGAS_GEColor(argSign));
   pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding,
                       &matrix);
 }
 
-void CFWL_WidgetTP::DrawBtn(CXFA_Graphics* pGraphics,
+void CFWL_WidgetTP::DrawBtn(CFGAS_GEGraphics* pGraphics,
                             const CFX_RectF& rect,
                             FWLTHEME_STATE eState,
                             const CFX_Matrix& matrix) {
   InitializeArrowColorData();
   FillSolidRect(pGraphics, m_pColorData->clrEnd[eState - 1], rect, matrix);
 
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
-  pGraphics->SetStrokeColor(CXFA_GEColor(m_pColorData->clrBorder[eState - 1]));
+  pGraphics->SetStrokeColor(CFGAS_GEColor(m_pColorData->clrBorder[eState - 1]));
   pGraphics->StrokePath(&path, &matrix);
 }
 
-void CFWL_WidgetTP::DrawArrowBtn(CXFA_Graphics* pGraphics,
+void CFWL_WidgetTP::DrawArrowBtn(CFGAS_GEGraphics* pGraphics,
                                  const CFX_RectF& rect,
                                  FWLTHEME_DIRECTION eDict,
                                  FWLTHEME_STATE eState,
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h
index a545589..a5c035c 100644
--- a/xfa/fwl/theme/cfwl_widgettp.h
+++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -18,9 +18,9 @@
 
 class CFDE_TextOut;
 class CFGAS_GEFont;
+class CFGAS_GEGraphics;
 class CFWL_ThemeBackground;
 class CFWL_ThemeText;
-class CXFA_Graphics;
 
 class CFWL_WidgetTP : public cppgc::GarbageCollected<CFWL_WidgetTP> {
  public:
@@ -47,29 +47,29 @@
   void InitializeArrowColorData();
   void EnsureTTOInitialized();
 
-  void DrawBorder(CXFA_Graphics* pGraphics,
+  void DrawBorder(CFGAS_GEGraphics* pGraphics,
                   const CFX_RectF& rect,
                   const CFX_Matrix& matrix);
-  void FillBackground(CXFA_Graphics* pGraphics,
+  void FillBackground(CFGAS_GEGraphics* pGraphics,
                       const CFX_RectF& rect,
                       const CFX_Matrix& matrix);
-  void FillSolidRect(CXFA_Graphics* pGraphics,
+  void FillSolidRect(CFGAS_GEGraphics* pGraphics,
                      FX_ARGB fillColor,
                      const CFX_RectF& rect,
                      const CFX_Matrix& matrix);
-  void DrawFocus(CXFA_Graphics* pGraphics,
+  void DrawFocus(CFGAS_GEGraphics* pGraphics,
                  const CFX_RectF& rect,
                  const CFX_Matrix& matrix);
-  void DrawArrow(CXFA_Graphics* pGraphics,
+  void DrawArrow(CFGAS_GEGraphics* pGraphics,
                  const CFX_RectF& rect,
                  FWLTHEME_DIRECTION eDict,
                  FX_ARGB argSign,
                  const CFX_Matrix& matrix);
-  void DrawBtn(CXFA_Graphics* pGraphics,
+  void DrawBtn(CFGAS_GEGraphics* pGraphics,
                const CFX_RectF& rect,
                FWLTHEME_STATE eState,
                const CFX_Matrix& matrix);
-  void DrawArrowBtn(CXFA_Graphics* pGraphics,
+  void DrawArrowBtn(CFGAS_GEGraphics* pGraphics,
                     const CFX_RectF& rect,
                     FWLTHEME_DIRECTION eDict,
                     FWLTHEME_STATE eState,
diff --git a/xfa/fxfa/BUILD.gn b/xfa/fxfa/BUILD.gn
index fdb604f..ec4093e 100644
--- a/xfa/fxfa/BUILD.gn
+++ b/xfa/fxfa/BUILD.gn
@@ -96,9 +96,9 @@
     "../../fxjs:gc",
     "../fde",
     "../fgas",
+    "../fgas/graphics",
     "../fgas/layout",
     "../fwl",
-    "../fxgraphics",
     "layout",
     "parser",
   ]
diff --git a/xfa/fxfa/cxfa_ffarc.cpp b/xfa/fxfa/cxfa_ffarc.cpp
index fa4e8f4..86fa498 100644
--- a/xfa/fxfa/cxfa_ffarc.cpp
+++ b/xfa/fxfa/cxfa_ffarc.cpp
@@ -13,7 +13,7 @@
 
 CXFA_FFArc::~CXFA_FFArc() = default;
 
-void CXFA_FFArc::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFArc::RenderWidget(CFGAS_GEGraphics* pGS,
                               const CFX_Matrix& matrix,
                               HighlightOption highlight) {
   if (!HasVisibleStatus())
diff --git a/xfa/fxfa/cxfa_ffarc.h b/xfa/fxfa/cxfa_ffarc.h
index 4be0b9f..bb05e20 100644
--- a/xfa/fxfa/cxfa_ffarc.h
+++ b/xfa/fxfa/cxfa_ffarc.h
@@ -15,7 +15,7 @@
   ~CXFA_FFArc() override;
 
   // CXFA_FFWidget
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
 
diff --git a/xfa/fxfa/cxfa_ffbarcode.cpp b/xfa/fxfa/cxfa_ffbarcode.cpp
index 72b2f08..c7bc88a 100644
--- a/xfa/fxfa/cxfa_ffbarcode.cpp
+++ b/xfa/fxfa/cxfa_ffbarcode.cpp
@@ -165,7 +165,7 @@
   return CXFA_FFField::LoadWidget();
 }
 
-void CXFA_FFBarcode::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFBarcode::RenderWidget(CFGAS_GEGraphics* pGS,
                                   const CFX_Matrix& matrix,
                                   HighlightOption highlight) {
   if (!HasVisibleStatus())
diff --git a/xfa/fxfa/cxfa_ffbarcode.h b/xfa/fxfa/cxfa_ffbarcode.h
index 965c209..518db68 100644
--- a/xfa/fxfa/cxfa_ffbarcode.h
+++ b/xfa/fxfa/cxfa_ffbarcode.h
@@ -100,7 +100,7 @@
 
   // CXFA_FFTextEdit
   bool LoadWidget() override;
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
   void UpdateWidgetProperty() override;
diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp
index 05319c6..81de82b 100644
--- a/xfa/fxfa/cxfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp
@@ -232,7 +232,7 @@
   }
 }
 
-void CXFA_FFCheckButton::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFCheckButton::RenderWidget(CFGAS_GEGraphics* pGS,
                                       const CFX_Matrix& matrix,
                                       HighlightOption highlight) {
   if (!HasVisibleStatus())
@@ -344,7 +344,7 @@
   m_pOldDelegate->OnProcessEvent(pEvent);
 }
 
-void CXFA_FFCheckButton::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CXFA_FFCheckButton::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                       const CFX_Matrix& matrix) {
   m_pOldDelegate->OnDrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fxfa/cxfa_ffcheckbutton.h b/xfa/fxfa/cxfa_ffcheckbutton.h
index 89d561e..d93821f 100644
--- a/xfa/fxfa/cxfa_ffcheckbutton.h
+++ b/xfa/fxfa/cxfa_ffcheckbutton.h
@@ -22,7 +22,7 @@
   void Trace(cppgc::Visitor* visitor) const override;
 
   // CXFA_FFField
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
 
@@ -33,7 +33,7 @@
   bool OnLButtonUp(uint32_t dwFlags, const CFX_PointF& point) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
   FormFieldType GetFormFieldType() override;
 
diff --git a/xfa/fxfa/cxfa_ffcombobox.cpp b/xfa/fxfa/cxfa_ffcombobox.cpp
index 23cdaf0..baf0bdd 100644
--- a/xfa/fxfa/cxfa_ffcombobox.cpp
+++ b/xfa/fxfa/cxfa_ffcombobox.cpp
@@ -372,7 +372,7 @@
   m_pOldDelegate->OnProcessEvent(pEvent);
 }
 
-void CXFA_FFComboBox::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CXFA_FFComboBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                    const CFX_Matrix& matrix) {
   m_pOldDelegate->OnDrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fxfa/cxfa_ffcombobox.h b/xfa/fxfa/cxfa_ffcombobox.h
index 5711a92..a0dd056 100644
--- a/xfa/fxfa/cxfa_ffcombobox.h
+++ b/xfa/fxfa/cxfa_ffcombobox.h
@@ -48,7 +48,7 @@
   // IFWL_WidgetDelegate
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   // CXFA_FFDropDown
diff --git a/xfa/fxfa/cxfa_ffexclgroup.cpp b/xfa/fxfa/cxfa_ffexclgroup.cpp
index b634f85..d88b9eb 100644
--- a/xfa/fxfa/cxfa_ffexclgroup.cpp
+++ b/xfa/fxfa/cxfa_ffexclgroup.cpp
@@ -15,7 +15,7 @@
 
 CXFA_FFExclGroup::~CXFA_FFExclGroup() = default;
 
-void CXFA_FFExclGroup::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFExclGroup::RenderWidget(CFGAS_GEGraphics* pGS,
                                     const CFX_Matrix& matrix,
                                     HighlightOption highlight) {
   if (!HasVisibleStatus())
diff --git a/xfa/fxfa/cxfa_ffexclgroup.h b/xfa/fxfa/cxfa_ffexclgroup.h
index 5e97ca5..1de89b6 100644
--- a/xfa/fxfa/cxfa_ffexclgroup.h
+++ b/xfa/fxfa/cxfa_ffexclgroup.h
@@ -16,7 +16,7 @@
   ~CXFA_FFExclGroup() override;
 
   // CXFA_FFWidget
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
 
diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp
index 0acc63a..6fb5c5e 100644
--- a/xfa/fxfa/cxfa_fffield.cpp
+++ b/xfa/fxfa/cxfa_fffield.cpp
@@ -10,6 +10,8 @@
 #include <utility>
 
 #include "third_party/base/check.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_edit.h"
 #include "xfa/fwl/cfwl_eventmouse.h"
 #include "xfa/fwl/cfwl_messagekey.h"
@@ -33,8 +35,6 @@
 #include "xfa/fxfa/parser/cxfa_margin.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 #include "xfa/fxfa/parser/cxfa_script.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 CXFA_FFField::CXFA_FFField(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {}
 
@@ -69,7 +69,7 @@
   }
 }
 
-void CXFA_FFField::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFField::RenderWidget(CFGAS_GEGraphics* pGS,
                                 const CFX_Matrix& matrix,
                                 HighlightOption highlight) {
   if (!HasVisibleStatus())
@@ -89,7 +89,7 @@
   GetApp()->GetFWLWidgetMgr()->OnDrawWidget(GetNormalWidget(), pGS, mt);
 }
 
-void CXFA_FFField::DrawHighlight(CXFA_Graphics* pGS,
+void CXFA_FFField::DrawHighlight(CFGAS_GEGraphics* pGS,
                                  CFX_Matrix* pMatrix,
                                  HighlightOption highlight,
                                  ShapeOption shape) {
@@ -100,8 +100,8 @@
       !m_pNode->IsOpenAccess()) {
     return;
   }
-  pGS->SetFillColor(CXFA_GEColor(GetDoc()->GetHighlightColor()));
-  CXFA_GEPath path;
+  pGS->SetFillColor(CFGAS_GEColor(GetDoc()->GetHighlightColor()));
+  CFGAS_GEPath path;
   if (shape == kRoundShape)
     path.AddEllipse(m_UIRect);
   else
@@ -111,17 +111,17 @@
   pGS->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding, pMatrix);
 }
 
-void CXFA_FFField::DrawFocus(CXFA_Graphics* pGS, CFX_Matrix* pMatrix) {
+void CXFA_FFField::DrawFocus(CFGAS_GEGraphics* pGS, CFX_Matrix* pMatrix) {
   if (!GetLayoutItem()->TestStatusBits(XFA_WidgetStatus_Focused))
     return;
 
-  pGS->SetStrokeColor(CXFA_GEColor(0xFF000000));
+  pGS->SetStrokeColor(CFGAS_GEColor(0xFF000000));
 
   static constexpr float kDashPattern[2] = {1, 1};
   pGS->SetLineDash(0.0f, kDashPattern);
   pGS->SetLineWidth(0);
 
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(m_UIRect.left, m_UIRect.top, m_UIRect.width,
                     m_UIRect.height);
   pGS->StrokePath(&path, pMatrix);
@@ -582,7 +582,7 @@
   m_CaptionRect.height = std::max(m_CaptionRect.height, fHeight);
 }
 
-void CXFA_FFField::RenderCaption(CXFA_Graphics* pGS, CFX_Matrix* pMatrix) {
+void CXFA_FFField::RenderCaption(CFGAS_GEGraphics* pGS, CFX_Matrix* pMatrix) {
   CXFA_TextLayout* pCapTextLayout = m_pNode->GetCaptionTextLayout();
   if (!pCapTextLayout)
     return;
@@ -760,5 +760,5 @@
   }
 }
 
-void CXFA_FFField::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CXFA_FFField::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                 const CFX_Matrix& matrix) {}
diff --git a/xfa/fxfa/cxfa_fffield.h b/xfa/fxfa/cxfa_fffield.h
index 558ff0d..297470a 100644
--- a/xfa/fxfa/cxfa_fffield.h
+++ b/xfa/fxfa/cxfa_fffield.h
@@ -31,7 +31,7 @@
   void Trace(cppgc::Visitor* visitor) const override;
   CXFA_FFField* AsField() override;
   CFX_RectF GetBBox(FocusOption focus) override;
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
   bool IsLoaded() override;
@@ -62,7 +62,7 @@
   // IFWL_WidgetDelegate:
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   void UpdateFWL();
@@ -82,16 +82,16 @@
   void SetNormalWidget(CFWL_Widget* widget);
   CFX_PointF FWLToClient(const CFX_PointF& point);
   void LayoutCaption();
-  void RenderCaption(CXFA_Graphics* pGS, CFX_Matrix* pMatrix);
+  void RenderCaption(CFGAS_GEGraphics* pGS, CFX_Matrix* pMatrix);
 
   int32_t CalculateOverride();
   int32_t CalculateNode(CXFA_Node* pNode);
   bool ProcessCommittedData();
-  void DrawHighlight(CXFA_Graphics* pGS,
+  void DrawHighlight(CFGAS_GEGraphics* pGS,
                      CFX_Matrix* pMatrix,
                      HighlightOption highlight,
                      ShapeOption shape);
-  void DrawFocus(CXFA_Graphics* pGS, CFX_Matrix* pMatrix);
+  void DrawFocus(CFGAS_GEGraphics* pGS, CFX_Matrix* pMatrix);
   void SendMessageToFWLWidget(CFWL_Message* pMessage);
   void CapPlacement();
   void CapTopBottomPlacement(const CXFA_Margin* margin,
diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp
index c7c09f6..f3cdb3f 100644
--- a/xfa/fxfa/cxfa_ffimage.cpp
+++ b/xfa/fxfa/cxfa_ffimage.cpp
@@ -35,7 +35,7 @@
   return GetNode()->LoadImageImage(GetDoc()) && CXFA_FFWidget::LoadWidget();
 }
 
-void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFImage::RenderWidget(CFGAS_GEGraphics* pGS,
                                 const CFX_Matrix& matrix,
                                 HighlightOption highlight) {
   if (!HasVisibleStatus())
diff --git a/xfa/fxfa/cxfa_ffimage.h b/xfa/fxfa/cxfa_ffimage.h
index d75e5b5..5e192fa 100644
--- a/xfa/fxfa/cxfa_ffimage.h
+++ b/xfa/fxfa/cxfa_ffimage.h
@@ -16,7 +16,7 @@
 
   // CXFA_FFWidget:
   void PreFinalize() override;
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
   bool IsLoaded() override;
diff --git a/xfa/fxfa/cxfa_ffimageedit.cpp b/xfa/fxfa/cxfa_ffimageedit.cpp
index b70bc1a..97dda51 100644
--- a/xfa/fxfa/cxfa_ffimageedit.cpp
+++ b/xfa/fxfa/cxfa_ffimageedit.cpp
@@ -57,7 +57,7 @@
   return true;
 }
 
-void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFImageEdit::RenderWidget(CFGAS_GEGraphics* pGS,
                                     const CFX_Matrix& matrix,
                                     HighlightOption highlight) {
   if (!HasVisibleStatus())
@@ -147,7 +147,7 @@
   m_pOldDelegate->OnProcessEvent(pEvent);
 }
 
-void CXFA_FFImageEdit::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CXFA_FFImageEdit::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                     const CFX_Matrix& matrix) {
   m_pOldDelegate->OnDrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fxfa/cxfa_ffimageedit.h b/xfa/fxfa/cxfa_ffimageedit.h
index 92d2dc2..5fe867c 100644
--- a/xfa/fxfa/cxfa_ffimageedit.h
+++ b/xfa/fxfa/cxfa_ffimageedit.h
@@ -18,7 +18,7 @@
   // CXFA_FFField:
   void PreFinalize() override;
   void Trace(cppgc::Visitor* visitor) const override;
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
   bool LoadWidget() override;
@@ -28,7 +28,7 @@
   bool OnLButtonDown(uint32_t dwFlags, const CFX_PointF& point) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
   FormFieldType GetFormFieldType() override;
 
diff --git a/xfa/fxfa/cxfa_ffline.cpp b/xfa/fxfa/cxfa_ffline.cpp
index 8e5ac88..defb771 100644
--- a/xfa/fxfa/cxfa_ffline.cpp
+++ b/xfa/fxfa/cxfa_ffline.cpp
@@ -7,12 +7,12 @@
 #include "xfa/fxfa/cxfa_ffline.h"
 
 #include "third_party/base/notreached.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fxfa/parser/cxfa_edge.h"
 #include "xfa/fxfa/parser/cxfa_line.h"
 #include "xfa/fxfa/parser/cxfa_value.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
 
 namespace {
 
@@ -83,7 +83,7 @@
   }
 }
 
-void CXFA_FFLine::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFLine::RenderWidget(CFGAS_GEGraphics* pGS,
                                const CFX_Matrix& matrix,
                                HighlightOption highlight) {
   if (!HasVisibleStatus())
@@ -120,7 +120,7 @@
 
   GetRectFromHand(rtLine, line ? line->GetHand() : XFA_AttributeValue::Left,
                   fLineWidth);
-  CXFA_GEPath linePath;
+  CFGAS_GEPath linePath;
   if (line && line->GetSlope() && rtLine.right() > 0.0f &&
       rtLine.bottom() > 0.0f) {
     linePath.AddLine(rtLine.TopRight(), rtLine.BottomLeft());
@@ -133,7 +133,7 @@
   pGS->EnableActOnDash();
   XFA_StrokeTypeSetLineDash(pGS, iStrokeType, iCap);
 
-  pGS->SetStrokeColor(CXFA_GEColor(lineColor));
+  pGS->SetStrokeColor(CFGAS_GEColor(lineColor));
   pGS->SetLineCap(LineCapToFXGE(iCap));
   pGS->StrokePath(&linePath, &mtRotate);
   pGS->RestoreGraphState();
diff --git a/xfa/fxfa/cxfa_ffline.h b/xfa/fxfa/cxfa_ffline.h
index a7f3e26..be66a43 100644
--- a/xfa/fxfa/cxfa_ffline.h
+++ b/xfa/fxfa/cxfa_ffline.h
@@ -15,7 +15,7 @@
   ~CXFA_FFLine() override;
 
   // CXFA_FFWidget
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
 
diff --git a/xfa/fxfa/cxfa_fflistbox.cpp b/xfa/fxfa/cxfa_fflistbox.cpp
index 9505063..cf0fb3f 100644
--- a/xfa/fxfa/cxfa_fflistbox.cpp
+++ b/xfa/fxfa/cxfa_fflistbox.cpp
@@ -210,7 +210,7 @@
   m_pOldDelegate->OnProcessEvent(pEvent);
 }
 
-void CXFA_FFListBox::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CXFA_FFListBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                   const CFX_Matrix& matrix) {
   m_pOldDelegate->OnDrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fxfa/cxfa_fflistbox.h b/xfa/fxfa/cxfa_fflistbox.h
index ca967aa..ae8bca9 100644
--- a/xfa/fxfa/cxfa_fflistbox.h
+++ b/xfa/fxfa/cxfa_fflistbox.h
@@ -22,7 +22,7 @@
   bool OnKillFocus(CXFA_FFWidget* pNewWidget) override WARN_UNUSED_RESULT;
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
   FormFieldType GetFormFieldType() override;
 
diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp
index 0078ff9..343846e 100644
--- a/xfa/fxfa/cxfa_ffpushbutton.cpp
+++ b/xfa/fxfa/cxfa_ffpushbutton.cpp
@@ -8,6 +8,8 @@
 
 #include "third_party/base/check.h"
 #include "v8/include/cppgc/visitor.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fwl/cfwl_notedriver.h"
 #include "xfa/fwl/cfwl_pushbutton.h"
 #include "xfa/fwl/cfwl_widgetmgr.h"
@@ -22,8 +24,6 @@
 #include "xfa/fxfa/parser/cxfa_button.h"
 #include "xfa/fxfa/parser/cxfa_caption.h"
 #include "xfa/fxfa/parser/cxfa_edge.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 CXFA_FFPushButton::CXFA_FFPushButton(CXFA_Node* pNode, CXFA_Button* button)
     : CXFA_FFField(pNode), button_(button) {}
@@ -40,7 +40,7 @@
   visitor->Trace(button_);
 }
 
-void CXFA_FFPushButton::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFPushButton::RenderWidget(CFGAS_GEGraphics* pGS,
                                      const CFX_Matrix& matrix,
                                      HighlightOption highlight) {
   if (!HasVisibleStatus())
@@ -171,7 +171,7 @@
     m_pDownTextLayout->Layout(sz);
 }
 
-void CXFA_FFPushButton::RenderHighlightCaption(CXFA_Graphics* pGS,
+void CXFA_FFPushButton::RenderHighlightCaption(CFGAS_GEGraphics* pGS,
                                                CFX_Matrix* pMatrix) {
   CXFA_TextLayout* pCapTextLayout = m_pNode->GetCaptionTextLayout();
   CXFA_Caption* caption = m_pNode->GetCaptionIfExists();
@@ -210,7 +210,7 @@
   CXFA_FFField::OnProcessEvent(pEvent);
 }
 
-void CXFA_FFPushButton::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CXFA_FFPushButton::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                      const CFX_Matrix& matrix) {
   auto* pWidget = GetNormalWidget();
   if (pWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) {
@@ -219,9 +219,9 @@
       CFX_RectF rtFill(0, 0, pWidget->GetWidgetRect().Size());
       float fLineWith = GetLineWidth();
       rtFill.Deflate(fLineWith, fLineWith);
-      CXFA_GEPath path;
+      CFGAS_GEPath path;
       path.AddRectangle(rtFill.left, rtFill.top, rtFill.width, rtFill.height);
-      pGraphics->SetFillColor(CXFA_GEColor(ArgbEncode(128, 128, 255, 255)));
+      pGraphics->SetFillColor(CFGAS_GEColor(ArgbEncode(128, 128, 255, 255)));
       pGraphics->FillPath(&path, CFX_FillRenderOptions::FillType::kWinding,
                           &matrix);
     }
@@ -232,10 +232,10 @@
     if ((pWidget->GetStates() & FWL_STATE_PSB_Pressed) &&
         (pWidget->GetStates() & FWL_STATE_PSB_Hovered)) {
       float fLineWidth = GetLineWidth();
-      pGraphics->SetStrokeColor(CXFA_GEColor(ArgbEncode(255, 128, 255, 255)));
+      pGraphics->SetStrokeColor(CFGAS_GEColor(ArgbEncode(255, 128, 255, 255)));
       pGraphics->SetLineWidth(fLineWidth);
 
-      CXFA_GEPath path;
+      CFGAS_GEPath path;
       CFX_RectF rect = pWidget->GetWidgetRect();
       path.AddRectangle(0, 0, rect.width, rect.height);
       pGraphics->StrokePath(&path, &matrix);
diff --git a/xfa/fxfa/cxfa_ffpushbutton.h b/xfa/fxfa/cxfa_ffpushbutton.h
index b1d0ce2..c0e6db2 100644
--- a/xfa/fxfa/cxfa_ffpushbutton.h
+++ b/xfa/fxfa/cxfa_ffpushbutton.h
@@ -26,7 +26,7 @@
   void Trace(cppgc::Visitor* visitor) const override;
 
   // CXFA_FFField
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
   bool LoadWidget() override;
@@ -34,7 +34,7 @@
   void UpdateWidgetProperty() override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
   FormFieldType GetFormFieldType() override;
 
@@ -43,7 +43,7 @@
 
   void LoadHighlightCaption();
   void LayoutHighlightCaption();
-  void RenderHighlightCaption(CXFA_Graphics* pGS, CFX_Matrix* pMatrix);
+  void RenderHighlightCaption(CFGAS_GEGraphics* pGS, CFX_Matrix* pMatrix);
   float GetLineWidth();
   FX_ARGB GetLineColor();
   FX_ARGB GetFillColor();
diff --git a/xfa/fxfa/cxfa_ffrectangle.cpp b/xfa/fxfa/cxfa_ffrectangle.cpp
index 1619f24..e578ccc 100644
--- a/xfa/fxfa/cxfa_ffrectangle.cpp
+++ b/xfa/fxfa/cxfa_ffrectangle.cpp
@@ -13,7 +13,7 @@
 
 CXFA_FFRectangle::~CXFA_FFRectangle() = default;
 
-void CXFA_FFRectangle::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFRectangle::RenderWidget(CFGAS_GEGraphics* pGS,
                                     const CFX_Matrix& matrix,
                                     HighlightOption highlight) {
   if (!HasVisibleStatus())
diff --git a/xfa/fxfa/cxfa_ffrectangle.h b/xfa/fxfa/cxfa_ffrectangle.h
index 20cc5ad..c52c328 100644
--- a/xfa/fxfa/cxfa_ffrectangle.h
+++ b/xfa/fxfa/cxfa_ffrectangle.h
@@ -15,7 +15,7 @@
   ~CXFA_FFRectangle() override;
 
   // CXFA_FFWidget
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
 
diff --git a/xfa/fxfa/cxfa_ffsignature.cpp b/xfa/fxfa/cxfa_ffsignature.cpp
index 9487a7c..34d2f24 100644
--- a/xfa/fxfa/cxfa_ffsignature.cpp
+++ b/xfa/fxfa/cxfa_ffsignature.cpp
@@ -22,7 +22,7 @@
   return CXFA_FFField::LoadWidget();
 }
 
-void CXFA_FFSignature::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFSignature::RenderWidget(CFGAS_GEGraphics* pGS,
                                     const CFX_Matrix& matrix,
                                     HighlightOption highlight) {
   if (!HasVisibleStatus())
diff --git a/xfa/fxfa/cxfa_ffsignature.h b/xfa/fxfa/cxfa_ffsignature.h
index 77a6507..32d2294 100644
--- a/xfa/fxfa/cxfa_ffsignature.h
+++ b/xfa/fxfa/cxfa_ffsignature.h
@@ -15,7 +15,7 @@
   ~CXFA_FFSignature() override;
 
   // CXFA_FFField
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
   bool LoadWidget() override;
diff --git a/xfa/fxfa/cxfa_fftext.cpp b/xfa/fxfa/cxfa_fftext.cpp
index f9b2085..fc1b7f9 100644
--- a/xfa/fxfa/cxfa_fftext.cpp
+++ b/xfa/fxfa/cxfa_fftext.cpp
@@ -6,6 +6,7 @@
 
 #include "xfa/fxfa/cxfa_fftext.h"
 
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 #include "xfa/fgas/layout/cfx_linkuserdata.h"
 #include "xfa/fwl/fwl_widgethit.h"
 #include "xfa/fxfa/cxfa_ffapp.h"
@@ -14,13 +15,12 @@
 #include "xfa/fxfa/cxfa_ffwidget.h"
 #include "xfa/fxfa/cxfa_textlayout.h"
 #include "xfa/fxfa/parser/cxfa_margin.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
 
 CXFA_FFText::CXFA_FFText(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {}
 
 CXFA_FFText::~CXFA_FFText() = default;
 
-void CXFA_FFText::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFText::RenderWidget(CFGAS_GEGraphics* pGS,
                                const CFX_Matrix& matrix,
                                HighlightOption highlight) {
   if (!HasVisibleStatus())
diff --git a/xfa/fxfa/cxfa_fftext.h b/xfa/fxfa/cxfa_fftext.h
index e7db71b..7de77a1 100644
--- a/xfa/fxfa/cxfa_fftext.h
+++ b/xfa/fxfa/cxfa_fftext.h
@@ -22,7 +22,7 @@
   bool OnLButtonUp(uint32_t dwFlags, const CFX_PointF& point) override;
   bool OnMouseMove(uint32_t dwFlags, const CFX_PointF& point) override;
   FWL_WidgetHit HitTest(const CFX_PointF& point) override;
-  void RenderWidget(CXFA_Graphics* pGS,
+  void RenderWidget(CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     HighlightOption highlight) override;
   bool IsLoaded() override;
diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp
index 58b7f76..28602a6 100644
--- a/xfa/fxfa/cxfa_fftextedit.cpp
+++ b/xfa/fxfa/cxfa_fftextedit.cpp
@@ -355,7 +355,7 @@
   m_pOldDelegate->OnProcessEvent(pEvent);
 }
 
-void CXFA_FFTextEdit::OnDrawWidget(CXFA_Graphics* pGraphics,
+void CXFA_FFTextEdit::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                                    const CFX_Matrix& matrix) {
   m_pOldDelegate->OnDrawWidget(pGraphics, matrix);
 }
diff --git a/xfa/fxfa/cxfa_fftextedit.h b/xfa/fxfa/cxfa_fftextedit.h
index 23a4e54..642ec6d 100644
--- a/xfa/fxfa/cxfa_fftextedit.h
+++ b/xfa/fxfa/cxfa_fftextedit.h
@@ -39,7 +39,7 @@
   bool OnKillFocus(CXFA_FFWidget* pNewWidget) override WARN_UNUSED_RESULT;
   void OnProcessMessage(CFWL_Message* pMessage) override;
   void OnProcessEvent(CFWL_Event* pEvent) override;
-  void OnDrawWidget(CXFA_Graphics* pGraphics,
+  void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
                     const CFX_Matrix& matrix) override;
 
   void OnTextWillChange(CFWL_Widget* pWidget, CFWL_EventTextWillChange* change);
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 84e7e62..011b856 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -19,6 +19,7 @@
 #include "core/fxge/cfx_renderdevice.h"
 #include "core/fxge/dib/cfx_dibitmap.h"
 #include "third_party/base/check.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 #include "xfa/fwl/fwl_widgethit.h"
 #include "xfa/fxfa/cxfa_eventparam.h"
 #include "xfa/fxfa/cxfa_ffapp.h"
@@ -34,7 +35,6 @@
 #include "xfa/fxfa/parser/cxfa_image.h"
 #include "xfa/fxfa/parser/cxfa_margin.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
 
 namespace {
 
@@ -77,7 +77,7 @@
 
 }  // namespace
 
-void XFA_DrawImage(CXFA_Graphics* pGS,
+void XFA_DrawImage(CFGAS_GEGraphics* pGS,
                    const CFX_RectF& rtImage,
                    const CFX_Matrix& matrix,
                    const RetainPtr<CFX_DIBitmap>& pDIBitmap,
@@ -298,7 +298,7 @@
   return m_pPageView->GetPageViewRect();
 }
 
-void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS,
+void CXFA_FFWidget::RenderWidget(CFGAS_GEGraphics* pGS,
                                  const CFX_Matrix& matrix,
                                  HighlightOption highlight) {
   if (!HasVisibleStatus())
@@ -351,7 +351,7 @@
   return pHandler->ProcessEvent(pNode, params) == XFA_EventError::kSuccess;
 }
 
-void CXFA_FFWidget::DrawBorder(CXFA_Graphics* pGS,
+void CXFA_FFWidget::DrawBorder(CFGAS_GEGraphics* pGS,
                                CXFA_Box* box,
                                const CFX_RectF& rtBorder,
                                const CFX_Matrix& matrix) {
@@ -359,7 +359,7 @@
     box->Draw(pGS, rtBorder, matrix, false);
 }
 
-void CXFA_FFWidget::DrawBorderWithFlag(CXFA_Graphics* pGS,
+void CXFA_FFWidget::DrawBorderWithFlag(CFGAS_GEGraphics* pGS,
                                        CXFA_Box* box,
                                        const CFX_RectF& rtBorder,
                                        const CFX_Matrix& matrix,
diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h
index fc91494..b319ad4 100644
--- a/xfa/fxfa/cxfa_ffwidget.h
+++ b/xfa/fxfa/cxfa_ffwidget.h
@@ -21,6 +21,7 @@
 #include "xfa/fxfa/fxfa.h"
 #include "xfa/fxfa/layout/cxfa_contentlayoutitem.h"
 
+class CFGAS_GEGraphics;
 class CFX_DIBitmap;
 class CXFA_Box;
 class CXFA_FFApp;
@@ -29,7 +30,6 @@
 class CXFA_FFField;
 class CXFA_FFPageView;
 class CXFA_FFWidgetHandler;
-class CXFA_Graphics;
 class CXFA_Image;
 class CXFA_Margin;
 enum class FWL_WidgetHit;
@@ -40,7 +40,7 @@
 
 constexpr float kXFAWidgetPrecision = 0.001f;
 
-void XFA_DrawImage(CXFA_Graphics* pGS,
+void XFA_DrawImage(CFGAS_GEGraphics* pGS,
                    const CFX_RectF& rtImage,
                    const CFX_Matrix& matrix,
                    const RetainPtr<CFX_DIBitmap>& pDIBitmap,
@@ -80,7 +80,7 @@
 
   virtual CXFA_FFField* AsField();
   virtual CFX_RectF GetBBox(FocusOption focus);
-  virtual void RenderWidget(CXFA_Graphics* pGS,
+  virtual void RenderWidget(CFGAS_GEGraphics* pGS,
                             const CFX_Matrix& matrix,
                             HighlightOption highlight);
   virtual bool IsLoaded();
@@ -174,11 +174,11 @@
   explicit CXFA_FFWidget(CXFA_Node* pNode);
   virtual bool PtInActiveRect(const CFX_PointF& point);
 
-  void DrawBorder(CXFA_Graphics* pGS,
+  void DrawBorder(CFGAS_GEGraphics* pGS,
                   CXFA_Box* box,
                   const CFX_RectF& rtBorder,
                   const CFX_Matrix& matrix);
-  void DrawBorderWithFlag(CXFA_Graphics* pGS,
+  void DrawBorderWithFlag(CFGAS_GEGraphics* pGS,
                           CXFA_Box* box,
                           const CFX_RectF& rtBorder,
                           const CFX_Matrix& matrix,
diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp
index 33b0572..4fe4bc3 100644
--- a/xfa/fxfa/cxfa_ffwidgethandler.cpp
+++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp
@@ -190,7 +190,7 @@
 }
 
 void CXFA_FFWidgetHandler::RenderWidget(CXFA_FFWidget* hWidget,
-                                        CXFA_Graphics* pGS,
+                                        CFGAS_GEGraphics* pGS,
                                         const CFX_Matrix& matrix,
                                         bool bHighlight) {
   hWidget->RenderWidget(
diff --git a/xfa/fxfa/cxfa_ffwidgethandler.h b/xfa/fxfa/cxfa_ffwidgethandler.h
index 1f3c54d..f8d5a52 100644
--- a/xfa/fxfa/cxfa_ffwidgethandler.h
+++ b/xfa/fxfa/cxfa_ffwidgethandler.h
@@ -15,8 +15,8 @@
 #include "xfa/fxfa/fxfa.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
 
+class CFGAS_GEGraphics;
 class CXFA_FFDocView;
-class CXFA_Graphics;
 enum class FWL_WidgetHit;
 
 class CXFA_FFWidgetHandler final
@@ -70,7 +70,7 @@
   bool OnChar(CXFA_FFWidget* hWidget, uint32_t dwChar, uint32_t dwFlags);
   FWL_WidgetHit HitTest(CXFA_FFWidget* pWidget, const CFX_PointF& point);
   void RenderWidget(CXFA_FFWidget* hWidget,
-                    CXFA_Graphics* pGS,
+                    CFGAS_GEGraphics* pGS,
                     const CFX_Matrix& matrix,
                     bool bHighlight);
   bool HasEvent(CXFA_Node* pNode, XFA_EVENTTYPE eEventType);
diff --git a/xfa/fxfa/cxfa_fwltheme.cpp b/xfa/fxfa/cxfa_fwltheme.cpp
index 82b8d34..ea73992 100644
--- a/xfa/fxfa/cxfa_fwltheme.cpp
+++ b/xfa/fxfa/cxfa_fwltheme.cpp
@@ -12,6 +12,7 @@
 #include "xfa/fgas/font/cfgas_fontmgr.h"
 #include "xfa/fgas/font/cfgas_gefont.h"
 #include "xfa/fgas/font/cfgas_gemodule.h"
+#include "xfa/fgas/graphics/cfgas_gecolor.h"
 #include "xfa/fwl/cfwl_barcode.h"
 #include "xfa/fwl/cfwl_caret.h"
 #include "xfa/fwl/cfwl_checkbox.h"
@@ -31,7 +32,6 @@
 #include "xfa/fxfa/cxfa_ffwidget.h"
 #include "xfa/fxfa/cxfa_fontmgr.h"
 #include "xfa/fxfa/parser/cxfa_para.h"
-#include "xfa/fxgraphics/cxfa_gecolor.h"
 
 namespace {
 
@@ -110,7 +110,7 @@
     if (pParams.m_iPart == CFWL_Part::Caption)
       m_pTextOut->SetTextColor(ArgbEncode(0xff, 0, 153, 255));
 
-    CXFA_Graphics* pGraphics = pParams.m_pGraphics;
+    CFGAS_GEGraphics* pGraphics = pParams.m_pGraphics;
     CFX_RenderDevice* pRenderDevice = pGraphics->GetRenderDevice();
     CFX_Matrix mtPart = pParams.m_matrix;
     const CFX_Matrix* pMatrix = pGraphics->GetMatrix();
@@ -127,7 +127,7 @@
     return;
 
   CXFA_Node* pNode = pWidget->GetNode();
-  CXFA_Graphics* pGraphics = pParams.m_pGraphics;
+  CFGAS_GEGraphics* pGraphics = pParams.m_pGraphics;
   CFX_RenderDevice* pRenderDevice = pGraphics->GetRenderDevice();
   m_pTextOut->SetStyles(pParams.m_dwTTOStyles);
   m_pTextOut->SetAlignment(pParams.m_iTTOAlign);
diff --git a/xfa/fxfa/parser/BUILD.gn b/xfa/fxfa/parser/BUILD.gn
index 080bed8..c7f2bdc 100644
--- a/xfa/fxfa/parser/BUILD.gn
+++ b/xfa/fxfa/parser/BUILD.gn
@@ -686,7 +686,7 @@
     "../../../fxjs:gc",
     "../../fde",
     "../../fgas",
-    "../../fxgraphics",
+    "../../fgas/graphics",
   ]
   allow_circular_includes_from = [ "../../../fxjs" ]
   configs += [
diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp
index 6a40094..b472979 100644
--- a/xfa/fxfa/parser/cxfa_box.cpp
+++ b/xfa/fxfa/parser/cxfa_box.cpp
@@ -12,6 +12,10 @@
 
 #include "fxjs/xfa/cjx_object.h"
 #include "third_party/base/notreached.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
+#include "xfa/fgas/graphics/cfgas_gepattern.h"
+#include "xfa/fgas/graphics/cfgas_geshading.h"
 #include "xfa/fxfa/parser/cxfa_corner.h"
 #include "xfa/fxfa/parser/cxfa_edge.h"
 #include "xfa/fxfa/parser/cxfa_fill.h"
@@ -19,10 +23,6 @@
 #include "xfa/fxfa/parser/cxfa_measurement.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 #include "xfa/fxfa/parser/cxfa_rectangle.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
-#include "xfa/fxgraphics/cxfa_gepattern.h"
-#include "xfa/fxgraphics/cxfa_geshading.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
 
 namespace {
 
@@ -180,7 +180,7 @@
   return strokes;
 }
 
-void CXFA_Box::Draw(CXFA_Graphics* pGS,
+void CXFA_Box::Draw(CFGAS_GEGraphics* pGS,
                     const CFX_RectF& rtWidget,
                     const CFX_Matrix& matrix,
                     bool forceRound) {
@@ -208,7 +208,7 @@
 }
 
 void CXFA_Box::DrawFill(const std::vector<CXFA_Stroke*>& strokes,
-                        CXFA_Graphics* pGS,
+                        CFGAS_GEGraphics* pGS,
                         CFX_RectF rtWidget,
                         const CFX_Matrix& matrix,
                         bool forceRound) {
@@ -218,7 +218,7 @@
 
   pGS->SaveGraphState();
 
-  CXFA_GEPath fillPath;
+  CFGAS_GEPath fillPath;
   XFA_Element type = GetElementType();
   if (type == XFA_Element::Arc || forceRound) {
     CXFA_Edge* edge = GetEdgeIfExists(0);
@@ -244,7 +244,7 @@
 
 void CXFA_Box::GetPathArcOrRounded(CFX_RectF rtDraw,
                                    bool forceRound,
-                                   CXFA_GEPath* fillPath) {
+                                   CFGAS_GEPath* fillPath) {
   float a, b;
   a = rtDraw.width / 2.0f;
   b = rtDraw.height / 2.0f;
@@ -268,7 +268,7 @@
                    -sweepAngle.value_or(360) * FX_PI / 180.0f);
 }
 
-void CXFA_Box::StrokeArcOrRounded(CXFA_Graphics* pGS,
+void CXFA_Box::StrokeArcOrRounded(CFGAS_GEGraphics* pGS,
                                   CFX_RectF rtWidget,
                                   const CFX_Matrix& matrix,
                                   bool forceRound) {
@@ -301,7 +301,7 @@
     if (fHalf < 0.001f)
       return;
 
-    CXFA_GEPath arcPath;
+    CFGAS_GEPath arcPath;
     GetPathArcOrRounded(rtWidget, forceRound, &arcPath);
     if (edge)
       edge->Stroke(&arcPath, pGS, matrix);
@@ -324,30 +324,30 @@
   rtWidget.width = a + a;
   rtWidget.height = b + b;
 
-  CXFA_GEPath arcPath;
+  CFGAS_GEPath arcPath;
   arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FX_PI / 4.0f,
                  FX_PI);
 
-  pGS->SetStrokeColor(CXFA_GEColor(0xFF808080));
+  pGS->SetStrokeColor(CFGAS_GEColor(0xFF808080));
   pGS->StrokePath(&arcPath, &matrix);
   arcPath.Clear();
   arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FX_PI / 4.0f,
                  FX_PI);
 
-  pGS->SetStrokeColor(CXFA_GEColor(0xFFFFFFFF));
+  pGS->SetStrokeColor(CFGAS_GEColor(0xFFFFFFFF));
   pGS->StrokePath(&arcPath, &matrix);
   rtWidget.Deflate(fHalf, fHalf);
   arcPath.Clear();
   arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FX_PI / 4.0f,
                  FX_PI);
 
-  pGS->SetStrokeColor(CXFA_GEColor(0xFF404040));
+  pGS->SetStrokeColor(CFGAS_GEColor(0xFF404040));
   pGS->StrokePath(&arcPath, &matrix);
   arcPath.Clear();
   arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FX_PI / 4.0f,
                  FX_PI);
 
-  pGS->SetStrokeColor(CXFA_GEColor(0xFFC0C0C0));
+  pGS->SetStrokeColor(CFGAS_GEColor(0xFFC0C0C0));
   pGS->StrokePath(&arcPath, &matrix);
   pGS->RestoreGraphState();
 }
diff --git a/xfa/fxfa/parser/cxfa_box.h b/xfa/fxfa/parser/cxfa_box.h
index 54ca865..330817d 100644
--- a/xfa/fxfa/parser/cxfa_box.h
+++ b/xfa/fxfa/parser/cxfa_box.h
@@ -11,12 +11,12 @@
 #include <vector>
 
 #include "core/fxcrt/fx_coordinates.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
+class CFGAS_GEGraphics;
 class CXFA_Edge;
 class CXFA_Fill;
-class CXFA_Graphics;
 class CXFA_Margin;
 class CXFA_Stroke;
 
@@ -34,7 +34,7 @@
 
   std::vector<CXFA_Stroke*> GetStrokes();
 
-  void Draw(CXFA_Graphics* pGS,
+  void Draw(CFGAS_GEGraphics* pGS,
             const CFX_RectF& rtWidget,
             const CFX_Matrix& matrix,
             bool forceRound);
@@ -58,17 +58,17 @@
 
   std::vector<CXFA_Stroke*> GetStrokesInternal(bool bNull);
   void DrawFill(const std::vector<CXFA_Stroke*>& strokes,
-                CXFA_Graphics* pGS,
+                CFGAS_GEGraphics* pGS,
                 CFX_RectF rtWidget,
                 const CFX_Matrix& matrix,
                 bool forceRound);
-  void StrokeArcOrRounded(CXFA_Graphics* pGS,
+  void StrokeArcOrRounded(CFGAS_GEGraphics* pGS,
                           CFX_RectF rtWidget,
                           const CFX_Matrix& matrix,
                           bool forceRound);
   void GetPathArcOrRounded(CFX_RectF rtDraw,
                            bool forceRound,
-                           CXFA_GEPath* fillPath);
+                           CFGAS_GEPath* fillPath);
 };
 
 #endif  // XFA_FXFA_PARSER_CXFA_BOX_H_
diff --git a/xfa/fxfa/parser/cxfa_fill.cpp b/xfa/fxfa/parser/cxfa_fill.cpp
index 2f9a1ff..552746c 100644
--- a/xfa/fxfa/parser/cxfa_fill.cpp
+++ b/xfa/fxfa/parser/cxfa_fill.cpp
@@ -87,8 +87,8 @@
   return XFA_Element::Solid;
 }
 
-void CXFA_Fill::Draw(CXFA_Graphics* pGS,
-                     CXFA_GEPath* fillPath,
+void CXFA_Fill::Draw(CFGAS_GEGraphics* pGS,
+                     CFGAS_GEPath* fillPath,
                      const CFX_RectF& rtWidget,
                      const CFX_Matrix& matrix) {
   pGS->SaveGraphState();
@@ -107,7 +107,7 @@
       DrawStipple(pGS, fillPath, rtWidget, matrix);
       break;
     default:
-      pGS->SetFillColor(CXFA_GEColor(GetColor(false)));
+      pGS->SetFillColor(CFGAS_GEColor(GetColor(false)));
       pGS->FillPath(fillPath, CFX_FillRenderOptions::FillType::kWinding,
                     &matrix);
       break;
@@ -116,8 +116,8 @@
   pGS->RestoreGraphState();
 }
 
-void CXFA_Fill::DrawStipple(CXFA_Graphics* pGS,
-                            CXFA_GEPath* fillPath,
+void CXFA_Fill::DrawStipple(CFGAS_GEGraphics* pGS,
+                            CFGAS_GEPath* fillPath,
                             const CFX_RectF& rtWidget,
                             const CFX_Matrix& matrix) {
   CXFA_Stipple* stipple =
@@ -126,8 +126,8 @@
     stipple->Draw(pGS, fillPath, rtWidget, matrix);
 }
 
-void CXFA_Fill::DrawRadial(CXFA_Graphics* pGS,
-                           CXFA_GEPath* fillPath,
+void CXFA_Fill::DrawRadial(CFGAS_GEGraphics* pGS,
+                           CFGAS_GEPath* fillPath,
                            const CFX_RectF& rtWidget,
                            const CFX_Matrix& matrix) {
   CXFA_Radial* radial =
@@ -136,8 +136,8 @@
     radial->Draw(pGS, fillPath, GetColor(false), rtWidget, matrix);
 }
 
-void CXFA_Fill::DrawLinear(CXFA_Graphics* pGS,
-                           CXFA_GEPath* fillPath,
+void CXFA_Fill::DrawLinear(CFGAS_GEGraphics* pGS,
+                           CFGAS_GEPath* fillPath,
                            const CFX_RectF& rtWidget,
                            const CFX_Matrix& matrix) {
   CXFA_Linear* linear =
@@ -146,8 +146,8 @@
     linear->Draw(pGS, fillPath, GetColor(false), rtWidget, matrix);
 }
 
-void CXFA_Fill::DrawPattern(CXFA_Graphics* pGS,
-                            CXFA_GEPath* fillPath,
+void CXFA_Fill::DrawPattern(CFGAS_GEGraphics* pGS,
+                            CFGAS_GEPath* fillPath,
                             const CFX_RectF& rtWidget,
                             const CFX_Matrix& matrix) {
   CXFA_Pattern* pattern =
diff --git a/xfa/fxfa/parser/cxfa_fill.h b/xfa/fxfa/parser/cxfa_fill.h
index 8947aec..3f51c8f 100644
--- a/xfa/fxfa/parser/cxfa_fill.h
+++ b/xfa/fxfa/parser/cxfa_fill.h
@@ -9,10 +9,10 @@
 
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxge/fx_dib.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
-class CXFA_Graphics;
+class CFGAS_GEGraphics;
 class CXFA_Linear;
 class CXFA_Pattern;
 class CXFA_Radial;
@@ -28,8 +28,8 @@
   FX_ARGB GetColor(bool bText);
   void SetColor(FX_ARGB color);
 
-  void Draw(CXFA_Graphics* pGS,
-            CXFA_GEPath* fillPath,
+  void Draw(CFGAS_GEGraphics* pGS,
+            CFGAS_GEPath* fillPath,
             const CFX_RectF& rtWidget,
             const CFX_Matrix& matrix);
 
@@ -38,20 +38,20 @@
 
   XFA_Element GetType() const;
 
-  void DrawStipple(CXFA_Graphics* pGS,
-                   CXFA_GEPath* fillPath,
+  void DrawStipple(CFGAS_GEGraphics* pGS,
+                   CFGAS_GEPath* fillPath,
                    const CFX_RectF& rtWidget,
                    const CFX_Matrix& matrix);
-  void DrawRadial(CXFA_Graphics* pGS,
-                  CXFA_GEPath* fillPath,
+  void DrawRadial(CFGAS_GEGraphics* pGS,
+                  CFGAS_GEPath* fillPath,
                   const CFX_RectF& rtWidget,
                   const CFX_Matrix& matrix);
-  void DrawLinear(CXFA_Graphics* pGS,
-                  CXFA_GEPath* fillPath,
+  void DrawLinear(CFGAS_GEGraphics* pGS,
+                  CFGAS_GEPath* fillPath,
                   const CFX_RectF& rtWidget,
                   const CFX_Matrix& matrix);
-  void DrawPattern(CXFA_Graphics* pGS,
-                   CXFA_GEPath* fillPath,
+  void DrawPattern(CFGAS_GEGraphics* pGS,
+                   CFGAS_GEPath* fillPath,
                    const CFX_RectF& rtWidget,
                    const CFX_Matrix& matrix);
 };
diff --git a/xfa/fxfa/parser/cxfa_linear.cpp b/xfa/fxfa/parser/cxfa_linear.cpp
index adb4948..565e888 100644
--- a/xfa/fxfa/parser/cxfa_linear.cpp
+++ b/xfa/fxfa/parser/cxfa_linear.cpp
@@ -7,9 +7,9 @@
 #include "xfa/fxfa/parser/cxfa_linear.h"
 
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fgas/graphics/cfgas_geshading.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
-#include "xfa/fxgraphics/cxfa_geshading.h"
 
 namespace {
 
@@ -52,8 +52,8 @@
   return GetChild<CXFA_Color>(0, XFA_Element::Color, false);
 }
 
-void CXFA_Linear::Draw(CXFA_Graphics* pGS,
-                       CXFA_GEPath* fillPath,
+void CXFA_Linear::Draw(CFGAS_GEGraphics* pGS,
+                       CFGAS_GEPath* fillPath,
                        FX_ARGB crStart,
                        const CFX_RectF& rtFill,
                        const CFX_Matrix& matrix) {
@@ -83,10 +83,10 @@
       break;
   }
 
-  CXFA_GEShading shading(ptStart, ptEnd, false, false, crStart, crEnd);
+  CFGAS_GEShading shading(ptStart, ptEnd, false, false, crStart, crEnd);
 
   pGS->SaveGraphState();
-  pGS->SetFillColor(CXFA_GEColor(&shading));
+  pGS->SetFillColor(CFGAS_GEColor(&shading));
   pGS->FillPath(fillPath, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   pGS->RestoreGraphState();
 }
diff --git a/xfa/fxfa/parser/cxfa_linear.h b/xfa/fxfa/parser/cxfa_linear.h
index e7625a1..7d61fc6 100644
--- a/xfa/fxfa/parser/cxfa_linear.h
+++ b/xfa/fxfa/parser/cxfa_linear.h
@@ -8,11 +8,11 @@
 #define XFA_FXFA_PARSER_CXFA_LINEAR_H_
 
 #include "core/fxcrt/fx_coordinates.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
+class CFGAS_GEGraphics;
 class CXFA_Color;
-class CXFA_Graphics;
 
 class CXFA_Linear final : public CXFA_Node {
  public:
@@ -22,8 +22,8 @@
   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CXFA_Linear() override;
 
-  void Draw(CXFA_Graphics* pGS,
-            CXFA_GEPath* fillPath,
+  void Draw(CFGAS_GEGraphics* pGS,
+            CFGAS_GEPath* fillPath,
             FX_ARGB crStart,
             const CFX_RectF& rtFill,
             const CFX_Matrix& matrix);
diff --git a/xfa/fxfa/parser/cxfa_pattern.cpp b/xfa/fxfa/parser/cxfa_pattern.cpp
index bbfd9b8..4a5eae6 100644
--- a/xfa/fxfa/parser/cxfa_pattern.cpp
+++ b/xfa/fxfa/parser/cxfa_pattern.cpp
@@ -7,9 +7,9 @@
 #include "xfa/fxfa/parser/cxfa_pattern.h"
 
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fgas/graphics/cfgas_gepattern.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
-#include "xfa/fxgraphics/cxfa_gepattern.h"
 
 namespace {
 
@@ -50,8 +50,8 @@
   return JSObject()->GetEnum(XFA_Attribute::Type);
 }
 
-void CXFA_Pattern::Draw(CXFA_Graphics* pGS,
-                        CXFA_GEPath* fillPath,
+void CXFA_Pattern::Draw(CFGAS_GEGraphics* pGS,
+                        CFGAS_GEPath* fillPath,
                         FX_ARGB crStart,
                         const CFX_RectF& rtFill,
                         const CFX_Matrix& matrix) {
@@ -79,10 +79,10 @@
       break;
   }
 
-  CXFA_GEPattern pattern(iHatch, crEnd, crStart);
+  CFGAS_GEPattern pattern(iHatch, crEnd, crStart);
 
   pGS->SaveGraphState();
-  pGS->SetFillColor(CXFA_GEColor(&pattern, 0x0));
+  pGS->SetFillColor(CFGAS_GEColor(&pattern, 0x0));
   pGS->FillPath(fillPath, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   pGS->RestoreGraphState();
 }
diff --git a/xfa/fxfa/parser/cxfa_pattern.h b/xfa/fxfa/parser/cxfa_pattern.h
index 87c6c23..4e52b6c 100644
--- a/xfa/fxfa/parser/cxfa_pattern.h
+++ b/xfa/fxfa/parser/cxfa_pattern.h
@@ -8,11 +8,11 @@
 #define XFA_FXFA_PARSER_CXFA_PATTERN_H_
 
 #include "core/fxcrt/fx_coordinates.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
+class CFGAS_GEGraphics;
 class CXFA_Color;
-class CXFA_Graphics;
 
 class CXFA_Pattern final : public CXFA_Node {
  public:
@@ -22,8 +22,8 @@
   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CXFA_Pattern() override;
 
-  void Draw(CXFA_Graphics* pGS,
-            CXFA_GEPath* fillPath,
+  void Draw(CFGAS_GEGraphics* pGS,
+            CFGAS_GEPath* fillPath,
             FX_ARGB crStart,
             const CFX_RectF& rtFill,
             const CFX_Matrix& matrix);
diff --git a/xfa/fxfa/parser/cxfa_radial.cpp b/xfa/fxfa/parser/cxfa_radial.cpp
index 87136e6..7b75ca8 100644
--- a/xfa/fxfa/parser/cxfa_radial.cpp
+++ b/xfa/fxfa/parser/cxfa_radial.cpp
@@ -9,9 +9,9 @@
 #include <utility>
 
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fgas/graphics/cfgas_geshading.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
-#include "xfa/fxgraphics/cxfa_geshading.h"
 
 namespace {
 
@@ -53,8 +53,8 @@
   return GetChild<CXFA_Color>(0, XFA_Element::Color, false);
 }
 
-void CXFA_Radial::Draw(CXFA_Graphics* pGS,
-                       CXFA_GEPath* fillPath,
+void CXFA_Radial::Draw(CFGAS_GEGraphics* pGS,
+                       CFGAS_GEPath* fillPath,
                        FX_ARGB crStart,
                        const CFX_RectF& rtFill,
                        const CFX_Matrix& matrix) {
@@ -66,11 +66,11 @@
   float endRadius = sqrt(rtFill.Width() * rtFill.Width() +
                          rtFill.Height() * rtFill.Height()) /
                     2;
-  CXFA_GEShading shading(rtFill.Center(), rtFill.Center(), 0, endRadius, true,
-                         true, crStart, crEnd);
+  CFGAS_GEShading shading(rtFill.Center(), rtFill.Center(), 0, endRadius, true,
+                          true, crStart, crEnd);
 
   pGS->SaveGraphState();
-  pGS->SetFillColor(CXFA_GEColor(&shading));
+  pGS->SetFillColor(CFGAS_GEColor(&shading));
   pGS->FillPath(fillPath, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   pGS->RestoreGraphState();
 }
diff --git a/xfa/fxfa/parser/cxfa_radial.h b/xfa/fxfa/parser/cxfa_radial.h
index 4b4378c..c21cc68 100644
--- a/xfa/fxfa/parser/cxfa_radial.h
+++ b/xfa/fxfa/parser/cxfa_radial.h
@@ -8,19 +8,19 @@
 #define XFA_FXFA_PARSER_CXFA_RADIAL_H_
 
 #include "core/fxcrt/fx_coordinates.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
+class CFGAS_GEGraphics;
 class CXFA_Color;
-class CXFA_Graphics;
 
 class CXFA_Radial final : public CXFA_Node {
  public:
   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CXFA_Radial() override;
 
-  void Draw(CXFA_Graphics* pGS,
-            CXFA_GEPath* fillPath,
+  void Draw(CFGAS_GEGraphics* pGS,
+            CFGAS_GEPath* fillPath,
             FX_ARGB crStart,
             const CFX_RectF& rtFill,
             const CFX_Matrix& matrix);
diff --git a/xfa/fxfa/parser/cxfa_rectangle.cpp b/xfa/fxfa/parser/cxfa_rectangle.cpp
index e640bc3..aeb41ad 100644
--- a/xfa/fxfa/parser/cxfa_rectangle.cpp
+++ b/xfa/fxfa/parser/cxfa_rectangle.cpp
@@ -67,7 +67,7 @@
 
 void CXFA_Rectangle::GetFillPath(const std::vector<CXFA_Stroke*>& strokes,
                                  const CFX_RectF& rtWidget,
-                                 CXFA_GEPath* fillPath) {
+                                 CFGAS_GEPath* fillPath) {
   bool bSameStyles = true;
   CXFA_Stroke* stroke1 = strokes[0];
   for (int32_t i = 1; i < 8; i++) {
@@ -212,7 +212,7 @@
 }
 
 void CXFA_Rectangle::Draw(const std::vector<CXFA_Stroke*>& strokes,
-                          CXFA_Graphics* pGS,
+                          CFGAS_GEGraphics* pGS,
                           CFX_RectF rtWidget,
                           const CFX_Matrix& matrix) {
   bool bVisible = false;
@@ -268,7 +268,7 @@
 }
 
 void CXFA_Rectangle::Stroke(const std::vector<CXFA_Stroke*>& strokes,
-                            CXFA_Graphics* pGS,
+                            CFGAS_GEGraphics* pGS,
                             CFX_RectF rtWidget,
                             const CFX_Matrix& matrix) {
   bool bVisible;
@@ -332,7 +332,7 @@
   }
 
   bool bStart = true;
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   for (int32_t i = 0; i < 8; i++) {
     CXFA_Stroke* stroke = strokes[i];
     if ((i % 1) == 0 && stroke->GetRadius() < 0) {
@@ -364,7 +364,7 @@
   }
 }
 
-void CXFA_Rectangle::StrokeRect(CXFA_Graphics* pGraphic,
+void CXFA_Rectangle::StrokeRect(CFGAS_GEGraphics* pGraphic,
                                 const CFX_RectF& rt,
                                 float fLineWidth,
                                 const CFX_Matrix& matrix,
@@ -372,7 +372,7 @@
                                 FX_ARGB argbBottomRight) {
   float fBottom = rt.bottom();
   float fRight = rt.right();
-  CXFA_GEPath pathLT;
+  CFGAS_GEPath pathLT;
   pathLT.MoveTo(CFX_PointF(rt.left, fBottom));
   pathLT.LineTo(CFX_PointF(rt.left, rt.top));
   pathLT.LineTo(CFX_PointF(fRight, rt.top));
@@ -380,11 +380,11 @@
   pathLT.LineTo(CFX_PointF(rt.left + fLineWidth, rt.top + fLineWidth));
   pathLT.LineTo(CFX_PointF(rt.left + fLineWidth, fBottom - fLineWidth));
   pathLT.LineTo(CFX_PointF(rt.left, fBottom));
-  pGraphic->SetFillColor(CXFA_GEColor(argbTopLeft));
+  pGraphic->SetFillColor(CFGAS_GEColor(argbTopLeft));
   pGraphic->FillPath(&pathLT, CFX_FillRenderOptions::FillType::kWinding,
                      &matrix);
 
-  CXFA_GEPath pathRB;
+  CFGAS_GEPath pathRB;
   pathRB.MoveTo(CFX_PointF(fRight, rt.top));
   pathRB.LineTo(CFX_PointF(fRight, fBottom));
   pathRB.LineTo(CFX_PointF(rt.left, fBottom));
@@ -392,12 +392,12 @@
   pathRB.LineTo(CFX_PointF(fRight - fLineWidth, fBottom - fLineWidth));
   pathRB.LineTo(CFX_PointF(fRight - fLineWidth, rt.top + fLineWidth));
   pathRB.LineTo(CFX_PointF(fRight, rt.top));
-  pGraphic->SetFillColor(CXFA_GEColor(argbBottomRight));
+  pGraphic->SetFillColor(CFGAS_GEColor(argbBottomRight));
   pGraphic->FillPath(&pathRB, CFX_FillRenderOptions::FillType::kWinding,
                      &matrix);
 }
 
-void CXFA_Rectangle::StrokeLowered(CXFA_Graphics* pGS,
+void CXFA_Rectangle::StrokeLowered(CFGAS_GEGraphics* pGS,
                                    CFX_RectF rt,
                                    float fThickness,
                                    const CFX_Matrix& matrix) {
@@ -405,16 +405,16 @@
   CFX_RectF rtInner(rt);
   rtInner.Deflate(fHalfWidth, fHalfWidth);
 
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(rt.left, rt.top, rt.width, rt.height);
   path.AddRectangle(rtInner.left, rtInner.top, rtInner.width, rtInner.height);
-  pGS->SetFillColor(CXFA_GEColor(0xFF000000));
+  pGS->SetFillColor(CFGAS_GEColor(0xFF000000));
   pGS->FillPath(&path, CFX_FillRenderOptions::FillType::kEvenOdd, &matrix);
 
   StrokeRect(pGS, rtInner, fHalfWidth, matrix, 0xFF808080, 0xFFC0C0C0);
 }
 
-void CXFA_Rectangle::StrokeRaised(CXFA_Graphics* pGS,
+void CXFA_Rectangle::StrokeRaised(CFGAS_GEGraphics* pGS,
                                   CFX_RectF rt,
                                   float fThickness,
                                   const CFX_Matrix& matrix) {
@@ -422,16 +422,16 @@
   CFX_RectF rtInner(rt);
   rtInner.Deflate(fHalfWidth, fHalfWidth);
 
-  CXFA_GEPath path;
+  CFGAS_GEPath path;
   path.AddRectangle(rt.left, rt.top, rt.width, rt.height);
   path.AddRectangle(rtInner.left, rtInner.top, rtInner.width, rtInner.height);
-  pGS->SetFillColor(CXFA_GEColor(0xFF000000));
+  pGS->SetFillColor(CFGAS_GEColor(0xFF000000));
   pGS->FillPath(&path, CFX_FillRenderOptions::FillType::kEvenOdd, &matrix);
 
   StrokeRect(pGS, rtInner, fHalfWidth, matrix, 0xFFFFFFFF, 0xFF808080);
 }
 
-void CXFA_Rectangle::StrokeEtched(CXFA_Graphics* pGS,
+void CXFA_Rectangle::StrokeEtched(CFGAS_GEGraphics* pGS,
                                   CFX_RectF rt,
                                   float fThickness,
                                   const CFX_Matrix& matrix) {
@@ -443,7 +443,7 @@
   StrokeRect(pGS, rtInner, fHalfWidth, matrix, 0xFFFFFFFF, 0xFF808080);
 }
 
-void CXFA_Rectangle::StrokeEmbossed(CXFA_Graphics* pGS,
+void CXFA_Rectangle::StrokeEmbossed(CFGAS_GEGraphics* pGS,
                                     CFX_RectF rt,
                                     float fThickness,
                                     const CFX_Matrix& matrix) {
@@ -457,7 +457,7 @@
 
 void CXFA_Rectangle::GetPath(const std::vector<CXFA_Stroke*>& strokes,
                              CFX_RectF rtWidget,
-                             CXFA_GEPath& path,
+                             CFGAS_GEPath& path,
                              int32_t nIndex,
                              bool bStart,
                              bool bCorner) {
diff --git a/xfa/fxfa/parser/cxfa_rectangle.h b/xfa/fxfa/parser/cxfa_rectangle.h
index 40da50f..c1500e0 100644
--- a/xfa/fxfa/parser/cxfa_rectangle.h
+++ b/xfa/fxfa/parser/cxfa_rectangle.h
@@ -9,8 +9,8 @@
 
 #include <vector>
 
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fxfa/parser/cxfa_box.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
 class CXFA_Rectangle : public CXFA_Box {
  public:
@@ -19,9 +19,9 @@
 
   void GetFillPath(const std::vector<CXFA_Stroke*>& strokes,
                    const CFX_RectF& rtWidget,
-                   CXFA_GEPath* fillPath);
+                   CFGAS_GEPath* fillPath);
   void Draw(const std::vector<CXFA_Stroke*>& strokes,
-            CXFA_Graphics* pGS,
+            CFGAS_GEGraphics* pGS,
             CFX_RectF rtWidget,
             const CFX_Matrix& matrix);
 
@@ -37,26 +37,26 @@
                  CJX_Object* js_node);
 
   void Stroke(const std::vector<CXFA_Stroke*>& strokes,
-              CXFA_Graphics* pGS,
+              CFGAS_GEGraphics* pGS,
               CFX_RectF rtWidget,
               const CFX_Matrix& matrix);
-  void StrokeEmbossed(CXFA_Graphics* pGS,
+  void StrokeEmbossed(CFGAS_GEGraphics* pGS,
                       CFX_RectF rt,
                       float fThickness,
                       const CFX_Matrix& matrix);
-  void StrokeLowered(CXFA_Graphics* pGS,
+  void StrokeLowered(CFGAS_GEGraphics* pGS,
                      CFX_RectF rt,
                      float fThickness,
                      const CFX_Matrix& matrix);
-  void StrokeRaised(CXFA_Graphics* pGS,
+  void StrokeRaised(CFGAS_GEGraphics* pGS,
                     CFX_RectF rt,
                     float fThickness,
                     const CFX_Matrix& matrix);
-  void StrokeEtched(CXFA_Graphics* pGS,
+  void StrokeEtched(CFGAS_GEGraphics* pGS,
                     CFX_RectF rt,
                     float fThickness,
                     const CFX_Matrix& matrix);
-  void StrokeRect(CXFA_Graphics* pGraphic,
+  void StrokeRect(CFGAS_GEGraphics* pGraphic,
                   const CFX_RectF& rt,
                   float fLineWidth,
                   const CFX_Matrix& matrix,
@@ -64,7 +64,7 @@
                   FX_ARGB argbBottomRight);
   void GetPath(const std::vector<CXFA_Stroke*>& strokes,
                CFX_RectF rtWidget,
-               CXFA_GEPath& path,
+               CFGAS_GEPath& path,
                int32_t nIndex,
                bool bStart,
                bool bCorner);
diff --git a/xfa/fxfa/parser/cxfa_stipple.cpp b/xfa/fxfa/parser/cxfa_stipple.cpp
index a28e0e0..cc401cd 100644
--- a/xfa/fxfa/parser/cxfa_stipple.cpp
+++ b/xfa/fxfa/parser/cxfa_stipple.cpp
@@ -50,8 +50,8 @@
       .value_or(GetDefaultRate());
 }
 
-void CXFA_Stipple::Draw(CXFA_Graphics* pGS,
-                        CXFA_GEPath* fillPath,
+void CXFA_Stipple::Draw(CFGAS_GEGraphics* pGS,
+                        CFGAS_GEPath* fillPath,
                         const CFX_RectF& rtFill,
                         const CFX_Matrix& matrix) {
   int32_t iRate = GetRate();
@@ -67,7 +67,7 @@
   FX_ARGB cr = AlphaAndColorRefToArgb(iRate * alpha / 100, colorref);
 
   pGS->SaveGraphState();
-  pGS->SetFillColor(CXFA_GEColor(cr));
+  pGS->SetFillColor(CFGAS_GEColor(cr));
   pGS->FillPath(fillPath, CFX_FillRenderOptions::FillType::kWinding, &matrix);
   pGS->RestoreGraphState();
 }
diff --git a/xfa/fxfa/parser/cxfa_stipple.h b/xfa/fxfa/parser/cxfa_stipple.h
index 396f89f..ac6195a 100644
--- a/xfa/fxfa/parser/cxfa_stipple.h
+++ b/xfa/fxfa/parser/cxfa_stipple.h
@@ -8,11 +8,11 @@
 #define XFA_FXFA_PARSER_CXFA_STIPPLE_H_
 
 #include "core/fxcrt/fx_coordinates.h"
+#include "xfa/fgas/graphics/cfgas_gepath.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxgraphics/cxfa_gepath.h"
 
+class CFGAS_GEGraphics;
 class CXFA_Color;
-class CXFA_Graphics;
 
 class CXFA_Stipple final : public CXFA_Node {
  public:
@@ -21,8 +21,8 @@
   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CXFA_Stipple() override;
 
-  void Draw(CXFA_Graphics* pGS,
-            CXFA_GEPath* fillPath,
+  void Draw(CFGAS_GEGraphics* pGS,
+            CFGAS_GEPath* fillPath,
             const CFX_RectF& rtFill,
             const CFX_Matrix& matrix);
 
diff --git a/xfa/fxfa/parser/cxfa_stroke.cpp b/xfa/fxfa/parser/cxfa_stroke.cpp
index 0fa8a5f..1296c7c 100644
--- a/xfa/fxfa/parser/cxfa_stroke.cpp
+++ b/xfa/fxfa/parser/cxfa_stroke.cpp
@@ -9,15 +9,15 @@
 #include <utility>
 
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fgas/graphics/cfgas_gegraphics.h"
 #include "xfa/fxfa/cxfa_ffwidget.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_measurement.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 #include "xfa/fxfa/parser/xfa_utils.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
 
-void XFA_StrokeTypeSetLineDash(CXFA_Graphics* pGraphics,
+void XFA_StrokeTypeSetLineDash(CFGAS_GEGraphics* pGraphics,
                                XFA_AttributeValue iStrokeType,
                                XFA_AttributeValue iCapType) {
   switch (iStrokeType) {
@@ -167,8 +167,8 @@
   return true;
 }
 
-void CXFA_Stroke::Stroke(CXFA_GEPath* pPath,
-                         CXFA_Graphics* pGS,
+void CXFA_Stroke::Stroke(CFGAS_GEPath* pPath,
+                         CFGAS_GEGraphics* pGS,
                          const CFX_Matrix& matrix) {
   if (!IsVisible())
     return;
@@ -185,7 +185,7 @@
   pGS->EnableActOnDash();
   pGS->SetLineCap(CFX_GraphStateData::LineCapButt);
   XFA_StrokeTypeSetLineDash(pGS, GetStrokeType(), XFA_AttributeValue::Butt);
-  pGS->SetStrokeColor(CXFA_GEColor(GetColor()));
+  pGS->SetStrokeColor(CFGAS_GEColor(GetColor()));
   pGS->StrokePath(pPath, &matrix);
   pGS->RestoreGraphState();
 }
diff --git a/xfa/fxfa/parser/cxfa_stroke.h b/xfa/fxfa/parser/cxfa_stroke.h
index 078c174..193a587 100644
--- a/xfa/fxfa/parser/cxfa_stroke.h
+++ b/xfa/fxfa/parser/cxfa_stroke.h
@@ -17,11 +17,11 @@
   XFA_STROKE_SAMESTYLE_Corner = 2
 };
 
-class CXFA_GEPath;
-class CXFA_Graphics;
+class CFGAS_GEGraphics;
+class CFGAS_GEPath;
 class CXFA_Node;
 
-void XFA_StrokeTypeSetLineDash(CXFA_Graphics* pGraphics,
+void XFA_StrokeTypeSetLineDash(CFGAS_GEGraphics* pGraphics,
                                XFA_AttributeValue iStrokeType,
                                XFA_AttributeValue iCapType);
 
@@ -48,7 +48,9 @@
 
   bool SameStyles(CXFA_Stroke* stroke, uint32_t dwFlags);
 
-  void Stroke(CXFA_GEPath* pPath, CXFA_Graphics* pGS, const CFX_Matrix& matrix);
+  void Stroke(CFGAS_GEPath* pPath,
+              CFGAS_GEGraphics* pGS,
+              const CFX_Matrix& matrix);
 
  protected:
   CXFA_Stroke(CXFA_Document* pDoc,
diff --git a/xfa/fxgraphics/BUILD.gn b/xfa/fxgraphics/BUILD.gn
deleted file mode 100644
index b1b0204..0000000
--- a/xfa/fxgraphics/BUILD.gn
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2018 The PDFium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("../../pdfium.gni")
-
-assert(pdf_enable_xfa)
-
-source_set("fxgraphics") {
-  sources = [
-    "cxfa_gecolor.cpp",
-    "cxfa_gecolor.h",
-    "cxfa_gepath.cpp",
-    "cxfa_gepath.h",
-    "cxfa_gepattern.cpp",
-    "cxfa_gepattern.h",
-    "cxfa_geshading.cpp",
-    "cxfa_geshading.h",
-    "cxfa_graphics.cpp",
-    "cxfa_graphics.h",
-  ]
-  configs += [
-    "../../:pdfium_core_config",
-    "../:xfa_warnings",
-  ]
-  deps = [
-    "../../core/fxcrt",
-    "../../core/fxge",
-  ]
-  visibility = [ "../../*" ]
-}
diff --git a/xfa/fxgraphics/cxfa_gecolor.cpp b/xfa/fxgraphics/cxfa_gecolor.cpp
deleted file mode 100644
index 32dec96..0000000
--- a/xfa/fxgraphics/cxfa_gecolor.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fxgraphics/cxfa_gecolor.h"
-
-CXFA_GEColor::CXFA_GEColor(const FX_ARGB argb) : m_type(Solid), m_argb(argb) {}
-
-CXFA_GEColor::CXFA_GEColor(CXFA_GEPattern* pattern, const FX_ARGB argb)
-    : m_type(Pattern), m_argb(argb), m_pPattern(pattern) {}
-
-CXFA_GEColor::CXFA_GEColor(CXFA_GEShading* shading)
-    : m_type(Shading), m_pShading(shading) {}
-
-CXFA_GEColor::CXFA_GEColor(const CXFA_GEColor& that) = default;
-
-CXFA_GEColor::~CXFA_GEColor() = default;
-
-CXFA_GEColor& CXFA_GEColor::operator=(const CXFA_GEColor& that) = default;
diff --git a/xfa/fxgraphics/cxfa_gecolor.h b/xfa/fxgraphics/cxfa_gecolor.h
deleted file mode 100644
index 63f2a92..0000000
--- a/xfa/fxgraphics/cxfa_gecolor.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXGRAPHICS_CXFA_GECOLOR_H_
-#define XFA_FXGRAPHICS_CXFA_GECOLOR_H_
-
-#include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/fx_dib.h"
-#include "third_party/base/check.h"
-
-class CXFA_GEPattern;
-class CXFA_GEShading;
-
-class CXFA_GEColor {
- public:
-  enum Type { Invalid, Solid, Pattern, Shading };
-
-  explicit CXFA_GEColor(const FX_ARGB argb);
-  explicit CXFA_GEColor(CXFA_GEShading* shading);
-  CXFA_GEColor(CXFA_GEPattern* pattern, const FX_ARGB argb);
-  CXFA_GEColor(const CXFA_GEColor& that);
-  ~CXFA_GEColor();
-
-  Type GetType() const { return m_type; }
-  FX_ARGB GetArgb() const {
-    DCHECK(m_type == Solid || m_type == Pattern);
-    return m_argb;
-  }
-  CXFA_GEPattern* GetPattern() const {
-    DCHECK(m_type == Pattern);
-    return m_pPattern.Get();
-  }
-  CXFA_GEShading* GetShading() const {
-    DCHECK(m_type == Shading);
-    return m_pShading.Get();
-  }
-
-  CXFA_GEColor& operator=(const CXFA_GEColor& that);
-
- private:
-  Type m_type = Invalid;
-  FX_ARGB m_argb = 0;
-  UnownedPtr<CXFA_GEPattern> m_pPattern;
-  UnownedPtr<CXFA_GEShading> m_pShading;
-};
-
-#endif  // XFA_FXGRAPHICS_CXFA_GECOLOR_H_
diff --git a/xfa/fxgraphics/cxfa_gepattern.cpp b/xfa/fxgraphics/cxfa_gepattern.cpp
deleted file mode 100644
index c0668d3..0000000
--- a/xfa/fxgraphics/cxfa_gepattern.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fxgraphics/cxfa_gepattern.h"
-
-CXFA_GEPattern::CXFA_GEPattern(FX_HatchStyle hatchStyle,
-                               const FX_ARGB foreArgb,
-                               const FX_ARGB backArgb)
-    : m_hatchStyle(hatchStyle), m_foreArgb(foreArgb), m_backArgb(backArgb) {}
-
-CXFA_GEPattern::~CXFA_GEPattern() = default;
diff --git a/xfa/fxgraphics/cxfa_gepattern.h b/xfa/fxgraphics/cxfa_gepattern.h
deleted file mode 100644
index f5a3413..0000000
--- a/xfa/fxgraphics/cxfa_gepattern.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXGRAPHICS_CXFA_GEPATTERN_H_
-#define XFA_FXGRAPHICS_CXFA_GEPATTERN_H_
-
-#include "core/fxcrt/fx_coordinates.h"
-#include "core/fxcrt/fx_system.h"
-#include "xfa/fxgraphics/cxfa_graphics.h"
-
-class CFX_DIBitmap;
-class CFX_Matrix;
-
-class CXFA_GEPattern final {
- public:
-  CXFA_GEPattern(FX_HatchStyle hatchStyle,
-                 const FX_ARGB foreArgb,
-                 const FX_ARGB backArgb);
-
-  ~CXFA_GEPattern();
-
- private:
-  friend class CXFA_Graphics;
-
-  const FX_HatchStyle m_hatchStyle;
-  const FX_ARGB m_foreArgb;
-  const FX_ARGB m_backArgb;
-};
-
-#endif  // XFA_FXGRAPHICS_CXFA_GEPATTERN_H_
diff --git a/xfa/fxgraphics/cxfa_geshading.h b/xfa/fxgraphics/cxfa_geshading.h
deleted file mode 100644
index 8905a12..0000000
--- a/xfa/fxgraphics/cxfa_geshading.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXGRAPHICS_CXFA_GESHADING_H_
-#define XFA_FXGRAPHICS_CXFA_GESHADING_H_
-
-#include "core/fxcrt/fx_coordinates.h"
-#include "core/fxcrt/fx_system.h"
-#include "core/fxge/fx_dib.h"
-
-#define FX_SHADING_Steps 256
-
-enum CXFA_GEShading_Type { FX_SHADING_Axial = 1, FX_SHADING_Radial };
-
-class CXFA_GEShading final {
- public:
-  // Axial shading.
-  CXFA_GEShading(const CFX_PointF& beginPoint,
-                 const CFX_PointF& endPoint,
-                 bool isExtendedBegin,
-                 bool isExtendedEnd,
-                 const FX_ARGB beginArgb,
-                 const FX_ARGB endArgb);
-
-  // Radial shading.
-  CXFA_GEShading(const CFX_PointF& beginPoint,
-                 const CFX_PointF& endPoint,
-                 const float beginRadius,
-                 const float endRadius,
-                 bool isExtendedBegin,
-                 bool isExtendedEnd,
-                 const FX_ARGB beginArgb,
-                 const FX_ARGB endArgb);
-
-  ~CXFA_GEShading();
-
- private:
-  friend class CXFA_Graphics;
-
-  void InitArgbArray();
-
-  const CXFA_GEShading_Type m_type;
-  const CFX_PointF m_beginPoint;
-  const CFX_PointF m_endPoint;
-  const float m_beginRadius;
-  const float m_endRadius;
-  const bool m_isExtendedBegin;
-  const bool m_isExtendedEnd;
-  const FX_ARGB m_beginArgb;
-  const FX_ARGB m_endArgb;
-  FX_ARGB m_argbArray[FX_SHADING_Steps];
-};
-
-#endif  // XFA_FXGRAPHICS_CXFA_GESHADING_H_