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_module.h" | 9 #include "core/include/fpdfapi/fpdf_module.h" |
10 #include "core/include/fpdfapi/fpdf_render.h" | 10 #include "core/include/fpdfapi/fpdf_render.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 pData->m_StrokeColor.Copy(&pParentData->m_StrokeColor); | 233 pData->m_StrokeColor.Copy(&pParentData->m_StrokeColor); |
234 } | 234 } |
235 } | 235 } |
236 } else { | 236 } else { |
237 m_InitialStates.DefaultStates(); | 237 m_InitialStates.DefaultStates(); |
238 } | 238 } |
239 m_pObjectRenderer.reset(); | 239 m_pObjectRenderer.reset(); |
240 m_Transparency = transparency; | 240 m_Transparency = transparency; |
241 return TRUE; | 241 return TRUE; |
242 } | 242 } |
243 void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjects* pObjs, | 243 void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjectList* pObjs, |
244 const CFX_Matrix* pObj2Device) { | 244 const CFX_Matrix* pObj2Device) { |
245 CFX_FloatRect clip_rect = m_pDevice->GetClipBox(); | 245 CFX_FloatRect clip_rect = m_pDevice->GetClipBox(); |
246 CFX_Matrix device2object; | 246 CFX_Matrix device2object; |
247 device2object.SetReverse(*pObj2Device); | 247 device2object.SetReverse(*pObj2Device); |
248 device2object.TransformRect(clip_rect); | 248 device2object.TransformRect(clip_rect); |
249 int index = 0; | 249 int index = 0; |
250 FX_POSITION pos = pObjs->GetFirstObjectPosition(); | 250 FX_POSITION pos = pObjs->GetFirstObjectPosition(); |
251 while (pos) { | 251 while (pos) { |
252 index++; | 252 index++; |
253 CPDF_PageObject* pCurObj = pObjs->GetNextObject(pos); | 253 CPDF_PageObject* pCurObj = pObjs->GetNextObject(pos); |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 m_pPageResources(pPage->m_pPageResources), | 961 m_pPageResources(pPage->m_pPageResources), |
962 m_pPageCache(pPage->GetRenderCache()), | 962 m_pPageCache(pPage->GetRenderCache()), |
963 m_bFirstLayer(TRUE) {} | 963 m_bFirstLayer(TRUE) {} |
964 CPDF_RenderContext::CPDF_RenderContext(CPDF_Document* pDoc, | 964 CPDF_RenderContext::CPDF_RenderContext(CPDF_Document* pDoc, |
965 CPDF_PageRenderCache* pPageCache) | 965 CPDF_PageRenderCache* pPageCache) |
966 : m_pDocument(pDoc), | 966 : m_pDocument(pDoc), |
967 m_pPageResources(nullptr), | 967 m_pPageResources(nullptr), |
968 m_pPageCache(pPageCache), | 968 m_pPageCache(pPageCache), |
969 m_bFirstLayer(TRUE) {} | 969 m_bFirstLayer(TRUE) {} |
970 CPDF_RenderContext::~CPDF_RenderContext() {} | 970 CPDF_RenderContext::~CPDF_RenderContext() {} |
971 void CPDF_RenderContext::AppendObjectList(CPDF_PageObjects* pObjs, | 971 void CPDF_RenderContext::AppendObjectList(CPDF_PageObjectList* pObjs, |
972 const CFX_Matrix* pObject2Device) { | 972 const CFX_Matrix* pObject2Device) { |
973 _PDF_RenderItem* pItem = m_ContentList.AddSpace(); | 973 _PDF_RenderItem* pItem = m_ContentList.AddSpace(); |
974 pItem->m_pObjectList = pObjs; | 974 pItem->m_pObjectList = pObjs; |
975 if (pObject2Device) { | 975 if (pObject2Device) { |
976 pItem->m_Matrix = *pObject2Device; | 976 pItem->m_Matrix = *pObject2Device; |
977 } else { | 977 } else { |
978 pItem->m_Matrix.SetIdentity(); | 978 pItem->m_Matrix.SetIdentity(); |
979 } | 979 } |
980 } | 980 } |
981 void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, | 981 void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 } | 1016 } |
1017 if (status.m_bStopped) { | 1017 if (status.m_bStopped) { |
1018 pDevice->RestoreState(); | 1018 pDevice->RestoreState(); |
1019 break; | 1019 break; |
1020 } | 1020 } |
1021 } | 1021 } |
1022 pDevice->RestoreState(); | 1022 pDevice->RestoreState(); |
1023 } | 1023 } |
1024 } | 1024 } |
1025 void CPDF_RenderContext::DrawObjectList(CFX_RenderDevice* pDevice, | 1025 void CPDF_RenderContext::DrawObjectList(CFX_RenderDevice* pDevice, |
1026 CPDF_PageObjects* pObjs, | 1026 CPDF_PageObjectList* pObjs, |
1027 const CFX_Matrix* pObject2Device, | 1027 const CFX_Matrix* pObject2Device, |
1028 const CPDF_RenderOptions* pOptions) { | 1028 const CPDF_RenderOptions* pOptions) { |
1029 AppendObjectList(pObjs, pObject2Device); | 1029 AppendObjectList(pObjs, pObject2Device); |
1030 Render(pDevice, pOptions); | 1030 Render(pDevice, pOptions); |
1031 } | 1031 } |
1032 | 1032 |
1033 CPDF_ProgressiveRenderer::CPDF_ProgressiveRenderer( | 1033 CPDF_ProgressiveRenderer::CPDF_ProgressiveRenderer( |
1034 CPDF_RenderContext* pContext, | 1034 CPDF_RenderContext* pContext, |
1035 CFX_RenderDevice* pDevice, | 1035 CFX_RenderDevice* pDevice, |
1036 const CPDF_RenderOptions* pOptions) | 1036 const CPDF_RenderOptions* pOptions) |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) { | 1398 item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) { |
1399 CPDF_Dictionary* pOCG = | 1399 CPDF_Dictionary* pOCG = |
1400 ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); | 1400 ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); |
1401 if (!CheckOCGVisible(pOCG)) { | 1401 if (!CheckOCGVisible(pOCG)) { |
1402 return FALSE; | 1402 return FALSE; |
1403 } | 1403 } |
1404 } | 1404 } |
1405 } | 1405 } |
1406 return TRUE; | 1406 return TRUE; |
1407 } | 1407 } |
OLD | NEW |