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 "core/fxge/include/fx_ge.h" | 7 #include "core/fxge/include/fx_ge.h" |
8 | 8 |
9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
10 | 10 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 if (!pIccTransform) { | 263 if (!pIccTransform) { |
264 return FALSE; | 264 return FALSE; |
265 } | 265 } |
266 SaveState(); | 266 SaveState(); |
267 CFX_PathData path; | 267 CFX_PathData path; |
268 path.AppendRect(0, 0, 1.0f, 1.0f); | 268 path.AppendRect(0, 0, 1.0f, 1.0f); |
269 SetClip_PathFill(&path, pMatrix, WINDING); | 269 SetClip_PathFill(&path, pMatrix, WINDING); |
270 FX_BOOL ret = StretchDIBits( | 270 FX_BOOL ret = StretchDIBits( |
271 pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), | 271 pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), |
272 full_rect.Height(), NULL, 0, alpha_flag, pIccTransform, blend_type); | 272 full_rect.Height(), NULL, 0, alpha_flag, pIccTransform, blend_type); |
273 RestoreState(); | 273 RestoreState(false); |
274 delete pTransformed; | 274 delete pTransformed; |
275 handle = NULL; | 275 handle = NULL; |
276 return ret; | 276 return ret; |
277 } | 277 } |
278 return FALSE; | 278 return FALSE; |
279 } | 279 } |
280 CPSOutput::CPSOutput(HDC hDC) { | 280 CPSOutput::CPSOutput(HDC hDC) { |
281 m_hDC = hDC; | 281 m_hDC = hDC; |
282 m_pBuf = NULL; | 282 m_pBuf = NULL; |
283 } | 283 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 } | 364 } |
365 FX_BOOL CPSPrinterDriver::StartRendering() { | 365 FX_BOOL CPSPrinterDriver::StartRendering() { |
366 return m_PSRenderer.StartRendering(); | 366 return m_PSRenderer.StartRendering(); |
367 } | 367 } |
368 void CPSPrinterDriver::EndRendering() { | 368 void CPSPrinterDriver::EndRendering() { |
369 m_PSRenderer.EndRendering(); | 369 m_PSRenderer.EndRendering(); |
370 } | 370 } |
371 void CPSPrinterDriver::SaveState() { | 371 void CPSPrinterDriver::SaveState() { |
372 m_PSRenderer.SaveState(); | 372 m_PSRenderer.SaveState(); |
373 } | 373 } |
374 void CPSPrinterDriver::RestoreState(FX_BOOL bKeepSaved) { | 374 |
| 375 void CPSPrinterDriver::RestoreState(bool bKeepSaved) { |
375 m_PSRenderer.RestoreState(bKeepSaved); | 376 m_PSRenderer.RestoreState(bKeepSaved); |
376 } | 377 } |
| 378 |
377 FX_BOOL CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, | 379 FX_BOOL CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, |
378 const CFX_Matrix* pObject2Device, | 380 const CFX_Matrix* pObject2Device, |
379 int fill_mode) { | 381 int fill_mode) { |
380 m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_mode); | 382 m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_mode); |
381 return TRUE; | 383 return TRUE; |
382 } | 384 } |
383 FX_BOOL CPSPrinterDriver::SetClip_PathStroke( | 385 FX_BOOL CPSPrinterDriver::SetClip_PathStroke( |
384 const CFX_PathData* pPathData, | 386 const CFX_PathData* pPathData, |
385 const CFX_Matrix* pObject2Device, | 387 const CFX_Matrix* pObject2Device, |
386 const CFX_GraphStateData* pGraphState) { | 388 const CFX_GraphStateData* pGraphState) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 CFX_FontCache* pCache, | 466 CFX_FontCache* pCache, |
465 const CFX_Matrix* pObject2Device, | 467 const CFX_Matrix* pObject2Device, |
466 FX_FLOAT font_size, | 468 FX_FLOAT font_size, |
467 uint32_t color, | 469 uint32_t color, |
468 int alpha_flag, | 470 int alpha_flag, |
469 void* pIccTransform) { | 471 void* pIccTransform) { |
470 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device, | 472 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device, |
471 font_size, color, alpha_flag, pIccTransform); | 473 font_size, color, alpha_flag, pIccTransform); |
472 } | 474 } |
473 #endif | 475 #endif |
OLD | NEW |