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 |
11 #include <windows.h> | 11 #include <windows.h> |
12 | 12 |
13 #include "core/fxge/dib/dib_int.h" | 13 #include "core/fxge/dib/dib_int.h" |
14 #include "core/fxge/ge/fx_text_int.h" | 14 #include "core/fxge/ge/fx_text_int.h" |
15 #include "core/fxge/include/fx_freetype.h" | 15 #include "core/fxge/include/fx_freetype.h" |
16 #include "core/fxge/include/fx_ge_win32.h" | 16 #include "core/fxge/include/fx_ge_win32.h" |
17 #include "core/fxge/win32/win32_int.h" | 17 #include "core/fxge/win32/win32_int.h" |
18 | 18 |
19 CGdiPrinterDriver::CGdiPrinterDriver(HDC hDC) | 19 CGdiPrinterDriver::CGdiPrinterDriver(HDC hDC) |
20 : CGdiDeviceDriver(hDC, FXDC_PRINTER), | 20 : CGdiDeviceDriver(hDC, FXDC_PRINTER), |
21 m_HorzSize(::GetDeviceCaps(m_hDC, HORZSIZE)), | 21 m_HorzSize(::GetDeviceCaps(m_hDC, HORZSIZE)), |
22 m_VertSize(::GetDeviceCaps(m_hDC, VERTSIZE)) {} | 22 m_VertSize(::GetDeviceCaps(m_hDC, VERTSIZE)) {} |
23 | 23 |
24 CGdiPrinterDriver::~CGdiPrinterDriver() {} | 24 CGdiPrinterDriver::~CGdiPrinterDriver() {} |
25 | 25 |
26 int CGdiPrinterDriver::GetDeviceCaps(int caps_id) { | 26 int CGdiPrinterDriver::GetDeviceCaps(int caps_id) const { |
27 if (caps_id == FXDC_HORZ_SIZE) | 27 if (caps_id == FXDC_HORZ_SIZE) |
28 return m_HorzSize; | 28 return m_HorzSize; |
29 if (caps_id == FXDC_VERT_SIZE) | 29 if (caps_id == FXDC_VERT_SIZE) |
30 return m_VertSize; | 30 return m_VertSize; |
31 return CGdiDeviceDriver::GetDeviceCaps(caps_id); | 31 return CGdiDeviceDriver::GetDeviceCaps(caps_id); |
32 } | 32 } |
33 | 33 |
34 FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, | 34 FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, |
35 uint32_t color, | 35 uint32_t color, |
36 const FX_RECT* pSrcRect, | 36 const FX_RECT* pSrcRect, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 return FALSE; | 153 return FALSE; |
154 | 154 |
155 return StretchDIBits(pTransformed.get(), color, full_rect.left, | 155 return StretchDIBits(pTransformed.get(), color, full_rect.left, |
156 full_rect.top, full_rect.Width(), full_rect.Height(), | 156 full_rect.top, full_rect.Width(), full_rect.Height(), |
157 nullptr, 0, blend_type); | 157 nullptr, 0, blend_type); |
158 } | 158 } |
159 return FALSE; | 159 return FALSE; |
160 } | 160 } |
161 | 161 |
162 #endif | 162 #endif |
OLD | NEW |