Flutter Engine
The Flutter Engine
egl.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
7#include "flutter/fml/logging.h"
8
9namespace impeller {
10namespace egl {
11
13 return [](const char* name) -> void* {
14 return reinterpret_cast<void*>(::eglGetProcAddress(name));
15 };
16}
17
18static const char* EGLErrorToString(EGLint error) {
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}
53
54void LogEGLError(const char* file, int line) {
55 const auto error = ::eglGetError();
56 FML_LOG(ERROR) << "EGL Error: " << EGLErrorToString(error) << " (" << error
57 << ") in " << file << ":" << line;
58}
59
60} // namespace egl
61} // namespace impeller
const uint8_t uint32_t uint32_t GError ** error
#define FML_LOG(severity)
Definition: logging.h:82
Dart_NativeFunction function
Definition: fuchsia.cc:51
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
void LogEGLError(const char *file, int line)
Definition: egl.cc:54
static const char * EGLErrorToString(EGLint error)
Definition: egl.cc:18
std::function< void *(const char *)> CreateProcAddressResolver()
Creates a proc address resolver that resolves function pointers to EGL and OpenGL (ES) procs.
Definition: egl.cc:12
#define ERROR(message)
Definition: elf_loader.cc:260