summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fxge/cfx_windowsrenderdevice.h2
-rw-r--r--core/fxge/win32/fx_win32_device.cpp5
-rw-r--r--core/fxge/win32/fx_win32_print.cpp9
-rw-r--r--core/fxge/win32/win32_int.h3
4 files changed, 12 insertions, 7 deletions
diff --git a/core/fxge/cfx_windowsrenderdevice.h b/core/fxge/cfx_windowsrenderdevice.h
index c6e6686fab..bbe13415c6 100644
--- a/core/fxge/cfx_windowsrenderdevice.h
+++ b/core/fxge/cfx_windowsrenderdevice.h
@@ -32,7 +32,7 @@ extern bool g_pdfium_print_text_with_gdi;
extern PDFiumEnsureTypefaceCharactersAccessible
g_pdfium_typeface_accessible_func;
#endif
-extern int g_pdfium_print_mode;
+extern WindowsPrintMode g_pdfium_print_mode;
class CFX_WindowsRenderDevice : public CFX_RenderDevice {
public:
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index f5b062ba61..ed03101ecd 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -671,7 +671,7 @@ bool CFX_Win32FontInfo::GetFontCharset(void* hFont, int* charset) {
} // namespace
-int g_pdfium_print_mode = WindowsPrintMode::kModeEmf;
+WindowsPrintMode g_pdfium_print_mode = WindowsPrintMode::kModeEmf;
std::unique_ptr<SystemFontInfoIface> SystemFontInfoIface::CreateDefault(
const char** pUnused) {
@@ -1361,8 +1361,5 @@ RenderDeviceDriverIface* CFX_WindowsRenderDevice::CreateDriver(HDC hDC) {
if (g_pdfium_print_mode == WindowsPrintMode::kModeTextOnly)
return new CTextOnlyPrinterDriver(hDC);
- // Should be PostScript
- ASSERT(g_pdfium_print_mode == WindowsPrintMode::kModePostScript2 ||
- g_pdfium_print_mode == WindowsPrintMode::kModePostScript3);
return new CPSPrinterDriver(hDC, g_pdfium_print_mode, false);
}
diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp
index 66fbdd9b02..da40b8a762 100644
--- a/core/fxge/win32/fx_win32_print.cpp
+++ b/core/fxge/win32/fx_win32_print.cpp
@@ -328,8 +328,15 @@ bool CGdiPrinterDriver::DrawDeviceText(int nChars,
#endif
}
-CPSPrinterDriver::CPSPrinterDriver(HDC hDC, int pslevel, bool bCmykOutput)
+CPSPrinterDriver::CPSPrinterDriver(HDC hDC,
+ WindowsPrintMode mode,
+ bool bCmykOutput)
: m_hDC(hDC), m_bCmykOutput(bCmykOutput) {
+ // |mode| should be PostScript.
+ ASSERT(mode == WindowsPrintMode::kModePostScript2 ||
+ mode == WindowsPrintMode::kModePostScript3);
+ int pslevel = mode == WindowsPrintMode::kModePostScript2 ? 2 : 3;
+
m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE);
m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE);
m_Width = ::GetDeviceCaps(m_hDC, HORZRES);
diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h
index 7d4ec43cb9..fe0e7f3ba9 100644
--- a/core/fxge/win32/win32_int.h
+++ b/core/fxge/win32/win32_int.h
@@ -14,6 +14,7 @@
#include "core/fxcrt/retain_ptr.h"
#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_windowsrenderdevice.h"
#include "core/fxge/renderdevicedriver_iface.h"
#include "core/fxge/win32/cfx_psrenderer.h"
#include "core/fxge/win32/cpsoutput.h"
@@ -270,7 +271,7 @@ class CGdiPrinterDriver : public CGdiDeviceDriver {
class CPSPrinterDriver : public RenderDeviceDriverIface {
public:
- CPSPrinterDriver(HDC hDC, int ps_level, bool bCmykOutput);
+ CPSPrinterDriver(HDC hDC, WindowsPrintMode mode, bool bCmykOutput);
~CPSPrinterDriver() override;
protected: