cogl/onscreen/egl: Move pending_resize_notify to Xlib platform

It's only used in the Xlib onscreen, so move it there.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
This commit is contained in:
Jonas Ådahl 2020-10-17 00:56:07 +02:00 committed by Robert Mader
parent b24d5ce1dd
commit 760a07cc24
2 changed files with 8 additions and 5 deletions

View File

@ -169,8 +169,6 @@ typedef struct _CoglOnscreenEGL
{ {
EGLSurface egl_surface; EGLSurface egl_surface;
gboolean pending_resize_notify;
/* Platform specific data */ /* Platform specific data */
void *platform; void *platform;
} CoglOnscreenEGL; } CoglOnscreenEGL;

View File

@ -60,6 +60,8 @@ typedef struct _CoglDisplayXlib
typedef struct _CoglOnscreenXlib typedef struct _CoglOnscreenXlib
{ {
Window xwin; Window xwin;
gboolean pending_resize_notify;
} CoglOnscreenXlib; } CoglOnscreenXlib;
#ifdef EGL_KHR_image_pixmap #ifdef EGL_KHR_image_pixmap
@ -103,11 +105,12 @@ flush_pending_resize_notifications_cb (void *data,
{ {
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer); CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
CoglOnscreenEGL *egl_onscreen = cogl_onscreen_get_winsys (onscreen); CoglOnscreenEGL *egl_onscreen = cogl_onscreen_get_winsys (onscreen);
CoglOnscreenXlib *xlib_onscreen = egl_onscreen->platform;
if (egl_onscreen->pending_resize_notify) if (xlib_onscreen->pending_resize_notify)
{ {
_cogl_onscreen_notify_resize (onscreen); _cogl_onscreen_notify_resize (onscreen);
egl_onscreen->pending_resize_notify = FALSE; xlib_onscreen->pending_resize_notify = FALSE;
} }
} }
} }
@ -140,6 +143,7 @@ notify_resize (CoglContext *context,
CoglOnscreen *onscreen = find_onscreen_for_xid (context, drawable); CoglOnscreen *onscreen = find_onscreen_for_xid (context, drawable);
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen); CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
CoglOnscreenEGL *egl_onscreen; CoglOnscreenEGL *egl_onscreen;
CoglOnscreenXlib *xlib_onscreen;
if (!onscreen) if (!onscreen)
return; return;
@ -160,7 +164,8 @@ notify_resize (CoglContext *context,
NULL); NULL);
} }
egl_onscreen->pending_resize_notify = TRUE; xlib_onscreen = egl_onscreen->platform;
xlib_onscreen->pending_resize_notify = TRUE;
} }
static CoglFilterReturn static CoglFilterReturn