compositor: Handle GL video memory purged errors

Emit a signal so that interested parties can recreate their FBOs and
queue a full scene graph redraw to ensure we don't end up showing
graphical artifacts.

This relies on the GL driver supporting the
NV_robustness_video_memory_purge extension and cogl creating a
suitable GL context. For now we only make use of it with the X backend
since the only driver with which this is useful is NVIDIA.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
This commit is contained in:
Rui Matos
2016-05-20 19:22:23 +02:00
parent 7ed14e0ee8
commit 7f6bcea331
4 changed files with 38 additions and 2 deletions

View File

@@ -125,6 +125,7 @@ enum
SHOW_RESTART_MESSAGE,
RESTART,
SHOW_RESIZE_POPUP,
GL_VIDEO_MEMORY_PURGED,
LAST_SIGNAL
};
@@ -342,6 +343,14 @@ meta_display_class_init (MetaDisplayClass *klass)
G_TYPE_BOOLEAN, 4,
G_TYPE_BOOLEAN, META_TYPE_RECTANGLE, G_TYPE_INT, G_TYPE_INT);
display_signals[GL_VIDEO_MEMORY_PURGED] =
g_signal_new ("gl-video-memory-purged",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
g_object_class_install_property (object_class,
PROP_FOCUS_WINDOW,
g_param_spec_object ("focus-window",