Pass matrix by const-ref in CFGAS_GEGraphics::StrokePath()

Change-Id: I245ee50f52019ebcefce81241466e902caf78bd7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/80071
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/xfa/fgas/graphics/cfgas_gegraphics.cpp b/xfa/fgas/graphics/cfgas_gegraphics.cpp
index 63145ca..c06262c 100644
--- a/xfa/fgas/graphics/cfgas_gegraphics.cpp
+++ b/xfa/fgas/graphics/cfgas_gegraphics.cpp
@@ -167,7 +167,7 @@
 }
 
 void CFGAS_GEGraphics::StrokePath(const CFGAS_GEPath& path,
-                                  const CFX_Matrix* matrix) {
+                                  const CFX_Matrix& matrix) {
   RenderDeviceStrokePath(path, matrix);
 }
 
@@ -201,14 +201,12 @@
 }
 
 void CFGAS_GEGraphics::RenderDeviceStrokePath(const CFGAS_GEPath& path,
-                                              const CFX_Matrix* matrix) {
+                                              const CFX_Matrix& matrix) {
   if (m_info.strokeColor.GetType() != CFGAS_GEColor::Solid)
     return;
 
   CFX_Matrix m = m_info.CTM;
-  if (matrix)
-    m.Concat(*matrix);
-
+  m.Concat(matrix);
   m_renderDevice->DrawPath(path.GetPathData(), &m, &m_info.graphState, 0x0,
                            m_info.strokeColor.GetArgb(),
                            CFX_FillRenderOptions());
diff --git a/xfa/fgas/graphics/cfgas_gegraphics.h b/xfa/fgas/graphics/cfgas_gegraphics.h
index edf5d79..f7dc999 100644
--- a/xfa/fgas/graphics/cfgas_gegraphics.h
+++ b/xfa/fgas/graphics/cfgas_gegraphics.h
@@ -50,7 +50,7 @@
   void SetStrokeColor(const CFGAS_GEColor& color);
   void SetFillColor(const CFGAS_GEColor& color);
   void SetClipRect(const CFX_RectF& rect);
-  void StrokePath(const CFGAS_GEPath& path, const CFX_Matrix* matrix);
+  void StrokePath(const CFGAS_GEPath& path, const CFX_Matrix& matrix);
   void FillPath(const CFGAS_GEPath& path,
                 CFX_FillRenderOptions::FillType fill_type,
                 const CFX_Matrix& matrix);
@@ -70,7 +70,7 @@
   };
 
   void RenderDeviceStrokePath(const CFGAS_GEPath& path,
-                              const CFX_Matrix* matrix);
+                              const CFX_Matrix& matrix);
   void RenderDeviceFillPath(const CFGAS_GEPath& path,
                             CFX_FillRenderOptions::FillType fill_type,
                             const CFX_Matrix& matrix);
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index 108b844..10dd265 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -84,7 +84,7 @@
   pGraphics->SaveGraphState();
   pGraphics->SetStrokeColor(CFGAS_GEColor(argbFill));
   pGraphics->SetLineWidth(1.0f);
-  pGraphics->StrokePath(path, &matrix);
+  pGraphics->StrokePath(path, matrix);
   pGraphics->RestoreGraphState();
 }
 
diff --git a/xfa/fwl/theme/cfwl_edittp.cpp b/xfa/fwl/theme/cfwl_edittp.cpp
index 60285d6..5188d0d 100644
--- a/xfa/fwl/theme/cfwl_edittp.cpp
+++ b/xfa/fwl/theme/cfwl_edittp.cpp
@@ -26,7 +26,7 @@
     pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(cr));
     pParams.m_pGraphics->SetLineWidth(fWidth);
     if (pParams.m_pPath)
-      pParams.m_pGraphics->StrokePath(*pParams.m_pPath, &pParams.m_matrix);
+      pParams.m_pGraphics->StrokePath(*pParams.m_pPath, pParams.m_matrix);
     return;
   }
 
@@ -72,7 +72,7 @@
       pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(0xFF000000));
       pParams.m_pGraphics->SetLineWidth(1.0f);
       if (pParams.m_pPath)
-        pParams.m_pGraphics->StrokePath(*pParams.m_pPath, &pParams.m_matrix);
+        pParams.m_pGraphics->StrokePath(*pParams.m_pPath, pParams.m_matrix);
       break;
     }
     default:
diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
index c47b13a..b889be0 100644
--- a/xfa/fwl/theme/cfwl_monthcalendartp.cpp
+++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
@@ -130,7 +130,7 @@
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(
       CFGAS_GEColor(ArgbEncode(0xff, 205, 219, 243)));
-  pParams.m_pGraphics->StrokePath(path, &matrix);
+  pParams.m_pGraphics->StrokePath(path, matrix);
   if (pParams.m_dwStates & CFWL_PartState_Pressed) {
     pParams.m_pGraphics->SetFillColor(
         CFGAS_GEColor(ArgbEncode(0xff, 174, 198, 242)));
@@ -153,7 +153,7 @@
 
   pParams.m_pGraphics->SetStrokeColor(
       CFGAS_GEColor(ArgbEncode(0xff, 50, 104, 205)));
-  pParams.m_pGraphics->StrokePath(path, &matrix);
+  pParams.m_pGraphics->StrokePath(path, matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
@@ -165,7 +165,7 @@
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(
       CFGAS_GEColor(ArgbEncode(0xff, 205, 219, 243)));
-  pParams.m_pGraphics->StrokePath(path, &matrix);
+  pParams.m_pGraphics->StrokePath(path, matrix);
   if (pParams.m_dwStates & CFWL_PartState_Pressed) {
     pParams.m_pGraphics->SetFillColor(
         CFGAS_GEColor(ArgbEncode(0xff, 174, 198, 242)));
@@ -188,7 +188,7 @@
 
   pParams.m_pGraphics->SetStrokeColor(
       CFGAS_GEColor(ArgbEncode(0xff, 50, 104, 205)));
-  pParams.m_pGraphics->StrokePath(path, &matrix);
+  pParams.m_pGraphics->StrokePath(path, matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
@@ -200,7 +200,7 @@
   path.LineTo(CFX_PointF(rtHSep.right(), rtHSep.top + rtHSep.height / 2));
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(kSeparatorColor));
-  pParams.m_pGraphics->StrokePath(path, &matrix);
+  pParams.m_pGraphics->StrokePath(path, matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
@@ -212,7 +212,7 @@
   path.LineTo(rtWeekSep.BottomLeft());
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(kSeparatorColor));
-  pParams.m_pGraphics->StrokePath(path, &matrix);
+  pParams.m_pGraphics->StrokePath(path, matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
@@ -250,7 +250,7 @@
                     rtSelDay.height);
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(kDatesCircleColor));
-  pParams.m_pGraphics->StrokePath(path, &matrix);
+  pParams.m_pGraphics->StrokePath(path, matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
@@ -262,7 +262,7 @@
                     rtTodayCircle.height);
   pParams.m_pGraphics->SaveGraphState();
   pParams.m_pGraphics->SetStrokeColor(CFGAS_GEColor(kDatesCircleColor));
-  pParams.m_pGraphics->StrokePath(path, &matrix);
+  pParams.m_pGraphics->StrokePath(path, matrix);
   pParams.m_pGraphics->RestoreGraphState();
 }
 
diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.cpp b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
index 724854e..3e7b65e 100644
--- a/xfa/fwl/theme/cfwl_pushbuttontp.cpp
+++ b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
@@ -66,7 +66,7 @@
                     pParams.m_matrix);
 
       pGraphics->SetStrokeColor(CFGAS_GEColor(m_pThemeData->clrBorder[iColor]));
-      pGraphics->StrokePath(strokePath, &pParams.m_matrix);
+      pGraphics->StrokePath(strokePath, pParams.m_matrix);
 
       fillPath.Clear();
       fillPath.AddRectangle(rtInner.left, rtInner.top, rtInner.width,
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp
index 9175bc1..164d37d 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.cpp
+++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp
@@ -90,7 +90,7 @@
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
   pGraphics->SetStrokeColor(
       CFGAS_GEColor(m_pThemeData->clrBtnBorder[eState - 1]));
-  pGraphics->StrokePath(path, &matrix);
+  pGraphics->StrokePath(path, matrix);
   pGraphics->RestoreGraphState();
 }
 
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 2febc07..7e763d1 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -134,7 +134,7 @@
   pGraphics->SetStrokeColor(CFGAS_GEColor(0xFF000000));
   static constexpr float kDashPattern[2] = {1, 1};
   pGraphics->SetLineDash(0.0f, kDashPattern);
-  pGraphics->StrokePath(path, &matrix);
+  pGraphics->StrokePath(path, matrix);
   pGraphics->RestoreGraphState();
 }
 
@@ -200,7 +200,7 @@
   CFGAS_GEPath path;
   path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
   pGraphics->SetStrokeColor(CFGAS_GEColor(m_pColorData->clrBorder[eState - 1]));
-  pGraphics->StrokePath(path, &matrix);
+  pGraphics->StrokePath(path, matrix);
 }
 
 void CFWL_WidgetTP::DrawArrowBtn(CFGAS_GEGraphics* pGraphics,
diff --git a/xfa/fxfa/cxfa_ffline.cpp b/xfa/fxfa/cxfa_ffline.cpp
index c54ffe0..37e3bae 100644
--- a/xfa/fxfa/cxfa_ffline.cpp
+++ b/xfa/fxfa/cxfa_ffline.cpp
@@ -135,6 +135,6 @@
 
   pGS->SetStrokeColor(CFGAS_GEColor(lineColor));
   pGS->SetLineCap(LineCapToFXGE(iCap));
-  pGS->StrokePath(linePath, &mtRotate);
+  pGS->StrokePath(linePath, mtRotate);
   pGS->RestoreGraphState();
 }
diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp
index ab14e40..844d2e5 100644
--- a/xfa/fxfa/cxfa_ffpushbutton.cpp
+++ b/xfa/fxfa/cxfa_ffpushbutton.cpp
@@ -238,7 +238,7 @@
       CFGAS_GEPath path;
       CFX_RectF rect = pWidget->GetWidgetRect();
       path.AddRectangle(0, 0, rect.width, rect.height);
-      pGraphics->StrokePath(path, &matrix);
+      pGraphics->StrokePath(path, matrix);
     }
   }
 }
diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp
index dd196fc..6f596b2 100644
--- a/xfa/fxfa/parser/cxfa_box.cpp
+++ b/xfa/fxfa/parser/cxfa_box.cpp
@@ -329,25 +329,25 @@
                  FX_PI);
 
   pGS->SetStrokeColor(CFGAS_GEColor(0xFF808080));
-  pGS->StrokePath(arcPath, &matrix);
+  pGS->StrokePath(arcPath, matrix);
   arcPath.Clear();
   arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FX_PI / 4.0f,
                  FX_PI);
 
   pGS->SetStrokeColor(CFGAS_GEColor(0xFFFFFFFF));
-  pGS->StrokePath(arcPath, &matrix);
+  pGS->StrokePath(arcPath, matrix);
   rtWidget.Deflate(fHalf, fHalf);
   arcPath.Clear();
   arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FX_PI / 4.0f,
                  FX_PI);
 
   pGS->SetStrokeColor(CFGAS_GEColor(0xFF404040));
-  pGS->StrokePath(arcPath, &matrix);
+  pGS->StrokePath(arcPath, matrix);
   arcPath.Clear();
   arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FX_PI / 4.0f,
                  FX_PI);
 
   pGS->SetStrokeColor(CFGAS_GEColor(0xFFC0C0C0));
-  pGS->StrokePath(arcPath, &matrix);
+  pGS->StrokePath(arcPath, matrix);
   pGS->RestoreGraphState();
 }
diff --git a/xfa/fxfa/parser/cxfa_stroke.cpp b/xfa/fxfa/parser/cxfa_stroke.cpp
index 0a3dd5c..45ac038 100644
--- a/xfa/fxfa/parser/cxfa_stroke.cpp
+++ b/xfa/fxfa/parser/cxfa_stroke.cpp
@@ -186,6 +186,6 @@
   pGS->SetLineCap(CFX_GraphStateData::LineCapButt);
   XFA_StrokeTypeSetLineDash(pGS, GetStrokeType(), XFA_AttributeValue::Butt);
   pGS->SetStrokeColor(CFGAS_GEColor(GetColor()));
-  pGS->StrokePath(pPath, &matrix);
+  pGS->StrokePath(pPath, matrix);
   pGS->RestoreGraphState();
 }