Pass CFX_Matrix arguments by const-ref in xfa/fwl/theme methods.

The argument is always present and not modified.

Change-Id: Ic8bd615256e16f790d1536dcb03a1b968f84109c
Reviewed-on: https://pdfium-review.googlesource.com/c/48490
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fwl/theme/cfwl_barcodetp.cpp b/xfa/fwl/theme/cfwl_barcodetp.cpp
index c1baf9b..31548fb 100644
--- a/xfa/fwl/theme/cfwl_barcodetp.cpp
+++ b/xfa/fwl/theme/cfwl_barcodetp.cpp
@@ -18,11 +18,11 @@
   switch (pParams.m_iPart) {
     case CFWL_Part::Border:
       DrawBorder(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                 &pParams.m_matrix);
+                 pParams.m_matrix);
       break;
     case CFWL_Part::Background:
       FillBackground(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                     &pParams.m_matrix);
+                     pParams.m_matrix);
       break;
     default:
       break;
diff --git a/xfa/fwl/theme/cfwl_carettp.cpp b/xfa/fwl/theme/cfwl_carettp.cpp
index 4d95034..a322e7e 100644
--- a/xfa/fwl/theme/cfwl_carettp.cpp
+++ b/xfa/fwl/theme/cfwl_carettp.cpp
@@ -22,7 +22,7 @@
         return;
 
       DrawCaretBK(pParams.m_pGraphics.Get(), pParams.m_dwStates,
-                  &pParams.m_rtPart, &pParams.m_matrix);
+                  &pParams.m_rtPart, pParams.m_matrix);
       break;
     }
     default:
@@ -33,10 +33,10 @@
 void CFWL_CaretTP::DrawCaretBK(CXFA_Graphics* pGraphics,
                                uint32_t dwStates,
                                const CFX_RectF* pRect,
-                               const CFX_Matrix* pMatrix) {
+                               const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   CFX_RectF rect = *pRect;
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
   pGraphics->SetFillColor(CXFA_GEColor(ArgbEncode(255, 0, 0, 0)));
-  pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
 }
diff --git a/xfa/fwl/theme/cfwl_carettp.h b/xfa/fwl/theme/cfwl_carettp.h
index 096ed7a..864496c 100644
--- a/xfa/fwl/theme/cfwl_carettp.h
+++ b/xfa/fwl/theme/cfwl_carettp.h
@@ -21,7 +21,7 @@
   void DrawCaretBK(CXFA_Graphics* pGraphics,
                    uint32_t dwStates,
                    const CFX_RectF* pRect,
-                   const CFX_Matrix* pMatrix);
+                   const CFX_Matrix& matrix);
 };
 
 #endif  // XFA_FWL_THEME_CFWL_CARETTP_H_
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index c97bc91..ae69e7c 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -61,13 +61,13 @@
 void CFWL_CheckBoxTP::DrawSignCheck(CXFA_Graphics* pGraphics,
                                     const CFX_RectF* pRtSign,
                                     FX_ARGB argbFill,
-                                    const CFX_Matrix* pMatrix) {
+                                    const CFX_Matrix& matrix) {
   if (!m_pCheckPath)
     InitCheckPath(pRtSign->width);
 
   CFX_Matrix mt;
   mt.Translate(pRtSign->left, pRtSign->top);
-  mt.Concat(*pMatrix);
+  mt.Concat(matrix);
   pGraphics->SaveGraphState();
   pGraphics->SetFillColor(CXFA_GEColor(argbFill));
   pGraphics->FillPath(m_pCheckPath.get(), FXFILL_WINDING, &mt);
@@ -77,19 +77,19 @@
 void CFWL_CheckBoxTP::DrawSignCircle(CXFA_Graphics* pGraphics,
                                      const CFX_RectF* pRtSign,
                                      FX_ARGB argbFill,
-                                     const CFX_Matrix* pMatrix) {
+                                     const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   path.AddEllipse(*pRtSign);
   pGraphics->SaveGraphState();
   pGraphics->SetFillColor(CXFA_GEColor(argbFill));
-  pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   pGraphics->RestoreGraphState();
 }
 
 void CFWL_CheckBoxTP::DrawSignCross(CXFA_Graphics* pGraphics,
                                     const CFX_RectF* pRtSign,
                                     FX_ARGB argbFill,
-                                    const CFX_Matrix* pMatrix) {
+                                    const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   float fRight = pRtSign->right();
   float fBottom = pRtSign->bottom();
@@ -100,14 +100,14 @@
   pGraphics->SaveGraphState();
   pGraphics->SetStrokeColor(CXFA_GEColor(argbFill));
   pGraphics->SetLineWidth(1.0f);
-  pGraphics->StrokePath(&path, pMatrix);
+  pGraphics->StrokePath(&path, &matrix);
   pGraphics->RestoreGraphState();
 }
 
 void CFWL_CheckBoxTP::DrawSignDiamond(CXFA_Graphics* pGraphics,
                                       const CFX_RectF* pRtSign,
                                       FX_ARGB argbFill,
-                                      const CFX_Matrix* pMatrix) {
+                                      const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   float fWidth = pRtSign->width;
   float fHeight = pRtSign->height;
@@ -120,27 +120,27 @@
 
   pGraphics->SaveGraphState();
   pGraphics->SetFillColor(CXFA_GEColor(argbFill));
-  pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   pGraphics->RestoreGraphState();
 }
 
 void CFWL_CheckBoxTP::DrawSignSquare(CXFA_Graphics* pGraphics,
                                      const CFX_RectF* pRtSign,
                                      FX_ARGB argbFill,
-                                     const CFX_Matrix* pMatrix) {
+                                     const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   path.AddRectangle(pRtSign->left, pRtSign->top, pRtSign->width,
                     pRtSign->height);
   pGraphics->SaveGraphState();
   pGraphics->SetFillColor(CXFA_GEColor(argbFill));
-  pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   pGraphics->RestoreGraphState();
 }
 
 void CFWL_CheckBoxTP::DrawSignStar(CXFA_Graphics* pGraphics,
                                    const CFX_RectF* pRtSign,
                                    FX_ARGB argbFill,
-                                   const CFX_Matrix* pMatrix) {
+                                   const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   float fBottom = pRtSign->bottom();
   float fRadius =
@@ -168,7 +168,7 @@
   }
   pGraphics->SaveGraphState();
   pGraphics->SetFillColor(CXFA_GEColor(argbFill));
-  pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   pGraphics->RestoreGraphState();
 }
 
@@ -271,7 +271,7 @@
   if ((pParams.m_dwStates & CFWL_PartState_Checked) ||
       (pParams.m_dwStates & CFWL_PartState_Neutral)) {
     DrawCheckSign(pParams.m_pWidget, pParams.m_pGraphics.Get(),
-                  pParams.m_rtPart, pParams.m_dwStates, &pParams.m_matrix);
+                  pParams.m_rtPart, pParams.m_dwStates, pParams.m_matrix);
   }
 }
 
@@ -279,7 +279,7 @@
                                     CXFA_Graphics* pGraphics,
                                     const CFX_RectF& pRtBox,
                                     int32_t iState,
-                                    const CFX_Matrix* pMatrix) {
+                                    const CFX_Matrix& matrix) {
   CFX_RectF rtSign(pRtBox);
   uint32_t dwColor = iState & CFWL_PartState_Neutral ? 0xFFA9A9A9 : 0xFF000000;
 
@@ -287,22 +287,22 @@
   rtSign.Deflate(rtSign.width / 4, rtSign.height / 4);
   switch (dwStyle & FWL_STYLEEXT_CKB_SignShapeMask) {
     case FWL_STYLEEXT_CKB_SignShapeCheck:
-      DrawSignCheck(pGraphics, &rtSign, dwColor, pMatrix);
+      DrawSignCheck(pGraphics, &rtSign, dwColor, matrix);
       break;
     case FWL_STYLEEXT_CKB_SignShapeCircle:
-      DrawSignCircle(pGraphics, &rtSign, dwColor, pMatrix);
+      DrawSignCircle(pGraphics, &rtSign, dwColor, matrix);
       break;
     case FWL_STYLEEXT_CKB_SignShapeCross:
-      DrawSignCross(pGraphics, &rtSign, dwColor, pMatrix);
+      DrawSignCross(pGraphics, &rtSign, dwColor, matrix);
       break;
     case FWL_STYLEEXT_CKB_SignShapeDiamond:
-      DrawSignDiamond(pGraphics, &rtSign, dwColor, pMatrix);
+      DrawSignDiamond(pGraphics, &rtSign, dwColor, matrix);
       break;
     case FWL_STYLEEXT_CKB_SignShapeSquare:
-      DrawSignSquare(pGraphics, &rtSign, dwColor, pMatrix);
+      DrawSignSquare(pGraphics, &rtSign, dwColor, matrix);
       break;
     case FWL_STYLEEXT_CKB_SignShapeStar:
-      DrawSignStar(pGraphics, &rtSign, dwColor, pMatrix);
+      DrawSignStar(pGraphics, &rtSign, dwColor, matrix);
       break;
     default:
       break;
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.h b/xfa/fwl/theme/cfwl_checkboxtp.h
index f10f4be..51c7106 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.h
+++ b/xfa/fwl/theme/cfwl_checkboxtp.h
@@ -41,31 +41,31 @@
                      CXFA_Graphics* pGraphics,
                      const CFX_RectF& pRtBox,
                      int32_t iState,
-                     const CFX_Matrix* pMatrix);
+                     const CFX_Matrix& matrix);
   void DrawSignCheck(CXFA_Graphics* pGraphics,
                      const CFX_RectF* pRtSign,
                      FX_ARGB argbFill,
-                     const CFX_Matrix* pMatrix);
+                     const CFX_Matrix& matrix);
   void DrawSignCircle(CXFA_Graphics* pGraphics,
                       const CFX_RectF* pRtSign,
                       FX_ARGB argbFill,
-                      const CFX_Matrix* pMatrix);
+                      const CFX_Matrix& matrix);
   void DrawSignCross(CXFA_Graphics* pGraphics,
                      const CFX_RectF* pRtSign,
                      FX_ARGB argbFill,
-                     const CFX_Matrix* pMatrix);
+                     const CFX_Matrix& matrix);
   void DrawSignDiamond(CXFA_Graphics* pGraphics,
                        const CFX_RectF* pRtSign,
                        FX_ARGB argbFill,
-                       const CFX_Matrix* pMatrix);
+                       const CFX_Matrix& matrix);
   void DrawSignSquare(CXFA_Graphics* pGraphics,
                       const CFX_RectF* pRtSign,
                       FX_ARGB argbFill,
-                      const CFX_Matrix* pMatrix);
+                      const CFX_Matrix& matrix);
   void DrawSignStar(CXFA_Graphics* pGraphics,
                     const CFX_RectF* pRtSign,
                     FX_ARGB argbFill,
-                    const CFX_Matrix* pMatrix);
+                    const CFX_Matrix& matrix);
 
   void InitCheckPath(float fCheckLen);
   void SetThemeData();
diff --git a/xfa/fwl/theme/cfwl_comboboxtp.cpp b/xfa/fwl/theme/cfwl_comboboxtp.cpp
index f5cfeb5..9705219 100644
--- a/xfa/fwl/theme/cfwl_comboboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_comboboxtp.cpp
@@ -21,7 +21,7 @@
   switch (pParams.m_iPart) {
     case CFWL_Part::Border: {
       DrawBorder(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                 &pParams.m_matrix);
+                 pParams.m_matrix);
       break;
     }
     case CFWL_Part::Background: {
@@ -46,11 +46,11 @@
       break;
     }
     case CFWL_Part::DropDownButton: {
-      DrawDropDownButton(pParams, pParams.m_dwStates, &pParams.m_matrix);
+      DrawDropDownButton(pParams, pParams.m_dwStates, pParams.m_matrix);
       break;
     }
     case CFWL_Part::StretchHandler: {
-      DrawStretchHandler(pParams, 0, &pParams.m_matrix);
+      DrawStretchHandler(pParams, 0, pParams.m_matrix);
       break;
     }
     default:
@@ -60,7 +60,7 @@
 
 void CFWL_ComboBoxTP::DrawStretchHandler(const CFWL_ThemeBackground& pParams,
                                          uint32_t dwStates,
-                                         const CFX_Matrix* pMatrix) {
+                                         const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   path.AddRectangle(pParams.m_rtPart.left, pParams.m_rtPart.top,
                     pParams.m_rtPart.width - 1, pParams.m_rtPart.height);
@@ -70,7 +70,7 @@
 
 void CFWL_ComboBoxTP::DrawDropDownButton(const CFWL_ThemeBackground& pParams,
                                          uint32_t dwStates,
-                                         const CFX_Matrix* pMatrix) {
+                                         const CFX_Matrix& matrix) {
   FWLTHEME_STATE eState = FWLTHEME_STATE_Normal;
   switch (dwStates) {
     case CFWL_PartState_Normal: {
@@ -93,5 +93,5 @@
       break;
   }
   DrawArrowBtn(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-               FWLTHEME_DIRECTION_Down, eState, &pParams.m_matrix);
+               FWLTHEME_DIRECTION_Down, eState, pParams.m_matrix);
 }
diff --git a/xfa/fwl/theme/cfwl_comboboxtp.h b/xfa/fwl/theme/cfwl_comboboxtp.h
index 11f23d8..0be02aa 100644
--- a/xfa/fwl/theme/cfwl_comboboxtp.h
+++ b/xfa/fwl/theme/cfwl_comboboxtp.h
@@ -20,10 +20,10 @@
  private:
   void DrawDropDownButton(const CFWL_ThemeBackground& pParams,
                           uint32_t dwStates,
-                          const CFX_Matrix* pMatrix);
+                          const CFX_Matrix& matrix);
   void DrawStretchHandler(const CFWL_ThemeBackground& pParams,
                           uint32_t dwStates,
-                          const CFX_Matrix* pMatrix);
+                          const CFX_Matrix& matrix);
 };
 
 #endif  // XFA_FWL_THEME_CFWL_COMBOBOXTP_H_
diff --git a/xfa/fwl/theme/cfwl_datetimepickertp.cpp b/xfa/fwl/theme/cfwl_datetimepickertp.cpp
index b529575..7693c6c 100644
--- a/xfa/fwl/theme/cfwl_datetimepickertp.cpp
+++ b/xfa/fwl/theme/cfwl_datetimepickertp.cpp
@@ -18,10 +18,10 @@
   switch (pParams.m_iPart) {
     case CFWL_Part::Border:
       DrawBorder(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                 &pParams.m_matrix);
+                 pParams.m_matrix);
       break;
     case CFWL_Part::DropDownButton:
-      DrawDropDownButton(pParams, &pParams.m_matrix);
+      DrawDropDownButton(pParams, pParams.m_matrix);
       break;
     default:
       break;
@@ -30,7 +30,7 @@
 
 void CFWL_DateTimePickerTP::DrawDropDownButton(
     const CFWL_ThemeBackground& pParams,
-    const CFX_Matrix* pMatrix) {
+    const CFX_Matrix& matrix) {
   uint32_t dwStates = pParams.m_dwStates;
   dwStates &= 0x03;
   FWLTHEME_STATE eState = FWLTHEME_STATE_Normal;
@@ -55,5 +55,5 @@
       break;
   }
   DrawArrowBtn(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-               FWLTHEME_DIRECTION_Down, eState, pMatrix);
+               FWLTHEME_DIRECTION_Down, eState, matrix);
 }
diff --git a/xfa/fwl/theme/cfwl_datetimepickertp.h b/xfa/fwl/theme/cfwl_datetimepickertp.h
index b74600f..e7163e0 100644
--- a/xfa/fwl/theme/cfwl_datetimepickertp.h
+++ b/xfa/fwl/theme/cfwl_datetimepickertp.h
@@ -19,7 +19,7 @@
 
  private:
   void DrawDropDownButton(const CFWL_ThemeBackground& pParams,
-                          const CFX_Matrix* pMatrix);
+                          const CFX_Matrix& matrix);
 };
 
 #endif  // XFA_FWL_THEME_CFWL_DATETIMEPICKERTP_H_
diff --git a/xfa/fwl/theme/cfwl_edittp.cpp b/xfa/fwl/theme/cfwl_edittp.cpp
index 16d3f79..d1e6c22 100644
--- a/xfa/fwl/theme/cfwl_edittp.cpp
+++ b/xfa/fwl/theme/cfwl_edittp.cpp
@@ -44,7 +44,7 @@
   switch (pParams.m_iPart) {
     case CFWL_Part::Border: {
       DrawBorder(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                 &pParams.m_matrix);
+                 pParams.m_matrix);
       break;
     }
     case CFWL_Part::Background: {
diff --git a/xfa/fwl/theme/cfwl_listboxtp.cpp b/xfa/fwl/theme/cfwl_listboxtp.cpp
index 7b614af..c3eb313 100644
--- a/xfa/fwl/theme/cfwl_listboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_listboxtp.cpp
@@ -20,21 +20,21 @@
   switch (pParams.m_iPart) {
     case CFWL_Part::Border: {
       DrawBorder(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                 &pParams.m_matrix);
+                 pParams.m_matrix);
       break;
     }
     case CFWL_Part::Background: {
       FillSolidRect(pParams.m_pGraphics.Get(), ArgbEncode(255, 255, 255, 255),
-                    &pParams.m_rtPart, &pParams.m_matrix);
+                    &pParams.m_rtPart, pParams.m_matrix);
       if (pParams.m_pRtData) {
         FillSolidRect(pParams.m_pGraphics.Get(), FWLTHEME_COLOR_Background,
-                      pParams.m_pRtData, &pParams.m_matrix);
+                      pParams.m_pRtData, pParams.m_matrix);
       }
       break;
     }
     case CFWL_Part::ListItem: {
       DrawListBoxItem(pParams.m_pGraphics.Get(), pParams.m_dwStates,
-                      &pParams.m_rtPart, pParams.m_pRtData, &pParams.m_matrix);
+                      &pParams.m_rtPart, pParams.m_pRtData, pParams.m_matrix);
       break;
     }
     case CFWL_Part::Check: {
@@ -45,7 +45,7 @@
         color = 0xFF0000FF;
       }
       FillSolidRect(pParams.m_pGraphics.Get(), color, &pParams.m_rtPart,
-                    &pParams.m_matrix);
+                    pParams.m_matrix);
       break;
     }
     default:
@@ -57,7 +57,7 @@
                                      uint32_t dwStates,
                                      const CFX_RectF* prtItem,
                                      const CFX_RectF* pData,
-                                     const CFX_Matrix* pMatrix) {
+                                     const CFX_Matrix& matrix) {
   if (dwStates & CFWL_PartState_Selected) {
     pGraphics->SaveGraphState();
     pGraphics->SetFillColor(CXFA_GEColor(FWLTHEME_COLOR_BKSelected));
@@ -68,9 +68,9 @@
 #else
     path.AddRectangle(rt.left, rt.top, rt.width, rt.height);
 #endif
-    pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+    pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
     pGraphics->RestoreGraphState();
   }
   if ((dwStates & CFWL_PartState_Focused) && pData)
-    DrawFocus(pGraphics, pData, pMatrix);
+    DrawFocus(pGraphics, pData, matrix);
 }
diff --git a/xfa/fwl/theme/cfwl_listboxtp.h b/xfa/fwl/theme/cfwl_listboxtp.h
index 8c57e3f..e67d29c 100644
--- a/xfa/fwl/theme/cfwl_listboxtp.h
+++ b/xfa/fwl/theme/cfwl_listboxtp.h
@@ -22,7 +22,7 @@
                        uint32_t dwStates,
                        const CFX_RectF* prtItem,
                        const CFX_RectF* pData,
-                       const CFX_Matrix* pMatrix);
+                       const CFX_Matrix& matrix);
 };
 
 #endif  // XFA_FWL_THEME_CFWL_LISTBOXTP_H_
diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
index cb0fe98..909344f 100644
--- a/xfa/fwl/theme/cfwl_monthcalendartp.cpp
+++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
@@ -35,47 +35,47 @@
   switch (pParams.m_iPart) {
     case CFWL_Part::Border: {
       DrawBorder(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                 &pParams.m_matrix);
+                 pParams.m_matrix);
       break;
     }
     case CFWL_Part::Background: {
-      DrawTotalBK(pParams, &pParams.m_matrix);
+      DrawTotalBK(pParams, pParams.m_matrix);
       break;
     }
     case CFWL_Part::Header: {
-      DrawHeadBk(pParams, &pParams.m_matrix);
+      DrawHeadBk(pParams, pParams.m_matrix);
       break;
     }
     case CFWL_Part::LBtn: {
       FWLTHEME_STATE eState = GetState(pParams.m_dwStates);
       DrawArrowBtn(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                   FWLTHEME_DIRECTION_Left, eState, &pParams.m_matrix);
+                   FWLTHEME_DIRECTION_Left, eState, pParams.m_matrix);
       break;
     }
     case CFWL_Part::RBtn: {
       FWLTHEME_STATE eState = GetState(pParams.m_dwStates);
       DrawArrowBtn(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                   FWLTHEME_DIRECTION_Right, eState, &pParams.m_matrix);
+                   FWLTHEME_DIRECTION_Right, eState, pParams.m_matrix);
       break;
     }
     case CFWL_Part::HSeparator: {
-      DrawHSeperator(pParams, &pParams.m_matrix);
+      DrawHSeperator(pParams, pParams.m_matrix);
       break;
     }
     case CFWL_Part::DatesIn: {
-      DrawDatesInBK(pParams, &pParams.m_matrix);
+      DrawDatesInBK(pParams, pParams.m_matrix);
       break;
     }
     case CFWL_Part::TodayCircle: {
-      DrawTodayCircle(pParams, &pParams.m_matrix);
+      DrawTodayCircle(pParams, pParams.m_matrix);
       break;
     }
     case CFWL_Part::DateInCircle: {
-      DrawDatesInCircle(pParams, &pParams.m_matrix);
+      DrawDatesInCircle(pParams, pParams.m_matrix);
       break;
     }
     case CFWL_Part::WeekNumSep: {
-      DrawWeekNumSep(pParams, &pParams.m_matrix);
+      DrawWeekNumSep(pParams, pParams.m_matrix);
       break;
     }
     default:
@@ -101,44 +101,44 @@
 }
 
 void CFWL_MonthCalendarTP::DrawTotalBK(const CFWL_ThemeBackground& pParams,
-                                       const CFX_Matrix* pMatrix) {
+                                       const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   CFX_RectF rtTotal(pParams.m_rtPart);
   path.AddRectangle(rtTotal.left, rtTotal.top, rtTotal.width, rtTotal.height);
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetFillColor(CXFA_GEColor(m_pThemeData->clrBK));
-  pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawHeadBk(const CFWL_ThemeBackground& pParams,
-                                      const CFX_Matrix* pMatrix) {
+                                      const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   CFX_RectF rtHead = pParams.m_rtPart;
   path.AddRectangle(rtHead.left, rtHead.top, rtHead.width, rtHead.height);
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetFillColor(CXFA_GEColor(m_pThemeData->clrBK));
-  pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawLButton(const CFWL_ThemeBackground& pParams,
-                                       const CFX_Matrix* pMatrix) {
+                                       const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   CFX_RectF rtLBtn = pParams.m_rtPart;
   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)));
-  pParams.m_pGraphics->StrokePath(&path, pMatrix);
+  pParams.m_pGraphics->StrokePath(&path, &matrix);
   if (pParams.m_dwStates & CFWL_PartState_Pressed) {
     pParams.m_pGraphics->SetFillColor(
         CXFA_GEColor(ArgbEncode(0xff, 174, 198, 242)));
-    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   } else {
     pParams.m_pGraphics->SetFillColor(
         CXFA_GEColor(ArgbEncode(0xff, 227, 235, 249)));
-    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   }
 
   path.Clear();
@@ -151,27 +151,27 @@
 
   pParams.m_pGraphics->SetStrokeColor(
       CXFA_GEColor(ArgbEncode(0xff, 50, 104, 205)));
-  pParams.m_pGraphics->StrokePath(&path, pMatrix);
+  pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawRButton(const CFWL_ThemeBackground& pParams,
-                                       const CFX_Matrix* pMatrix) {
+                                       const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   CFX_RectF rtRBtn = pParams.m_rtPart;
   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)));
-  pParams.m_pGraphics->StrokePath(&path, pMatrix);
+  pParams.m_pGraphics->StrokePath(&path, &matrix);
   if (pParams.m_dwStates & CFWL_PartState_Pressed) {
     pParams.m_pGraphics->SetFillColor(
         CXFA_GEColor(ArgbEncode(0xff, 174, 198, 242)));
-    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   } else {
     pParams.m_pGraphics->SetFillColor(
         CXFA_GEColor(ArgbEncode(0xff, 227, 235, 249)));
-    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   }
 
   path.Clear();
@@ -184,36 +184,36 @@
 
   pParams.m_pGraphics->SetStrokeColor(
       CXFA_GEColor(ArgbEncode(0xff, 50, 104, 205)));
-  pParams.m_pGraphics->StrokePath(&path, pMatrix);
+  pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawHSeperator(const CFWL_ThemeBackground& pParams,
-                                          const CFX_Matrix* pMatrix) {
+                                          const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   CFX_RectF rtHSep = pParams.m_rtPart;
   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(m_pThemeData->clrSeperator));
-  pParams.m_pGraphics->StrokePath(&path, pMatrix);
+  pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawWeekNumSep(const CFWL_ThemeBackground& pParams,
-                                          const CFX_Matrix* pMatrix) {
+                                          const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   CFX_RectF rtWeekSep = pParams.m_rtPart;
   path.MoveTo(rtWeekSep.TopLeft());
   path.LineTo(rtWeekSep.BottomLeft());
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(CXFA_GEColor(m_pThemeData->clrSeperator));
-  pParams.m_pGraphics->StrokePath(&path, pMatrix);
+  pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawDatesInBK(const CFWL_ThemeBackground& pParams,
-                                         const CFX_Matrix* pMatrix) {
+                                         const CFX_Matrix& matrix) {
   pParams.m_pGraphics->SaveGraphState();
   if (pParams.m_dwStates & CFWL_PartState_Selected) {
     CXFA_GEPath path;
@@ -222,7 +222,7 @@
                       rtSelDay.height);
     pParams.m_pGraphics->SetFillColor(
         CXFA_GEColor(m_pThemeData->clrDatesSelectedBK));
-    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   } else if (pParams.m_dwStates & CFWL_PartState_Hovered) {
     CXFA_GEPath path;
     CFX_RectF rtSelDay = pParams.m_rtPart;
@@ -230,14 +230,14 @@
                       rtSelDay.height);
     pParams.m_pGraphics->SetFillColor(
         CXFA_GEColor(m_pThemeData->clrDatesHoverBK));
-    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+    pParams.m_pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   }
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawDatesInCircle(
     const CFWL_ThemeBackground& pParams,
-    const CFX_Matrix* pMatrix) {
+    const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   CFX_RectF rtSelDay = pParams.m_rtPart;
   path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width,
@@ -245,12 +245,12 @@
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(
       CXFA_GEColor(m_pThemeData->clrDatesCircle));
-  pParams.m_pGraphics->StrokePath(&path, pMatrix);
+  pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
 void CFWL_MonthCalendarTP::DrawTodayCircle(const CFWL_ThemeBackground& pParams,
-                                           const CFX_Matrix* pMatrix) {
+                                           const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   CFX_RectF rtTodayCircle = pParams.m_rtPart;
   path.AddRectangle(rtTodayCircle.left, rtTodayCircle.top, rtTodayCircle.width,
@@ -258,7 +258,7 @@
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(
       CXFA_GEColor(m_pThemeData->clrDatesCircle));
-  pParams.m_pGraphics->StrokePath(&path, pMatrix);
+  pParams.m_pGraphics->StrokePath(&path, &matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.h b/xfa/fwl/theme/cfwl_monthcalendartp.h
index ee6661a..b731ca9 100644
--- a/xfa/fwl/theme/cfwl_monthcalendartp.h
+++ b/xfa/fwl/theme/cfwl_monthcalendartp.h
@@ -34,23 +34,23 @@
   };
 
   void DrawTotalBK(const CFWL_ThemeBackground& pParams,
-                   const CFX_Matrix* pMatrix);
+                   const CFX_Matrix& matrix);
   void DrawHeadBk(const CFWL_ThemeBackground& pParams,
-                  const CFX_Matrix* pMatrix);
+                  const CFX_Matrix& matrix);
   void DrawLButton(const CFWL_ThemeBackground& pParams,
-                   const CFX_Matrix* pMatrix);
+                   const CFX_Matrix& matrix);
   void DrawRButton(const CFWL_ThemeBackground& pParams,
-                   const CFX_Matrix* pMatrix);
+                   const CFX_Matrix& matrix);
   void DrawDatesInBK(const CFWL_ThemeBackground& pParams,
-                     const CFX_Matrix* pMatrix);
+                     const CFX_Matrix& matrix);
   void DrawDatesInCircle(const CFWL_ThemeBackground& pParams,
-                         const CFX_Matrix* pMatrix);
+                         const CFX_Matrix& matrix);
   void DrawTodayCircle(const CFWL_ThemeBackground& pParams,
-                       const CFX_Matrix* pMatrix);
+                       const CFX_Matrix& matrix);
   void DrawHSeperator(const CFWL_ThemeBackground& pParams,
-                      const CFX_Matrix* pMatrix);
+                      const CFX_Matrix& matrix);
   void DrawWeekNumSep(const CFWL_ThemeBackground& pParams,
-                      const CFX_Matrix* pMatrix);
+                      const CFX_Matrix& matrix);
   FWLTHEME_STATE GetState(uint32_t dwFWLStates);
   void SetThemeData();
 
diff --git a/xfa/fwl/theme/cfwl_pictureboxtp.cpp b/xfa/fwl/theme/cfwl_pictureboxtp.cpp
index 851eb74..251356f 100644
--- a/xfa/fwl/theme/cfwl_pictureboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_pictureboxtp.cpp
@@ -18,7 +18,7 @@
   switch (pParams.m_iPart) {
     case CFWL_Part::Border:
       DrawBorder(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                 &pParams.m_matrix);
+                 pParams.m_matrix);
       break;
     default:
       break;
diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.cpp b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
index 9b5d416..210aa3e 100644
--- a/xfa/fwl/theme/cfwl_pushbuttontp.cpp
+++ b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
@@ -25,7 +25,7 @@
   switch (pParams.m_iPart) {
     case CFWL_Part::Border: {
       DrawBorder(pParams.m_pGraphics.Get(), &pParams.m_rtPart,
-                 &pParams.m_matrix);
+                 pParams.m_matrix);
       break;
     }
     case CFWL_Part::Background: {
@@ -63,7 +63,7 @@
 
       int32_t iColor = GetColorID(pParams.m_dwStates);
       FillSolidRect(pGraphics, m_pThemeData->clrEnd[iColor], &rect,
-                    &pParams.m_matrix);
+                    pParams.m_matrix);
 
       pGraphics->SetStrokeColor(CXFA_GEColor(m_pThemeData->clrBorder[iColor]));
       pGraphics->StrokePath(&strokePath, &pParams.m_matrix);
@@ -76,7 +76,7 @@
       pGraphics->FillPath(&fillPath, FXFILL_WINDING, &pParams.m_matrix);
       if (pParams.m_dwStates & CFWL_PartState_Focused) {
         rtInner.Inflate(1, 1, 0, 0);
-        DrawFocus(pGraphics, &rtInner, &pParams.m_matrix);
+        DrawFocus(pGraphics, &rtInner, pParams.m_matrix);
       }
       pGraphics->RestoreGraphState();
       break;
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp
index e46675e..c557c69 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.cpp
+++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp
@@ -42,25 +42,25 @@
     case CFWL_Part::ForeArrow: {
       DrawMaxMinBtn(pGraphics, pRect,
                     bVert ? FWLTHEME_DIRECTION_Up : FWLTHEME_DIRECTION_Left,
-                    eState, &pParams.m_matrix);
+                    eState, pParams.m_matrix);
       break;
     }
     case CFWL_Part::BackArrow: {
       DrawMaxMinBtn(pGraphics, pRect,
                     bVert ? FWLTHEME_DIRECTION_Down : FWLTHEME_DIRECTION_Right,
-                    eState, &pParams.m_matrix);
+                    eState, pParams.m_matrix);
       break;
     }
     case CFWL_Part::Thumb: {
-      DrawThumbBtn(pGraphics, pRect, bVert, eState, true, &pParams.m_matrix);
+      DrawThumbBtn(pGraphics, pRect, bVert, eState, true, pParams.m_matrix);
       break;
     }
     case CFWL_Part::LowerTrack: {
-      DrawTrack(pGraphics, pRect, bVert, eState, true, &pParams.m_matrix);
+      DrawTrack(pGraphics, pRect, bVert, eState, true, pParams.m_matrix);
       break;
     }
     case CFWL_Part::UpperTrack: {
-      DrawTrack(pGraphics, pRect, bVert, eState, false, &pParams.m_matrix);
+      DrawTrack(pGraphics, pRect, bVert, eState, false, pParams.m_matrix);
       break;
     }
     default:
@@ -73,7 +73,7 @@
                                     bool bVert,
                                     FWLTHEME_STATE eState,
                                     bool bPawButton,
-                                    const CFX_Matrix* pMatrix) {
+                                    const CFX_Matrix& matrix) {
   if (eState < FWLTHEME_STATE_Normal || eState > FWLTHEME_STATE_Disable)
     return;
 
@@ -87,7 +87,7 @@
     return;
 
   FillSolidRect(pGraphics, m_pThemeData->clrBtnBK[eState - 1][1], &rect,
-                pMatrix);
+                matrix);
 
   pGraphics->SaveGraphState();
 
@@ -95,7 +95,7 @@
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
   pGraphics->SetStrokeColor(
       CXFA_GEColor(m_pThemeData->clrBtnBorder[eState - 1]));
-  pGraphics->StrokePath(&path, pMatrix);
+  pGraphics->StrokePath(&path, &matrix);
   pGraphics->RestoreGraphState();
 }
 
@@ -103,7 +103,7 @@
                                const CFX_RectF* pRect,
                                bool bVert,
                                FWLTHEME_STATE eState,
-                               const CFX_Matrix* pMatrix) {
+                               const CFX_Matrix& matrix) {
   CXFA_GEPath path;
   if (bVert) {
     float fPawLen = kPawLength;
@@ -141,7 +141,7 @@
     pGraphics->SetLineWidth(1);
     pGraphics->SetStrokeColor(
         CXFA_GEColor(m_pThemeData->clrPawColorDark[eState - 1]));
-    pGraphics->StrokePath(&path, pMatrix);
+    pGraphics->StrokePath(&path, &matrix);
   } else {
     float fPawLen = kPawLength;
     if (pRect->height / 2 <= fPawLen) {
@@ -162,7 +162,7 @@
     pGraphics->SetLineWidth(1);
     pGraphics->SetStrokeColor(
         CXFA_GEColor(m_pThemeData->clrPawColorLight[eState - 1]));
-    pGraphics->StrokePath(&path, pMatrix);
+    pGraphics->StrokePath(&path, &matrix);
     fY++;
 
     path.Clear();
@@ -178,7 +178,7 @@
     pGraphics->SetLineWidth(1);
     pGraphics->SetStrokeColor(
         CXFA_GEColor(m_pThemeData->clrPawColorDark[eState - 1]));
-    pGraphics->StrokePath(&path, pMatrix);
+    pGraphics->StrokePath(&path, &matrix);
   }
 }
 
@@ -187,7 +187,7 @@
                                  bool bVert,
                                  FWLTHEME_STATE eState,
                                  bool bLowerTrack,
-                                 const CFX_Matrix* pMatrix) {
+                                 const CFX_Matrix& matrix) {
   if (eState < FWLTHEME_STATE_Normal || eState > FWLTHEME_STATE_Disable)
     return;
 
@@ -203,25 +203,25 @@
     path.AddRectangle(pRect->left, fBottom - 1, pRect->width, 1);
   }
   pGraphics->SetFillColor(CXFA_GEColor(ArgbEncode(255, 238, 237, 229)));
-  pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   path.Clear();
   path.AddRectangle(pRect->left + 1, pRect->top, pRect->width - 2,
                     pRect->height);
   pGraphics->RestoreGraphState();
-  FillSolidRect(pGraphics, m_pThemeData->clrTrackBKEnd, pRect, pMatrix);
+  FillSolidRect(pGraphics, m_pThemeData->clrTrackBKEnd, pRect, matrix);
 }
 
 void CFWL_ScrollBarTP::DrawMaxMinBtn(CXFA_Graphics* pGraphics,
                                      const CFX_RectF* pRect,
                                      FWLTHEME_DIRECTION eDict,
                                      FWLTHEME_STATE eState,
-                                     const CFX_Matrix* pMatrix) {
+                                     const CFX_Matrix& matrix) {
   DrawTrack(pGraphics, pRect,
             eDict == FWLTHEME_DIRECTION_Up || eDict == FWLTHEME_DIRECTION_Down,
-            eState, true, pMatrix);
+            eState, true, matrix);
   CFX_RectF rtArrowBtn(*pRect);
   rtArrowBtn.Deflate(1, 1, 1, 1);
-  DrawArrowBtn(pGraphics, &rtArrowBtn, eDict, eState, pMatrix);
+  DrawArrowBtn(pGraphics, &rtArrowBtn, eDict, eState, matrix);
 }
 
 void CFWL_ScrollBarTP::SetThemeData() {
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.h b/xfa/fwl/theme/cfwl_scrollbartp.h
index 2727a0b..8f26b83 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.h
+++ b/xfa/fwl/theme/cfwl_scrollbartp.h
@@ -34,23 +34,23 @@
                     bool bVert,
                     FWLTHEME_STATE eState,
                     bool bPawButton,
-                    const CFX_Matrix* pMatrix);
+                    const CFX_Matrix& matrix);
   void DrawTrack(CXFA_Graphics* pGraphics,
                  const CFX_RectF* pRect,
                  bool bVert,
                  FWLTHEME_STATE eState,
                  bool bLowerTrack,
-                 const CFX_Matrix* pMatrix);
+                 const CFX_Matrix& matrix);
   void DrawMaxMinBtn(CXFA_Graphics* pGraphics,
                      const CFX_RectF* pRect,
                      FWLTHEME_DIRECTION eDict,
                      FWLTHEME_STATE eState,
-                     const CFX_Matrix* pMatrix);
+                     const CFX_Matrix& matrix);
   void DrawPaw(CXFA_Graphics* pGraphics,
                const CFX_RectF* pRect,
                bool bVert,
                FWLTHEME_STATE eState,
-               const CFX_Matrix* pMatrix);
+               const CFX_Matrix& matrix);
   void SetThemeData();
 
   std::unique_ptr<SBThemeData> m_pThemeData;
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 5c2bf22..d756a9a 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -102,7 +102,7 @@
 
 void CFWL_WidgetTP::DrawBorder(CXFA_Graphics* pGraphics,
                                const CFX_RectF* pRect,
-                               const CFX_Matrix* pMatrix) {
+                               const CFX_Matrix& matrix) {
   if (!pGraphics || !pRect)
     return;
 
@@ -112,20 +112,20 @@
                     pRect->height - 2);
   pGraphics->SaveGraphState();
   pGraphics->SetFillColor(CXFA_GEColor(ArgbEncode(255, 0, 0, 0)));
-  pGraphics->FillPath(&path, FXFILL_ALTERNATE, pMatrix);
+  pGraphics->FillPath(&path, FXFILL_ALTERNATE, &matrix);
   pGraphics->RestoreGraphState();
 }
 
 void CFWL_WidgetTP::FillBackground(CXFA_Graphics* pGraphics,
                                    const CFX_RectF* pRect,
-                                   const CFX_Matrix* pMatrix) {
-  FillSolidRect(pGraphics, FWLTHEME_COLOR_Background, pRect, pMatrix);
+                                   const CFX_Matrix& matrix) {
+  FillSolidRect(pGraphics, FWLTHEME_COLOR_Background, pRect, matrix);
 }
 
 void CFWL_WidgetTP::FillSolidRect(CXFA_Graphics* pGraphics,
                                   FX_ARGB fillColor,
                                   const CFX_RectF* pRect,
-                                  const CFX_Matrix* pMatrix) {
+                                  const CFX_Matrix& matrix) {
   if (!pGraphics || !pRect)
     return;
 
@@ -133,13 +133,13 @@
   path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height);
   pGraphics->SaveGraphState();
   pGraphics->SetFillColor(CXFA_GEColor(fillColor));
-  pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
   pGraphics->RestoreGraphState();
 }
 
 void CFWL_WidgetTP::DrawFocus(CXFA_Graphics* pGraphics,
                               const CFX_RectF* pRect,
-                              const CFX_Matrix* pMatrix) {
+                              const CFX_Matrix& matrix) {
   if (!pGraphics || !pRect)
     return;
 
@@ -149,7 +149,7 @@
   pGraphics->SetStrokeColor(CXFA_GEColor(0xFF000000));
   static constexpr float kDashPattern[2] = {1, 1};
   pGraphics->SetLineDash(0.0f, kDashPattern, FX_ArraySize(kDashPattern));
-  pGraphics->StrokePath(&path, pMatrix);
+  pGraphics->StrokePath(&path, &matrix);
   pGraphics->RestoreGraphState();
 }
 
@@ -157,7 +157,7 @@
                               const CFX_RectF* pRect,
                               FWLTHEME_DIRECTION eDict,
                               FX_ARGB argSign,
-                              const CFX_Matrix* pMatrix) {
+                              const CFX_Matrix& matrix) {
   bool bVert =
       (eDict == FWLTHEME_DIRECTION_Up || eDict == FWLTHEME_DIRECTION_Down);
   float fLeft =
@@ -204,32 +204,30 @@
     }
   }
   pGraphics->SetFillColor(CXFA_GEColor(argSign));
-  pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+  pGraphics->FillPath(&path, FXFILL_WINDING, &matrix);
 }
 
 void CFWL_WidgetTP::DrawBtn(CXFA_Graphics* pGraphics,
                             const CFX_RectF* pRect,
                             FWLTHEME_STATE eState,
-                            const CFX_Matrix* pMatrix) {
+                            const CFX_Matrix& matrix) {
   InitializeArrowColorData();
-  FillSolidRect(pGraphics, m_pColorData->clrEnd[eState - 1], pRect, pMatrix);
+  FillSolidRect(pGraphics, m_pColorData->clrEnd[eState - 1], pRect, matrix);
 
   CXFA_GEPath path;
   path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height);
   pGraphics->SetStrokeColor(CXFA_GEColor(m_pColorData->clrBorder[eState - 1]));
-  pGraphics->StrokePath(&path, pMatrix);
+  pGraphics->StrokePath(&path, &matrix);
 }
 
 void CFWL_WidgetTP::DrawArrowBtn(CXFA_Graphics* pGraphics,
                                  const CFX_RectF* pRect,
                                  FWLTHEME_DIRECTION eDict,
                                  FWLTHEME_STATE eState,
-                                 const CFX_Matrix* pMatrix) {
-  DrawBtn(pGraphics, pRect, eState, pMatrix);
-
+                                 const CFX_Matrix& matrix) {
+  DrawBtn(pGraphics, pRect, eState, matrix);
   InitializeArrowColorData();
-  DrawArrow(pGraphics, pRect, eDict, m_pColorData->clrSign[eState - 1],
-            pMatrix);
+  DrawArrow(pGraphics, pRect, eDict, m_pColorData->clrSign[eState - 1], matrix);
 }
 
 CFWL_FontData::CFWL_FontData() : m_dwStyles(0), m_dwCodePage(0) {}
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h
index 732b510..caf65f5 100644
--- a/xfa/fwl/theme/cfwl_widgettp.h
+++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -50,31 +50,31 @@
 
   void DrawBorder(CXFA_Graphics* pGraphics,
                   const CFX_RectF* pRect,
-                  const CFX_Matrix* pMatrix);
+                  const CFX_Matrix& matrix);
   void FillBackground(CXFA_Graphics* pGraphics,
                       const CFX_RectF* pRect,
-                      const CFX_Matrix* pMatrix);
+                      const CFX_Matrix& matrix);
   void FillSolidRect(CXFA_Graphics* pGraphics,
                      FX_ARGB fillColor,
                      const CFX_RectF* pRect,
-                     const CFX_Matrix* pMatrix);
+                     const CFX_Matrix& matrix);
   void DrawFocus(CXFA_Graphics* pGraphics,
                  const CFX_RectF* pRect,
-                 const CFX_Matrix* pMatrix);
+                 const CFX_Matrix& matrix);
   void DrawArrow(CXFA_Graphics* pGraphics,
                  const CFX_RectF* pRect,
                  FWLTHEME_DIRECTION eDict,
                  FX_ARGB argSign,
-                 const CFX_Matrix* pMatrix);
+                 const CFX_Matrix& matrix);
   void DrawBtn(CXFA_Graphics* pGraphics,
                const CFX_RectF* pRect,
                FWLTHEME_STATE eState,
-               const CFX_Matrix* pMatrix);
+               const CFX_Matrix& matrix);
   void DrawArrowBtn(CXFA_Graphics* pGraphics,
                     const CFX_RectF* pRect,
                     FWLTHEME_DIRECTION eDict,
                     FWLTHEME_STATE eState,
-                    const CFX_Matrix* pMatrix);
+                    const CFX_Matrix& matrix);
 
   uint32_t m_dwRefCount;
   std::unique_ptr<CFDE_TextOut> m_pTextOut;