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

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

Issue 1145843005: Revert "Remove FX_Alloc() null checks now that it can't return NULL." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 7 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/ge/fx_ge_text.cpp ('k') | core/src/fxge/win32/fx_win32_dib.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 "../../../include/fxge/fx_ge_win32.h" 9 #include "../../../include/fxge/fx_ge_win32.h"
10 #include <crtdbg.h> 10 #include <crtdbg.h>
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 int a; 648 int a;
649 FX_COLORREF rgb; 649 FX_COLORREF rgb;
650 ArgbDecode(argb, a, rgb); 650 ArgbDecode(argb, a, rgb);
651 LOGBRUSH lb; 651 LOGBRUSH lb;
652 lb.lbColor = rgb; 652 lb.lbColor = rgb;
653 lb.lbStyle = BS_SOLID; 653 lb.lbStyle = BS_SOLID;
654 lb.lbHatch = 0; 654 lb.lbHatch = 0;
655 FX_DWORD* pDash = NULL; 655 FX_DWORD* pDash = NULL;
656 if (pGraphState->m_DashCount) { 656 if (pGraphState->m_DashCount) {
657 pDash = FX_Alloc(FX_DWORD, pGraphState->m_DashCount); 657 pDash = FX_Alloc(FX_DWORD, pGraphState->m_DashCount);
658 if (!pDash) {
659 return NULL;
660 }
658 for (int i = 0; i < pGraphState->m_DashCount; i ++) { 661 for (int i = 0; i < pGraphState->m_DashCount; i ++) {
659 pDash[i] = FXSYS_round(pMatrix ? pMatrix->TransformDistance(pGraphSt ate->m_DashArray[i]) : pGraphState->m_DashArray[i]); 662 pDash[i] = FXSYS_round(pMatrix ? pMatrix->TransformDistance(pGraphSt ate->m_DashArray[i]) : pGraphState->m_DashArray[i]);
660 if (pDash[i] < 1) { 663 if (pDash[i] < 1) {
661 pDash[i] = 1; 664 pDash[i] = 1;
662 } 665 }
663 } 666 }
664 } 667 }
665 HPEN hPen = ExtCreatePen(PenStyle, (DWORD)FXSYS_ceil(width), &lb, pGraphStat e->m_DashCount, (const DWORD*)pDash); 668 HPEN hPen = ExtCreatePen(PenStyle, (DWORD)FXSYS_ceil(width), &lb, pGraphStat e->m_DashCount, (const DWORD*)pDash);
666 if (pDash) { 669 if (pDash) {
667 FX_Free(pDash); 670 FX_Free(pDash);
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 if (m_hDC) { 1197 if (m_hDC) {
1195 SelectObject(m_hDC, m_hOldBitmap); 1198 SelectObject(m_hDC, m_hOldBitmap);
1196 DeleteDC(m_hDC); 1199 DeleteDC(m_hDC);
1197 } 1200 }
1198 if (m_hBitmap) { 1201 if (m_hBitmap) {
1199 DeleteObject(m_hBitmap); 1202 DeleteObject(m_hBitmap);
1200 } 1203 }
1201 delete GetBitmap(); 1204 delete GetBitmap();
1202 } 1205 }
1203 #endif 1206 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/ge/fx_ge_text.cpp ('k') | core/src/fxge/win32/fx_win32_dib.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698