Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render.cpp

Issue 1410343003: [Merge to XFA] Revert "Revert "Add type cast definitions for CPDF_Dictionary."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebase to origin/xfa Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "../../../include/fpdfapi/fpdf_module.h" 7 #include "../../../include/fpdfapi/fpdf_module.h"
8 #include "../../../include/fpdfapi/fpdf_render.h" 8 #include "../../../include/fpdfapi/fpdf_render.h"
9 #include "../../../include/fxge/fx_ge.h" 9 #include "../../../include/fxge/fx_ge.h"
10 #include "../fpdf_page/pageint.h" 10 #include "../fpdf_page/pageint.h"
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 FX_BOOL CPDF_RenderStatus::ProcessTransparency( 731 FX_BOOL CPDF_RenderStatus::ProcessTransparency(
732 const CPDF_PageObject* pPageObj, 732 const CPDF_PageObject* pPageObj,
733 const CFX_AffineMatrix* pObj2Device) { 733 const CFX_AffineMatrix* pObj2Device) {
734 const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState; 734 const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState;
735 int blend_type = 735 int blend_type =
736 pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL; 736 pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL;
737 if (blend_type == FXDIB_BLEND_UNSUPPORTED) { 737 if (blend_type == FXDIB_BLEND_UNSUPPORTED) {
738 return TRUE; 738 return TRUE;
739 } 739 }
740 CPDF_Dictionary* pSMaskDict = 740 CPDF_Dictionary* pSMaskDict =
741 pGeneralState ? (CPDF_Dictionary*)pGeneralState->m_pSoftMask : NULL; 741 pGeneralState ? ToDictionary(pGeneralState->m_pSoftMask) : NULL;
742 if (pSMaskDict) { 742 if (pSMaskDict) {
743 if (pPageObj->m_Type == PDFPAGE_IMAGE && 743 if (pPageObj->m_Type == PDFPAGE_IMAGE &&
744 ((CPDF_ImageObject*)pPageObj) 744 ((CPDF_ImageObject*)pPageObj)
745 ->m_pImage->GetDict() 745 ->m_pImage->GetDict()
746 ->KeyExist(FX_BSTRC("SMask"))) { 746 ->KeyExist(FX_BSTRC("SMask"))) {
747 pSMaskDict = NULL; 747 pSMaskDict = NULL;
748 } 748 }
749 } 749 }
750 CPDF_Dictionary* pFormResource = NULL; 750 CPDF_Dictionary* pFormResource = NULL;
751 FX_FLOAT group_alpha = 1.0f; 751 FX_FLOAT group_alpha = 1.0f;
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 m_Rect.top, m_Rect.Width(), m_Rect.Height()); 1431 m_Rect.top, m_Rect.Width(), m_Rect.Height());
1432 } 1432 }
1433 } 1433 }
1434 FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) { 1434 FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) {
1435 const CPDF_ContentMarkData* pData = pObj->m_ContentMark; 1435 const CPDF_ContentMarkData* pData = pObj->m_ContentMark;
1436 int nItems = pData->CountItems(); 1436 int nItems = pData->CountItems();
1437 for (int i = 0; i < nItems; i++) { 1437 for (int i = 0; i < nItems; i++) {
1438 CPDF_ContentMarkItem& item = pData->GetItem(i); 1438 CPDF_ContentMarkItem& item = pData->GetItem(i);
1439 if (item.GetName() == FX_BSTRC("OC") && 1439 if (item.GetName() == FX_BSTRC("OC") &&
1440 item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) { 1440 item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) {
1441 CPDF_Dictionary* pOCG = (CPDF_Dictionary*)item.GetParam(); 1441 CPDF_Dictionary* pOCG =
1442 ToDictionary(static_cast<CPDF_Object*>(item.GetParam()));
1442 if (!CheckOCGVisible(pOCG)) { 1443 if (!CheckOCGVisible(pOCG)) {
1443 return FALSE; 1444 return FALSE;
1444 } 1445 }
1445 } 1446 }
1446 } 1447 }
1447 return TRUE; 1448 return TRUE;
1448 } 1449 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698