| 29 | // and OpenGL ES is reinitialized. See eglMakeCurrent |
| 30 | |
| 31 | Status InitDisplay(EGLDisplay* egl_display) { |
| 32 | RETURN_IF_ERROR( |
| 33 | TFLITE_GPU_CALL_EGL(eglGetDisplay, egl_display, EGL_DEFAULT_DISPLAY)); |
| 34 | if (*egl_display == EGL_NO_DISPLAY) { |
| 35 | return UnavailableError("eglGetDisplay returned nullptr"); |
| 36 | } |
| 37 | bool is_initialized; |
| 38 | RETURN_IF_ERROR(TFLITE_GPU_CALL_EGL(eglInitialize, &is_initialized, |
| 39 | *egl_display, nullptr, nullptr)); |
| 40 | if (!is_initialized) { |
| 41 | return InternalError("No EGL error, but eglInitialize failed"); |
| 42 | } |
| 43 | return OkStatus(); |
| 44 | } |
| 45 | |
| 46 | } // namespace |
| 47 |
no test coverage detected