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 | #ifndef FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_H_ |
6 | #define FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_H_ |
7 | |
8 | #include "flutter/shell/common/platform_view.h" |
9 | #include "flutter/shell/common/shell_test_external_view_embedder.h" |
10 | #include "flutter/shell/common/vsync_waiters_test.h" |
11 | |
12 | namespace flutter { |
13 | namespace testing { |
14 | |
15 | class ShellTestPlatformView : public PlatformView { |
16 | public: |
17 | enum class BackendType { |
18 | kGLBackend, |
19 | kVulkanBackend, |
20 | kDefaultBackend, |
21 | }; |
22 | |
23 | static std::unique_ptr<ShellTestPlatformView> Create( |
24 | PlatformView::Delegate& delegate, |
25 | TaskRunners task_runners, |
26 | std::shared_ptr<ShellTestVsyncClock> vsync_clock, |
27 | CreateVsyncWaiter create_vsync_waiter, |
28 | BackendType backend, |
29 | std::shared_ptr<ShellTestExternalViewEmbedder> |
30 | shell_test_external_view_embedder); |
31 | |
32 | virtual void SimulateVSync() = 0; |
33 | |
34 | protected: |
35 | ShellTestPlatformView(PlatformView::Delegate& delegate, |
36 | TaskRunners task_runners) |
37 | : PlatformView(delegate, task_runners) {} |
38 | |
39 | FML_DISALLOW_COPY_AND_ASSIGN(ShellTestPlatformView); |
40 | }; |
41 | |
42 | } // namespace testing |
43 | } // namespace flutter |
44 | |
45 | #endif // FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_GL_H_ |
46 | |