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