4
4
5
5
#include " flutter/shell/common/shell_test_platform_view.h"
6
6
7
- #ifdef SHELL_ENABLE_GL
8
- #include " flutter/shell/common/shell_test_platform_view_gl.h"
9
- #endif // SHELL_ENABLE_GL
10
- #ifdef SHELL_ENABLE_VULKAN
11
- #include " flutter/shell/common/shell_test_platform_view_vulkan.h"
12
- #endif // SHELL_ENABLE_VULKAN
13
- #ifdef SHELL_ENABLE_METAL
14
- #include " flutter/shell/common/shell_test_platform_view_metal.h"
15
- #endif // SHELL_ENABLE_METAL
16
-
17
7
#include " flutter/shell/common/vsync_waiter_fallback.h"
18
8
19
- namespace flutter {
20
- namespace testing {
9
+ namespace flutter ::testing {
21
10
22
11
std::unique_ptr<ShellTestPlatformView> ShellTestPlatformView::Create (
23
12
PlatformView::Delegate& delegate,
@@ -32,28 +21,18 @@ std::unique_ptr<ShellTestPlatformView> ShellTestPlatformView::Create(
32
21
// Make this fully runtime configurable
33
22
switch (backend) {
34
23
case BackendType::kDefaultBackend :
35
- #ifdef SHELL_ENABLE_GL
36
24
case BackendType::kGLBackend :
37
- return std::make_unique<ShellTestPlatformViewGL> (
25
+ return CreatePlatformViewGL (
38
26
delegate, task_runners, vsync_clock, create_vsync_waiter,
39
- shell_test_external_view_embedder);
40
- #endif // SHELL_ENABLE_GL
41
- #ifdef SHELL_ENABLE_VULKAN
27
+ shell_test_external_view_embedder, is_gpu_disabled_sync_switch);
42
28
case BackendType::kVulkanBackend :
43
- return std::make_unique<ShellTestPlatformViewVulkan> (
29
+ return CreatePlatformViewVulkan (
44
30
delegate, task_runners, vsync_clock, create_vsync_waiter,
45
- shell_test_external_view_embedder);
46
- #endif // SHELL_ENABLE_VULKAN
47
- #ifdef SHELL_ENABLE_METAL
31
+ shell_test_external_view_embedder, is_gpu_disabled_sync_switch);
48
32
case BackendType::kMetalBackend :
49
- return std::make_unique<ShellTestPlatformViewMetal> (
33
+ return CreatePlatformViewMetal (
50
34
delegate, task_runners, vsync_clock, create_vsync_waiter,
51
35
shell_test_external_view_embedder, is_gpu_disabled_sync_switch);
52
- #endif // SHELL_ENABLE_METAL
53
-
54
- default :
55
- FML_LOG (FATAL) << " No backends supported for ShellTestPlatformView" ;
56
- return nullptr ;
57
36
}
58
37
}
59
38
@@ -86,5 +65,50 @@ std::unique_ptr<PlatformView> ShellTestPlatformViewBuilder::operator()(
86
65
);
87
66
}
88
67
89
- } // namespace testing
90
- } // namespace flutter
68
+ #ifndef SHELL_ENABLE_GL
69
+ // Fallback implementation.
70
+ // See: flutter/shell/common/shell_test_platform_view_gl.cc
71
+ std::unique_ptr<ShellTestPlatformView>
72
+ ShellTestPlatformView::CreatePlatformViewGL (
73
+ PlatformView::Delegate& delegate,
74
+ const TaskRunners& task_runners,
75
+ const std::shared_ptr<ShellTestVsyncClock>& vsync_clock,
76
+ const CreateVsyncWaiter& create_vsync_waiter,
77
+ const std::shared_ptr<ShellTestExternalViewEmbedder>&
78
+ shell_test_external_view_embedder,
79
+ const std::shared_ptr<const fml::SyncSwitch>& is_gpu_disabled_sync_switch) {
80
+ return nullptr ;
81
+ }
82
+ #endif // SHELL_ENABLE_GL
83
+ #ifndef SHELL_ENABLE_METAL
84
+ // Fallback implementation.
85
+ // See: flutter/shell/common/shell_test_platform_view_metal.mm
86
+ std::unique_ptr<ShellTestPlatformView>
87
+ ShellTestPlatformView::CreatePlatformViewMetal (
88
+ PlatformView::Delegate& delegate,
89
+ const TaskRunners& task_runners,
90
+ const std::shared_ptr<ShellTestVsyncClock>& vsync_clock,
91
+ const CreateVsyncWaiter& create_vsync_waiter,
92
+ const std::shared_ptr<ShellTestExternalViewEmbedder>&
93
+ shell_test_external_view_embedder,
94
+ const std::shared_ptr<const fml::SyncSwitch>& is_gpu_disabled_sync_switch) {
95
+ return nullptr ;
96
+ }
97
+ #endif // SHELL_ENABLE_METAL
98
+ #ifndef SHELL_ENABLE_VULKAN
99
+ // Fallback implementation.
100
+ // See: flutter/shell/common/shell_test_platform_view_vulkan.cc
101
+ std::unique_ptr<ShellTestPlatformView>
102
+ ShellTestPlatformView::CreatePlatformViewVulkan (
103
+ PlatformView::Delegate& delegate,
104
+ const TaskRunners& task_runners,
105
+ const std::shared_ptr<ShellTestVsyncClock>& vsync_clock,
106
+ const CreateVsyncWaiter& create_vsync_waiter,
107
+ const std::shared_ptr<ShellTestExternalViewEmbedder>&
108
+ shell_test_external_view_embedder,
109
+ const std::shared_ptr<const fml::SyncSwitch>& is_gpu_disabled_sync_switch) {
110
+ return nullptr ;
111
+ }
112
+ #endif // SHELL_ENABLE_VULKAN
113
+
114
+ } // namespace flutter::testing
0 commit comments