mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
cogl/egl: Warn when we fail to query a buffer age.
In order to avoid log spamming, just warn once it starts to happen, not on every frame for every onscreen. Just knowing that this is happening is a hint that something's going wrong. https://gitlab.gnome.org/GNOME/mutter/merge_requests/906
This commit is contained in:
parent
f4f7e31303
commit
6ee7c0f486
@ -697,12 +697,22 @@ _cogl_winsys_onscreen_get_buffer_age (CoglOnscreen *onscreen)
|
||||
CoglRendererEGL *egl_renderer = renderer->winsys;
|
||||
CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
|
||||
EGLSurface surface = egl_onscreen->egl_surface;
|
||||
static gboolean warned = FALSE;
|
||||
int age;
|
||||
|
||||
if (!(egl_renderer->private_features & COGL_EGL_WINSYS_FEATURE_BUFFER_AGE))
|
||||
return 0;
|
||||
|
||||
eglQuerySurface (egl_renderer->edpy, surface, EGL_BUFFER_AGE_EXT, &age);
|
||||
if (!eglQuerySurface (egl_renderer->edpy, surface, EGL_BUFFER_AGE_EXT, &age))
|
||||
{
|
||||
if (!warned)
|
||||
g_critical ("Failed to query buffer age, got error %x", eglGetError ());
|
||||
warned = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
warned = FALSE;
|
||||
}
|
||||
|
||||
return age;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user