summaryrefslogtreecommitdiff
path: root/core/fxge/agg
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 /core/fxge/agg
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 'core/fxge/agg')
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 063f36d600..69006b6083 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -285,14 +285,14 @@ void RasterizeStroke(agg::rasterizer_scanline_aa* rasterizer,
1.0f / ((pObject2Device->GetXUnit() + pObject2Device->GetYUnit()) / 2);
}
width = std::max(width, unit);
- if (pGraphState->m_DashArray) {
+ if (!pGraphState->m_DashArray.empty()) {
typedef agg::conv_dash<agg::path_storage> dash_converter;
dash_converter dash(*path_data);
- for (int i = 0; i < (pGraphState->m_DashCount + 1) / 2; i++) {
+ for (size_t i = 0; i < (pGraphState->m_DashArray.size() + 1) / 2; i++) {
float on = pGraphState->m_DashArray[i * 2];
if (on <= 0.000001f)
on = 1.0f / 10;
- float off = i * 2 + 1 == pGraphState->m_DashCount
+ float off = i * 2 + 1 == pGraphState->m_DashArray.size()
? on
: pGraphState->m_DashArray[i * 2 + 1];
off = std::max(off, 0.0f);