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/render/render_int.h" | 7 #include "core/fpdfapi/render/render_int.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 | 975 |
976 CPDF_Form form(m_pContext->GetDocument(), m_pContext->GetPageResources(), | 976 CPDF_Form form(m_pContext->GetDocument(), m_pContext->GetPageResources(), |
977 pGroup); | 977 pGroup); |
978 form.ParseContent(nullptr, nullptr, nullptr); | 978 form.ParseContent(nullptr, nullptr, nullptr); |
979 | 979 |
980 CFX_FxgeDevice bitmap_device; | 980 CFX_FxgeDevice bitmap_device; |
981 bool bLuminosity = pSMaskDict->GetStringFor("S") != "Alpha"; | 981 bool bLuminosity = pSMaskDict->GetStringFor("S") != "Alpha"; |
982 int width = pClipRect->right - pClipRect->left; | 982 int width = pClipRect->right - pClipRect->left; |
983 int height = pClipRect->bottom - pClipRect->top; | 983 int height = pClipRect->bottom - pClipRect->top; |
984 FXDIB_Format format; | 984 FXDIB_Format format; |
985 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_ | 985 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_ || \ |
| 986 defined _SKIA_SUPPORT_PATHS_ |
986 format = bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask; | 987 format = bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask; |
987 #else | 988 #else |
988 format = bLuminosity ? FXDIB_Rgb : FXDIB_8bppMask; | 989 format = bLuminosity ? FXDIB_Rgb : FXDIB_8bppMask; |
989 #endif | 990 #endif |
990 if (!bitmap_device.Create(width, height, format, nullptr)) | 991 if (!bitmap_device.Create(width, height, format, nullptr)) |
991 return nullptr; | 992 return nullptr; |
992 | 993 |
993 CFX_DIBitmap& bitmap = *bitmap_device.GetBitmap(); | 994 CFX_DIBitmap& bitmap = *bitmap_device.GetBitmap(); |
994 int color_space_family = 0; | 995 int color_space_family = 0; |
995 if (bLuminosity) { | 996 if (bLuminosity) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 } else if (pFunc) { | 1081 } else if (pFunc) { |
1081 int size = dest_pitch * height; | 1082 int size = dest_pitch * height; |
1082 for (int i = 0; i < size; i++) { | 1083 for (int i = 0; i < size; i++) { |
1083 dest_buf[i] = transfers[src_buf[i]]; | 1084 dest_buf[i] = transfers[src_buf[i]]; |
1084 } | 1085 } |
1085 } else { | 1086 } else { |
1086 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 1087 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
1087 } | 1088 } |
1088 return pMask.release(); | 1089 return pMask.release(); |
1089 } | 1090 } |
OLD | NEW |