summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_streamcontentparser.h
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-07-06 20:32:29 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-06 20:32:29 +0000
commit4caa1200938a397d7f2f193872355129adb768ed (patch)
tree4f3a3d3e3d8d0a6eb3ef3e30a114562cd69ca38e /core/fpdfapi/page/cpdf_streamcontentparser.h
parent05aa09d3ebfd587dd8e1116b6cac8053a2944a1a (diff)
downloadpdfium-4caa1200938a397d7f2f193872355129adb768ed.tar.xz
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 <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.h')
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.h3
1 files changed, 2 insertions, 1 deletions
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 <map>
#include <memory>
#include <set>
+#include <stack>
#include <vector>
#include "core/fpdfapi/page/cpdf_contentmark.h"
@@ -219,7 +220,7 @@ class CPDF_StreamContentParser {
uint32_t m_ParamCount;
UnownedPtr<CPDF_StreamParser> m_pSyntax;
std::unique_ptr<CPDF_AllStates> m_pCurStates;
- std::unique_ptr<CPDF_ContentMark> m_pCurContentMark;
+ std::stack<std::unique_ptr<CPDF_ContentMark>> m_ContentMarksStack;
std::vector<std::unique_ptr<CPDF_TextObject>> m_ClipTextList;
UnownedPtr<CPDF_TextObject> m_pLastTextObject;
float m_DefFontSize;