OLD | NEW |
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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 m_pPSOutput = new CPSOutput(hDC); | 288 m_pPSOutput = new CPSOutput(hDC); |
289 ((CPSOutput*)m_pPSOutput)->Init(); | 289 ((CPSOutput*)m_pPSOutput)->Init(); |
290 m_PSRenderer.Init(m_pPSOutput, pslevel, m_Width, m_Height, bCmykOutput); | 290 m_PSRenderer.Init(m_pPSOutput, pslevel, m_Width, m_Height, bCmykOutput); |
291 m_bCmykOutput = bCmykOutput; | 291 m_bCmykOutput = bCmykOutput; |
292 HRGN hRgn = ::CreateRectRgn(0, 0, 1, 1); | 292 HRGN hRgn = ::CreateRectRgn(0, 0, 1, 1); |
293 int ret = ::GetClipRgn(hDC, hRgn); | 293 int ret = ::GetClipRgn(hDC, hRgn); |
294 if (ret == 1) { | 294 if (ret == 1) { |
295 ret = ::GetRegionData(hRgn, 0, NULL); | 295 ret = ::GetRegionData(hRgn, 0, NULL); |
296 if (ret) { | 296 if (ret) { |
297 RGNDATA* pData = (RGNDATA*)FX_Alloc(FX_BYTE, ret); | 297 RGNDATA* pData = (RGNDATA*)FX_Alloc(FX_BYTE, ret); |
| 298 if (!pData) { |
| 299 return FALSE; |
| 300 } |
298 ret = ::GetRegionData(hRgn, ret, pData); | 301 ret = ::GetRegionData(hRgn, ret, pData); |
299 if (ret) { | 302 if (ret) { |
300 CFX_PathData path; | 303 CFX_PathData path; |
301 path.AllocPointCount(pData->rdh.nCount * 5); | 304 path.AllocPointCount(pData->rdh.nCount * 5); |
302 for (FX_DWORD i = 0; i < pData->rdh.nCount; i ++) { | 305 for (FX_DWORD i = 0; i < pData->rdh.nCount; i ++) { |
303 RECT* pRect = (RECT*)(pData->Buffer + pData->rdh.nRgnSize *
i); | 306 RECT* pRect = (RECT*)(pData->Buffer + pData->rdh.nRgnSize *
i); |
304 path.AppendRect((FX_FLOAT)pRect->left, (FX_FLOAT)pRect->bott
om, (FX_FLOAT)pRect->right, (FX_FLOAT)pRect->top); | 307 path.AppendRect((FX_FLOAT)pRect->left, (FX_FLOAT)pRect->bott
om, (FX_FLOAT)pRect->right, (FX_FLOAT)pRect->top); |
305 } | 308 } |
306 m_PSRenderer.SetClip_PathFill(&path, NULL, FXFILL_WINDING); | 309 m_PSRenderer.SetClip_PathFill(&path, NULL, FXFILL_WINDING); |
307 } | 310 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 handle = NULL; | 408 handle = NULL; |
406 return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_
flag, pIccTransform); | 409 return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_
flag, pIccTransform); |
407 } | 410 } |
408 FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pChar
Pos, CFX_Font* pFont, | 411 FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pChar
Pos, CFX_Font* pFont, |
409 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT
font_size, FX_DWORD color, | 412 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT
font_size, FX_DWORD color, |
410 int alpha_flag, void* pIccTransform) | 413 int alpha_flag, void* pIccTransform) |
411 { | 414 { |
412 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device
, font_size, color, alpha_flag, pIccTransform); | 415 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device
, font_size, color, alpha_flag, pIccTransform); |
413 } | 416 } |
414 #endif | 417 #endif |
OLD | NEW |