summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-07 09:35:36 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-07 09:35:36 -0700
commit85a65b310924eacbd2e720162cc7547153b03077 (patch)
tree118cd6e4f5417704b82d4537169a97db103a122d /core/fpdfapi
parentcb92dc762d5c35232af9f6051b04e9716247d4ae (diff)
downloadpdfium-85a65b310924eacbd2e720162cc7547153b03077.tar.xz
Maybe avoid a copy in CPDF_RenderStatus::SelectClipPath
Use the shared copy-on-write version instead of the underlying CFX_GraphStateData since it may not always get modified. Review-Url: https://codereview.chromium.org/2316823002
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp
index 89667f3a23..887ea30a42 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -653,12 +653,11 @@ FX_BOOL CPDF_RenderStatus::SelectClipPath(const CPDF_PathObject* pPathObj,
CFX_Matrix path_matrix = pPathObj->m_Matrix;
path_matrix.Concat(*pObj2Device);
if (bStroke) {
- CFX_GraphStateData graphState(*pPathObj->m_GraphState.GetObject());
- if (m_Options.m_Flags & RENDER_THINLINE) {
- graphState.m_LineWidth = 0;
- }
+ CFX_GraphState graphState = pPathObj->m_GraphState;
+ if (m_Options.m_Flags & RENDER_THINLINE)
+ graphState.SetLineWidth(0);
return m_pDevice->SetClip_PathStroke(pPathObj->m_Path.GetObject(),
- &path_matrix, &graphState);
+ &path_matrix, graphState.GetObject());
}
int fill_mode = pPathObj->m_FillType;
if (m_Options.m_Flags & RENDER_NOPATHSMOOTH) {