| 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 <memory> |
| 10 |
| 9 #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" | 11 #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" |
| 10 #include "core/fpdfapi/fpdf_font/cpdf_type3font.h" | 12 #include "core/fpdfapi/fpdf_font/cpdf_type3font.h" |
| 11 #include "core/fpdfapi/fpdf_page/cpdf_colorstatedata.h" | 13 #include "core/fpdfapi/fpdf_page/cpdf_colorstatedata.h" |
| 12 #include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" | 14 #include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" |
| 13 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" | 15 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
| 14 #include "core/fpdfapi/fpdf_page/include/cpdf_formobject.h" | 16 #include "core/fpdfapi/fpdf_page/include/cpdf_formobject.h" |
| 15 #include "core/fpdfapi/fpdf_page/include/cpdf_image.h" | 17 #include "core/fpdfapi/fpdf_page/include/cpdf_image.h" |
| 16 #include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" | 18 #include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" |
| 17 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 19 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
| 18 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" | 20 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 pPageObj->m_GeneralState.GetObject(); | 681 pPageObj->m_GeneralState.GetObject(); |
| 680 int blend_type = | 682 int blend_type = |
| 681 pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL; | 683 pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL; |
| 682 if (blend_type == FXDIB_BLEND_UNSUPPORTED) { | 684 if (blend_type == FXDIB_BLEND_UNSUPPORTED) { |
| 683 return TRUE; | 685 return TRUE; |
| 684 } | 686 } |
| 685 CPDF_Dictionary* pSMaskDict = | 687 CPDF_Dictionary* pSMaskDict = |
| 686 pGeneralState ? ToDictionary(pGeneralState->m_pSoftMask) : nullptr; | 688 pGeneralState ? ToDictionary(pGeneralState->m_pSoftMask) : nullptr; |
| 687 if (pSMaskDict) { | 689 if (pSMaskDict) { |
| 688 if (pPageObj->IsImage() && | 690 if (pPageObj->IsImage() && |
| 689 pPageObj->AsImage()->m_pImage->GetDict()->KeyExist("SMask")) { | 691 pPageObj->AsImage()->GetImage()->GetDict()->KeyExist("SMask")) { |
| 690 pSMaskDict = nullptr; | 692 pSMaskDict = nullptr; |
| 691 } | 693 } |
| 692 } | 694 } |
| 693 CPDF_Dictionary* pFormResource = nullptr; | 695 CPDF_Dictionary* pFormResource = nullptr; |
| 694 FX_FLOAT group_alpha = 1.0f; | 696 FX_FLOAT group_alpha = 1.0f; |
| 695 int Transparency = m_Transparency; | 697 int Transparency = m_Transparency; |
| 696 FX_BOOL bGroupTransparent = FALSE; | 698 FX_BOOL bGroupTransparent = FALSE; |
| 697 if (pPageObj->IsForm()) { | 699 if (pPageObj->IsForm()) { |
| 698 const CPDF_FormObject* pFormObj = pPageObj->AsForm(); | 700 const CPDF_FormObject* pFormObj = pPageObj->AsForm(); |
| 699 const CPDF_GeneralStateData* pStateData = | 701 const CPDF_GeneralStateData* pStateData = |
| (...skipping 14 matching lines...) Expand all Loading... |
| 714 bTextClip = TRUE; | 716 bTextClip = TRUE; |
| 715 } | 717 } |
| 716 if ((m_Options.m_Flags & RENDER_OVERPRINT) && pPageObj->IsImage() && | 718 if ((m_Options.m_Flags & RENDER_OVERPRINT) && pPageObj->IsImage() && |
| 717 pGeneralState && pGeneralState->m_FillOP && pGeneralState->m_StrokeOP) { | 719 pGeneralState && pGeneralState->m_FillOP && pGeneralState->m_StrokeOP) { |
| 718 CPDF_Document* pDocument = nullptr; | 720 CPDF_Document* pDocument = nullptr; |
| 719 CPDF_Page* pPage = nullptr; | 721 CPDF_Page* pPage = nullptr; |
| 720 if (m_pContext->GetPageCache()) { | 722 if (m_pContext->GetPageCache()) { |
| 721 pPage = m_pContext->GetPageCache()->GetPage(); | 723 pPage = m_pContext->GetPageCache()->GetPage(); |
| 722 pDocument = pPage->m_pDocument; | 724 pDocument = pPage->m_pDocument; |
| 723 } else { | 725 } else { |
| 724 pDocument = pPageObj->AsImage()->m_pImage->GetDocument(); | 726 pDocument = pPageObj->AsImage()->GetImage()->GetDocument(); |
| 725 } | 727 } |
| 726 CPDF_Dictionary* pPageResources = pPage ? pPage->m_pPageResources : nullptr; | 728 CPDF_Dictionary* pPageResources = pPage ? pPage->m_pPageResources : nullptr; |
| 727 CPDF_Object* pCSObj = pPageObj->AsImage() | 729 CPDF_Object* pCSObj = pPageObj->AsImage() |
| 728 ->m_pImage->GetStream() | 730 ->GetImage() |
| 731 ->GetStream() |
| 729 ->GetDict() | 732 ->GetDict() |
| 730 ->GetDirectObjectBy("ColorSpace"); | 733 ->GetDirectObjectBy("ColorSpace"); |
| 731 CPDF_ColorSpace* pColorSpace = | 734 CPDF_ColorSpace* pColorSpace = |
| 732 pDocument->LoadColorSpace(pCSObj, pPageResources); | 735 pDocument->LoadColorSpace(pCSObj, pPageResources); |
| 733 if (pColorSpace) { | 736 if (pColorSpace) { |
| 734 int format = pColorSpace->GetFamily(); | 737 int format = pColorSpace->GetFamily(); |
| 735 if (format == PDFCS_DEVICECMYK || format == PDFCS_SEPARATION || | 738 if (format == PDFCS_DEVICECMYK || format == PDFCS_SEPARATION || |
| 736 format == PDFCS_DEVICEN) { | 739 format == PDFCS_DEVICEN) { |
| 737 blend_type = FXDIB_BLEND_DARKEN; | 740 blend_type = FXDIB_BLEND_DARKEN; |
| 738 } | 741 } |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, | 1292 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, |
| 1290 m_Rect.top, m_Rect.Width(), m_Rect.Height()); | 1293 m_Rect.top, m_Rect.Width(), m_Rect.Height()); |
| 1291 } | 1294 } |
| 1292 } | 1295 } |
| 1293 | 1296 |
| 1294 #if defined _SKIA_SUPPORT_ | 1297 #if defined _SKIA_SUPPORT_ |
| 1295 void CPDF_RenderStatus::DebugVerifyDeviceIsPreMultiplied() const { | 1298 void CPDF_RenderStatus::DebugVerifyDeviceIsPreMultiplied() const { |
| 1296 m_pDevice->DebugVerifyBitmapIsPreMultiplied(); | 1299 m_pDevice->DebugVerifyBitmapIsPreMultiplied(); |
| 1297 } | 1300 } |
| 1298 #endif | 1301 #endif |
| OLD | NEW |