Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
playground_impl_gles.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_IMPELLER_PLAYGROUND_BACKEND_GLES_PLAYGROUND_IMPL_GLES_H_
6#define FLUTTER_IMPELLER_PLAYGROUND_BACKEND_GLES_PLAYGROUND_IMPL_GLES_H_
7
9
11
12struct GLFWwindow;
13
14namespace impeller {
15
16class PlaygroundImplGLES final : public PlaygroundImpl {
17 public:
18 struct ShareableContext;
19
20 explicit PlaygroundImplGLES(const PlaygroundSwitches& switches);
21
23
25 const std::shared_ptr<Capabilities>& capabilities) override;
26
27 static void OnTearDownTestEnvironment();
28
29 private:
30 class ReactorWorker;
31
32 static void DestroyWindowHandle(WindowHandle handle);
33 using UniqueHandle =
34 std::unique_ptr<GLFWwindow, decltype(&DestroyWindowHandle)>;
35 UniqueHandle handle_;
36 const bool use_angle_;
37 void* angle_glesv2_;
38 std::shared_ptr<Context> context_;
39 std::unique_ptr<ShareableContext> unique_context_;
40
41 // Return the best ShareableContext holder to store the context for
42 // this Playground. Note that this might be either the instance-specific
43 // |unique_context_| field or it might be one of the globally shared
44 // contexts fields used for most of the tests.
45 std::unique_ptr<PlaygroundImplGLES::ShareableContext>& GetShareableContext();
46
47 // |PlaygroundImpl|
48 std::shared_ptr<Context> GetContext() const override;
49
50 // |PlaygroundImpl|
51 WindowHandle GetWindowHandle() const override;
52
53 // |PlaygroundImpl|
54 std::unique_ptr<Surface> AcquireSurfaceFrame(
55 std::shared_ptr<Context> context) override;
56
57 // |PlaygroundImpl|
58 Playground::GLProcAddressResolver CreateGLProcAddressResolver()
59 const override;
60
61 static Playground::GLProcAddressResolver CreateGLProcAddressResolver(
62 const PlaygroundSwitches& switches);
63
64 static GLFWwindow* CreateGLWindow(const PlaygroundSwitches& switches,
65 GLFWwindow* share_window);
66
67 static std::unique_ptr<ShareableContext> MakeShareableContext(
68 const PlaygroundSwitches& switches);
69
70 // These store longer-term shared contexts that are shared between
71 // tests in the playground suite while the flags that affect the
72 // construction of the context remain consistent.
73 static std::unique_ptr<ShareableContext> shared_context_msaa_;
74 static std::unique_ptr<ShareableContext> shared_context_sdf_;
75
76 RuntimeStageBackend GetRuntimeStageBackend() const override;
77
79
80 PlaygroundImplGLES& operator=(const PlaygroundImplGLES&) = delete;
81};
82
83} // namespace impeller
84
85#endif // FLUTTER_IMPELLER_PLAYGROUND_BACKEND_GLES_PLAYGROUND_IMPL_GLES_H_
std::function< void *(const char *proc_name)> GLProcAddressResolver
Definition playground.h:119
fml::Status SetCapabilities(const std::shared_ptr< Capabilities > &capabilities) override
fuchsia::ui::composition::ParentViewportWatcherHandle handle_
std::shared_ptr< ContextGLES > context