summaryrefslogtreecommitdiff
path: root/xfa/fxgraphics/cxfa_graphics.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-17 19:29:46 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-17 19:29:46 +0000
commitc37fa7d9c5c60ac407b46bfc2e7745afa0b2df85 (patch)
treeacca98967c4e532732ef9b15a399b2dc710e01e5 /xfa/fxgraphics/cxfa_graphics.cpp
parentdcc2f3cf96fd20782c32ae03629427fb93b219b2 (diff)
downloadpdfium-c37fa7d9c5c60ac407b46bfc2e7745afa0b2df85.tar.xz
Move code related to stroke line dash to CXFA_Stroke
This CL moves XFA_StrokeTypeSetLineDash into the CXFA_Stroke class and cleans up the unused CXFA_Graphics code for setting line dash values. Change-Id: If6db6c315571dbcea630bc32e0d05dae6c0f10be Reviewed-on: https://pdfium-review.googlesource.com/23114 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxgraphics/cxfa_graphics.cpp')
-rw-r--r--xfa/fxgraphics/cxfa_graphics.cpp35
1 files changed, 2 insertions, 33 deletions
diff --git a/xfa/fxgraphics/cxfa_graphics.cpp b/xfa/fxgraphics/cxfa_graphics.cpp
index 47517309b7..d1e2f35c7e 100644
--- a/xfa/fxgraphics/cxfa_graphics.cpp
+++ b/xfa/fxgraphics/cxfa_graphics.cpp
@@ -154,9 +154,9 @@ void CXFA_Graphics::SetLineDash(float dashPhase,
}
}
-void CXFA_Graphics::SetLineDash(FX_DashStyle dashStyle) {
+void CXFA_Graphics::SetSolidLineDash() {
if (m_type == FX_CONTEXT_Device && m_renderDevice)
- RenderDeviceSetLineDash(dashStyle);
+ m_info.graphState.SetDashCount(0);
}
void CXFA_Graphics::SetLineWidth(float lineWidth) {
@@ -229,37 +229,6 @@ CFX_RenderDevice* CXFA_Graphics::GetRenderDevice() {
return m_renderDevice;
}
-void CXFA_Graphics::RenderDeviceSetLineDash(FX_DashStyle dashStyle) {
- switch (dashStyle) {
- case FX_DASHSTYLE_Solid: {
- m_info.graphState.SetDashCount(0);
- return;
- }
- case FX_DASHSTYLE_Dash: {
- float dashArray[] = {3, 1};
- SetLineDash(0, dashArray, 2);
- return;
- }
- case FX_DASHSTYLE_Dot: {
- float dashArray[] = {1, 1};
- SetLineDash(0, dashArray, 2);
- return;
- }
- case FX_DASHSTYLE_DashDot: {
- float dashArray[] = {3, 1, 1, 1};
- SetLineDash(0, dashArray, 4);
- return;
- }
- case FX_DASHSTYLE_DashDotDot: {
- float dashArray[] = {4, 1, 2, 1, 2, 1};
- SetLineDash(0, dashArray, 6);
- return;
- }
- default:
- return;
- }
-}
-
void CXFA_Graphics::RenderDeviceStrokePath(const CXFA_GEPath* path,
const CFX_Matrix* matrix) {
if (m_info.strokeColor.GetType() != CXFA_GEColor::Solid)