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/include/fxge/fx_ge.h" | 7 #include "core/include/fxge/fx_ge.h" |
8 | 8 |
9 CFX_RenderDevice::CFX_RenderDevice() { | 9 CFX_RenderDevice::CFX_RenderDevice() { |
10 m_pDeviceDriver = NULL; | 10 m_pDeviceDriver = NULL; |
11 m_pBitmap = NULL; | 11 m_pBitmap = NULL; |
12 } | 12 } |
13 CFX_RenderDevice::~CFX_RenderDevice() { | 13 CFX_RenderDevice::~CFX_RenderDevice() { |
14 delete m_pDeviceDriver; | 14 delete m_pDeviceDriver; |
15 } | 15 } |
16 void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver) { | 16 void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver) { |
17 delete m_pDeviceDriver; | 17 delete m_pDeviceDriver; |
18 m_pDeviceDriver = pDriver; | 18 m_pDeviceDriver = pDriver; |
19 InitDeviceInfo(); | 19 InitDeviceInfo(); |
20 } | 20 } |
21 void CFX_RenderDevice::InitDeviceInfo() { | 21 void CFX_RenderDevice::InitDeviceInfo() { |
22 ASSERT(m_pDeviceDriver != NULL); | |
23 m_Width = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_WIDTH); | 22 m_Width = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_WIDTH); |
24 m_Height = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_HEIGHT); | 23 m_Height = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_HEIGHT); |
25 m_bpp = m_pDeviceDriver->GetDeviceCaps(FXDC_BITS_PIXEL); | 24 m_bpp = m_pDeviceDriver->GetDeviceCaps(FXDC_BITS_PIXEL); |
26 m_RenderCaps = m_pDeviceDriver->GetDeviceCaps(FXDC_RENDER_CAPS); | 25 m_RenderCaps = m_pDeviceDriver->GetDeviceCaps(FXDC_RENDER_CAPS); |
27 m_DeviceClass = m_pDeviceDriver->GetDeviceCaps(FXDC_DEVICE_CLASS); | 26 m_DeviceClass = m_pDeviceDriver->GetDeviceCaps(FXDC_DEVICE_CLASS); |
28 if (!m_pDeviceDriver->GetClipBox(&m_ClipBox)) { | 27 if (!m_pDeviceDriver->GetClipBox(&m_ClipBox)) { |
29 m_ClipBox.left = 0; | 28 m_ClipBox.left = 0; |
30 m_ClipBox.top = 0; | 29 m_ClipBox.top = 0; |
31 m_ClipBox.right = m_Width; | 30 m_ClipBox.right = m_Width; |
32 m_ClipBox.bottom = m_Height; | 31 m_ClipBox.bottom = m_Height; |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, | 465 return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, |
467 flags, handle, alpha_flag, pIccTransform, | 466 flags, handle, alpha_flag, pIccTransform, |
468 blend_mode); | 467 blend_mode); |
469 } | 468 } |
470 FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) { | 469 FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) { |
471 return m_pDeviceDriver->ContinueDIBits(handle, pPause); | 470 return m_pDeviceDriver->ContinueDIBits(handle, pPause); |
472 } | 471 } |
473 void CFX_RenderDevice::CancelDIBits(void* handle) { | 472 void CFX_RenderDevice::CancelDIBits(void* handle) { |
474 m_pDeviceDriver->CancelDIBits(handle); | 473 m_pDeviceDriver->CancelDIBits(handle); |
475 } | 474 } |
OLD | NEW |