From 85a65b310924eacbd2e720162cc7547153b03077 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 7 Sep 2016 09:35:36 -0700 Subject: 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 --- core/fpdfapi/fpdf_render/fpdf_render.cpp | 9 ++++----- 1 file 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) { -- cgit v1.2.3