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

Side by Side Diff: core/src/fxge/win32/fx_win32_print.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/win32/fx_win32_gdipext.cpp ('k') | fpdfsdk/src/fsdk_baseform.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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 297 }
298 ((CPSOutput*)m_pPSOutput)->Init(); 298 ((CPSOutput*)m_pPSOutput)->Init();
299 m_PSRenderer.Init(m_pPSOutput, pslevel, m_Width, m_Height, bCmykOutput); 299 m_PSRenderer.Init(m_pPSOutput, pslevel, m_Width, m_Height, bCmykOutput);
300 m_bCmykOutput = bCmykOutput; 300 m_bCmykOutput = bCmykOutput;
301 HRGN hRgn = ::CreateRectRgn(0, 0, 1, 1); 301 HRGN hRgn = ::CreateRectRgn(0, 0, 1, 1);
302 int ret = ::GetClipRgn(hDC, hRgn); 302 int ret = ::GetClipRgn(hDC, hRgn);
303 if (ret == 1) { 303 if (ret == 1) {
304 ret = ::GetRegionData(hRgn, 0, NULL); 304 ret = ::GetRegionData(hRgn, 0, NULL);
305 if (ret) { 305 if (ret) {
306 RGNDATA* pData = (RGNDATA*)FX_Alloc(FX_BYTE, ret); 306 RGNDATA* pData = (RGNDATA*)FX_Alloc(FX_BYTE, ret);
307 if (!pData) {
308 return FALSE;
309 }
310 ret = ::GetRegionData(hRgn, ret, pData); 307 ret = ::GetRegionData(hRgn, ret, pData);
311 if (ret) { 308 if (ret) {
312 CFX_PathData path; 309 CFX_PathData path;
313 path.AllocPointCount(pData->rdh.nCount * 5); 310 path.AllocPointCount(pData->rdh.nCount * 5);
314 for (FX_DWORD i = 0; i < pData->rdh.nCount; i ++) { 311 for (FX_DWORD i = 0; i < pData->rdh.nCount; i ++) {
315 RECT* pRect = (RECT*)(pData->Buffer + pData->rdh.nRgnSize * i); 312 RECT* pRect = (RECT*)(pData->Buffer + pData->rdh.nRgnSize * i);
316 path.AppendRect((FX_FLOAT)pRect->left, (FX_FLOAT)pRect->bott om, (FX_FLOAT)pRect->right, (FX_FLOAT)pRect->top); 313 path.AppendRect((FX_FLOAT)pRect->left, (FX_FLOAT)pRect->bott om, (FX_FLOAT)pRect->right, (FX_FLOAT)pRect->top);
317 } 314 }
318 m_PSRenderer.SetClip_PathFill(&path, NULL, FXFILL_WINDING); 315 m_PSRenderer.SetClip_PathFill(&path, NULL, FXFILL_WINDING);
319 } 316 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 handle = NULL; 414 handle = NULL;
418 return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_ flag, pIccTransform); 415 return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_ flag, pIccTransform);
419 } 416 }
420 FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pChar Pos, CFX_Font* pFont, 417 FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pChar Pos, CFX_Font* pFont,
421 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color, 418 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
422 int alpha_flag, void* pIccTransform) 419 int alpha_flag, void* pIccTransform)
423 { 420 {
424 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device , font_size, color, alpha_flag, pIccTransform); 421 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device , font_size, color, alpha_flag, pIccTransform);
425 } 422 }
426 #endif 423 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/win32/fx_win32_gdipext.cpp ('k') | fpdfsdk/src/fsdk_baseform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698