Flutter Engine
shell_test_platform_view.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "flutter/shell/common/shell_test_platform_view.h"
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 
14 namespace flutter {
15 namespace testing {
16 
17 std::unique_ptr<ShellTestPlatformView> ShellTestPlatformView::Create(
18  PlatformView::Delegate& delegate,
19  TaskRunners task_runners,
20  std::shared_ptr<ShellTestVsyncClock> vsync_clock,
21  CreateVsyncWaiter create_vsync_waiter,
22  BackendType backend,
23  std::shared_ptr<ShellTestExternalViewEmbedder>
24  shell_test_external_view_embedder) {
25  // TODO(gw280): https://github.com/flutter/flutter/issues/50298
26  // Make this fully runtime configurable
27  switch (backend) {
29 #ifdef SHELL_ENABLE_GL
31  return std::make_unique<ShellTestPlatformViewGL>(
32  delegate, task_runners, vsync_clock, create_vsync_waiter,
33  shell_test_external_view_embedder);
34 #endif // SHELL_ENABLE_GL
35 #ifdef SHELL_ENABLE_VULKAN
37  return std::make_unique<ShellTestPlatformViewVulkan>(
38  delegate, task_runners, vsync_clock, create_vsync_waiter,
39  shell_test_external_view_embedder);
40 #endif // SHELL_ENABLE_VULKAN
41  default:
42  FML_LOG(FATAL) << "No backends supported for ShellTestPlatformView";
43  return nullptr;
44  }
45 }
46 
47 } // namespace testing
48 } // namespace flutter
#define FML_LOG(severity)
Definition: logging.h:65
std::function< std::unique_ptr< VsyncWaiter >()> CreateVsyncWaiter
Used to forward events from the platform view to interested subsystems. This forwarding is done by th...
Definition: platform_view.h:51
static std::unique_ptr< ShellTestPlatformView > Create(PlatformView::Delegate &delegate, TaskRunners task_runners, std::shared_ptr< ShellTestVsyncClock > vsync_clock, CreateVsyncWaiter create_vsync_waiter, BackendType backend, std::shared_ptr< ShellTestExternalViewEmbedder > shell_test_external_view_embedder)