Flutter Impeller
impeller::egl Namespace Reference

Classes

class  Config
 
struct  ConfigDescriptor
 
class  Context
 
class  Display
 
class  Surface
 

Enumerations

enum  API {
  API::kOpenGL,
  API::kOpenGLES2,
  API::kOpenGLES3
}
 
enum  Samples {
  Samples::kOne = 1,
  Samples::kTwo = 2,
  Samples::kFour = 4
}
 
enum  ColorFormat {
  ColorFormat::kRGBA8888,
  ColorFormat::kRGB565
}
 
enum  StencilBits {
  StencilBits::kZero = 0,
  StencilBits::kEight = 8
}
 
enum  DepthBits {
  DepthBits::kZero = 0,
  DepthBits::kEight = 8
}
 
enum  SurfaceType {
  SurfaceType::kWindow,
  SurfaceType::kPBuffer
}
 

Functions

static EGLBoolean EGLMakeCurrentIfNecessary (EGLDisplay display, EGLSurface draw, EGLSurface read, EGLContext context)
 
static const char * EGLErrorToString (EGLint error)
 
void LogEGLError (const char *file, int line)
 

Variables

std::function< void *(const char *)> CreateProcAddressResolver ()
 

Enumeration Type Documentation

◆ API

enum impeller::egl::API
strong
Enumerator
kOpenGL 
kOpenGLES2 
kOpenGLES3 

Definition at line 14 of file config.h.

14  {
15  kOpenGL,
16  kOpenGLES2,
17  kOpenGLES3,
18 };

◆ ColorFormat

Enumerator
kRGBA8888 
kRGB565 

Definition at line 26 of file config.h.

26  {
27  kRGBA8888,
28  kRGB565,
29 };

◆ DepthBits

Enumerator
kZero 
kEight 

Definition at line 36 of file config.h.

36  {
37  kZero = 0,
38  kEight = 8,
39 };

◆ Samples

Enumerator
kOne 
kTwo 
kFour 

Definition at line 20 of file config.h.

20  {
21  kOne = 1,
22  kTwo = 2,
23  kFour = 4,
24 };

◆ StencilBits

Enumerator
kZero 
kEight 

Definition at line 31 of file config.h.

31  {
32  kZero = 0,
33  kEight = 8,
34 };

◆ SurfaceType

Enumerator
kWindow 
kPBuffer 

Definition at line 41 of file config.h.

41  {
42  kWindow,
43  kPBuffer,
44 };

Function Documentation

◆ EGLErrorToString()

static const char* impeller::egl::EGLErrorToString ( EGLint  error)
static

Definition at line 18 of file egl.cc.

18  {
19  switch (error) {
20  case EGL_SUCCESS:
21  return "Success";
22  case EGL_NOT_INITIALIZED:
23  return "Not Initialized";
24  case EGL_BAD_ACCESS:
25  return "Bad Access";
26  case EGL_BAD_ALLOC:
27  return "Bad Alloc";
28  case EGL_BAD_ATTRIBUTE:
29  return "Bad Attribute";
30  case EGL_BAD_CONTEXT:
31  return "Bad Context";
32  case EGL_BAD_CONFIG:
33  return "Bad Config";
34  case EGL_BAD_CURRENT_SURFACE:
35  return "Bad Current Surface";
36  case EGL_BAD_DISPLAY:
37  return "Bad Display";
38  case EGL_BAD_SURFACE:
39  return "Bad Surface";
40  case EGL_BAD_MATCH:
41  return "Bad Match";
42  case EGL_BAD_PARAMETER:
43  return "Bad Parameter";
44  case EGL_BAD_NATIVE_PIXMAP:
45  return "Bad Native Pixmap";
46  case EGL_BAD_NATIVE_WINDOW:
47  return "Bad Native Window";
48  case EGL_CONTEXT_LOST:
49  return "Context Lost";
50  }
51  return "Unknown";
52 }

Referenced by LogEGLError().

◆ EGLMakeCurrentIfNecessary()

static EGLBoolean impeller::egl::EGLMakeCurrentIfNecessary ( EGLDisplay  display,
EGLSurface  draw,
EGLSurface  read,
EGLContext  context 
)
static

Definition at line 31 of file context.cc.

34  {
35  if (display != ::eglGetCurrentDisplay() ||
36  draw != ::eglGetCurrentSurface(EGL_DRAW) ||
37  read != ::eglGetCurrentSurface(EGL_READ) ||
38  context != ::eglGetCurrentContext()) {
39  return ::eglMakeCurrent(display, draw, read, context);
40  }
41  // The specified context configuration is already current.
42  return EGL_TRUE;
43 }

Referenced by impeller::egl::Context::ClearCurrent(), and impeller::egl::Context::MakeCurrent().

◆ LogEGLError()

void impeller::egl::LogEGLError ( const char *  file,
int  line 
)

Definition at line 54 of file egl.cc.

54  {
55  const auto error = ::eglGetError();
56  FML_LOG(ERROR) << "EGL Error: " << EGLErrorToString(error) << " (" << error
57  << ") in " << file << ":" << line;
58 }

References EGLErrorToString().

Variable Documentation

◆ CreateProcAddressResolver

std::function< void *(const char *)> impeller::egl::CreateProcAddressResolver

Definition at line 17 of file egl.h.

impeller::egl::StencilBits::kEight
@ kEight
impeller::egl::ColorFormat::kRGB565
@ kRGB565
impeller::egl::Samples::kTwo
@ kTwo
impeller::BlendFactor::kZero
@ kZero
impeller::egl::API::kOpenGLES2
@ kOpenGLES2
impeller::egl::EGLErrorToString
static const char * EGLErrorToString(EGLint error)
Definition: egl.cc:18
impeller::BlendFactor::kOne
@ kOne
impeller::egl::Samples::kFour
@ kFour
impeller::egl::API::kOpenGL
@ kOpenGL
impeller::egl::SurfaceType::kWindow
@ kWindow
impeller::egl::ColorFormat::kRGBA8888
@ kRGBA8888
impeller::egl::API::kOpenGLES3
@ kOpenGLES3
impeller::egl::SurfaceType::kPBuffer
@ kPBuffer