| 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_render/render_int.h" | 7 #include "core/fpdfapi/fpdf_render/render_int.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_page/pageint.h" | 9 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 10 #include "core/include/fpdfapi/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 11 #include "core/include/fpdfapi/cpdf_dictionary.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
| 12 #include "core/include/fpdfapi/cpdf_document.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| 13 #include "core/include/fpdfapi/fpdf_module.h" | 13 #include "core/fpdfapi/fpdf_parser/ipdf_occontext.h" |
| 14 #include "core/include/fpdfapi/fpdf_render.h" | 14 #include "core/fpdfapi/fpdf_render/cpdf_pagerendercache.h" |
| 15 #include "core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h" |
| 16 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
| 17 #include "core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h" |
| 18 #include "core/fpdfapi/include/cpdf_modulemgr.h" |
| 19 #include "core/fpdfapi/ipdf_rendermodule.h" |
| 15 #include "core/include/fxge/fx_ge.h" | 20 #include "core/include/fxge/fx_ge.h" |
| 16 | 21 |
| 17 CPDF_DocRenderData::CPDF_DocRenderData(CPDF_Document* pPDFDoc) | 22 CPDF_DocRenderData::CPDF_DocRenderData(CPDF_Document* pPDFDoc) |
| 18 : m_pPDFDoc(pPDFDoc), m_pFontCache(new CFX_FontCache) {} | 23 : m_pPDFDoc(pPDFDoc), m_pFontCache(new CFX_FontCache) {} |
| 19 | 24 |
| 20 CPDF_DocRenderData::~CPDF_DocRenderData() { | 25 CPDF_DocRenderData::~CPDF_DocRenderData() { |
| 21 Clear(TRUE); | 26 Clear(TRUE); |
| 22 } | 27 } |
| 23 | 28 |
| 24 void CPDF_DocRenderData::Clear(FX_BOOL bRelease) { | 29 void CPDF_DocRenderData::Clear(FX_BOOL bRelease) { |
| (...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 m_pContext->GetBackground(m_pBitmapDevice->GetBitmap(), m_pObject, pOptions, | 1320 m_pContext->GetBackground(m_pBitmapDevice->GetBitmap(), m_pObject, pOptions, |
| 1316 &m_Matrix); | 1321 &m_Matrix); |
| 1317 return TRUE; | 1322 return TRUE; |
| 1318 } | 1323 } |
| 1319 void CPDF_ScaledRenderBuffer::OutputToDevice() { | 1324 void CPDF_ScaledRenderBuffer::OutputToDevice() { |
| 1320 if (m_pBitmapDevice) { | 1325 if (m_pBitmapDevice) { |
| 1321 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, | 1326 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, |
| 1322 m_Rect.top, m_Rect.Width(), m_Rect.Height()); | 1327 m_Rect.top, m_Rect.Width(), m_Rect.Height()); |
| 1323 } | 1328 } |
| 1324 } | 1329 } |
| 1325 FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) { | |
| 1326 const CPDF_ContentMarkData* pData = pObj->m_ContentMark; | |
| 1327 int nItems = pData->CountItems(); | |
| 1328 for (int i = 0; i < nItems; i++) { | |
| 1329 const CPDF_ContentMarkItem& item = pData->GetItem(i); | |
| 1330 if (item.GetName() == "OC" && | |
| 1331 item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict && | |
| 1332 !CheckOCGVisible(item.GetParam())) { | |
| 1333 return FALSE; | |
| 1334 } | |
| 1335 } | |
| 1336 return TRUE; | |
| 1337 } | |
| OLD | NEW |