win: Assume that we always run on at least Windows 2000
CWin32Platform::Init() is always called right after the CWin32Platform
ctor. It checks if the OS version number is >=5 which per
https://docs.microsoft.com/en-us/windows/win32/sysinfo/operating-system-version
means Windows 2000. That's very very old, let's just assume it's available.
Bug: chromium:1255114
Change-Id: I175f3182ebad957f2b46a1d23bad7307fc256a80
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/85610
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
diff --git a/core/fxge/win32/cgdi_device_driver.cpp b/core/fxge/win32/cgdi_device_driver.cpp
index c8a15b2..7379598 100644
--- a/core/fxge/win32/cgdi_device_driver.cpp
+++ b/core/fxge/win32/cgdi_device_driver.cpp
@@ -307,9 +307,7 @@
CGdiDeviceDriver::CGdiDeviceDriver(HDC hDC, DeviceType device_type)
: m_hDC(hDC), m_DeviceType(device_type) {
- auto* pPlatform =
- static_cast<CWin32Platform*>(CFX_GEModule::Get()->GetPlatform());
- SetStretchBltMode(m_hDC, pPlatform->m_bHalfTone ? HALFTONE : COLORONCOLOR);
+ SetStretchBltMode(m_hDC, HALFTONE);
DWORD obj_type = GetObjectType(m_hDC);
m_bMetafileDCType = obj_type == OBJ_ENHMETADC || obj_type == OBJ_ENHMETAFILE;
if (obj_type == OBJ_MEMDC) {
diff --git a/core/fxge/win32/cwin32_platform.cpp b/core/fxge/win32/cwin32_platform.cpp
index 44c6f1e..9269b8f 100644
--- a/core/fxge/win32/cwin32_platform.cpp
+++ b/core/fxge/win32/cwin32_platform.cpp
@@ -435,10 +435,6 @@
CWin32Platform::~CWin32Platform() = default;
void CWin32Platform::Init() {
- OSVERSIONINFO ver;
- ver.dwOSVersionInfoSize = sizeof(ver);
- GetVersionEx(&ver);
- m_bHalfTone = ver.dwMajorVersion >= 5;
if (pdfium::base::win::IsUser32AndGdi32Available())
m_GdiplusExt.Load();
}
diff --git a/core/fxge/win32/cwin32_platform.h b/core/fxge/win32/cwin32_platform.h
index 14f508d..1a47402 100644
--- a/core/fxge/win32/cwin32_platform.h
+++ b/core/fxge/win32/cwin32_platform.h
@@ -21,7 +21,6 @@
void Init() override;
std::unique_ptr<SystemFontInfoIface> CreateDefaultSystemFontInfo() override;
- bool m_bHalfTone = false;
CGdiplusExt m_GdiplusExt;
};