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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrixBy("Matrix"); | 682 CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrixBy("Matrix"); |
683 if (pGraphicStates) { | 683 if (pGraphicStates) { |
684 form_matrix.Concat(pGraphicStates->m_CTM); | 684 form_matrix.Concat(pGraphicStates->m_CTM); |
685 } | 685 } |
686 CPDF_Array* pBBox = pForm->m_pFormDict->GetArrayBy("BBox"); | 686 CPDF_Array* pBBox = pForm->m_pFormDict->GetArrayBy("BBox"); |
687 CFX_FloatRect form_bbox; | 687 CFX_FloatRect form_bbox; |
688 CPDF_Path ClipPath; | 688 CPDF_Path ClipPath; |
689 if (pBBox) { | 689 if (pBBox) { |
690 form_bbox = pBBox->GetRect(); | 690 form_bbox = pBBox->GetRect(); |
691 ClipPath.New(); | 691 ClipPath.New(); |
692 ClipPath->AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right, | 692 ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right, |
693 form_bbox.top); | 693 form_bbox.top); |
694 ClipPath.Transform(&form_matrix); | 694 ClipPath.Transform(&form_matrix); |
695 if (pParentMatrix) { | 695 if (pParentMatrix) { |
696 ClipPath.Transform(pParentMatrix); | 696 ClipPath.Transform(pParentMatrix); |
697 } | 697 } |
698 form_bbox.Transform(&form_matrix); | 698 form_bbox.Transform(&form_matrix); |
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"); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 FXSYS_round(m_pParser->GetType3Data()[5] * 1000); | 801 FXSYS_round(m_pParser->GetType3Data()[5] * 1000); |
802 } | 802 } |
803 for (auto& pObj : *m_pObjectHolder->GetPageObjectList()) { | 803 for (auto& pObj : *m_pObjectHolder->GetPageObjectList()) { |
804 if (!pObj->m_ClipPath) | 804 if (!pObj->m_ClipPath) |
805 continue; | 805 continue; |
806 if (pObj->m_ClipPath.GetPathCount() != 1) | 806 if (pObj->m_ClipPath.GetPathCount() != 1) |
807 continue; | 807 continue; |
808 if (pObj->m_ClipPath.GetTextCount()) | 808 if (pObj->m_ClipPath.GetTextCount()) |
809 continue; | 809 continue; |
810 CPDF_Path ClipPath = pObj->m_ClipPath.GetPath(0); | 810 CPDF_Path ClipPath = pObj->m_ClipPath.GetPath(0); |
811 if (!ClipPath->IsRect() || pObj->IsShading()) | 811 if (!ClipPath.IsRect() || pObj->IsShading()) |
812 continue; | 812 continue; |
813 CFX_FloatRect old_rect(ClipPath->GetPointX(0), ClipPath->GetPointY(0), | 813 CFX_FloatRect old_rect(ClipPath.GetPointX(0), ClipPath.GetPointY(0), |
814 ClipPath->GetPointX(2), ClipPath->GetPointY(2)); | 814 ClipPath.GetPointX(2), ClipPath.GetPointY(2)); |
815 CFX_FloatRect obj_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, | 815 CFX_FloatRect obj_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, |
816 pObj->m_Top); | 816 pObj->m_Top); |
817 if (old_rect.Contains(obj_rect)) | 817 if (old_rect.Contains(obj_rect)) |
818 pObj->m_ClipPath.Clear(); | 818 pObj->m_ClipPath.Clear(); |
819 } | 819 } |
820 m_Status = Done; | 820 m_Status = Done; |
821 return; | 821 return; |
822 } | 822 } |
823 steps++; | 823 steps++; |
824 if (pPause && pPause->NeedToPauseNow()) { | 824 if (pPause && pPause->NeedToPauseNow()) { |
825 break; | 825 break; |
826 } | 826 } |
827 } | 827 } |
828 } | 828 } |
OLD | NEW |