Skip to content

Commit

Permalink
win: Remove CefEnableHighDPISupport function (fixes issue chromiumemb…
Browse files Browse the repository at this point in the history
…edded#3452)

High-DPI support is now enabled by default in Chromium.
  • Loading branch information
magreenblatt committed Mar 3, 2023
1 parent d33b67c commit f3b570c
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 47 deletions.
4 changes: 2 additions & 2 deletions include/cef_api_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// 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)
#define CEF_API_HASH_PLATFORM "5dcd05c3516709113ae110e1602907bd0e027802"
#define CEF_API_HASH_PLATFORM "34ef9830e2b8dc5e4c930db28e279e2a70d9f4bf"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "9152ecd1a004d3c800af9c2ca12246554f91723c"
#elif defined(OS_LINUX)
Expand Down
7 changes: 0 additions & 7 deletions include/internal/cef_app_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ CEF_EXPORT int cef_run_main_with_preferred_stack_size(mainPtr main,
char* argv[]);
#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
/// modal message loop. Set to false (0) after exiting the modal message loop.
Expand Down
7 changes: 0 additions & 7 deletions include/internal/cef_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ int CefRunWinMainWithPreferredStackSize(wWinMainPtr wWinMain,
int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]);
#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
/// modal message loop. Set to false after exiting the modal message loop.
Expand Down
5 changes: 0 additions & 5 deletions libcef/browser/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#if BUILDFLAG(IS_WIN)
#include "base/debug/alias.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/win_util.h"
#include "chrome/chrome_elf/chrome_elf_main.h"
#include "chrome/install_static/initialize_from_primary_module.h"
#include "include/internal/cef_win.h"
Expand Down Expand Up @@ -401,10 +400,6 @@ int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]) {
}
#endif // defined(ARCH_CPU_32_BITS)

void CefEnableHighDPISupport() {
base::win::EnableHighDPISupport();
}

void CefSetOSModalLoop(bool osModalLoop) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
Expand Down
4 changes: 0 additions & 4 deletions libcef_dll/libcef_dll2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ CEF_EXPORT int cef_run_main_with_preferred_stack_size(mainPtr main,
}
#endif // defined(ARCH_CPU_32_BITS)

CEF_EXPORT void cef_enable_highdpi_support() {
CefEnableHighDPISupport();
}

CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop) {
CefSetOSModalLoop(osModalLoop ? true : false);
}
Expand Down
11 changes: 0 additions & 11 deletions libcef_dll/wrapper/libcef_dll_wrapper2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ int CefRunMainWithPreferredStackSize(mainPtr main, int argc, char* argv[]) {
}
#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) {
cef_set_osmodal_loop(osModalLoop);
}
Expand Down
3 changes: 0 additions & 3 deletions tests/cefclient/cefclient_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ namespace client {
namespace {

int RunMain(HINSTANCE hInstance, int nCmdShow) {
// Enable High-DPI support on Windows 7 or newer.
CefEnableHighDPISupport();

CefMainArgs main_args(hInstance);

void* sandbox_info = nullptr;
Expand Down
3 changes: 0 additions & 3 deletions tests/cefsimple/cefsimple_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
}
#endif

// Enable High-DPI support on Windows 7 or newer.
CefEnableHighDPISupport();

void* sandbox_info = nullptr;

#if defined(CEF_USE_SANDBOX)
Expand Down
5 changes: 0 additions & 5 deletions tests/ceftests/run_all_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,6 @@ int main(int argc, char* argv[]) {
CefTestSuite test_suite(argc, argv);

#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));
#else
CefMainArgs main_args(argc, argv);
Expand Down

0 comments on commit f3b570c

Please sign in to comment.