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

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

Issue 2608663003: Pdfium Patch to restore PS Path (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « core/fxge/win32/fx_ge_ps.cpp ('k') | core/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 679479160f3700193896fc2e5201b9b6a4f18ee9..2ec7245c916e6650c54a8c4cd7592f1adddabf1e 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -9,15 +9,11 @@
#include <algorithm>
#include <memory>
#include <vector>
-
+#include <windows.h>
#include "core/fxcodec/fx_codec.h"
#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"
@@ -1369,8 +1365,8 @@ bool CGdiDisplayDriver::StartDIBits(const CFX_DIBSource* pBitmap,
return false;
}
-CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC) {
- SetDeviceDriver(pdfium::WrapUnique(CreateDriver(hDC)));
+CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, int type) {
+ SetDeviceDriver(pdfium::WrapUnique(CreateDriver(hDC, type)));
}
CFX_WindowsDevice::~CFX_WindowsDevice() {}
@@ -1380,13 +1376,27 @@ HDC CFX_WindowsDevice::GetDC() const {
return pRDD ? reinterpret_cast<HDC>(pRDD->GetPlatformSurface()) : nullptr;
}
+bool HasEscapeSupprt(HDC hdc, DWORD escape) {
+ const char* ptr = reinterpret_cast<const char*>(&escape);
+ return ExtEscape(hdc, QUERYESCSUPPORT, sizeof(escape), ptr, 0, nullptr) > 0;
+}
+
// static
-IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC) {
+IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC,
+ int driver_type) {
int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY);
int obj_type = ::GetObjectType(hDC);
bool use_printer = device_type == DT_RASPRINTER ||
device_type == DT_PLOTTER || obj_type == OBJ_ENHMETADC;
- if (use_printer)
+
+ bool post_script = driver_type > 1;
+ if (!use_printer)
+ return new CGdiDisplayDriver(hDC);
+
+ // TODO: Need to select between the two somehow and set the PS level.
+ int pslevel = driver_type;
+ if (post_script)
+ return new CPSPrinterDriver(hDC, pslevel, false);
+ else
return new CGdiPrinterDriver(hDC);
- return new CGdiDisplayDriver(hDC);
}
« no previous file with comments | « core/fxge/win32/fx_ge_ps.cpp ('k') | core/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698