Remove unnecessary CFX_GraphStateData initialization
There is no need to instantiate a CFX_GraphStateData, and immediately
set its member variables to their default values. Delete code that does
this.
Change-Id: I50d8fd2afae8e128b9b82089662748f4d3ecf703
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/124811
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@google.com>
diff --git a/core/fxge/cfx_drawutils.cpp b/core/fxge/cfx_drawutils.cpp
index 7226cff..91910c2 100644
--- a/core/fxge/cfx_drawutils.cpp
+++ b/core/fxge/cfx_drawutils.cpp
@@ -32,8 +32,6 @@
CFX_GraphStateData graph_state_data;
graph_state_data.m_DashArray = {1.0f};
- graph_state_data.m_DashPhase = 0;
- graph_state_data.m_LineWidth = 1.0f;
render_device->DrawPath(path, &user_to_device, &graph_state_data, 0,
ArgbEncode(255, 0, 0, 0),
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 6d52dc2..6c48e2f 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -1405,7 +1405,6 @@
case BorderStyle::kDash: {
CFX_GraphStateData gsd;
gsd.m_DashArray = {3.0f, 3.0f};
- gsd.m_DashPhase = 0;
gsd.m_LineWidth = fWidth;
CFX_Path path;
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp
index 696324c..36daaea 100644
--- a/xfa/fxfa/cxfa_textlayout.cpp
+++ b/xfa/fxfa/cxfa_textlayout.cpp
@@ -1274,13 +1274,8 @@
}
}
- CFX_GraphStateData graphState;
- graphState.m_LineCap = CFX_GraphStateData::LineCap::kButt;
- graphState.m_LineJoin = CFX_GraphStateData::LineJoin::kMiter;
- graphState.m_LineWidth = 1;
- graphState.m_MiterLimit = 10;
- graphState.m_DashPhase = 0;
- pDevice->DrawPath(path, &mtDoc2Device, &graphState, 0, pPiece->dwColor,
+ const CFX_GraphStateData graph_state;
+ pDevice->DrawPath(path, &mtDoc2Device, &graph_state, 0, pPiece->dwColor,
CFX_FillRenderOptions());
}