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_GL_H_ |
6 | #define FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_GL_H_ |
7 | |
8 | #include "flutter/shell/common/shell_test_external_view_embedder.h" |
9 | #include "flutter/shell/common/shell_test_platform_view.h" |
10 | #include "flutter/shell/gpu/gpu_surface_gl_delegate.h" |
11 | #include "flutter/testing/test_gl_surface.h" |
12 | |
13 | namespace flutter { |
14 | namespace testing { |
15 | |
16 | class ShellTestPlatformViewGL : public ShellTestPlatformView, |
17 | public GPUSurfaceGLDelegate { |
18 | public: |
19 | ShellTestPlatformViewGL(PlatformView::Delegate& delegate, |
20 | TaskRunners task_runners, |
21 | std::shared_ptr<ShellTestVsyncClock> vsync_clock, |
22 | CreateVsyncWaiter create_vsync_waiter, |
23 | std::shared_ptr<ShellTestExternalViewEmbedder> |
24 | shell_test_external_view_embedder); |
25 | |
26 | virtual ~ShellTestPlatformViewGL() override; |
27 | |
28 | virtual void SimulateVSync() override; |
29 | |
30 | private: |
31 | TestGLSurface gl_surface_; |
32 | |
33 | CreateVsyncWaiter create_vsync_waiter_; |
34 | |
35 | std::shared_ptr<ShellTestVsyncClock> vsync_clock_; |
36 | |
37 | std::shared_ptr<ShellTestExternalViewEmbedder> |
38 | shell_test_external_view_embedder_; |
39 | |
40 | // |PlatformView| |
41 | std::unique_ptr<Surface> CreateRenderingSurface() override; |
42 | |
43 | // |PlatformView| |
44 | std::unique_ptr<VsyncWaiter> CreateVSyncWaiter() override; |
45 | |
46 | // |PlatformView| |
47 | PointerDataDispatcherMaker GetDispatcherMaker() override; |
48 | |
49 | // |GPUSurfaceGLDelegate| |
50 | std::unique_ptr<GLContextResult> GLContextMakeCurrent() override; |
51 | |
52 | // |GPUSurfaceGLDelegate| |
53 | bool GLContextClearCurrent() override; |
54 | |
55 | // |GPUSurfaceGLDelegate| |
56 | bool GLContextPresent() override; |
57 | |
58 | // |GPUSurfaceGLDelegate| |
59 | intptr_t GLContextFBO() const override; |
60 | |
61 | // |GPUSurfaceGLDelegate| |
62 | GLProcResolver GetGLProcResolver() const override; |
63 | |
64 | // |GPUSurfaceGLDelegate| |
65 | ExternalViewEmbedder* GetExternalViewEmbedder() override; |
66 | |
67 | FML_DISALLOW_COPY_AND_ASSIGN(ShellTestPlatformViewGL); |
68 | }; |
69 | |
70 | } // namespace testing |
71 | } // namespace flutter |
72 | |
73 | #endif // FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_GL_H_ |
74 |