| 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_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
| 8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ | 8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #include <gdiplus.h> | 10 #include <gdiplus.h> |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 dest_pixel_format = PixelFormat32bppARGB; | 1193 dest_pixel_format = PixelFormat32bppARGB; |
| 1194 } | 1194 } |
| 1195 LPBYTE buf = FX_Alloc(BYTE, info_size); | 1195 LPBYTE buf = FX_Alloc(BYTE, info_size); |
| 1196 if (!buf) { | 1196 if (!buf) { |
| 1197 if (pStream) { | 1197 if (pStream) { |
| 1198 pStream->Release(); | 1198 pStream->Release(); |
| 1199 } | 1199 } |
| 1200 return NULL; | 1200 return NULL; |
| 1201 } | 1201 } |
| 1202 BITMAPINFOHEADER* pbmih = (BITMAPINFOHEADER*)buf; | 1202 BITMAPINFOHEADER* pbmih = (BITMAPINFOHEADER*)buf; |
| 1203 FXSYS_memset32(buf, 0, info_size); | |
| 1204 pbmih->biBitCount = bpp; | 1203 pbmih->biBitCount = bpp; |
| 1205 pbmih->biCompression = BI_RGB; | 1204 pbmih->biCompression = BI_RGB; |
| 1206 pbmih->biHeight = -(int)height; | 1205 pbmih->biHeight = -(int)height; |
| 1207 pbmih->biPlanes = 1; | 1206 pbmih->biPlanes = 1; |
| 1208 pbmih->biWidth = width; | 1207 pbmih->biWidth = width; |
| 1209 Rect rect(0, 0, width, height); | 1208 Rect rect(0, 0, width, height); |
| 1210 BitmapData* pBitmapData = FX_Alloc(BitmapData, 1); | 1209 BitmapData* pBitmapData = FX_Alloc(BitmapData, 1); |
| 1211 if (!pBitmapData) { | 1210 if (!pBitmapData) { |
| 1212 if (pStream) { | 1211 if (pStream) { |
| 1213 pStream->Release(); | 1212 pStream->Release(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 FXSYS_memcpy32(pData, pInfo->pScan0, dest_pitch * height); | 1276 FXSYS_memcpy32(pData, pInfo->pScan0, dest_pitch * height); |
| 1278 } else for (int i = 0; i < height; i ++) { | 1277 } else for (int i = 0; i < height; i ++) { |
| 1279 FXSYS_memcpy32(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride
* i, dest_pitch); | 1278 FXSYS_memcpy32(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride
* i, dest_pitch); |
| 1280 } | 1279 } |
| 1281 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf(pInfo->pbmi, pData, pIn
fo->pbmi->bmiHeader.biBitCount == 32); | 1280 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf(pInfo->pbmi, pData, pIn
fo->pbmi->bmiHeader.biBitCount == 32); |
| 1282 FX_Free(pData); | 1281 FX_Free(pData); |
| 1283 FreeDIBitmap(pInfo); | 1282 FreeDIBitmap(pInfo); |
| 1284 return pDIBitmap; | 1283 return pDIBitmap; |
| 1285 } | 1284 } |
| 1286 #endif | 1285 #endif |
| OLD | NEW |