| 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/fxge/fx_dib.h" | 7 #include "../../../include/fxge/fx_dib.h" |
| 8 #include "../../../include/fxge/fx_ge.h" | 8 #include "../../../include/fxge/fx_ge.h" |
| 9 #include "../../../include/fxcodec/fx_codec.h" | 9 #include "../../../include/fxcodec/fx_codec.h" |
| 10 const FX_DWORD g_dwWinPalette[256] = { | 10 const FX_DWORD g_dwWinPalette[256] = { |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 CFX_DIBitmap* pClone = Clone(pClip); | 935 CFX_DIBitmap* pClone = Clone(pClip); |
| 936 if (pClone == NULL) { | 936 if (pClone == NULL) { |
| 937 return NULL; | 937 return NULL; |
| 938 } | 938 } |
| 939 if(!pClone->ConvertFormat(dest_format, pIccTransform)) { | 939 if(!pClone->ConvertFormat(dest_format, pIccTransform)) { |
| 940 delete pClone; | 940 delete pClone; |
| 941 return NULL; | 941 return NULL; |
| 942 } | 942 } |
| 943 return pClone; | 943 return pClone; |
| 944 } | 944 } |
| 945 CFX_DIBitmap* pClone = FX_NEW CFX_DIBitmap; | 945 CFX_DIBitmap* pClone = new CFX_DIBitmap; |
| 946 if (!pClone) { | |
| 947 return NULL; | |
| 948 } | |
| 949 if(!pClone->Create(m_Width, m_Height, dest_format)) { | 946 if(!pClone->Create(m_Width, m_Height, dest_format)) { |
| 950 delete pClone; | 947 delete pClone; |
| 951 return NULL; | 948 return NULL; |
| 952 } | 949 } |
| 953 FX_BOOL ret = TRUE; | 950 FX_BOOL ret = TRUE; |
| 954 CFX_DIBitmap* pSrcAlpha = NULL; | 951 CFX_DIBitmap* pSrcAlpha = NULL; |
| 955 if (m_AlphaFlag & 2) { | 952 if (m_AlphaFlag & 2) { |
| 956 pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask; | 953 pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask; |
| 957 if (pSrcAlpha == NULL) { | 954 if (pSrcAlpha == NULL) { |
| 958 delete pClone; | 955 delete pClone; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 if (!m_bExtBuf) { | 1075 if (!m_bExtBuf) { |
| 1079 FX_Free(m_pBuffer); | 1076 FX_Free(m_pBuffer); |
| 1080 } | 1077 } |
| 1081 m_bExtBuf = FALSE; | 1078 m_bExtBuf = FALSE; |
| 1082 m_pBuffer = dest_buf; | 1079 m_pBuffer = dest_buf; |
| 1083 m_bpp = (FX_BYTE)dest_format; | 1080 m_bpp = (FX_BYTE)dest_format; |
| 1084 m_AlphaFlag = (FX_BYTE)(dest_format >> 8); | 1081 m_AlphaFlag = (FX_BYTE)(dest_format >> 8); |
| 1085 m_Pitch = dest_pitch; | 1082 m_Pitch = dest_pitch; |
| 1086 return TRUE; | 1083 return TRUE; |
| 1087 } | 1084 } |
| OLD | NEW |