| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "core/fpdfapi/fpdf_page/pageint.h" | 7 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 8 | 8 |
| 9 #include <limits.h> | 9 #include <limits.h> |
| 10 | 10 |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 if (pParentMatrix) { | 699 if (pParentMatrix) { |
| 700 form_bbox.Transform(pParentMatrix); | 700 form_bbox.Transform(pParentMatrix); |
| 701 } | 701 } |
| 702 } | 702 } |
| 703 CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDictBy("Resources"); | 703 CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDictBy("Resources"); |
| 704 m_pParser.reset(new CPDF_StreamContentParser( | 704 m_pParser.reset(new CPDF_StreamContentParser( |
| 705 pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources, | 705 pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources, |
| 706 pParentMatrix, pForm, pResources, &form_bbox, pGraphicStates, level)); | 706 pParentMatrix, pForm, pResources, &form_bbox, pGraphicStates, level)); |
| 707 m_pParser->GetCurStates()->m_CTM = form_matrix; | 707 m_pParser->GetCurStates()->m_CTM = form_matrix; |
| 708 m_pParser->GetCurStates()->m_ParentMatrix = form_matrix; | 708 m_pParser->GetCurStates()->m_ParentMatrix = form_matrix; |
| 709 if (ClipPath.NotNull()) { | 709 if (ClipPath) { |
| 710 m_pParser->GetCurStates()->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, | 710 m_pParser->GetCurStates()->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, |
| 711 TRUE); | 711 TRUE); |
| 712 } | 712 } |
| 713 if (pForm->m_Transparency & PDFTRANS_GROUP) { | 713 if (pForm->m_Transparency & PDFTRANS_GROUP) { |
| 714 CPDF_GeneralStateData* pData = | 714 CPDF_GeneralStateData* pData = |
| 715 m_pParser->GetCurStates()->m_GeneralState.GetModify(); | 715 m_pParser->GetCurStates()->m_GeneralState.GetModify(); |
| 716 pData->m_BlendType = FXDIB_BLEND_NORMAL; | 716 pData->m_BlendType = FXDIB_BLEND_NORMAL; |
| 717 pData->m_StrokeAlpha = 1.0f; | 717 pData->m_StrokeAlpha = 1.0f; |
| 718 pData->m_FillAlpha = 1.0f; | 718 pData->m_FillAlpha = 1.0f; |
| 719 pData->m_pSoftMask = nullptr; | 719 pData->m_pSoftMask = nullptr; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 m_pType3Char->m_BBox.left = | 792 m_pType3Char->m_BBox.left = |
| 793 FXSYS_round(m_pParser->GetType3Data()[2] * 1000); | 793 FXSYS_round(m_pParser->GetType3Data()[2] * 1000); |
| 794 m_pType3Char->m_BBox.bottom = | 794 m_pType3Char->m_BBox.bottom = |
| 795 FXSYS_round(m_pParser->GetType3Data()[3] * 1000); | 795 FXSYS_round(m_pParser->GetType3Data()[3] * 1000); |
| 796 m_pType3Char->m_BBox.right = | 796 m_pType3Char->m_BBox.right = |
| 797 FXSYS_round(m_pParser->GetType3Data()[4] * 1000); | 797 FXSYS_round(m_pParser->GetType3Data()[4] * 1000); |
| 798 m_pType3Char->m_BBox.top = | 798 m_pType3Char->m_BBox.top = |
| 799 FXSYS_round(m_pParser->GetType3Data()[5] * 1000); | 799 FXSYS_round(m_pParser->GetType3Data()[5] * 1000); |
| 800 } | 800 } |
| 801 for (auto& pObj : *m_pObjectHolder->GetPageObjectList()) { | 801 for (auto& pObj : *m_pObjectHolder->GetPageObjectList()) { |
| 802 if (pObj->m_ClipPath.IsNull()) { | 802 if (!pObj->m_ClipPath) |
| 803 continue; | 803 continue; |
| 804 } | 804 if (pObj->m_ClipPath.GetPathCount() != 1) |
| 805 if (pObj->m_ClipPath.GetPathCount() != 1) { | |
| 806 continue; | 805 continue; |
| 807 } | 806 if (pObj->m_ClipPath.GetTextCount()) |
| 808 if (pObj->m_ClipPath.GetTextCount()) { | |
| 809 continue; | 807 continue; |
| 810 } | |
| 811 CPDF_Path ClipPath = pObj->m_ClipPath.GetPath(0); | 808 CPDF_Path ClipPath = pObj->m_ClipPath.GetPath(0); |
| 812 if (!ClipPath.IsRect() || pObj->IsShading()) { | 809 if (!ClipPath.IsRect() || pObj->IsShading()) |
| 813 continue; | 810 continue; |
| 814 } | |
| 815 CFX_FloatRect old_rect(ClipPath.GetPointX(0), ClipPath.GetPointY(0), | 811 CFX_FloatRect old_rect(ClipPath.GetPointX(0), ClipPath.GetPointY(0), |
| 816 ClipPath.GetPointX(2), ClipPath.GetPointY(2)); | 812 ClipPath.GetPointX(2), ClipPath.GetPointY(2)); |
| 817 CFX_FloatRect obj_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, | 813 CFX_FloatRect obj_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, |
| 818 pObj->m_Top); | 814 pObj->m_Top); |
| 819 if (old_rect.Contains(obj_rect)) { | 815 if (old_rect.Contains(obj_rect)) { |
| 820 pObj->m_ClipPath.SetNull(); | 816 pObj->m_ClipPath.SetNull(); |
| 821 } | 817 } |
| 822 } | 818 } |
| 823 m_Status = Done; | 819 m_Status = Done; |
| 824 return; | 820 return; |
| 825 } | 821 } |
| 826 steps++; | 822 steps++; |
| 827 if (pPause && pPause->NeedToPauseNow()) { | 823 if (pPause && pPause->NeedToPauseNow()) { |
| 828 break; | 824 break; |
| 829 } | 825 } |
| 830 } | 826 } |
| 831 } | 827 } |
| OLD | NEW |