Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
impeller::egl Namespace Reference

Classes

class  Config
 
struct  ConfigDescriptor
 
class  Context
 
class  Display
 
class  Surface
 

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 ()
 
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 14 of file config.h.

14 {
15 kOpenGL,
18};
@ kOpenGL
Definition embedder.h:80

◆ ColorFormat

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

Definition at line 26 of file config.h.

◆ DepthBits

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

Definition at line 36 of file config.h.

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

◆ Samples

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

Definition at line 20 of file config.h.

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

◆ StencilBits

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

Definition at line 31 of file config.h.

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

◆ SurfaceType

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

Definition at line 41 of file config.h.

Function Documentation

◆ CreateProcAddressResolver()

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

Definition at line 12 of file egl.cc.

12 {
13 return [](const char* name) -> void* {
14 return reinterpret_cast<void*>(::eglGetProcAddress(name));
15 };
16}
const char * name
Definition fuchsia.cc:50

◆ 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)