diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-06-05 18:56:52 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-05 18:56:52 +0000 |
commit | 354ed202ccd4d6b9d408789a30517ebb1633570b (patch) | |
tree | 0d960f1b1c79d11d1c148aaa06c17e4c9a6bfca8 /core/fpdfapi/page/cpdf_streamcontentparser.cpp | |
parent | a9f327580558a96f659e96157731f21c6abbb951 (diff) | |
download | pdfium-354ed202ccd4d6b9d408789a30517ebb1633570b.tar.xz |
Revert "Create m_ContentStream field in CPDF_PageObject."
This reverts commit d3d8287e143daf12a602a919c120b4e0c656abf8.
Reason for revert: Need to revert https://pdfium-review.googlesource.com/c/pdfium/+/33595 that this depends on.
Original change's description:
> Create m_ContentStream field in CPDF_PageObject.
>
> Content streams are now split and can set nonzero values to identify
> each parsed content stream.
>
> Bug: pdfium:1051
> Change-Id: Ia2cb1e0997db5264d468043af31f9b41e8d0d349
> Reviewed-on: https://pdfium-review.googlesource.com/33591
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
TBR=thestig@chromium.org,hnakashima@chromium.org,rharrison@chromium.org
Change-Id: I5046b6a76508fccc0ff04cb7393cae6485dd091f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: pdfium:1051
Reviewed-on: https://pdfium-review.googlesource.com/33990
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp index 051d79ad1d..7e7c337d96 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp @@ -786,8 +786,7 @@ void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) { CFX_Matrix matrix = m_pCurStates->m_CTM; matrix.Concat(m_mtContentToUser); - auto pFormObj = pdfium::MakeUnique<CPDF_FormObject>(m_CurrentContentStream, - std::move(form), matrix); + auto pFormObj = pdfium::MakeUnique<CPDF_FormObject>(std::move(form), matrix); if (!m_pObjectHolder->BackgroundAlphaNeeded() && pFormObj->form()->BackgroundAlphaNeeded()) { m_pObjectHolder->SetBackgroundAlphaNeeded(true); @@ -802,14 +801,14 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage( if (!pStream) return nullptr; - auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>(m_CurrentContentStream); + auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>(); pImageObj->SetImage( pdfium::MakeRetain<CPDF_Image>(m_pDocument.Get(), std::move(pStream))); return AddImageObject(std::move(pImageObj)); } CPDF_ImageObject* CPDF_StreamContentParser::AddImage(uint32_t streamObjNum) { - auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>(m_CurrentContentStream); + auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>(); pImageObj->SetImage(m_pDocument->LoadImageFromPageData(streamObjNum)); return AddImageObject(std::move(pImageObj)); } @@ -819,7 +818,7 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage( if (!pImage) return nullptr; - auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>(m_CurrentContentStream); + auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>(); pImageObj->SetImage( m_pDocument->GetPageData()->GetImage(pImage->GetStream()->GetObjNum())); @@ -1086,8 +1085,7 @@ void CPDF_StreamContentParser::Handle_ShadeFill() { CFX_Matrix matrix = m_pCurStates->m_CTM; matrix.Concat(m_mtContentToUser); - auto pObj = pdfium::MakeUnique<CPDF_ShadingObject>(m_CurrentContentStream, - pShading, matrix); + auto pObj = pdfium::MakeUnique<CPDF_ShadingObject>(pShading, matrix); SetGraphicStates(pObj.get(), false, false, false); CFX_FloatRect bbox = pObj->m_ClipPath.HasRef() ? pObj->m_ClipPath.GetClipBox() : m_BBox; @@ -1222,7 +1220,7 @@ void CPDF_StreamContentParser::AddTextObject(ByteString* pStrs, pFont->IsType3Font() ? TextRenderingMode::MODE_FILL : m_pCurStates->m_TextState.GetTextMode(); { - auto pText = pdfium::MakeUnique<CPDF_TextObject>(m_CurrentContentStream); + auto pText = pdfium::MakeUnique<CPDF_TextObject>(); m_pLastTextObject = pText.get(); SetGraphicStates(m_pLastTextObject.Get(), true, true, true); if (TextRenderingModeIsStrokeMode(text_mode)) { @@ -1459,7 +1457,7 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, bool bStroke) { CFX_Matrix matrix = m_pCurStates->m_CTM; matrix.Concat(m_mtContentToUser); if (bStroke || FillType) { - auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>(m_CurrentContentStream); + auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>(); pPathObj->m_bStroke = bStroke; pPathObj->m_FillType = FillType; pPathObj->m_Path = Path; @@ -1479,10 +1477,7 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, bool bStroke) { uint32_t CPDF_StreamContentParser::Parse(const uint8_t* pData, uint32_t dwSize, - uint32_t max_cost, - uint32_t content_stream) { - m_CurrentContentStream = content_stream; - + uint32_t max_cost) { if (m_ParsedSet->size() > kMaxFormLevel || pdfium::ContainsKey(*m_ParsedSet, pData)) return dwSize; |