diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-09-24 17:55:00 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-09-24 17:55:00 +0000 |
commit | fed6e124109f089a38e24e37b104d983231bee78 (patch) | |
tree | 6c1aa45a97eb27c67611dbe7480bdbcd26710d14 /core/fxge/win32/cfx_psrenderer.cpp | |
parent | 97f4483de007c2ff248696f24d34634e0adbf894 (diff) | |
download | pdfium-chromium/3561.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/win32/cfx_psrenderer.cpp')
-rw-r--r-- | core/fxge/win32/cfx_psrenderer.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index dbc212123c..12795d0cc5 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -311,13 +311,10 @@ void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState) { buf << pGraphState->m_LineCap << " J\n"; } if (!m_bGraphStateSet || - m_CurGraphState.m_DashCount != pGraphState->m_DashCount || - memcmp(m_CurGraphState.m_DashArray, pGraphState->m_DashArray, - sizeof(float) * m_CurGraphState.m_DashCount)) { + m_CurGraphState.m_DashArray != pGraphState->m_DashArray) { buf << "["; - for (int i = 0; i < pGraphState->m_DashCount; ++i) - buf << pGraphState->m_DashArray[i] << " "; - + for (const auto& dash : pGraphState->m_DashArray) + buf << dash << " "; buf << "]" << pGraphState->m_DashPhase << " d\n"; } if (!m_bGraphStateSet || @@ -332,7 +329,7 @@ void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState) { m_CurGraphState.m_MiterLimit != pGraphState->m_MiterLimit) { buf << pGraphState->m_MiterLimit << " M\n"; } - m_CurGraphState.Copy(*pGraphState); + m_CurGraphState = *pGraphState; m_bGraphStateSet = true; WriteToStream(&buf); } |