From 4caa1200938a397d7f2f193872355129adb768ed Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Fri, 6 Jul 2018 20:32:29 +0000 Subject: Maintain a stack of CPDF_ContentMark while parsing a stream. This avoids copying the CPDF_ContentMark every time a mark is closed. Another benefit is that the same CPDF_ContentMarkItem vector will be shared by page objects before and after a nested mark. Bug: pdfium:1037 Change-Id: I6197f0b9a4693ef84da9269f86a2629aa50d8685 Reviewed-on: https://pdfium-review.googlesource.com/37190 Commit-Queue: Henrique Nakashima Reviewed-by: Ryan Harrison --- core/fpdfapi/page/cpdf_streamcontentparser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.h') diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h index ae0a7f39af..238999b846 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.h +++ b/core/fpdfapi/page/cpdf_streamcontentparser.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "core/fpdfapi/page/cpdf_contentmark.h" @@ -219,7 +220,7 @@ class CPDF_StreamContentParser { uint32_t m_ParamCount; UnownedPtr m_pSyntax; std::unique_ptr m_pCurStates; - std::unique_ptr m_pCurContentMark; + std::stack> m_ContentMarksStack; std::vector> m_ClipTextList; UnownedPtr m_pLastTextObject; float m_DefFontSize; -- cgit v1.2.3