Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: core/src/fxge/win32/fx_win32_gdipext.cpp

Issue 372473003: Remove custom memory manager (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Change malloc to calloc Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fxge/win32/fx_win32_dib.cpp ('k') | fpdfsdk/src/fpdfoom.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « core/src/fxge/win32/fx_win32_dib.cpp ('k') | fpdfsdk/src/fpdfoom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698