summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-09-24 17:55:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-24 17:55:00 +0000
commitfed6e124109f089a38e24e37b104d983231bee78 (patch)
tree6c1aa45a97eb27c67611dbe7480bdbcd26710d14 /fpdfsdk
parent97f4483de007c2ff248696f24d34634e0adbf894 (diff)
downloadpdfium-fed6e124109f089a38e24e37b104d983231bee78.tar.xz
Give CFX_GraphStateData a work-over.chromium/3561
Use std::vector<float> for dash array. Use compiler-generated default operations. Squeeze some enums. Fix obvious logic botch in DashChanged(). Change-Id: If1d809cc46a3cf2db98a09a3f5a49d22138c0640 Reviewed-on: https://pdfium-review.googlesource.com/42613 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp3
-rw-r--r--fpdfsdk/pwl/cpwl_edit.cpp10
2 files changed, 5 insertions, 8 deletions
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 7feda490ba..d76ce99578 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -86,8 +86,7 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
false);
CFX_GraphStateData gsd;
- gsd.SetDashCount(1);
- gsd.m_DashArray[0] = 1.0f;
+ gsd.m_DashArray = {1.0f};
gsd.m_DashPhase = 0;
gsd.m_LineWidth = 1.0f;
pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255, 0, 0, 0),
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp
index c4ff2f4bd4..4cd238b679 100644
--- a/fpdfsdk/pwl/cpwl_edit.cpp
+++ b/fpdfsdk/pwl/cpwl_edit.cpp
@@ -201,12 +201,10 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
}
case BorderStyle::DASH: {
CFX_GraphStateData gsd;
- gsd.m_LineWidth = (float)GetBorderWidth();
-
- gsd.SetDashCount(2);
- gsd.m_DashArray[0] = (float)GetBorderDash().nDash;
- gsd.m_DashArray[1] = (float)GetBorderDash().nGap;
- gsd.m_DashPhase = (float)GetBorderDash().nPhase;
+ gsd.m_LineWidth = static_cast<float>(GetBorderWidth());
+ gsd.m_DashArray = {static_cast<float>(GetBorderDash().nDash),
+ static_cast<float>(GetBorderDash().nGap)};
+ gsd.m_DashPhase = static_cast<float>(GetBorderDash().nPhase);
CFX_PathData path;
for (int32_t i = 0; i < nCharArray - 1; i++) {