Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::PlaygroundImplGLES Class Referencefinal

#include <playground_impl_gles.h>

Inheritance diagram for impeller::PlaygroundImplGLES:
impeller::PlaygroundImpl

Classes

class  ReactorWorker
 

Public Member Functions

 PlaygroundImplGLES (PlaygroundSwitches switches)
 
 ~PlaygroundImplGLES ()
 
fml::Status SetCapabilities (const std::shared_ptr< Capabilities > &capabilities) override
 
- Public Member Functions inherited from impeller::PlaygroundImpl
virtual ~PlaygroundImpl ()
 
Vector2 GetContentScale () const
 
virtual Playground::VKProcAddressResolver CreateVKProcAddressResolver () const
 
virtual void SetGPUDisabled (bool disabled) const
 

Additional Inherited Members

- Public Types inherited from impeller::PlaygroundImpl
using WindowHandle = void *
 
- Static Public Member Functions inherited from impeller::PlaygroundImpl
static std::unique_ptr< PlaygroundImplCreate (PlaygroundBackend backend, PlaygroundSwitches switches)
 
- Protected Member Functions inherited from impeller::PlaygroundImpl
 PlaygroundImpl (PlaygroundSwitches switches)
 
- Protected Attributes inherited from impeller::PlaygroundImpl
const PlaygroundSwitches switches_
 

Detailed Description

Definition at line 12 of file playground_impl_gles.h.

Constructor & Destructor Documentation

◆ PlaygroundImplGLES()

impeller::PlaygroundImplGLES::PlaygroundImplGLES ( PlaygroundSwitches  switches)
explicit

Definition at line 64 of file playground_impl_gles.cc.

65 : PlaygroundImpl(switches),
66 handle_(nullptr, &DestroyWindowHandle),
67 worker_(std::shared_ptr<ReactorWorker>(new ReactorWorker())),
68 use_angle_(switches.use_angle) {
69 if (use_angle_) {
70#if IMPELLER_PLAYGROUND_SUPPORTS_ANGLE
71 angle_glesv2_ = dlopen("libGLESv2.dylib", RTLD_LAZY);
72#endif
73 FML_CHECK(angle_glesv2_ != nullptr);
74 }
75
76 ::glfwDefaultWindowHints();
77
78#if FML_OS_MACOSX
79 FML_CHECK(use_angle_) << "Must use Angle on macOS for OpenGL ES.";
80 ::glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
81#endif // FML_OS_MACOSX
82#if FML_OS_LINUX
83 // Use EGL even on X11 then the client can select the GLES implementation
84 // by defining __EGL_VENDOR_LIBRARY_FILENAMES
85 ::glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
86#endif
87 ::glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
88 ::glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
89 ::glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
90 ::glfwWindowHint(GLFW_RED_BITS, 8);
91 ::glfwWindowHint(GLFW_GREEN_BITS, 8);
92 ::glfwWindowHint(GLFW_BLUE_BITS, 8);
93 ::glfwWindowHint(GLFW_ALPHA_BITS, 8);
94 ::glfwWindowHint(GLFW_DEPTH_BITS, 32); // 32 bit depth buffer
95 ::glfwWindowHint(GLFW_STENCIL_BITS, 8); // 8 bit stencil buffer
96 ::glfwWindowHint(GLFW_SAMPLES, 4); // 4xMSAA
97
98 ::glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
99#ifndef NDEBUG
100 ::glfwWindowHint(GLFW_CONTEXT_DEBUG, GLFW_TRUE);
101#endif
102
103 auto window = ::glfwCreateWindow(1, 1, "Test", nullptr, nullptr);
104
105 ::glfwMakeContextCurrent(window);
106 worker_->SetReactionsAllowedOnCurrentThread(true);
107
108 handle_.reset(window);
109}
PlaygroundImpl(PlaygroundSwitches switches)
GLFWwindow * window
Definition main.cc:60
#define GLFW_TRUE
#define GLFW_FALSE
#define FML_CHECK(condition)
Definition logging.h:104

References FML_CHECK, GLFW_FALSE, GLFW_TRUE, and window.

◆ ~PlaygroundImplGLES()

impeller::PlaygroundImplGLES::~PlaygroundImplGLES ( )
default

Member Function Documentation

◆ SetCapabilities()

fml::Status impeller::PlaygroundImplGLES::SetCapabilities ( const std::shared_ptr< Capabilities > &  capabilities)
overridevirtual

Implements impeller::PlaygroundImpl.

Definition at line 223 of file playground_impl_gles.cc.

224 {
225 return fml::Status(
227 "PlaygroundImplGLES doesn't support setting the capabilities.");
228}

References fml::kUnimplemented.


The documentation for this class was generated from the following files: