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"
12 
13 namespace flutter {
14 namespace testing {
15 
17  public GPUSurfaceGLDelegate {
18  public:
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  // |ShellTestPlatformView|
27  virtual ~ShellTestPlatformViewGL() override;
28 
29  // |ShellTestPlatformView|
30  virtual void SimulateVSync() override;
31 
32  private:
33  TestGLSurface gl_surface_;
34 
35  CreateVsyncWaiter create_vsync_waiter_;
36 
37  std::shared_ptr<ShellTestVsyncClock> vsync_clock_;
38 
39  std::shared_ptr<ShellTestExternalViewEmbedder>
40  shell_test_external_view_embedder_;
41 
42  // |PlatformView|
43  std::unique_ptr<Surface> CreateRenderingSurface() override;
44 
45  // |PlatformView|
46  std::shared_ptr<ExternalViewEmbedder> CreateExternalViewEmbedder() override;
47 
48  // |PlatformView|
49  std::unique_ptr<VsyncWaiter> CreateVSyncWaiter() override;
50 
51  // |PlatformView|
52  PointerDataDispatcherMaker GetDispatcherMaker() override;
53 
54  // |GPUSurfaceGLDelegate|
55  std::unique_ptr<GLContextResult> GLContextMakeCurrent() override;
56 
57  // |GPUSurfaceGLDelegate|
58  bool GLContextClearCurrent() override;
59 
60  // |GPUSurfaceGLDelegate|
61  bool GLContextPresent(fml::TimePoint target_time, uint32_t fbo_id) override;
62 
63  // |GPUSurfaceGLDelegate|
64  intptr_t GLContextFBO(GLFrameInfo frame_info) const override;
65 
66  // |GPUSurfaceGLDelegate|
67  GLProcResolver GetGLProcResolver() const override;
68 
69  FML_DISALLOW_COPY_AND_ASSIGN(ShellTestPlatformViewGL);
70 };
71 
72 } // namespace testing
73 } // namespace flutter
74 
75 #endif // FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_GL_H_
std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)> PointerDataDispatcherMaker
Signature for constructing PointerDataDispatcher.
ShellTestPlatformViewGL(PlatformView::Delegate &delegate, TaskRunners task_runners, std::shared_ptr< ShellTestVsyncClock > vsync_clock, CreateVsyncWaiter create_vsync_waiter, std::shared_ptr< ShellTestExternalViewEmbedder > shell_test_external_view_embedder)
std::function< void *(const char *)> GLProcResolver
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:54