render/egl: make wlr_egl_context public

This commit is contained in:
Simon Zeni 2021-09-21 09:36:44 -04:00
parent 3c26244340
commit 6eff6c365b
5 changed files with 36 additions and 34 deletions

View file

@ -560,14 +560,16 @@ bool wlr_egl_is_current(struct wlr_egl *egl) {
return eglGetCurrentContext() == egl->context;
}
void wlr_egl_save_context(struct wlr_egl_context *context) {
void wlr_egl_context_save(struct wlr_egl_context *context) {
context->display = eglGetCurrentDisplay();
context->context = eglGetCurrentContext();
context->draw_surface = eglGetCurrentSurface(EGL_DRAW);
context->read_surface = eglGetCurrentSurface(EGL_READ);
}
bool wlr_egl_restore_context(struct wlr_egl_context *context) {
bool wlr_egl_context_restore(struct wlr_egl_context *context) {
// If the saved context is a null-context, we must use the current
// display instead of the saved display because eglMakeCurrent() can't
// handle EGL_NO_DISPLAY.