[cogl/cogl-1.22] winsys: wayland: destroy eglsurface when destroying associated native window
- From: Lionel Landwerlin <llandwerlin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.22] winsys: wayland: destroy eglsurface when destroying associated native window
- Date: Mon, 7 Sep 2015 16:28:43 +0000 (UTC)
commit 4cb750928e97be859bfd48ef01e38caee60402b9
Author: Lionel Landwerlin <llandwerlin gmail com>
Date: Mon Sep 7 02:26:16 2015 +0100
winsys: wayland: destroy eglsurface when destroying associated native window
On Wayland deinit() of an onscreen buffer is going to destroy the
associated native window of an EGLSurface. So we should destroy the
EGLSurface as well otherwise we might end up confusing the GL driver.
We also currently guard against setting a EGL_NO_SURFACE as current
EGLSurface, but this shouldn't be a problem if we have a surfaceless
context. So we allow surface destruction under that condition.
https://bugzilla.gnome.org/show_bug.cgi?id=754667
cogl/winsys/cogl-winsys-egl.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index 2f15c5c..a53c0c7 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -676,7 +676,9 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
/* Cogl always needs a valid context bound to something so if we
* are destroying the onscreen that is currently bound we'll
* switch back to the dummy drawable. */
- if (egl_display->dummy_surface != EGL_NO_SURFACE &&
+ if ((egl_display->dummy_surface != EGL_NO_SURFACE ||
+ (egl_renderer->private_features &
+ COGL_EGL_WINSYS_FEATURE_SURFACELESS_CONTEXT) != 0) &&
(egl_display->current_draw_surface == egl_onscreen->egl_surface ||
egl_display->current_read_surface == egl_onscreen->egl_surface))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]