From 0fc185ea8a3a7028e566c05cc323e50ebce32d62 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Wed, 8 Feb 2017 12:13:20 -0500 Subject: Add EmbedderTest for adding and filling paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PathObject uses GraphState to obtain the bounding box, so I set defaults, according to Table 4.2 of PDF spec 1.7. Not testing stroke for now because the default line width seems to be too small and is not being rendered. Methodology: add the test methods to the RenderPage method in pdfium_test, and run with --png and --md5. Check that the png is reasonable with respect to the expected result, and use the output md5 on the embeddertest. BUG=pdfium:661 Change-Id: I674fe3a68374c8d58cd99aaf9dad66e29e057281 Reviewed-on: https://pdfium-review.googlesource.com/2554 Reviewed-by: Tom Sepez Reviewed-by: dsinclair Commit-Queue: Nicolás Peña --- core/fxge/ge/cfx_graphstate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/fxge') diff --git a/core/fxge/ge/cfx_graphstate.cpp b/core/fxge/ge/cfx_graphstate.cpp index 7eb6d3d853..6357aa51a4 100644 --- a/core/fxge/ge/cfx_graphstate.cpp +++ b/core/fxge/ge/cfx_graphstate.cpp @@ -30,7 +30,7 @@ void CFX_GraphState::SetLineDash(CPDF_Array* pArray, } FX_FLOAT CFX_GraphState::GetLineWidth() const { - return m_Ref.GetObject()->m_LineWidth; + return m_Ref.GetObject() ? m_Ref.GetObject()->m_LineWidth : 1.f; } void CFX_GraphState::SetLineWidth(FX_FLOAT width) { @@ -53,7 +53,7 @@ void CFX_GraphState::SetLineJoin(CFX_GraphStateData::LineJoin join) { } FX_FLOAT CFX_GraphState::GetMiterLimit() const { - return m_Ref.GetObject()->m_MiterLimit; + return m_Ref.GetObject() ? m_Ref.GetObject()->m_MiterLimit : 10.f; } void CFX_GraphState::SetMiterLimit(FX_FLOAT limit) { -- cgit v1.2.3