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

Side by Side Diff: core/src/fxge/win32/fx_win32_dib.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/dib/fx_dib_main.cpp ('k') | core/src/fxge/win32/fx_win32_gdipext.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 "../../../include/fxge/fx_ge_win32.h" 10 #include "../../../include/fxge/fx_ge_win32.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 size += sizeof (FX_DWORD) * 254; 217 size += sizeof (FX_DWORD) * 254;
218 } 218 }
219 BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(FX_BYTE, size); 219 BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(FX_BYTE, size);
220 if (!pbmih) { 220 if (!pbmih) {
221 delete pDIBitmap; 221 delete pDIBitmap;
222 if (bCreatedDC) { 222 if (bCreatedDC) {
223 DeleteDC(hDC); 223 DeleteDC(hDC);
224 } 224 }
225 return NULL; 225 return NULL;
226 } 226 }
227 FXSYS_memset32(pbmih, 0, sizeof (BITMAPINFOHEADER));
228 pbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); 227 pbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
229 pbmih->bmiHeader.biBitCount = bmih.biBitCount; 228 pbmih->bmiHeader.biBitCount = bmih.biBitCount;
230 pbmih->bmiHeader.biCompression = BI_RGB; 229 pbmih->bmiHeader.biCompression = BI_RGB;
231 pbmih->bmiHeader.biHeight = -height; 230 pbmih->bmiHeader.biHeight = -height;
232 pbmih->bmiHeader.biPlanes = 1; 231 pbmih->bmiHeader.biPlanes = 1;
233 pbmih->bmiHeader.biWidth = bmih.biWidth; 232 pbmih->bmiHeader.biWidth = bmih.biWidth;
234 if (!pDIBitmap->Create(bmih.biWidth, height, bmih.biBitCount == 1 ? FXDI B_1bppRgb : FXDIB_8bppRgb)) { 233 if (!pDIBitmap->Create(bmih.biWidth, height, bmih.biBitCount == 1 ? FXDI B_1bppRgb : FXDIB_8bppRgb)) {
235 delete pDIBitmap; 234 delete pDIBitmap;
236 FX_Free(pbmih); 235 FX_Free(pbmih);
237 if (bCreatedDC) { 236 if (bCreatedDC) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 300 }
302 void CFX_WindowsDIB::LoadFromDevice(HDC hDC, int left, int top) 301 void CFX_WindowsDIB::LoadFromDevice(HDC hDC, int left, int top)
303 { 302 {
304 ::BitBlt(m_hMemDC, 0, 0, m_Width, m_Height, hDC, left, top, SRCCOPY); 303 ::BitBlt(m_hMemDC, 0, 0, m_Width, m_Height, hDC, left, top, SRCCOPY);
305 } 304 }
306 void CFX_WindowsDIB::SetToDevice(HDC hDC, int left, int top) 305 void CFX_WindowsDIB::SetToDevice(HDC hDC, int left, int top)
307 { 306 {
308 ::BitBlt(hDC, left, top, m_Width, m_Height, m_hMemDC, 0, 0, SRCCOPY); 307 ::BitBlt(hDC, left, top, m_Width, m_Height, m_hMemDC, 0, 0, SRCCOPY);
309 } 308 }
310 #endif 309 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/dib/fx_dib_main.cpp ('k') | core/src/fxge/win32/fx_win32_gdipext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698