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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 } | 1089 } |
1090 return pClone; | 1090 return pClone; |
1091 } | 1091 } |
1092 CFX_DIBitmap* pClone = new CFX_DIBitmap; | 1092 CFX_DIBitmap* pClone = new CFX_DIBitmap; |
1093 if (!pClone->Create(m_Width, m_Height, dest_format)) { | 1093 if (!pClone->Create(m_Width, m_Height, dest_format)) { |
1094 delete pClone; | 1094 delete pClone; |
1095 return NULL; | 1095 return NULL; |
1096 } | 1096 } |
1097 FX_BOOL ret = TRUE; | 1097 FX_BOOL ret = TRUE; |
1098 CFX_DIBitmap* pSrcAlpha = NULL; | 1098 CFX_DIBitmap* pSrcAlpha = NULL; |
1099 if (m_AlphaFlag & 2) { | 1099 if (HasAlpha()) { |
1100 pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask; | 1100 pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask; |
1101 if (pSrcAlpha == NULL) { | 1101 if (pSrcAlpha == NULL) { |
1102 delete pClone; | 1102 delete pClone; |
1103 return NULL; | 1103 return NULL; |
1104 } | 1104 } |
1105 } | 1105 } |
1106 if (dest_format & 0x0200) { | 1106 if (dest_format & 0x0200) { |
1107 if (dest_format == FXDIB_Argb) | 1107 if (dest_format == FXDIB_Argb) |
1108 ret = pSrcAlpha ? pClone->LoadChannel(FXDIB_Alpha, pSrcAlpha, FXDIB_Alpha) | 1108 ret = pSrcAlpha ? pClone->LoadChannel(FXDIB_Alpha, pSrcAlpha, FXDIB_Alpha) |
1109 : pClone->LoadChannel(FXDIB_Alpha, 0xff); | 1109 : pClone->LoadChannel(FXDIB_Alpha, 0xff); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 if (!m_bExtBuf) { | 1217 if (!m_bExtBuf) { |
1218 FX_Free(m_pBuffer); | 1218 FX_Free(m_pBuffer); |
1219 } | 1219 } |
1220 m_bExtBuf = FALSE; | 1220 m_bExtBuf = FALSE; |
1221 m_pBuffer = dest_buf; | 1221 m_pBuffer = dest_buf; |
1222 m_bpp = (uint8_t)dest_format; | 1222 m_bpp = (uint8_t)dest_format; |
1223 m_AlphaFlag = (uint8_t)(dest_format >> 8); | 1223 m_AlphaFlag = (uint8_t)(dest_format >> 8); |
1224 m_Pitch = dest_pitch; | 1224 m_Pitch = dest_pitch; |
1225 return TRUE; | 1225 return TRUE; |
1226 } | 1226 } |
OLD | NEW |