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

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

Issue 1143663008: Merge to XFA: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebased. 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 int a; 651 int a;
652 FX_COLORREF rgb; 652 FX_COLORREF rgb;
653 ArgbDecode(argb, a, rgb); 653 ArgbDecode(argb, a, rgb);
654 LOGBRUSH lb; 654 LOGBRUSH lb;
655 lb.lbColor = rgb; 655 lb.lbColor = rgb;
656 lb.lbStyle = BS_SOLID; 656 lb.lbStyle = BS_SOLID;
657 lb.lbHatch = 0; 657 lb.lbHatch = 0;
658 FX_DWORD* pDash = NULL; 658 FX_DWORD* pDash = NULL;
659 if (pGraphState->m_DashCount) { 659 if (pGraphState->m_DashCount) {
660 pDash = FX_Alloc(FX_DWORD, pGraphState->m_DashCount); 660 pDash = FX_Alloc(FX_DWORD, pGraphState->m_DashCount);
661 if (!pDash) {
662 return NULL;
663 }
664 for (int i = 0; i < pGraphState->m_DashCount; i ++) { 661 for (int i = 0; i < pGraphState->m_DashCount; i ++) {
665 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]);
666 if (pDash[i] < 1) { 663 if (pDash[i] < 1) {
667 pDash[i] = 1; 664 pDash[i] = 1;
668 } 665 }
669 } 666 }
670 } 667 }
671 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);
672 if (pDash) { 669 if (pDash) {
673 FX_Free(pDash); 670 FX_Free(pDash);
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 if (m_hDC) { 1206 if (m_hDC) {
1210 SelectObject(m_hDC, m_hOldBitmap); 1207 SelectObject(m_hDC, m_hOldBitmap);
1211 DeleteDC(m_hDC); 1208 DeleteDC(m_hDC);
1212 } 1209 }
1213 if (m_hBitmap) { 1210 if (m_hBitmap) {
1214 DeleteObject(m_hBitmap); 1211 DeleteObject(m_hBitmap);
1215 } 1212 }
1216 delete GetBitmap(); 1213 delete GetBitmap();
1217 } 1214 }
1218 #endif 1215 #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