Flutter Engine
The Flutter Engine
Classes | Enumerations | Functions
impeller::egl Namespace Reference

Classes

class  Config
 An EGL config. These are returned by the display to indicate support for a specific config descriptor. More...
 
struct  ConfigDescriptor
 
class  Context
 An instance of an EGL context. More...
 
class  Display
 A connection to an EGL display. Only one connection per application instance is sufficient. More...
 
class  Surface
 An instance of an EGL surface. There is no ability to create surfaces directly. Instead, one must be created using a Display connection. More...
 

Enumerations

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

Functions

static EGLBoolean EGLMakeCurrentIfNecessary (EGLDisplay display, EGLSurface draw, EGLSurface read, EGLContext context)
 
std::function< void *(const char *)> CreateProcAddressResolver ()
 Creates a proc address resolver that resolves function pointers to EGL and OpenGL (ES) procs. More...
 
static const char * EGLErrorToString (EGLint error)
 
void LogEGLError (const char *file, int line)
 

Enumeration Type Documentation

◆ API

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

Definition at line 13 of file config.h.

13 {
14 kOpenGL,
17};
@ kOpenGL
Definition: embedder.h:80

◆ ColorFormat

enum class impeller::egl::ColorFormat
strong
Enumerator
kRGBA8888 
kRGB565 

Definition at line 25 of file config.h.

◆ DepthBits

enum class impeller::egl::DepthBits
strong
Enumerator
kZero 
kEight 

Definition at line 35 of file config.h.

◆ Samples

enum class impeller::egl::Samples
strong
Enumerator
kOne 
kTwo 
kFour 

Definition at line 19 of file config.h.

◆ StencilBits

enum class impeller::egl::StencilBits
strong
Enumerator
kZero 
kEight 

Definition at line 30 of file config.h.

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

◆ SurfaceType

enum class impeller::egl::SurfaceType
strong
Enumerator
kWindow 
kPBuffer 

Definition at line 40 of file config.h.

Function Documentation

◆ CreateProcAddressResolver()

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

Creates a proc address resolver that resolves function pointers to EGL and OpenGL (ES) procs.

Returns
The resolver if one can be created.

Definition at line 12 of file egl.cc.

12 {
13 return [](const char* name) -> void* {
14 return reinterpret_cast<void*>(::eglGetProcAddress(name));
15 };
16}
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ 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}
const uint8_t uint32_t uint32_t GError ** error

◆ 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}
static bool read(SkStream *stream, void *buffer, size_t amount)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27

◆ 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}
#define FML_LOG(severity)
Definition: logging.h:82
static const char * EGLErrorToString(EGLint error)
Definition: egl.cc:18
#define ERROR(message)
Definition: elf_loader.cc:260