Flutter Engine
The Flutter Engine
shell_test_platform_view_gl.h
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#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"
13
14namespace flutter {
15namespace testing {
16
19 public:
21 const TaskRunners& task_runners,
22 std::shared_ptr<ShellTestVsyncClock> vsync_clock,
23 CreateVsyncWaiter create_vsync_waiter,
24 std::shared_ptr<ShellTestExternalViewEmbedder>
25 shell_test_external_view_embedder);
26
27 // |ShellTestPlatformView|
28 virtual ~ShellTestPlatformViewGL() override;
29
30 // |ShellTestPlatformView|
31 virtual void SimulateVSync() override;
32
33 // |PlatformView|
34 std::shared_ptr<impeller::Context> GetImpellerContext() const {
35 return impeller_context_;
36 }
37
38 private:
39 std::shared_ptr<impeller::ContextGLES> impeller_context_;
40
41 TestGLSurface gl_surface_;
42
43 CreateVsyncWaiter create_vsync_waiter_;
44
45 std::shared_ptr<ShellTestVsyncClock> vsync_clock_;
46
47 std::shared_ptr<ShellTestExternalViewEmbedder>
48 shell_test_external_view_embedder_;
49
50 // |PlatformView|
51 std::unique_ptr<Surface> CreateRenderingSurface() override;
52
53 // |PlatformView|
54 std::shared_ptr<ExternalViewEmbedder> CreateExternalViewEmbedder() override;
55
56 // |PlatformView|
57 std::unique_ptr<VsyncWaiter> CreateVSyncWaiter() override;
58
59 // |PlatformView|
60 PointerDataDispatcherMaker GetDispatcherMaker() override;
61
62 // |GPUSurfaceGLDelegate|
63 std::unique_ptr<GLContextResult> GLContextMakeCurrent() override;
64
65 // |GPUSurfaceGLDelegate|
66 bool GLContextClearCurrent() override;
67
68 // |GPUSurfaceGLDelegate|
69 bool GLContextPresent(const GLPresentInfo& present_info) override;
70
71 // |GPUSurfaceGLDelegate|
72 GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override;
73
74 // |GPUSurfaceGLDelegate|
75 GLProcResolver GetGLProcResolver() const override;
76
77 FML_DISALLOW_COPY_AND_ASSIGN(ShellTestPlatformViewGL);
78};
79
80} // namespace testing
81} // namespace flutter
82
83#endif // FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_GL_H_
std::function< void *(const char *)> GLProcResolver
Used to forward events from the platform view to interested subsystems. This forwarding is done by th...
Definition: platform_view.h:60
ShellTestPlatformViewGL(PlatformView::Delegate &delegate, const TaskRunners &task_runners, std::shared_ptr< ShellTestVsyncClock > vsync_clock, CreateVsyncWaiter create_vsync_waiter, std::shared_ptr< ShellTestExternalViewEmbedder > shell_test_external_view_embedder)
std::shared_ptr< impeller::Context > GetImpellerContext() const
std::function< std::unique_ptr< VsyncWaiter >()> CreateVsyncWaiter
std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)> PointerDataDispatcherMaker
Signature for constructing PointerDataDispatcher.