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 "../../../include/fpdfapi/fpdf_module.h" | 7 #include "../../../include/fpdfapi/fpdf_module.h" |
8 #include "../../../include/fpdfapi/fpdf_pageobj.h" | 8 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
9 #include "../../../include/fpdfapi/fpdf_render.h" | 9 #include "../../../include/fpdfapi/fpdf_render.h" |
10 #include "../../../include/fxcodec/fx_codec.h" | 10 #include "../../../include/fxcodec/fx_codec.h" |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 int width = pClipRect->right - pClipRect->left; | 1048 int width = pClipRect->right - pClipRect->left; |
1049 int height = pClipRect->bottom - pClipRect->top; | 1049 int height = pClipRect->bottom - pClipRect->top; |
1050 FX_BOOL bLuminosity = FALSE; | 1050 FX_BOOL bLuminosity = FALSE; |
1051 bLuminosity = pSMaskDict->GetConstString(FX_BSTRC("S")) != FX_BSTRC("Alpha"); | 1051 bLuminosity = pSMaskDict->GetConstString(FX_BSTRC("S")) != FX_BSTRC("Alpha"); |
1052 CPDF_Stream* pGroup = pSMaskDict->GetStream(FX_BSTRC("G")); | 1052 CPDF_Stream* pGroup = pSMaskDict->GetStream(FX_BSTRC("G")); |
1053 if (pGroup == NULL) { | 1053 if (pGroup == NULL) { |
1054 return NULL; | 1054 return NULL; |
1055 } | 1055 } |
1056 CPDF_Function* pFunc = NULL; | 1056 CPDF_Function* pFunc = NULL; |
1057 CPDF_Object* pFuncObj = pSMaskDict->GetElementValue(FX_BSTRC("TR")); | 1057 CPDF_Object* pFuncObj = pSMaskDict->GetElementValue(FX_BSTRC("TR")); |
1058 if (pFuncObj && | 1058 if (pFuncObj && (pFuncObj->IsDictionary() || pFuncObj->IsStream())) |
1059 (pFuncObj->IsDictionary() || pFuncObj->GetType() == PDFOBJ_STREAM)) { | |
1060 pFunc = CPDF_Function::Load(pFuncObj); | 1059 pFunc = CPDF_Function::Load(pFuncObj); |
1061 } | 1060 |
1062 CFX_AffineMatrix matrix = *pMatrix; | 1061 CFX_AffineMatrix matrix = *pMatrix; |
1063 matrix.TranslateI(-pClipRect->left, -pClipRect->top); | 1062 matrix.TranslateI(-pClipRect->left, -pClipRect->top); |
1064 CPDF_Form form(m_pContext->m_pDocument, m_pContext->m_pPageResources, pGroup); | 1063 CPDF_Form form(m_pContext->m_pDocument, m_pContext->m_pPageResources, pGroup); |
1065 form.ParseContent(NULL, NULL, NULL, NULL); | 1064 form.ParseContent(NULL, NULL, NULL, NULL); |
1066 CFX_FxgeDevice bitmap_device; | 1065 CFX_FxgeDevice bitmap_device; |
1067 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 1066 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
1068 if (!bitmap_device.Create(width, height, | 1067 if (!bitmap_device.Create(width, height, |
1069 bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask)) { | 1068 bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask)) { |
1070 return NULL; | 1069 return NULL; |
1071 } | 1070 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 for (int i = 0; i < size; i++) { | 1165 for (int i = 0; i < size; i++) { |
1167 dest_buf[i] = pTransfer[src_buf[i]]; | 1166 dest_buf[i] = pTransfer[src_buf[i]]; |
1168 } | 1167 } |
1169 } else { | 1168 } else { |
1170 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 1169 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
1171 } | 1170 } |
1172 delete pFunc; | 1171 delete pFunc; |
1173 FX_Free(pTransfer); | 1172 FX_Free(pTransfer); |
1174 return pMask; | 1173 return pMask; |
1175 } | 1174 } |
OLD | NEW |