| 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 <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "core/fpdfapi/fpdf_page/cpdf_parseoptions.h" | |
| 13 #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h" | 12 #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h" |
| 14 #include "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h" | 13 #include "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h" |
| 15 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" | 14 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
| 16 #include "core/fpdfapi/fpdf_page/include/cpdf_image.h" | 15 #include "core/fpdfapi/fpdf_page/include/cpdf_image.h" |
| 17 #include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" | 16 #include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" |
| 18 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 17 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
| 19 #include "core/fpdfapi/fpdf_page/pageint.h" | 18 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 20 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 19 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 21 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 20 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
| 22 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 21 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 std::unique_ptr<CPDF_Function> pFunc; | 886 std::unique_ptr<CPDF_Function> pFunc; |
| 888 CPDF_Object* pFuncObj = pSMaskDict->GetDirectObjectBy("TR"); | 887 CPDF_Object* pFuncObj = pSMaskDict->GetDirectObjectBy("TR"); |
| 889 if (pFuncObj && (pFuncObj->IsDictionary() || pFuncObj->IsStream())) | 888 if (pFuncObj && (pFuncObj->IsDictionary() || pFuncObj->IsStream())) |
| 890 pFunc.reset(CPDF_Function::Load(pFuncObj)); | 889 pFunc.reset(CPDF_Function::Load(pFuncObj)); |
| 891 | 890 |
| 892 CFX_Matrix matrix = *pMatrix; | 891 CFX_Matrix matrix = *pMatrix; |
| 893 matrix.TranslateI(-pClipRect->left, -pClipRect->top); | 892 matrix.TranslateI(-pClipRect->left, -pClipRect->top); |
| 894 | 893 |
| 895 CPDF_Form form(m_pContext->GetDocument(), m_pContext->GetPageResources(), | 894 CPDF_Form form(m_pContext->GetDocument(), m_pContext->GetPageResources(), |
| 896 pGroup); | 895 pGroup); |
| 897 form.ParseContent(NULL, NULL, NULL, NULL); | 896 form.ParseContent(nullptr, nullptr, nullptr); |
| 898 | 897 |
| 899 CFX_FxgeDevice bitmap_device; | 898 CFX_FxgeDevice bitmap_device; |
| 900 FX_BOOL bLuminosity = pSMaskDict->GetStringBy("S") != "Alpha"; | 899 FX_BOOL bLuminosity = pSMaskDict->GetStringBy("S") != "Alpha"; |
| 901 int width = pClipRect->right - pClipRect->left; | 900 int width = pClipRect->right - pClipRect->left; |
| 902 int height = pClipRect->bottom - pClipRect->top; | 901 int height = pClipRect->bottom - pClipRect->top; |
| 903 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 902 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| 904 if (!bitmap_device.Create(width, height, | 903 if (!bitmap_device.Create(width, height, |
| 905 bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask)) { | 904 bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask)) { |
| 906 return NULL; | 905 return NULL; |
| 907 } | 906 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 } else if (pFunc) { | 997 } else if (pFunc) { |
| 999 int size = dest_pitch * height; | 998 int size = dest_pitch * height; |
| 1000 for (int i = 0; i < size; i++) { | 999 for (int i = 0; i < size; i++) { |
| 1001 dest_buf[i] = transfers[src_buf[i]]; | 1000 dest_buf[i] = transfers[src_buf[i]]; |
| 1002 } | 1001 } |
| 1003 } else { | 1002 } else { |
| 1004 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 1003 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
| 1005 } | 1004 } |
| 1006 return pMask.release(); | 1005 return pMask.release(); |
| 1007 } | 1006 } |
| OLD | NEW |