Flutter Impeller
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 70 of file playground_impl_gles.cc.

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

◆ ~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 252 of file playground_impl_gles.cc.

253  {
254  return fml::Status(
255  fml::StatusCode::kUnimplemented,
256  "PlaygroundImplGLES doesn't support setting the capabilities.");
257 }

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