Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2309)

Unified Diff: core/fxge/win32/fx_win32_device.cpp

Issue 2612243005: Add postscript path (Closed)
Patch Set: Small fixes, add comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/fxge/win32/fx_win32_device.cpp
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 1bfb4b7d6d2f72f40604f1e245471c16de76453e..65c32dae0645d92dab0f7dcec39d55e242c93648 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -14,10 +14,6 @@
#include "core/fxcrt/cfx_maybe_owned.h"
#include "core/fxcrt/fx_memory.h"
#include "core/fxcrt/fx_system.h"
-#include "core/fxge/cfx_fontmapper.h"
-#include "core/fxge/cfx_gemodule.h"
-#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_windowsdevice.h"
#include "core/fxge/dib/dib_int.h"
#include "core/fxge/fx_font.h"
@@ -697,6 +693,8 @@ bool CFX_Win32FontInfo::GetFontCharset(void* hFont, int& charset) {
} // namespace
+int g_pdfium_print_postscript_level = 0;
+
std::unique_ptr<IFX_SystemFontInfo> IFX_SystemFontInfo::CreateDefault(
const char** pUnused) {
if (IsGDIEnabled())
@@ -1387,7 +1385,14 @@ IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC) {
int obj_type = ::GetObjectType(hDC);
bool use_printer = device_type == DT_RASPRINTER ||
device_type == DT_PLOTTER || obj_type == OBJ_ENHMETADC;
- if (use_printer)
+
+ if (!use_printer)
+ return new CGdiDisplayDriver(hDC);
+
+ if (g_pdfium_print_postscript_level == 2 ||
+ g_pdfium_print_postscript_level == 3) {
+ return new CPSPrinterDriver(hDC, g_pdfium_print_postscript_level, false);
+ } else {
Tom Sepez 2017/01/09 20:18:20 nit: else after return not needed.
rbpotter 2017/01/10 20:28:24 Done.
return new CGdiPrinterDriver(hDC);
- return new CGdiDisplayDriver(hDC);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698