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/src/fpdfapi/fpdf_render/render_int.h" | 7 #include "core/src/fpdfapi/fpdf_render/render_int.h" |
8 | 8 |
9 #include "core/include/fpdfapi/fpdf_pageobj.h" | 9 #include "core/include/fpdfapi/fpdf_pageobj.h" |
10 #include "core/include/fpdfapi/fpdf_render.h" | 10 #include "core/include/fpdfapi/fpdf_render.h" |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 if (!pattern->Load()) { | 907 if (!pattern->Load()) { |
908 return; | 908 return; |
909 } | 909 } |
910 m_pDevice->SaveState(); | 910 m_pDevice->SaveState(); |
911 if (pPageObj->IsPath()) { | 911 if (pPageObj->IsPath()) { |
912 if (!SelectClipPath(pPageObj->AsPath(), pObj2Device, bStroke)) { | 912 if (!SelectClipPath(pPageObj->AsPath(), pObj2Device, bStroke)) { |
913 m_pDevice->RestoreState(); | 913 m_pDevice->RestoreState(); |
914 return; | 914 return; |
915 } | 915 } |
916 } else if (pPageObj->IsImage()) { | 916 } else if (pPageObj->IsImage()) { |
917 FX_RECT rect = pPageObj->GetBBox(pObj2Device); | 917 m_pDevice->SetClip_Rect(pPageObj->GetBBox(pObj2Device)); |
918 m_pDevice->SetClip_Rect(&rect); | |
919 } else { | 918 } else { |
920 return; | 919 return; |
921 } | 920 } |
922 FX_RECT rect; | 921 FX_RECT rect; |
923 if (GetObjectClippedRect(pPageObj, pObj2Device, FALSE, rect)) { | 922 if (GetObjectClippedRect(pPageObj, pObj2Device, FALSE, rect)) { |
924 m_pDevice->RestoreState(); | 923 m_pDevice->RestoreState(); |
925 return; | 924 return; |
926 } | 925 } |
927 CFX_Matrix matrix = pattern->m_Pattern2Form; | 926 CFX_Matrix matrix = pattern->m_Pattern2Form; |
928 matrix.Concat(*pObj2Device); | 927 matrix.Concat(*pObj2Device); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 if (!pPattern->Load()) { | 988 if (!pPattern->Load()) { |
990 return; | 989 return; |
991 } | 990 } |
992 m_pDevice->SaveState(); | 991 m_pDevice->SaveState(); |
993 if (pPageObj->IsPath()) { | 992 if (pPageObj->IsPath()) { |
994 if (!SelectClipPath(pPageObj->AsPath(), pObj2Device, bStroke)) { | 993 if (!SelectClipPath(pPageObj->AsPath(), pObj2Device, bStroke)) { |
995 m_pDevice->RestoreState(); | 994 m_pDevice->RestoreState(); |
996 return; | 995 return; |
997 } | 996 } |
998 } else if (pPageObj->IsImage()) { | 997 } else if (pPageObj->IsImage()) { |
999 FX_RECT rect = pPageObj->GetBBox(pObj2Device); | 998 m_pDevice->SetClip_Rect(pPageObj->GetBBox(pObj2Device)); |
1000 m_pDevice->SetClip_Rect(&rect); | |
1001 } else { | 999 } else { |
1002 return; | 1000 return; |
1003 } | 1001 } |
1004 FX_RECT clip_box = m_pDevice->GetClipBox(); | 1002 FX_RECT clip_box = m_pDevice->GetClipBox(); |
1005 if (clip_box.IsEmpty()) { | 1003 if (clip_box.IsEmpty()) { |
1006 m_pDevice->RestoreState(); | 1004 m_pDevice->RestoreState(); |
1007 return; | 1005 return; |
1008 } | 1006 } |
1009 CFX_Matrix dCTM = m_pDevice->GetCTM(); | 1007 CFX_Matrix dCTM = m_pDevice->GetCTM(); |
1010 FX_FLOAT sa = FXSYS_fabs(dCTM.a); | 1008 FX_FLOAT sa = FXSYS_fabs(dCTM.a); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 } | 1196 } |
1199 } | 1197 } |
1200 if (bStroke) { | 1198 if (bStroke) { |
1201 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); | 1199 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); |
1202 if (StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) { | 1200 if (StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) { |
1203 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); | 1201 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); |
1204 bStroke = FALSE; | 1202 bStroke = FALSE; |
1205 } | 1203 } |
1206 } | 1204 } |
1207 } | 1205 } |
OLD | NEW |