Merge to XFA: Remove CFX_AffineMatrix/CPDF_Matrix

Review URL: https://codereview.chromium.org/1513363002 .
(cherry picked from commit f32c969bce6743fca1e7ff796b54a1692d26d7f0)

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1519693002 .
diff --git a/fpdfsdk/include/formfiller/FFL_FormFiller.h b/fpdfsdk/include/formfiller/FFL_FormFiller.h
index 989d17e..a515c40 100644
--- a/fpdfsdk/include/formfiller/FFL_FormFiller.h
+++ b/fpdfsdk/include/formfiller/FFL_FormFiller.h
@@ -26,12 +26,12 @@
   virtual void OnDraw(CPDFSDK_PageView* pPageView,
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
-                      CPDF_Matrix* pUser2Device,
+                      CFX_Matrix* pUser2Device,
                       FX_DWORD dwFlags);
   virtual void OnDrawDeactive(CPDFSDK_PageView* pPageView,
                               CPDFSDK_Annot* pAnnot,
                               CFX_RenderDevice* pDevice,
-                              CPDF_Matrix* pUser2Device,
+                              CFX_Matrix* pUser2Device,
                               FX_DWORD dwFlags);
 
   virtual void OnCreate(CPDFSDK_Annot* pAnnot);
@@ -84,7 +84,7 @@
   IFX_SystemHandler* GetSystemHandler() const override;
 
   // IPWL_Provider
-  CPDF_Matrix GetWindowMatrix(void* pAttachedData) override;
+  CFX_Matrix GetWindowMatrix(void* pAttachedData) override;
   CFX_WideString LoadPopupMenuString(int nIndex) override;
 
   virtual void GetActionData(CPDFSDK_PageView* pPageView,
@@ -103,7 +103,7 @@
   virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView,
                                    FX_BOOL bRestoreValue);
 
-  CPDF_Matrix GetCurMatrix();
+  CFX_Matrix GetCurMatrix();
 
   CPDF_Rect FFLtoPWL(const CPDF_Rect& rect);
   CPDF_Rect PWLtoFFL(const CPDF_Rect& rect);
@@ -182,12 +182,12 @@
   void OnDraw(CPDFSDK_PageView* pPageView,
               CPDFSDK_Annot* pAnnot,
               CFX_RenderDevice* pDevice,
-              CPDF_Matrix* pUser2Device,
+              CFX_Matrix* pUser2Device,
               FX_DWORD dwFlags) override;
   void OnDrawDeactive(CPDFSDK_PageView* pPageView,
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
-                      CPDF_Matrix* pUser2Device,
+                      CFX_Matrix* pUser2Device,
                       FX_DWORD dwFlags) override;
 
  protected:
diff --git a/fpdfsdk/include/formfiller/FFL_IFormFiller.h b/fpdfsdk/include/formfiller/FFL_IFormFiller.h
index dbd8b86..5f6ac5c 100644
--- a/fpdfsdk/include/formfiller/FFL_IFormFiller.h
+++ b/fpdfsdk/include/formfiller/FFL_IFormFiller.h
@@ -27,7 +27,7 @@
   virtual void OnDraw(CPDFSDK_PageView* pPageView,
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
-                      CPDF_Matrix* pUser2Device,
+                      CFX_Matrix* pUser2Device,
                       FX_DWORD dwFlags);
 
   virtual void OnCreate(CPDFSDK_Annot* pAnnot);
diff --git a/fpdfsdk/include/formfiller/FFL_PushButton.h b/fpdfsdk/include/formfiller/FFL_PushButton.h
index 1bab968..13d6085 100644
--- a/fpdfsdk/include/formfiller/FFL_PushButton.h
+++ b/fpdfsdk/include/formfiller/FFL_PushButton.h
@@ -21,7 +21,7 @@
   void OnDraw(CPDFSDK_PageView* pPageView,
               CPDFSDK_Annot* pAnnot,
               CFX_RenderDevice* pDevice,
-              CPDF_Matrix* pUser2Device,
+              CFX_Matrix* pUser2Device,
               FX_DWORD dwFlags) override;
 };
 
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_page.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_page.h
index 1a97fe4..d88ba9f 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_page.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_page.h
@@ -43,7 +43,7 @@
                     int* device_x,

                     int* device_y);

 

-  void GetDisplayMatrix(CFX_AffineMatrix& matrix,

+  void GetDisplayMatrix(CFX_Matrix& matrix,

                         int xPos,

                         int yPos,

                         int xSize,

diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index 9040f40..44d2f52 100644
--- a/fpdfsdk/include/fsdk_annothandler.h
+++ b/fpdfsdk/include/fsdk_annothandler.h
@@ -22,7 +22,7 @@
 class CPDFSDK_Annot;
 class CPDFSDK_PageView;
 class CPDF_Annot;
-class CPDF_Matrix;
+class CFX_Matrix;
 class CPDF_Point;
 class CPDF_Rect;
 
@@ -58,13 +58,13 @@
   virtual void OnDraw(CPDFSDK_PageView* pPageView,
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
-                      CPDF_Matrix* pUser2Device,
+                      CFX_Matrix* pUser2Device,
                       FX_DWORD dwFlags) = 0;
 
   virtual void OnDrawSleep(CPDFSDK_PageView* pPageView,
                            CPDFSDK_Annot* pAnnot,
                            CFX_RenderDevice* pDevice,
-                           CPDF_Matrix* pUser2Device,
+                           CFX_Matrix* pUser2Device,
                            const CPDF_Rect& rcWindow,
                            FX_DWORD dwFlags) = 0;
 
@@ -159,12 +159,12 @@
   void OnDraw(CPDFSDK_PageView* pPageView,
               CPDFSDK_Annot* pAnnot,
               CFX_RenderDevice* pDevice,
-              CPDF_Matrix* pUser2Device,
+              CFX_Matrix* pUser2Device,
               FX_DWORD dwFlags) override;
   void OnDrawSleep(CPDFSDK_PageView* pPageView,
                    CPDFSDK_Annot* pAnnot,
                    CFX_RenderDevice* pDevice,
-                   CPDF_Matrix* pUser2Device,
+                   CFX_Matrix* pUser2Device,
                    const CPDF_Rect& rcWindow,
                    FX_DWORD dwFlags) override {}
   void OnCreate(CPDFSDK_Annot* pAnnot) override;
@@ -269,13 +269,13 @@
   virtual void OnDraw(CPDFSDK_PageView* pPageView,
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
-                      CPDF_Matrix* pUser2Device,
+                      CFX_Matrix* pUser2Device,
                       FX_DWORD dwFlags);
 
   virtual void OnDrawSleep(CPDFSDK_PageView* pPageView,
                            CPDFSDK_Annot* pAnnot,
                            CFX_RenderDevice* pDevice,
-                           CPDF_Matrix* pUser2Device,
+                           CFX_Matrix* pUser2Device,
                            const CPDF_Rect& rcWindow,
                            FX_DWORD dwFlags) {}
 
@@ -378,7 +378,7 @@
   virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView,
                             CPDFSDK_Annot* pAnnot,
                             CFX_RenderDevice* pDevice,
-                            CPDF_Matrix* pUser2Device,
+                            CFX_Matrix* pUser2Device,
                             FX_DWORD dwFlags);
 
   virtual void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView,
diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h
index 59c9c79..26de7aa 100644
--- a/fpdfsdk/include/fsdk_baseannot.h
+++ b/fpdfsdk/include/fsdk_baseannot.h
@@ -22,7 +22,7 @@
 class CPDF_Annot;
 class CPDF_Page;
 class CPDF_Rect;
-class CPDF_Matrix;
+class CFX_Matrix;
 class CPDF_RenderOptions;
 class CFX_RenderDevice;
 
@@ -94,7 +94,7 @@
   virtual CPDF_Rect GetRect() const { return CPDF_Rect(); }
 
   virtual void Annot_OnDraw(CFX_RenderDevice* pDevice,
-                            CPDF_Matrix* pUser2Device,
+                            CFX_Matrix* pUser2Device,
                             CPDF_RenderOptions* pOptions) {}
 
   UnderlyingPageType* GetUnderlyingPage();
@@ -135,7 +135,7 @@
   CPDF_Rect GetRect() const override;
   CPDF_Annot* GetPDFAnnot() const override;
   void Annot_OnDraw(CFX_RenderDevice* pDevice,
-                    CPDF_Matrix* pUser2Device,
+                    CFX_Matrix* pUser2Device,
                     CPDF_RenderOptions* pOptions) override;
 
   CPDF_Dictionary* GetAnnotDict() const;
@@ -198,18 +198,18 @@
   virtual FX_BOOL IsAppearanceValid();
   virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
   virtual void DrawAppearance(CFX_RenderDevice* pDevice,
-                              const CPDF_Matrix* pUser2Device,
+                              const CFX_Matrix* pUser2Device,
                               CPDF_Annot::AppearanceMode mode,
                               const CPDF_RenderOptions* pOptions);
   void DrawBorder(CFX_RenderDevice* pDevice,
-                  const CPDF_Matrix* pUser2Device,
+                  const CFX_Matrix* pUser2Device,
                   const CPDF_RenderOptions* pOptions);
 
   void ClearCachedAP();
 
   void WriteAppearance(const CFX_ByteString& sAPType,
                        const CPDF_Rect& rcBBox,
-                       const CPDF_Matrix& matrix,
+                       const CFX_Matrix& matrix,
                        const CFX_ByteString& sContents,
                        const CFX_ByteString& sAPState = "");
 
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h
index cc21a10..0ee99ce 100644
--- a/fpdfsdk/include/fsdk_baseform.h
+++ b/fpdfsdk/include/fsdk_baseform.h
@@ -191,7 +191,7 @@
 
   CFX_ByteString GetBackgroundAppStream() const;
   CFX_ByteString GetBorderAppStream() const;
-  CPDF_Matrix GetMatrix() const;
+  CFX_Matrix GetMatrix() const;
 
   CPWL_Color GetTextPWLColor() const;
   CPWL_Color GetBorderPWLColor() const;
@@ -203,7 +203,7 @@
  public:
   FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode);
   void DrawAppearance(CFX_RenderDevice* pDevice,
-                      const CPDF_Matrix* pUser2Device,
+                      const CFX_Matrix* pUser2Device,
                       CPDF_Annot::AppearanceMode mode,
                       const CPDF_RenderOptions* pOptions) override;
 
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 385cfdb..d0da678 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -567,12 +567,12 @@
 
 #ifdef PDF_ENABLE_XFA
   void PageView_OnDraw(CFX_RenderDevice* pDevice,
-                       CPDF_Matrix* pUser2Device,
+                       CFX_Matrix* pUser2Device,
                        CPDF_RenderOptions* pOptions,
                        const FX_RECT& pClip);
 #else   // PDF_ENABLE_XFA
   void PageView_OnDraw(CFX_RenderDevice* pDevice,
-                       CPDF_Matrix* pUser2Device,
+                       CFX_Matrix* pUser2Device,
                        CPDF_RenderOptions* pOptions);
 #endif  // PDF_ENABLE_XFA
 
@@ -626,7 +626,7 @@
                        const CPDF_Point& point,
                        int nFlag);
   bool IsValidAnnot(const CPDF_Annot* p) const;
-  void GetCurrentMatrix(CPDF_Matrix& matrix) { matrix = m_curMatrix; }
+  void GetCurrentMatrix(CFX_Matrix& matrix) { matrix = m_curMatrix; }
   void UpdateRects(CFX_RectArray& rects);
   void UpdateView(CPDFSDK_Annot* pAnnot);
   const std::vector<CPDFSDK_Annot*>& GetAnnotList() const {
@@ -647,7 +647,7 @@
   void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice,
                                       CPDFSDK_Widget* pWidget);
 
-  CPDF_Matrix m_curMatrix;
+  CFX_Matrix m_curMatrix;
   UnderlyingPageType* m_page;
   nonstd::unique_ptr<CPDF_AnnotList> m_pAnnotList;
   std::vector<CPDFSDK_Annot*> m_fxAnnotArray;
diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h
index d4788cd..a8f5bba 100644
--- a/fpdfsdk/include/fxedit/fx_edit.h
+++ b/fpdfsdk/include/fxedit/fx_edit.h
@@ -13,7 +13,7 @@
 
 class CFX_RenderDevice;
 class CPDF_Font;
-class CPDF_Matrix;
+class CFX_Matrix;
 class CPDF_PageObjects;
 class CPDF_Point;
 class CPDF_TextObject;
@@ -435,7 +435,7 @@
       const CPDF_Point& ptOffset,
       const CPVT_WordRange* pRange = NULL);
   static void DrawEdit(CFX_RenderDevice* pDevice,
-                       CPDF_Matrix* pUser2Device,
+                       CFX_Matrix* pUser2Device,
                        IFX_Edit* pEdit,
                        FX_COLORREF crTextFill,
                        FX_COLORREF crTextStroke,
@@ -445,14 +445,14 @@
                        IFX_SystemHandler* pSystemHandler,
                        void* pFFLData);
   static void DrawUnderline(CFX_RenderDevice* pDevice,
-                            CPDF_Matrix* pUser2Device,
+                            CFX_Matrix* pUser2Device,
                             IFX_Edit* pEdit,
                             FX_COLORREF color,
                             const CPDF_Rect& rcClip,
                             const CPDF_Point& ptOffset,
                             const CPVT_WordRange* pRange);
   static void DrawRichEdit(CFX_RenderDevice* pDevice,
-                           CPDF_Matrix* pUser2Device,
+                           CFX_Matrix* pUser2Device,
                            IFX_Edit* pEdit,
                            const CPDF_Rect& rcClip,
                            const CPDF_Point& ptOffset,
diff --git a/fpdfsdk/include/pdfwindow/PWL_Caret.h b/fpdfsdk/include/pdfwindow/PWL_Caret.h
index 0fe4e89..c2a2caf 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Caret.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Caret.h
@@ -27,7 +27,7 @@
   CFX_ByteString GetClassName() const override;
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   void InvalidateRect(CPDF_Rect* pRect = NULL) override;
   void SetVisible(FX_BOOL bVisible) override {}
   void TimerProc() override;
diff --git a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
index 9edb02c..9860483 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
@@ -39,7 +39,7 @@
   // CPWL_Wnd
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override;
   FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override;
 };
diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h
index 72e60a7..1912a63 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h
@@ -56,7 +56,7 @@
   CPDF_Rect GetClientRect() const override;
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override;
   FX_BOOL OnLButtonDblClk(const CPDF_Point& point, FX_DWORD nFlag) override;
   FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override;
diff --git a/fpdfsdk/include/pdfwindow/PWL_Icon.h b/fpdfsdk/include/pdfwindow/PWL_Icon.h
index 8c60c7b..0d2596f 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Icon.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Icon.h
@@ -24,7 +24,7 @@
  public:
   void SetPDFStream(CPDF_Stream* pStream);
   void GetImageSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight);
-  CPDF_Matrix GetImageMatrix();
+  CFX_Matrix GetImageMatrix();
   CFX_ByteString GetImageAlias();
   void SetImageAlias(const FX_CHAR* sImageAlias);
 
diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h
index c25f3b1..0a21bbe 100644
--- a/fpdfsdk/include/pdfwindow/PWL_IconList.h
+++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h
@@ -43,7 +43,7 @@
   void RePosChildWnd() override;
   FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   void OnEnabled() override;
   void OnDisabled() override;
 
diff --git a/fpdfsdk/include/pdfwindow/PWL_Label.h b/fpdfsdk/include/pdfwindow/PWL_Label.h
index 0504bb3..aba84fb 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Label.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Label.h
@@ -32,7 +32,7 @@
   FX_FLOAT GetFontSize() const override;
   void OnCreated() override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void RePosChildWnd() override;
 
diff --git a/fpdfsdk/include/pdfwindow/PWL_ListBox.h b/fpdfsdk/include/pdfwindow/PWL_ListBox.h
index 9d5827c..807f11e 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ListBox.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ListBox.h
@@ -59,7 +59,7 @@
   void OnDestroy() override;
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override;
   FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override;
   FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override;
diff --git a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
index dbaffc5..4c96d43 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
@@ -33,7 +33,7 @@
   // CPWL_Wnd
   void RePosChildWnd() override;
   void DrawChildAppearance(CFX_RenderDevice* pDevice,
-                           CPDF_Matrix* pUser2Device) override;
+                           CFX_Matrix* pUser2Device) override;
 
  private:
   void ResetAll(FX_BOOL bMove, int32_t nStart);
diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h
index b25d989..0edb1e3 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Note.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Note.h
@@ -89,7 +89,7 @@
  protected:
   // CPWL_Wnd
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
 
  private:
   int32_t m_nType;
@@ -103,7 +103,7 @@
  protected:
   // CPWL_Button
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override;
   FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override;
 
@@ -119,7 +119,7 @@
  protected:
   // CPWL_Wnd
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
 };
 
 class CPWL_Note_RBBox : public CPWL_Wnd {
@@ -130,7 +130,7 @@
  protected:
   // CPWL_Wnd
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
 };
 
 class CPWL_Note_Edit : public CPWL_Edit {
@@ -173,7 +173,7 @@
   void RePosChildWnd() override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   void SetTextColor(const CPWL_Color& color) override;
 
  private:
diff --git a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
index b91d467..891079e 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
@@ -42,7 +42,7 @@
   void OnCreate(PWL_CREATEPARAM& cp) override;
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override;
   FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override;
   FX_BOOL OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) override;
@@ -100,7 +100,7 @@
   void RePosChildWnd() override;
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override;
   FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override;
   void OnNotify(CPWL_Wnd* pWnd,
diff --git a/fpdfsdk/include/pdfwindow/PWL_Signature.h b/fpdfsdk/include/pdfwindow/PWL_Signature.h
index 009dd87..0dbd906 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Signature.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Signature.h
@@ -24,7 +24,7 @@
  protected:
   // CPWL_Image
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) override;
 
@@ -51,7 +51,7 @@
   void RePosChildWnd() override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                          CPDF_Matrix* pUser2Device) override;
+                          CFX_Matrix* pUser2Device) override;
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
 
  private:
diff --git a/fpdfsdk/include/pdfwindow/PWL_Utils.h b/fpdfsdk/include/pdfwindow/PWL_Utils.h
index 9658341..56f7a27 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Utils.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Utils.h
@@ -193,27 +193,27 @@
   static CFX_ByteString GetDropButtonAppStream(const CPDF_Rect& rcBBox);
 
   static void DrawFillRect(CFX_RenderDevice* pDevice,
-                           CPDF_Matrix* pUser2Device,
+                           CFX_Matrix* pUser2Device,
                            const CPDF_Rect& rect,
                            const CPWL_Color& color,
                            int32_t nTransparancy);
   static void DrawFillRect(CFX_RenderDevice* pDevice,
-                           CPDF_Matrix* pUser2Device,
+                           CFX_Matrix* pUser2Device,
                            const CPDF_Rect& rect,
                            const FX_COLORREF& color);
   static void DrawStrokeRect(CFX_RenderDevice* pDevice,
-                             CPDF_Matrix* pUser2Device,
+                             CFX_Matrix* pUser2Device,
                              const CPDF_Rect& rect,
                              const FX_COLORREF& color,
                              FX_FLOAT fWidth);
   static void DrawStrokeLine(CFX_RenderDevice* pDevice,
-                             CPDF_Matrix* pUser2Device,
+                             CFX_Matrix* pUser2Device,
                              const CPDF_Point& ptMoveTo,
                              const CPDF_Point& ptLineTo,
                              const FX_COLORREF& color,
                              FX_FLOAT fWidth);
   static void DrawBorder(CFX_RenderDevice* pDevice,
-                         CPDF_Matrix* pUser2Device,
+                         CFX_Matrix* pUser2Device,
                          const CPDF_Rect& rect,
                          FX_FLOAT fWidth,
                          const CPWL_Color& color,
@@ -223,12 +223,12 @@
                          const CPWL_Dash& dash,
                          int32_t nTransparancy);
   static void DrawFillArea(CFX_RenderDevice* pDevice,
-                           CPDF_Matrix* pUser2Device,
+                           CFX_Matrix* pUser2Device,
                            const CPDF_Point* pPts,
                            int32_t nCount,
                            const FX_COLORREF& color);
   static void DrawShadow(CFX_RenderDevice* pDevice,
-                         CPDF_Matrix* pUser2Device,
+                         CFX_Matrix* pUser2Device,
                          FX_BOOL bVertical,
                          FX_BOOL bHorizontal,
                          CPDF_Rect rect,
@@ -236,7 +236,7 @@
                          int32_t nStartGray,
                          int32_t nEndGray);
   static void DrawEditSpellCheck(CFX_RenderDevice* pDevice,
-                                 CPDF_Matrix* pUser2Device,
+                                 CFX_Matrix* pUser2Device,
                                  IFX_Edit* pEdit,
                                  const CPDF_Rect& rcClip,
                                  const CPDF_Point& ptOffset,
@@ -292,7 +292,7 @@
       const CPWL_Color& crFill,
       const CPWL_Color& crStroke = PWL_DEFAULT_BLACKCOLOR);
   static void DrawIconAppStream(CFX_RenderDevice* pDevice,
-                                CPDF_Matrix* pUser2Device,
+                                CFX_Matrix* pUser2Device,
                                 int32_t nType,
                                 const CPDF_Rect& rect,
                                 const CPWL_Color& crFill,
diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
index 37ddefb..91baafa 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
@@ -179,7 +179,7 @@
   virtual ~IPWL_Provider() {}
 
   // get a matrix which map user space to CWnd client space
-  virtual CPDF_Matrix GetWindowMatrix(void* pAttachedData) = 0;
+  virtual CFX_Matrix GetWindowMatrix(void* pAttachedData) = 0;
 
   /*
   0 L"&Undo\tCtrl+Z"
@@ -247,7 +247,7 @@
   CPWL_Wnd* pParentWnd;               // ignore
   CPWL_MsgControl* pMsgControl;       // ignore
   int32_t eCursorType;                // ignore
-  CPDF_Matrix mtChild;                // ignore
+  CFX_Matrix mtChild;                 // ignore
 };
 
 class CPWL_Timer {
@@ -293,7 +293,7 @@
   virtual void InvalidateRect(CPDF_Rect* pRect = NULL);
 
   void GetAppearanceStream(CFX_ByteString& sAppStream);
-  void DrawAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+  void DrawAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device);
 
   virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
   virtual FX_BOOL OnKeyUp(FX_WORD nChar, FX_DWORD nFlag);
@@ -378,10 +378,10 @@
   int32_t GetTransparency();
   void SetTransparency(int32_t nTransparency);
 
-  CPDF_Matrix GetChildToRoot() const;
-  CPDF_Matrix GetChildMatrix() const;
-  void SetChildMatrix(const CPDF_Matrix& mt);
-  CPDF_Matrix GetWindowMatrix() const;
+  CFX_Matrix GetChildToRoot() const;
+  CFX_Matrix GetChildMatrix() const;
+  void SetChildMatrix(const CFX_Matrix& mt);
+  CFX_Matrix GetWindowMatrix() const;
 
   virtual CPDF_Point ChildToParent(const CPDF_Point& point) const;
   virtual CPDF_Rect ChildToParent(const CPDF_Rect& rect) const;
@@ -408,9 +408,9 @@
   virtual void GetChildAppearanceStream(CFX_ByteTextBuf& sAppStream);
 
   virtual void DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                  CPDF_Matrix* pUser2Device);
+                                  CFX_Matrix* pUser2Device);
   virtual void DrawChildAppearance(CFX_RenderDevice* pDevice,
-                                   CPDF_Matrix* pUser2Device);
+                                   CFX_Matrix* pUser2Device);
 
   virtual void OnCreate(PWL_CREATEPARAM& cp);
   virtual void OnCreated();
diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
index 6989ed8..8b030a5 100644
--- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
@@ -73,12 +73,12 @@
 void CFFL_FormFiller::OnDraw(CPDFSDK_PageView* pPageView,
                              CPDFSDK_Annot* pAnnot,
                              CFX_RenderDevice* pDevice,
-                             CPDF_Matrix* pUser2Device,
+                             CFX_Matrix* pUser2Device,
                              FX_DWORD dwFlags) {
   ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
 
   if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
-    CPDF_Matrix mt = GetCurMatrix();
+    CFX_Matrix mt = GetCurMatrix();
     mt.Concat(*pUser2Device);
     pWnd->DrawAppearance(pDevice, &mt);
   } else {
@@ -91,7 +91,7 @@
 void CFFL_FormFiller::OnDrawDeactive(CPDFSDK_PageView* pPageView,
                                      CPDFSDK_Annot* pAnnot,
                                      CFX_RenderDevice* pDevice,
-                                     CPDF_Matrix* pUser2Device,
+                                     CFX_Matrix* pUser2Device,
                                      FX_DWORD dwFlags) {
   CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
   pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
@@ -398,22 +398,22 @@
   m_Maps.erase(it);
 }
 
-CPDF_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData) {
+CFX_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData) {
   if (CFFL_PrivateData* pPrivateData = (CFFL_PrivateData*)pAttachedData) {
     if (pPrivateData->pPageView) {
-      CPDF_Matrix mtPageView;
+      CFX_Matrix mtPageView;
       pPrivateData->pPageView->GetCurrentMatrix(mtPageView);
-      CPDF_Matrix mt = GetCurMatrix();
+      CFX_Matrix mt = GetCurMatrix();
       mt.Concat(mtPageView);
 
       return mt;
     }
   }
-  return CPDF_Matrix(1, 0, 0, 1, 0, 0);
+  return CFX_Matrix(1, 0, 0, 1, 0, 0);
 }
 
-CPDF_Matrix CFFL_FormFiller::GetCurMatrix() {
-  CPDF_Matrix mt;
+CFX_Matrix CFFL_FormFiller::GetCurMatrix() {
+  CFX_Matrix mt;
 
   ASSERT(m_pWidget != NULL);
 
@@ -423,17 +423,17 @@
   switch (m_pWidget->GetRotate()) {
     default:
     case 0:
-      mt = CPDF_Matrix(1, 0, 0, 1, 0, 0);
+      mt = CFX_Matrix(1, 0, 0, 1, 0, 0);
       break;
     case 90:
-      mt = CPDF_Matrix(0, 1, -1, 0, rcDA.right - rcDA.left, 0);
+      mt = CFX_Matrix(0, 1, -1, 0, rcDA.right - rcDA.left, 0);
       break;
     case 180:
-      mt = CPDF_Matrix(-1, 0, 0, -1, rcDA.right - rcDA.left,
-                       rcDA.top - rcDA.bottom);
+      mt = CFX_Matrix(-1, 0, 0, -1, rcDA.right - rcDA.left,
+                      rcDA.top - rcDA.bottom);
       break;
     case 270:
-      mt = CPDF_Matrix(0, -1, 1, 0, 0, rcDA.top - rcDA.bottom);
+      mt = CFX_Matrix(0, -1, 1, 0, 0, rcDA.top - rcDA.bottom);
       break;
   }
   mt.e += rcDA.left;
@@ -477,7 +477,7 @@
 }
 
 CPDF_Rect CFFL_FormFiller::FFLtoPWL(const CPDF_Rect& rect) {
-  CPDF_Matrix mt;
+  CFX_Matrix mt;
   mt.SetReverse(GetCurMatrix());
 
   CPDF_Rect temp = rect;
@@ -487,7 +487,7 @@
 }
 
 CPDF_Rect CFFL_FormFiller::PWLtoFFL(const CPDF_Rect& rect) {
-  CPDF_Matrix mt = GetCurMatrix();
+  CFX_Matrix mt = GetCurMatrix();
 
   CPDF_Rect temp = rect;
   mt.TransformRect(temp);
@@ -496,7 +496,7 @@
 }
 
 CPDF_Point CFFL_FormFiller::FFLtoPWL(const CPDF_Point& point) {
-  CPDF_Matrix mt;
+  CFX_Matrix mt;
   mt.SetReverse(GetCurMatrix());
 
   CPDF_Point pt = point;
@@ -506,7 +506,7 @@
 }
 
 CPDF_Point CFFL_FormFiller::PWLtoFFL(const CPDF_Point& point) {
-  CPDF_Matrix mt = GetCurMatrix();
+  CFX_Matrix mt = GetCurMatrix();
 
   CPDF_Point pt = point;
   mt.Transform(pt.x, pt.y);
@@ -689,7 +689,7 @@
 void CFFL_Button::OnDraw(CPDFSDK_PageView* pPageView,
                          CPDFSDK_Annot* pAnnot,
                          CFX_RenderDevice* pDevice,
-                         CPDF_Matrix* pUser2Device,
+                         CFX_Matrix* pUser2Device,
                          FX_DWORD dwFlags) {
   ASSERT(pPageView != NULL);
   CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
@@ -720,7 +720,7 @@
 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView,
                                  CPDFSDK_Annot* pAnnot,
                                  CFX_RenderDevice* pDevice,
-                                 CPDF_Matrix* pUser2Device,
+                                 CFX_Matrix* pUser2Device,
                                  FX_DWORD dwFlags) {
   OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
 }
diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
index a41fa40..352097d 100644
--- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
@@ -57,7 +57,7 @@
 void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
                               /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
                               CFX_RenderDevice* pDevice,
-                              CPDF_Matrix* pUser2Device,
+                              CFX_Matrix* pUser2Device,
                               /*const CRect& rcWindow,*/ FX_DWORD dwFlags) {
   ASSERT(pPageView != NULL);
   CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
diff --git a/fpdfsdk/src/formfiller/FFL_PushButton.cpp b/fpdfsdk/src/formfiller/FFL_PushButton.cpp
index 66ae68b..fbf782e 100644
--- a/fpdfsdk/src/formfiller/FFL_PushButton.cpp
+++ b/fpdfsdk/src/formfiller/FFL_PushButton.cpp
@@ -34,7 +34,7 @@
 void CFFL_PushButton::OnDraw(CPDFSDK_PageView* pPageView,
                              CPDFSDK_Annot* pAnnot,
                              CFX_RenderDevice* pDevice,
-                             CPDF_Matrix* pUser2Device,
+                             CFX_Matrix* pUser2Device,
                              FX_DWORD dwFlags) {
   CFFL_Button::OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
 }
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index 3943e9d..76ffec3 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -252,11 +252,11 @@
   }
 }
 
-CFX_AffineMatrix GetMatrix(CPDF_Rect rcAnnot,
-                           CPDF_Rect rcStream,
-                           CFX_AffineMatrix matrix) {
+CFX_Matrix GetMatrix(CPDF_Rect rcAnnot,
+                     CPDF_Rect rcStream,
+                     const CFX_Matrix& matrix) {
   if (rcStream.IsEmpty())
-    return CFX_AffineMatrix();
+    return CFX_Matrix();
 
   matrix.TransformRect(rcStream);
   rcStream.Normalize();
@@ -266,7 +266,7 @@
 
   FX_FLOAT e = rcAnnot.left - rcStream.left * a;
   FX_FLOAT f = rcAnnot.bottom - rcStream.bottom * d;
-  return CFX_AffineMatrix(a, 0, 0, d, e, f);
+  return CFX_Matrix(a, 0, 0, d, e, f);
 }
 
 void GetOffset(FX_FLOAT& fa,
@@ -275,7 +275,7 @@
                FX_FLOAT& ff,
                CPDF_Rect rcAnnot,
                CPDF_Rect rcStream,
-               CFX_AffineMatrix matrix) {
+               const CFX_Matrix& matrix) {
   FX_FLOAT fStreamWidth = 0.0f;
   FX_FLOAT fStreamHeight = 0.0f;
 
@@ -458,7 +458,7 @@
       continue;
 
     CPDF_Dictionary* pAPDic = pAPStream->GetDict();
-    CFX_AffineMatrix matrix = pAPDic->GetMatrix("Matrix");
+    CFX_Matrix matrix = pAPDic->GetMatrix("Matrix");
 
     CPDF_Rect rcStream;
     if (pAPDic->KeyExist("Rect"))
@@ -506,7 +506,7 @@
       matrix.f = 0.0f;
     }
 
-    CFX_AffineMatrix m = GetMatrix(rcAnnot, rcStream, matrix);
+    CFX_Matrix m = GetMatrix(rcAnnot, rcStream, matrix);
     sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f,
                  sFormName.c_str());
     sStream += sTemp;
diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp
index 50a3a32..05be360 100644
--- a/fpdfsdk/src/fpdf_transformpage.cpp
+++ b/fpdfsdk/src/fpdf_transformpage.cpp
@@ -175,8 +175,8 @@
         else
           continue;
 
-        CFX_AffineMatrix m = pDict->GetMatrix(FX_BSTRC("Matrix"));
-        CFX_AffineMatrix t = *(CFX_AffineMatrix*)matrix;
+        CFX_Matrix m = pDict->GetMatrix(FX_BSTRC("Matrix"));
+        CFX_Matrix t = *(CFX_Matrix*)matrix;
         m.Concat(t);
         pDict->SetAtMatrix(FX_BSTRC("Matrix"), m);
       }
@@ -197,8 +197,8 @@
   CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object;
   if (pPageObj == NULL)
     return;
-  CFX_AffineMatrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
-                          (FX_FLOAT)e, (FX_FLOAT)f);
+  CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
+                    (FX_FLOAT)e, (FX_FLOAT)f);
 
   // Special treatment to shading object, because the ClipPath for shading
   // object is already transformed.
diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp
index aff74d1..a1d5440 100644
--- a/fpdfsdk/src/fpdfeditpage.cpp
+++ b/fpdfsdk/src/fpdfeditpage.cpp
@@ -259,8 +259,8 @@
   if (!pPageObj)
     return;
 
-  CFX_AffineMatrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
-                          (FX_FLOAT)e, (FX_FLOAT)f);
+  CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
+                    (FX_FLOAT)e, (FX_FLOAT)f);
   pPageObj->Transform(matrix);
 }
 DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
@@ -279,8 +279,8 @@
     // transformAnnots Rectangle
     CPDF_Rect rect;
     pAnnot->GetRect(rect);
-    CFX_AffineMatrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
-                            (FX_FLOAT)e, (FX_FLOAT)f);
+    CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
+                      (FX_FLOAT)e, (FX_FLOAT)f);
     rect.Transform(&matrix);
     CPDF_Array* pRectArray = NULL;
     pRectArray = pAnnot->GetAnnotDict()->GetArray("Rect");
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 3f826eb..966d404 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -334,7 +334,7 @@
     return;
 #endif  // PDF_ENABLE_XFA
 
-  CFX_AffineMatrix matrix;
+  CFX_Matrix matrix;
   pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate);
 
   FX_RECT clip;
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 3591539..9e481a2 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -770,10 +770,10 @@
   pPage->DeviceToPage(start_x, start_y, size_x, size_y, rotate, device_x,
                       device_y, page_x, page_y);
 #else   // PDF_ENABLE_XFA
-  CPDF_Matrix page2device;
+  CFX_Matrix page2device;
   pPage->GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y,
                           rotate);
-  CPDF_Matrix device2page;
+  CFX_Matrix device2page;
   device2page.SetReverse(page2device);
   FX_FLOAT page_x_f, page_y_f;
   device2page.Transform((FX_FLOAT)(device_x), (FX_FLOAT)(device_y), page_x_f,
@@ -802,7 +802,7 @@
   pPage->PageToDevice(start_x, start_y, size_x, size_y, rotate, page_x, page_y,
                       device_x, device_y);
 #else   // PDF_ENABLE_XFA
-  CPDF_Matrix page2device;
+  CFX_Matrix page2device;
   pPage->GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y,
                           rotate);
   FX_FLOAT device_x_f, device_y_f;
@@ -945,7 +945,7 @@
   pContext->m_pOptions->m_pOCContext =
       new CPDF_OCContext(pPage->m_pDocument, usage);
 
-  CFX_AffineMatrix matrix;
+  CFX_Matrix matrix;
   pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate);
 
   FX_RECT clip;
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp
index 8b0db71..f78eb9b 100644
--- a/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp
+++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp
@@ -185,8 +185,8 @@
   if (!m_pPDFPage && !m_pXFAPageView)

     return;

 

-  CPDF_Matrix page2device;

-  CPDF_Matrix device2page;

+  CFX_Matrix page2device;

+  CFX_Matrix device2page;

   FX_FLOAT page_x_f, page_y_f;

 

   GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y, rotate);

@@ -211,7 +211,7 @@
   if (!m_pPDFPage && !m_pXFAPageView)

     return;

 

-  CPDF_Matrix page2device;

+  CFX_Matrix page2device;

   FX_FLOAT device_x_f, device_y_f;

 

   GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y, rotate);

@@ -223,7 +223,7 @@
   *device_y = FXSYS_round(device_y_f);

 }

 

-void CPDFXFA_Page::GetDisplayMatrix(CFX_AffineMatrix& matrix,

+void CPDFXFA_Page::GetDisplayMatrix(CFX_Matrix& matrix,

                                     int xPos,

                                     int yPos,

                                     int xSize,

diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp
index d66de82..ae6b5f2 100644
--- a/fpdfsdk/src/fsdk_annothandler.cpp
+++ b/fpdfsdk/src/fsdk_annothandler.cpp
@@ -143,7 +143,7 @@
 void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView,
                                            CPDFSDK_Annot* pAnnot,
                                            CFX_RenderDevice* pDevice,
-                                           CPDF_Matrix* pUser2Device,
+                                           CFX_Matrix* pUser2Device,
                                            FX_DWORD dwFlags) {
   ASSERT(pAnnot);
 
@@ -467,7 +467,7 @@
 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
                                     CPDFSDK_Annot* pAnnot,
                                     CFX_RenderDevice* pDevice,
-                                    CPDF_Matrix* pUser2Device,
+                                    CFX_Matrix* pUser2Device,
                                     FX_DWORD dwFlags) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
@@ -774,7 +774,7 @@
 void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
                                      CPDFSDK_Annot* pAnnot,
                                      CFX_RenderDevice* pDevice,
-                                     CPDF_Matrix* pUser2Device,
+                                     CFX_Matrix* pUser2Device,
                                      FX_DWORD dwFlags) {
   ASSERT(pPageView != NULL);
   ASSERT(pAnnot != NULL);
diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp
index c2036a5..82bbeb1 100644
--- a/fpdfsdk/src/fsdk_baseannot.cpp
+++ b/fpdfsdk/src/fsdk_baseannot.cpp
@@ -564,7 +564,7 @@
 }
 
 void CPDFSDK_BAAnnot::DrawAppearance(CFX_RenderDevice* pDevice,
-                                     const CPDF_Matrix* pUser2Device,
+                                     const CFX_Matrix* pUser2Device,
                                      CPDF_Annot::AppearanceMode mode,
                                      const CPDF_RenderOptions* pOptions) {
   ASSERT(m_pPageView != NULL);
@@ -601,7 +601,7 @@
 }
 
 void CPDFSDK_BAAnnot::DrawBorder(CFX_RenderDevice* pDevice,
-                                 const CPDF_Matrix* pUser2Device,
+                                 const CFX_Matrix* pUser2Device,
                                  const CPDF_RenderOptions* pOptions) {
   ASSERT(m_pAnnot != NULL);
   m_pAnnot->DrawBorder(pDevice, pUser2Device, pOptions);
@@ -849,7 +849,7 @@
 
 void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType,
                                       const CPDF_Rect& rcBBox,
-                                      const CPDF_Matrix& matrix,
+                                      const CFX_Matrix& matrix,
                                       const CFX_ByteString& sContents,
                                       const CFX_ByteString& sAPState) {
   CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP");
@@ -977,7 +977,7 @@
 #endif  // PDF_ENABLE_XFA
 
 void CPDFSDK_BAAnnot::Annot_OnDraw(CFX_RenderDevice* pDevice,
-                                   CPDF_Matrix* pUser2Device,
+                                   CFX_Matrix* pUser2Device,
                                    CPDF_RenderOptions* pOptions) {
   m_pAnnot->GetAPForm(m_pPageView->GetPDFPage(), CPDF_Annot::Normal);
   m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device,
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index c86bbc8..be20ab4 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -840,7 +840,7 @@
 }
 
 void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice,
-                                    const CPDF_Matrix* pUser2Device,
+                                    const CFX_Matrix* pUser2Device,
                                     CPDF_Annot::AppearanceMode mode,
                                     const CPDF_RenderOptions* pOptions) {
   int nFieldType = GetFieldType();
@@ -889,7 +889,7 @@
     CPDFDoc_Environment* pEnv = m_pInterForm->GetDocument()->GetEnv();
     if (!pEnv)
       return;
-    CFX_AffineMatrix page2device;
+    CFX_Matrix page2device;
     pPageView->GetCurrentMatrix(page2device);
     page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc.bottom),
                           rcDevice.left, rcDevice.bottom);
@@ -1831,8 +1831,8 @@
                                         dsBorder);
 }
 
-CPDF_Matrix CPDFSDK_Widget::GetMatrix() const {
-  CPDF_Matrix mt;
+CFX_Matrix CPDFSDK_Widget::GetMatrix() const {
+  CFX_Matrix mt;
   CPDF_FormControl* pControl = GetFormControl();
   ASSERT(pControl != NULL);
 
@@ -1843,16 +1843,16 @@
   switch (abs(pControl->GetRotation() % 360)) {
     case 0:
     default:
-      mt = CPDF_Matrix(1, 0, 0, 1, 0, 0);
+      mt = CFX_Matrix(1, 0, 0, 1, 0, 0);
       break;
     case 90:
-      mt = CPDF_Matrix(0, 1, -1, 0, fWidth, 0);
+      mt = CFX_Matrix(0, 1, -1, 0, fWidth, 0);
       break;
     case 180:
-      mt = CPDF_Matrix(-1, 0, 0, -1, fWidth, fHeight);
+      mt = CFX_Matrix(-1, 0, 0, -1, fWidth, fHeight);
       break;
     case 270:
-      mt = CPDF_Matrix(0, -1, 1, 0, 0, fHeight);
+      mt = CFX_Matrix(0, -1, 1, 0, 0, fHeight);
       break;
   }
 
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 4d2dbc1..62a37e3 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -102,9 +102,9 @@
   UnderlyingPageType* pPage = pSDKAnnot->GetUnderlyingPage();
   if (!pPage || !pPageView)
     return;
-  CPDF_Matrix page2device;
+  CFX_Matrix page2device;
   pPageView->GetCurrentMatrix(page2device);
-  CPDF_Matrix device2page;
+  CFX_Matrix device2page;
   device2page.SetReverse(page2device);
   FX_FLOAT left, top, right, bottom;
   device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top);
@@ -657,7 +657,7 @@
 }
 
 void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
-                                       CPDF_Matrix* pUser2Device,
+                                       CFX_Matrix* pUser2Device,
 #ifdef PDF_ENABLE_XFA
                                        CPDF_RenderOptions* pOptions,
                                        const FX_RECT& pClip) {
diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
index 88f97da..fefa42b 100644
--- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
+++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
@@ -29,7 +29,7 @@
                            const CPDF_Point& pt,
                            CPDF_Font* pFont,
                            FX_FLOAT fFontSize,
-                           CPDF_Matrix* pUser2Device,
+                           CFX_Matrix* pUser2Device,
                            const CFX_ByteString& str,
                            FX_ARGB crTextFill,
                            FX_ARGB crTextStroke,
@@ -39,7 +39,7 @@
 
   if (pFont) {
     if (nHorzScale != 100) {
-      CPDF_Matrix mt(nHorzScale / 100.0f, 0, 0, 1, 0, 0);
+      CFX_Matrix mt(nHorzScale / 100.0f, 0, 0, 1, 0, 0);
       mt.Concat(*pUser2Device);
 
       CPDF_RenderOptions ro;
@@ -85,7 +85,7 @@
 }
 
 void IFX_Edit::DrawUnderline(CFX_RenderDevice* pDevice,
-                             CPDF_Matrix* pUser2Device,
+                             CFX_Matrix* pUser2Device,
                              IFX_Edit* pEdit,
                              FX_COLORREF color,
                              const CPDF_Rect& rcClip,
@@ -138,7 +138,7 @@
 }
 
 void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice,
-                        CPDF_Matrix* pUser2Device,
+                        CFX_Matrix* pUser2Device,
                         IFX_Edit* pEdit,
                         FX_COLORREF crTextFill,
                         FX_COLORREF crTextStroke,
@@ -277,7 +277,7 @@
 }
 
 void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice,
-                            CPDF_Matrix* pUser2Device,
+                            CFX_Matrix* pUser2Device,
                             IFX_Edit* pEdit,
                             const CPDF_Rect& rcClip,
                             const CPDF_Point& ptOffset,
diff --git a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
index adb296d..d129c2c 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
@@ -33,7 +33,7 @@
 }
 
 void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                    CPDF_Matrix* pUser2Device) {
+                                    CFX_Matrix* pUser2Device) {
   if (IsVisible() && m_bFlash) {
     CPDF_Rect rcRect = GetCaretRect();
     CPDF_Rect rcClip = GetClipRect();
diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
index 395f764..71994ea 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
@@ -143,7 +143,7 @@
 }
 
 void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                       CPDF_Matrix* pUser2Device) {
+                                       CFX_Matrix* pUser2Device) {
   CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
 
   CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect();
diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
index 29e7c2e..6d32b72 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
@@ -370,7 +370,7 @@
 }
 
 void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                   CPDF_Matrix* pUser2Device) {
+                                   CFX_Matrix* pUser2Device) {
   CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
 
   CPDF_Rect rcClient = GetClientRect();
diff --git a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
index 0794be6..1c69f18 100644
--- a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
@@ -47,7 +47,7 @@
 }
 
 FX_BOOL CPWL_EditCtrl::IsWndHorV() {
-  CPDF_Matrix mt = GetWindowMatrix();
+  CFX_Matrix mt = GetWindowMatrix();
   CPDF_Point point1(0, 1);
   CPDF_Point point2(1, 1);
 
diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
index 166b4e7..61ad1f6 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
@@ -21,7 +21,7 @@
 
   CFX_ByteString sAlias = GetImageAlias();
   CPDF_Rect rcPlate = GetClientRect();
-  CPDF_Matrix mt;
+  CFX_Matrix mt;
   mt.SetReverse(GetImageMatrix());
 
   FX_FLOAT fHScale = 1.0f;
@@ -72,14 +72,14 @@
   }
 }
 
-CPDF_Matrix CPWL_Image::GetImageMatrix() {
+CFX_Matrix CPWL_Image::GetImageMatrix() {
   if (m_pPDFStream) {
     if (CPDF_Dictionary* pDict = m_pPDFStream->GetDict()) {
       return pDict->GetMatrix("Matrix");
     }
   }
 
-  return CPDF_Matrix();
+  return CFX_Matrix();
 }
 
 CFX_ByteString CPWL_Image::GetImageAlias() {
diff --git a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
index cc8b352..6a627d7 100644
--- a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
@@ -33,7 +33,7 @@
 }
 
 void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                            CPDF_Matrix* pUser2Device) {
+                                            CFX_Matrix* pUser2Device) {
   CPDF_Rect rcClient = GetClientRect();
 
   if (m_bSelected) {
diff --git a/fpdfsdk/src/pdfwindow/PWL_Label.cpp b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
index 4beeada..23be536 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Label.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
@@ -86,7 +86,7 @@
 }
 
 void CPWL_Label::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                    CPDF_Matrix* pUser2Device) {
+                                    CFX_Matrix* pUser2Device) {
   CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
 
   GetClientRect();
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
index 229c1dd..9b62c47 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
@@ -159,7 +159,7 @@
 }
 
 void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                      CPDF_Matrix* pUser2Device) {
+                                      CFX_Matrix* pUser2Device) {
   CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
 
   if (m_pList) {
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
index e578f9b..f7c1ef1 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
@@ -95,9 +95,9 @@
       FX_FLOAT fLeft = pChild->GetItemLeftMargin();
       FX_FLOAT fRight = pChild->GetItemRightMargin();
 
-      pChild->SetChildMatrix(CPDF_Matrix(1, 0, 0, 1,
-                                         rcClient.left - m_ptScroll.x,
-                                         rcClient.top - m_ptScroll.y));
+      pChild->SetChildMatrix(CFX_Matrix(1, 0, 0, 1,
+                                        rcClient.left - m_ptScroll.x,
+                                        rcClient.top - m_ptScroll.y));
 
       if (bMove) {
         FX_FLOAT fItemHeight = pChild->GetItemHeight(fWidth - fLeft - fRight);
@@ -138,7 +138,7 @@
 }
 
 void CPWL_ListCtrl::DrawChildAppearance(CFX_RenderDevice* pDevice,
-                                        CPDF_Matrix* pUser2Device) {
+                                        CFX_Matrix* pUser2Device) {
   pDevice->SaveState();
   CPDF_Rect rcClient = GetClientRect();
   CPDF_Rect rcTemp = rcClient;
@@ -152,7 +152,7 @@
     if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) {
       CPDF_Rect rcChild = pChild->ChildToParent(pChild->GetWindowRect());
       if (!(rcChild.top < rcClient.bottom || rcChild.bottom > rcClient.top)) {
-        CPDF_Matrix mt = pChild->GetChildMatrix();
+        CFX_Matrix mt = pChild->GetChildMatrix();
         if (mt.IsIdentity()) {
           pChild->DrawAppearance(pDevice, pUser2Device);
         } else {
diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
index 553a20f..f15004d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
@@ -75,7 +75,7 @@
 }
 
 void CPWL_Note_Options::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                           CPDF_Matrix* pUser2Device) {
+                                           CFX_Matrix* pUser2Device) {
   CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
 
   CPDF_Rect rcClient = GetClientRect();
@@ -246,7 +246,7 @@
 CPWL_Note_LBBox::~CPWL_Note_LBBox() {}
 
 void CPWL_Note_LBBox::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                         CPDF_Matrix* pUser2Device) {
+                                         CFX_Matrix* pUser2Device) {
   CPDF_Rect rcClient = GetClientRect();
 
   CFX_GraphStateData gsd;
@@ -276,7 +276,7 @@
 CPWL_Note_RBBox::~CPWL_Note_RBBox() {}
 
 void CPWL_Note_RBBox::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                         CPDF_Matrix* pUser2Device) {
+                                         CFX_Matrix* pUser2Device) {
   CPDF_Rect rcClient = GetClientRect();
 
   CFX_GraphStateData gsd;
@@ -310,7 +310,7 @@
 }
 
 void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                        CPDF_Matrix* pUser2Device) {
+                                        CFX_Matrix* pUser2Device) {
   CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nType, GetClientRect(),
                                 GetBackgroundColor(), PWL_DEFAULT_BLACKCOLOR,
                                 GetTransparency());
@@ -324,7 +324,7 @@
 CPWL_Note_CloseBox::~CPWL_Note_CloseBox() {}
 
 void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                            CPDF_Matrix* pUser2Device) {
+                                            CFX_Matrix* pUser2Device) {
   CPWL_Button::DrawThisAppearance(pDevice, pUser2Device);
 
   CPDF_Rect rcClient = GetClientRect();
diff --git a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
index 94f14fd..f4d4baf 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
@@ -244,7 +244,7 @@
 }
 
 void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                       CPDF_Matrix* pUser2Device) {
+                                       CFX_Matrix* pUser2Device) {
   if (!IsVisible())
     return;
 
@@ -696,7 +696,7 @@
 }
 
 void CPWL_ScrollBar::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                        CPDF_Matrix* pUser2Device) {
+                                        CFX_Matrix* pUser2Device) {
   CPDF_Rect rectWnd = GetWindowRect();
 
   if (IsVisible() && !rectWnd.IsEmpty()) {
diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
index f872bb4..dead655 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
@@ -27,7 +27,7 @@
 }
 
 void CPWL_Signature_Image::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                              CPDF_Matrix* pUser2Device) {
+                                              CFX_Matrix* pUser2Device) {
   CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
 
   if (m_pImage) {
@@ -166,7 +166,7 @@
 }
 
 void CPWL_Signature::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                        CPDF_Matrix* pUser2Device) {
+                                        CFX_Matrix* pUser2Device) {
   CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
 
   if (m_bFlagExist)
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
index fafdf1e..85593e1 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
@@ -1389,7 +1389,7 @@
 }
 
 void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice,
-                              CPDF_Matrix* pUser2Device,
+                              CFX_Matrix* pUser2Device,
                               const CPDF_Rect& rect,
                               const FX_COLORREF& color) {
   CFX_PathData path;
@@ -1399,7 +1399,7 @@
 }
 
 void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice,
-                              CPDF_Matrix* pUser2Device,
+                              CFX_Matrix* pUser2Device,
                               const CPDF_Point* pPts,
                               int32_t nCount,
                               const FX_COLORREF& color) {
@@ -1414,7 +1414,7 @@
 }
 
 void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice,
-                                CPDF_Matrix* pUser2Device,
+                                CFX_Matrix* pUser2Device,
                                 const CPDF_Rect& rect,
                                 const FX_COLORREF& color,
                                 FX_FLOAT fWidth) {
@@ -1429,7 +1429,7 @@
 }
 
 void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice,
-                                CPDF_Matrix* pUser2Device,
+                                CFX_Matrix* pUser2Device,
                                 const CPDF_Point& ptMoveTo,
                                 const CPDF_Point& ptLineTo,
                                 const FX_COLORREF& color,
@@ -1446,7 +1446,7 @@
 }
 
 void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice,
-                              CPDF_Matrix* pUser2Device,
+                              CFX_Matrix* pUser2Device,
                               const CPDF_Rect& rect,
                               const CPWL_Color& color,
                               int32_t nTransparancy) {
@@ -1455,7 +1455,7 @@
 }
 
 void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice,
-                            CPDF_Matrix* pUser2Device,
+                            CFX_Matrix* pUser2Device,
                             FX_BOOL bVertical,
                             FX_BOOL bHorizontal,
                             CPDF_Rect rect,
@@ -1490,7 +1490,7 @@
 }
 
 void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice,
-                            CPDF_Matrix* pUser2Device,
+                            CFX_Matrix* pUser2Device,
                             const CPDF_Rect& rect,
                             FX_FLOAT fWidth,
                             const CPWL_Color& color,
@@ -1697,7 +1697,7 @@
 }
 
 void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice,
-                                    CPDF_Matrix* pUser2Device,
+                                    CFX_Matrix* pUser2Device,
                                     IFX_Edit* pEdit,
                                     const CPDF_Rect& rcClip,
                                     const CPDF_Point& ptOffset,
@@ -1920,7 +1920,7 @@
 }
 
 void CPWL_Utils::DrawIconAppStream(CFX_RenderDevice* pDevice,
-                                   CPDF_Matrix* pUser2Device,
+                                   CFX_Matrix* pUser2Device,
                                    int32_t nType,
                                    const CPDF_Rect& rect,
                                    const CPWL_Color& crFill,
diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
index d8f3904..002fc05 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
@@ -224,7 +224,7 @@
     PWL_CREATEPARAM ccp = m_sPrivateParam;
 
     ccp.dwFlags &= 0xFFFF0000L;  // remove sub styles
-    ccp.mtChild = CPDF_Matrix(1, 0, 0, 1, 0, 0);
+    ccp.mtChild = CFX_Matrix(1, 0, 0, 1, 0, 0);
 
     CreateScrollBar(ccp);
     CreateChildWnd(ccp);
@@ -344,7 +344,7 @@
 }
 
 void CPWL_Wnd::DrawAppearance(CFX_RenderDevice* pDevice,
-                              CPDF_Matrix* pUser2Device) {
+                              CFX_Matrix* pUser2Device) {
   if (IsValid() && IsVisible()) {
     DrawThisAppearance(pDevice, pUser2Device);
     DrawChildAppearance(pDevice, pUser2Device);
@@ -352,7 +352,7 @@
 }
 
 void CPWL_Wnd::DrawThisAppearance(CFX_RenderDevice* pDevice,
-                                  CPDF_Matrix* pUser2Device) {
+                                  CFX_Matrix* pUser2Device) {
   CPDF_Rect rectWnd = GetWindowRect();
   if (!rectWnd.IsEmpty()) {
     if (HasFlag(PWS_BACKGROUND)) {
@@ -372,10 +372,10 @@
 }
 
 void CPWL_Wnd::DrawChildAppearance(CFX_RenderDevice* pDevice,
-                                   CPDF_Matrix* pUser2Device) {
+                                   CFX_Matrix* pUser2Device) {
   for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) {
     if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) {
-      CPDF_Matrix mt = pChild->GetChildMatrix();
+      CFX_Matrix mt = pChild->GetChildMatrix();
       if (mt.IsIdentity()) {
         pChild->DrawAppearance(pDevice, pUser2Device);
       } else {
@@ -918,8 +918,8 @@
   m_sPrivateParam.nTransparency = nTransparency;
 }
 
-CPDF_Matrix CPWL_Wnd::GetWindowMatrix() const {
-  CPDF_Matrix mt = GetChildToRoot();
+CFX_Matrix CPWL_Wnd::GetWindowMatrix() const {
+  CFX_Matrix mt = GetChildToRoot();
 
   if (IPWL_Provider* pProvider = GetProvider()) {
     mt.Concat(pProvider->GetWindowMatrix(GetAttachedData()));
@@ -930,7 +930,7 @@
 }
 
 void CPWL_Wnd::PWLtoWnd(const CPDF_Point& point, int32_t& x, int32_t& y) const {
-  CPDF_Matrix mt = GetWindowMatrix();
+  CFX_Matrix mt = GetWindowMatrix();
   CPDF_Point pt = point;
   mt.Transform(pt.x, pt.y);
   x = (int32_t)(pt.x + 0.5);
@@ -939,7 +939,7 @@
 
 FX_RECT CPWL_Wnd::PWLtoWnd(const CPDF_Rect& rect) const {
   CPDF_Rect rcTemp = rect;
-  CPDF_Matrix mt = GetWindowMatrix();
+  CFX_Matrix mt = GetWindowMatrix();
   mt.TransformRect(rcTemp);
   return FX_RECT((int32_t)(rcTemp.left + 0.5), (int32_t)(rcTemp.bottom + 0.5),
                  (int32_t)(rcTemp.right + 0.5), (int32_t)(rcTemp.top + 0.5));
@@ -950,7 +950,7 @@
 }
 
 CPDF_Point CPWL_Wnd::ChildToParent(const CPDF_Point& point) const {
-  CPDF_Matrix mt = GetChildMatrix();
+  CFX_Matrix mt = GetChildMatrix();
   if (mt.IsIdentity())
     return point;
 
@@ -960,7 +960,7 @@
 }
 
 CPDF_Rect CPWL_Wnd::ChildToParent(const CPDF_Rect& rect) const {
-  CPDF_Matrix mt = GetChildMatrix();
+  CFX_Matrix mt = GetChildMatrix();
   if (mt.IsIdentity())
     return rect;
 
@@ -970,7 +970,7 @@
 }
 
 CPDF_Point CPWL_Wnd::ParentToChild(const CPDF_Point& point) const {
-  CPDF_Matrix mt = GetChildMatrix();
+  CFX_Matrix mt = GetChildMatrix();
   if (mt.IsIdentity())
     return point;
 
@@ -981,7 +981,7 @@
 }
 
 CPDF_Rect CPWL_Wnd::ParentToChild(const CPDF_Rect& rect) const {
-  CPDF_Matrix mt = GetChildMatrix();
+  CFX_Matrix mt = GetChildMatrix();
   if (mt.IsIdentity())
     return rect;
 
@@ -991,8 +991,8 @@
   return rc;
 }
 
-CPDF_Matrix CPWL_Wnd::GetChildToRoot() const {
-  CPDF_Matrix mt(1, 0, 0, 1, 0, 0);
+CFX_Matrix CPWL_Wnd::GetChildToRoot() const {
+  CFX_Matrix mt(1, 0, 0, 1, 0, 0);
   if (HasFlag(PWS_CHILD)) {
     const CPWL_Wnd* pParent = this;
     while (pParent) {
@@ -1003,14 +1003,14 @@
   return mt;
 }
 
-CPDF_Matrix CPWL_Wnd::GetChildMatrix() const {
+CFX_Matrix CPWL_Wnd::GetChildMatrix() const {
   if (HasFlag(PWS_CHILD))
     return m_sPrivateParam.mtChild;
 
-  return CPDF_Matrix(1, 0, 0, 1, 0, 0);
+  return CFX_Matrix(1, 0, 0, 1, 0, 0);
 }
 
-void CPWL_Wnd::SetChildMatrix(const CPDF_Matrix& mt) {
+void CPWL_Wnd::SetChildMatrix(const CFX_Matrix& mt) {
   m_sPrivateParam.mtChild = mt;
 }