| 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 "render_int.h" | 7 #include "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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 buffer.OutputToDevice(); | 912 buffer.OutputToDevice(); |
| 913 } | 913 } |
| 914 void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, | 914 void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, |
| 915 CPDF_PageObject* pPageObj, | 915 CPDF_PageObject* pPageObj, |
| 916 const CFX_Matrix* pObj2Device, | 916 const CFX_Matrix* pObj2Device, |
| 917 FX_BOOL bStroke) { | 917 FX_BOOL bStroke) { |
| 918 if (!pattern->Load()) { | 918 if (!pattern->Load()) { |
| 919 return; | 919 return; |
| 920 } | 920 } |
| 921 m_pDevice->SaveState(); | 921 m_pDevice->SaveState(); |
| 922 if (pPageObj->m_Type == PDFPAGE_PATH) { | 922 if (pPageObj->m_Type == CPDF_PageObject::PATH) { |
| 923 if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) { | 923 if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) { |
| 924 m_pDevice->RestoreState(); | 924 m_pDevice->RestoreState(); |
| 925 return; | 925 return; |
| 926 } | 926 } |
| 927 } else if (pPageObj->m_Type == PDFPAGE_IMAGE) { | 927 } else if (pPageObj->m_Type == CPDF_PageObject::IMAGE) { |
| 928 FX_RECT rect = pPageObj->GetBBox(pObj2Device); | 928 FX_RECT rect = pPageObj->GetBBox(pObj2Device); |
| 929 m_pDevice->SetClip_Rect(&rect); | 929 m_pDevice->SetClip_Rect(&rect); |
| 930 } else { | 930 } else { |
| 931 return; | 931 return; |
| 932 } | 932 } |
| 933 FX_RECT rect; | 933 FX_RECT rect; |
| 934 if (GetObjectClippedRect(pPageObj, pObj2Device, FALSE, rect)) { | 934 if (GetObjectClippedRect(pPageObj, pObj2Device, FALSE, rect)) { |
| 935 m_pDevice->RestoreState(); | 935 m_pDevice->RestoreState(); |
| 936 return; | 936 return; |
| 937 } | 937 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 return pBitmap; | 994 return pBitmap; |
| 995 } | 995 } |
| 996 void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, | 996 void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, |
| 997 CPDF_PageObject* pPageObj, | 997 CPDF_PageObject* pPageObj, |
| 998 const CFX_Matrix* pObj2Device, | 998 const CFX_Matrix* pObj2Device, |
| 999 FX_BOOL bStroke) { | 999 FX_BOOL bStroke) { |
| 1000 if (!pPattern->Load()) { | 1000 if (!pPattern->Load()) { |
| 1001 return; | 1001 return; |
| 1002 } | 1002 } |
| 1003 m_pDevice->SaveState(); | 1003 m_pDevice->SaveState(); |
| 1004 if (pPageObj->m_Type == PDFPAGE_PATH) { | 1004 if (pPageObj->m_Type == CPDF_PageObject::PATH) { |
| 1005 if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) { | 1005 if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) { |
| 1006 m_pDevice->RestoreState(); | 1006 m_pDevice->RestoreState(); |
| 1007 return; | 1007 return; |
| 1008 } | 1008 } |
| 1009 } else if (pPageObj->m_Type == PDFPAGE_IMAGE) { | 1009 } else if (pPageObj->m_Type == CPDF_PageObject::IMAGE) { |
| 1010 FX_RECT rect = pPageObj->GetBBox(pObj2Device); | 1010 FX_RECT rect = pPageObj->GetBBox(pObj2Device); |
| 1011 m_pDevice->SetClip_Rect(&rect); | 1011 m_pDevice->SetClip_Rect(&rect); |
| 1012 } else { | 1012 } else { |
| 1013 return; | 1013 return; |
| 1014 } | 1014 } |
| 1015 FX_RECT clip_box = m_pDevice->GetClipBox(); | 1015 FX_RECT clip_box = m_pDevice->GetClipBox(); |
| 1016 if (clip_box.IsEmpty()) { | 1016 if (clip_box.IsEmpty()) { |
| 1017 m_pDevice->RestoreState(); | 1017 m_pDevice->RestoreState(); |
| 1018 return; | 1018 return; |
| 1019 } | 1019 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 } | 1207 } |
| 1208 } | 1208 } |
| 1209 if (bStroke) { | 1209 if (bStroke) { |
| 1210 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); | 1210 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); |
| 1211 if (StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) { | 1211 if (StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) { |
| 1212 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); | 1212 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); |
| 1213 bStroke = FALSE; | 1213 bStroke = FALSE; |
| 1214 } | 1214 } |
| 1215 } | 1215 } |
| 1216 } | 1216 } |
| OLD | NEW |