win: Remove CefEnableHighDPISupport function (fixes issue #3452)

High-DPI support is now enabled by default in Chromium.
This commit is contained in:
Marshall Greenblatt 2023-03-03 16:07:27 -05:00
parent d33b67cb33
commit f3b570cf8e
9 changed files with 2 additions and 47 deletions

View File

@ -42,9 +42,9 @@
// way that may cause binary incompatibility with other builds. The universal // way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash // hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected. // values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "3aeebca8c3036dc66e9100f9d19681908f39f321" #define CEF_API_HASH_UNIVERSAL "847b71b49130895cf4fb59fdb5be490ca29ef4ac"
#if defined(OS_WIN) #if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "5dcd05c3516709113ae110e1602907bd0e027802" #define CEF_API_HASH_PLATFORM "34ef9830e2b8dc5e4c930db28e279e2a70d9f4bf"
#elif defined(OS_MAC) #elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "9152ecd1a004d3c800af9c2ca12246554f91723c" #define CEF_API_HASH_PLATFORM "9152ecd1a004d3c800af9c2ca12246554f91723c"
#elif defined(OS_LINUX) #elif defined(OS_LINUX)

View File

@ -86,13 +86,6 @@ CEF_EXPORT int cef_run_main_with_preferred_stack_size(mainPtr main,
char* argv[]); char* argv[]);
#endif // defined(ARCH_CPU_32_BITS) #endif // defined(ARCH_CPU_32_BITS)
///
/// Call during process startup to enable High-DPI support on Windows 7 or
/// newer. Older versions of Windows should be left DPI-unaware because they do
/// not support DirectWrite and GDI fonts are kerned very badly.
///
CEF_EXPORT void cef_enable_highdpi_support(void);
/// ///
/// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a /// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a
/// modal message loop. Set to false (0) after exiting the modal message loop. /// modal message loop. Set to false (0) after exiting the modal message loop.

View File

@ -168,13 +168,6 @@ int CefRunWinMainWithPreferredStackSize(wWinMainPtr wWinMain,
int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]); int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]);
#endif // defined(ARCH_CPU_32_BITS) #endif // defined(ARCH_CPU_32_BITS)
///
/// Call during process startup to enable High-DPI support on Windows 7 or
/// newer. Older versions of Windows should be left DPI-unaware because they do
/// not support DirectWrite and GDI fonts are kerned very badly.
///
void CefEnableHighDPISupport();
/// ///
/// Set to true before calling Windows APIs like TrackPopupMenu that enter a /// Set to true before calling Windows APIs like TrackPopupMenu that enter a
/// modal message loop. Set to false after exiting the modal message loop. /// modal message loop. Set to false after exiting the modal message loop.

View File

@ -23,7 +23,6 @@
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
#include "base/debug/alias.h" #include "base/debug/alias.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/win/win_util.h"
#include "chrome/chrome_elf/chrome_elf_main.h" #include "chrome/chrome_elf/chrome_elf_main.h"
#include "chrome/install_static/initialize_from_primary_module.h" #include "chrome/install_static/initialize_from_primary_module.h"
#include "include/internal/cef_win.h" #include "include/internal/cef_win.h"
@ -401,10 +400,6 @@ int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]) {
} }
#endif // defined(ARCH_CPU_32_BITS) #endif // defined(ARCH_CPU_32_BITS)
void CefEnableHighDPISupport() {
base::win::EnableHighDPISupport();
}
void CefSetOSModalLoop(bool osModalLoop) { void CefSetOSModalLoop(bool osModalLoop) {
// Verify that the context is in a valid state. // Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) { if (!CONTEXT_STATE_VALID()) {

View File

@ -67,10 +67,6 @@ CEF_EXPORT int cef_run_main_with_preferred_stack_size(mainPtr main,
} }
#endif // defined(ARCH_CPU_32_BITS) #endif // defined(ARCH_CPU_32_BITS)
CEF_EXPORT void cef_enable_highdpi_support() {
CefEnableHighDPISupport();
}
CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop) { CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop) {
CefSetOSModalLoop(osModalLoop ? true : false); CefSetOSModalLoop(osModalLoop ? true : false);
} }

View File

@ -44,17 +44,6 @@ int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]) {
} }
#endif // defined(ARCH_CPU_32_BITS) #endif // defined(ARCH_CPU_32_BITS)
NO_SANITIZE("cfi-icall") void CefEnableHighDPISupport() {
const char* api_hash = cef_api_hash(0);
if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) {
// The libcef API hash does not match the current header API hash.
NOTREACHED();
return;
}
cef_enable_highdpi_support();
}
NO_SANITIZE("cfi-icall") void CefSetOSModalLoop(bool osModalLoop) { NO_SANITIZE("cfi-icall") void CefSetOSModalLoop(bool osModalLoop) {
cef_set_osmodal_loop(osModalLoop); cef_set_osmodal_loop(osModalLoop);
} }

View File

@ -35,9 +35,6 @@ namespace client {
namespace { namespace {
int RunMain(HINSTANCE hInstance, int nCmdShow) { int RunMain(HINSTANCE hInstance, int nCmdShow) {
// Enable High-DPI support on Windows 7 or newer.
CefEnableHighDPISupport();
CefMainArgs main_args(hInstance); CefMainArgs main_args(hInstance);
void* sandbox_info = nullptr; void* sandbox_info = nullptr;

View File

@ -46,9 +46,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
} }
#endif #endif
// Enable High-DPI support on Windows 7 or newer.
CefEnableHighDPISupport();
void* sandbox_info = nullptr; void* sandbox_info = nullptr;
#if defined(CEF_USE_SANDBOX) #if defined(CEF_USE_SANDBOX)

View File

@ -142,11 +142,6 @@ int main(int argc, char* argv[]) {
CefTestSuite test_suite(argc, argv); CefTestSuite test_suite(argc, argv);
#if defined(OS_WIN) #if defined(OS_WIN)
if (test_suite.command_line()->HasSwitch("enable-high-dpi-support")) {
// Enable High-DPI support on Windows 7 and newer.
CefEnableHighDPISupport();
}
CefMainArgs main_args(::GetModuleHandle(nullptr)); CefMainArgs main_args(::GetModuleHandle(nullptr));
#else #else
CefMainArgs main_args(argc, argv); CefMainArgs main_args(argc, argv);