Skip to content

Commit 7740028

Browse files
authored
Revert "Expose DPI helper functions for Runner apps to use (flutter#16313)"
This reverts commit bac380c.
1 parent 06c7cfe commit 7740028

16 files changed

+181
-338
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,6 @@ FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flu
11161116
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_view_controller.h
11171117
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/plugin_registrar_windows.h
11181118
FILE: ../../../flutter/shell/platform/windows/client_wrapper/plugin_registrar_windows_unittests.cc
1119-
FILE: ../../../flutter/shell/platform/windows/dpi_utils.cc
1120-
FILE: ../../../flutter/shell/platform/windows/dpi_utils.h
1121-
FILE: ../../../flutter/shell/platform/windows/dpi_utils_unittests.cc
11221119
FILE: ../../../flutter/shell/platform/windows/flutter_windows.cc
11231120
FILE: ../../../flutter/shell/platform/windows/key_event_handler.cc
11241121
FILE: ../../../flutter/shell/platform/windows/key_event_handler.h
@@ -1128,9 +1125,10 @@ FILE: ../../../flutter/shell/platform/windows/platform_handler.h
11281125
FILE: ../../../flutter/shell/platform/windows/public/flutter_windows.h
11291126
FILE: ../../../flutter/shell/platform/windows/text_input_plugin.cc
11301127
FILE: ../../../flutter/shell/platform/windows/text_input_plugin.h
1128+
FILE: ../../../flutter/shell/platform/windows/win32_dpi_helper.cc
1129+
FILE: ../../../flutter/shell/platform/windows/win32_dpi_helper.h
11311130
FILE: ../../../flutter/shell/platform/windows/win32_flutter_window.cc
11321131
FILE: ../../../flutter/shell/platform/windows/win32_flutter_window.h
1133-
FILE: ../../../flutter/shell/platform/windows/win32_flutter_window_unittests.cc
11341132
FILE: ../../../flutter/shell/platform/windows/win32_task_runner.cc
11351133
FILE: ../../../flutter/shell/platform/windows/win32_task_runner.h
11361134
FILE: ../../../flutter/shell/platform/windows/win32_window.cc

shell/platform/windows/BUILD.gn

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ source_set("flutter_windows_source") {
4141
sources = [
4242
"angle_surface_manager.cc",
4343
"angle_surface_manager.h",
44-
"dpi_utils.cc",
45-
"dpi_utils.h",
4644
"flutter_windows.cc",
4745
"key_event_handler.cc",
4846
"key_event_handler.h",
@@ -51,6 +49,8 @@ source_set("flutter_windows_source") {
5149
"platform_handler.h",
5250
"text_input_plugin.cc",
5351
"text_input_plugin.h",
52+
"win32_dpi_helper.cc",
53+
"win32_dpi_helper.h",
5454
"win32_flutter_window.cc",
5555
"win32_flutter_window.h",
5656
"win32_task_runner.cc",
@@ -109,12 +109,8 @@ executable("flutter_windows_unittests") {
109109
testonly = true
110110

111111
sources = [
112-
"dpi_utils_unittests.cc",
113112
"testing/win32_flutter_window_test.cc",
114113
"testing/win32_flutter_window_test.h",
115-
"testing/win32_window_test.cc",
116-
"testing/win32_window_test.h",
117-
"win32_flutter_window_unittests.cc",
118114
"win32_window_unittests.cc",
119115
]
120116

shell/platform/windows/dpi_utils.cc

Lines changed: 0 additions & 129 deletions
This file was deleted.

shell/platform/windows/dpi_utils.h

Lines changed: 0 additions & 24 deletions
This file was deleted.

shell/platform/windows/dpi_utils_unittests.cc

Lines changed: 0 additions & 21 deletions
This file was deleted.

shell/platform/windows/flutter_windows.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "flutter/shell/platform/common/cpp/client_wrapper/include/flutter/plugin_registrar.h"
1616
#include "flutter/shell/platform/common/cpp/incoming_message_dispatcher.h"
1717
#include "flutter/shell/platform/embedder/embedder.h"
18-
#include "flutter/shell/platform/windows/dpi_utils.h"
1918
#include "flutter/shell/platform/windows/key_event_handler.h"
2019
#include "flutter/shell/platform/windows/keyboard_hook_handler.h"
2120
#include "flutter/shell/platform/windows/platform_handler.h"
@@ -183,14 +182,6 @@ HWND FlutterDesktopViewGetHWND(FlutterDesktopViewRef view) {
183182
return view->window->GetWindowHandle();
184183
}
185184

186-
UINT FlutterDesktopGetDpiForHWND(HWND hwnd) {
187-
return flutter::GetDpiForHWND(hwnd);
188-
}
189-
190-
UINT FlutterDesktopGetDpiForMonitor(HMONITOR monitor) {
191-
return flutter::GetDpiForMonitor(monitor);
192-
}
193-
194185
FlutterDesktopEngineRef FlutterDesktopRunEngine(const char* assets_path,
195186
const char* icu_data_path,
196187
const char** arguments,

shell/platform/windows/public/flutter_windows.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,6 @@ FlutterDesktopProcessMessages(FlutterDesktopViewControllerRef controller);
7777
// Return backing HWND for manipulation in host application.
7878
FLUTTER_EXPORT HWND FlutterDesktopViewGetHWND(FlutterDesktopViewRef view);
7979

80-
// Gets the DPI for a given |hwnd|, depending on the supported APIs per
81-
// windows version and DPI awareness mode. If nullptr is passed, returns the DPI
82-
// of the primary monitor.
83-
FLUTTER_EXPORT UINT FlutterDesktopGetDpiForHWND(HWND hwnd);
84-
85-
// Gets the DPI for a given |monitor|. If the API is not available, a default
86-
// DPI of 96 is returned.
87-
FLUTTER_EXPORT UINT FlutterDesktopGetDpiForMonitor(HMONITOR monitor);
88-
8980
// Runs an instance of a headless Flutter engine.
9081
//
9182
// The |assets_path| is the path to the flutter_assets folder for the Flutter

shell/platform/windows/testing/win32_flutter_window_test.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,17 @@
44

55
#include <windowsx.h>
66

7+
#include "flutter/fml/macros.h"
78
#include "flutter/shell/platform/windows/win32_flutter_window.h"
89

910
namespace flutter {
1011
namespace testing {
1112

12-
/// Test class for Win32FlutterWindow.
1313
class Win32FlutterWindowTest : public Win32FlutterWindow {
1414
public:
1515
Win32FlutterWindowTest(int width, int height);
16-
virtual ~Win32FlutterWindowTest();
1716

18-
// Prevent copying.
19-
Win32FlutterWindowTest(Win32FlutterWindowTest const&) = delete;
20-
Win32FlutterWindowTest& operator=(Win32FlutterWindowTest const&) = delete;
17+
virtual ~Win32FlutterWindowTest();
2118

2219
// |Win32Window|
2320
void OnFontChange() override;
@@ -26,6 +23,8 @@ class Win32FlutterWindowTest : public Win32FlutterWindow {
2623

2724
private:
2825
bool on_font_change_called_ = false;
26+
27+
FML_DISALLOW_COPY_AND_ASSIGN(Win32FlutterWindowTest);
2928
};
3029

3130
} // namespace testing

shell/platform/windows/testing/win32_window_test.cc

Lines changed: 0 additions & 35 deletions
This file was deleted.

shell/platform/windows/testing/win32_window_test.h

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)