| 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 #include "../skia/fx_skia_driver.h" |
| 9 |
| 8 CFX_RenderDevice::CFX_RenderDevice() | 10 CFX_RenderDevice::CFX_RenderDevice() |
| 9 { | 11 { |
| 10 m_pDeviceDriver = NULL; | 12 m_pDeviceDriver = NULL; |
| 11 m_pBitmap = NULL; | 13 m_pBitmap = NULL; |
| 12 } | 14 } |
| 13 CFX_RenderDevice::~CFX_RenderDevice() | 15 CFX_RenderDevice::~CFX_RenderDevice() |
| 14 { | 16 { |
| 15 if (m_pDeviceDriver) { | 17 if (m_pDeviceDriver) { |
| 16 delete m_pDeviceDriver; | 18 delete m_pDeviceDriver; |
| 17 } | 19 } |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, fl
ags, handle, alpha_flag, pIccTransform, blend_mode); | 398 return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, fl
ags, handle, alpha_flag, pIccTransform, blend_mode); |
| 397 } | 399 } |
| 398 FX_BOOL CFX_RenderDevice::ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause) | 400 FX_BOOL CFX_RenderDevice::ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause) |
| 399 { | 401 { |
| 400 return m_pDeviceDriver->ContinueDIBits(handle, pPause); | 402 return m_pDeviceDriver->ContinueDIBits(handle, pPause); |
| 401 } | 403 } |
| 402 void CFX_RenderDevice::CancelDIBits(FX_LPVOID handle) | 404 void CFX_RenderDevice::CancelDIBits(FX_LPVOID handle) |
| 403 { | 405 { |
| 404 m_pDeviceDriver->CancelDIBits(handle); | 406 m_pDeviceDriver->CancelDIBits(handle); |
| 405 } | 407 } |
| 408 |
| 409 |
| 410 CFX_FxgeDevice::CFX_FxgeDevice() |
| 411 { |
| 412 m_bOwnedBitmap = FALSE; |
| 413 } |
| 414 FX_BOOL CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL b
RgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout) |
| 415 { |
| 416 if (pBitmap == NULL) { |
| 417 return FALSE; |
| 418 } |
| 419 SetBitmap(pBitmap); |
| 420 CFX_SkiaDriver* pDriver = FX_NEW CFX_SkiaDriver(pBitmap, dither_bits, bRgbBy
teOrder, pOriDevice, bGroupKnockout); |
| 421 if (!pDriver) { |
| 422 return FALSE; |
| 423 } |
| 424 SetDeviceDriver(pDriver); |
| 425 return TRUE; |
| 426 } |
| 427 FX_BOOL CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int d
ither_bits, CFX_DIBitmap* pOriDevice) |
| 428 { |
| 429 m_bOwnedBitmap = TRUE; |
| 430 CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap; |
| 431 if (!pBitmap) { |
| 432 return FALSE; |
| 433 } |
| 434 if (!pBitmap->Create(width, height, format)) { |
| 435 delete pBitmap; |
| 436 return FALSE; |
| 437 } |
| 438 SetBitmap(pBitmap); |
| 439 CFX_SkiaDriver* pDriver = FX_NEW CFX_SkiaDriver(pBitmap, dither_bits, FALSE,
pOriDevice, FALSE); |
| 440 if (!pDriver) { |
| 441 return FALSE; |
| 442 } |
| 443 SetDeviceDriver(pDriver); |
| 444 return TRUE; |
| 445 } |
| 446 CFX_FxgeDevice::~CFX_FxgeDevice() |
| 447 { |
| 448 if (m_bOwnedBitmap && GetBitmap()) { |
| 449 delete GetBitmap(); |
| 450 } |
| 451 } |
| OLD | NEW |