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 #include "core/fxge/include/ifx_renderdevicedriver.h" | 8 #include "core/fxge/include/ifx_renderdevicedriver.h" |
9 | 9 |
| 10 #if defined _SKIA_SUPPORT_ |
| 11 #include "third_party/skia/include/core/SkTypes.h" |
| 12 #endif |
| 13 |
10 CFX_RenderDevice::CFX_RenderDevice() | 14 CFX_RenderDevice::CFX_RenderDevice() |
11 : m_pBitmap(nullptr), | 15 : m_pBitmap(nullptr), |
12 m_Width(0), | 16 m_Width(0), |
13 m_Height(0), | 17 m_Height(0), |
14 m_bpp(0), | 18 m_bpp(0), |
15 m_RenderCaps(0), | 19 m_RenderCaps(0), |
16 m_DeviceClass(0), | 20 m_DeviceClass(0), |
17 m_pDeviceDriver(nullptr) {} | 21 m_pDeviceDriver(nullptr) {} |
18 | 22 |
19 CFX_RenderDevice::~CFX_RenderDevice() { | 23 CFX_RenderDevice::~CFX_RenderDevice() { |
20 delete m_pDeviceDriver; | 24 delete m_pDeviceDriver; |
21 } | 25 } |
22 | 26 |
| 27 void CFX_RenderDevice::Flush() { |
| 28 delete m_pDeviceDriver; |
| 29 m_pDeviceDriver = nullptr; |
| 30 } |
| 31 |
23 void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver) { | 32 void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver) { |
24 delete m_pDeviceDriver; | 33 delete m_pDeviceDriver; |
25 m_pDeviceDriver = pDriver; | 34 m_pDeviceDriver = pDriver; |
26 InitDeviceInfo(); | 35 InitDeviceInfo(); |
27 } | 36 } |
28 | 37 |
29 void CFX_RenderDevice::InitDeviceInfo() { | 38 void CFX_RenderDevice::InitDeviceInfo() { |
30 m_Width = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_WIDTH); | 39 m_Width = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_WIDTH); |
31 m_Height = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_HEIGHT); | 40 m_Height = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_HEIGHT); |
32 m_bpp = m_pDeviceDriver->GetDeviceCaps(FXDC_BITS_PIXEL); | 41 m_bpp = m_pDeviceDriver->GetDeviceCaps(FXDC_BITS_PIXEL); |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 flags, handle, blend_mode); | 482 flags, handle, blend_mode); |
474 } | 483 } |
475 | 484 |
476 FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) { | 485 FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) { |
477 return m_pDeviceDriver->ContinueDIBits(handle, pPause); | 486 return m_pDeviceDriver->ContinueDIBits(handle, pPause); |
478 } | 487 } |
479 | 488 |
480 void CFX_RenderDevice::CancelDIBits(void* handle) { | 489 void CFX_RenderDevice::CancelDIBits(void* handle) { |
481 m_pDeviceDriver->CancelDIBits(handle); | 490 m_pDeviceDriver->CancelDIBits(handle); |
482 } | 491 } |
| 492 |
| 493 #ifdef _SKIA_SUPPORT_ |
| 494 |
| 495 void CFX_RenderDevice::DebugVerifyBitmapIsPreMultiplied() const { |
| 496 SkASSERT(0); |
| 497 } |
| 498 #endif |
OLD | NEW |