diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index 454e6942e..0e0d103ad 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -172,6 +172,7 @@ enum AFTER_UPDATE, PAINT_VIEW, PRESENTED, + GL_VIDEO_MEMORY_PURGED, LAST_SIGNAL }; @@ -2011,6 +2012,22 @@ clutter_stage_class_init (ClutterStageClass *klass) CLUTTER_TYPE_STAGE_VIEW, G_TYPE_POINTER); + /** + * ClutterStage::gl-video-memory-purged: (skip) + * @stage: the stage that received the event + * + * Signals that the underlying GL driver has had its texture memory purged + * so anything presently held in texture memory is now invalidated, and + * likely corrupt. It needs redrawing. + */ + stage_signals[GL_VIDEO_MEMORY_PURGED] = + g_signal_new (I_("gl-video-memory-purged"), + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, NULL, + G_TYPE_NONE, 0); + klass->activate = clutter_stage_real_activate; klass->deactivate = clutter_stage_real_deactivate; klass->delete_event = clutter_stage_real_delete_event; diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 79c93cf0a..41a65be39 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -1113,6 +1113,7 @@ meta_compositor_real_after_paint (MetaCompositor *compositor, { MetaCompositorPrivate *priv = meta_compositor_get_instance_private (compositor); + ClutterActor *stage_actor = meta_backend_get_stage (priv->backend); CoglGraphicsResetStatus status; GList *l; @@ -1124,7 +1125,8 @@ meta_compositor_real_after_paint (MetaCompositor *compositor, case COGL_GRAPHICS_RESET_STATUS_PURGED_CONTEXT_RESET: g_signal_emit_by_name (priv->display, "gl-video-memory-purged"); - clutter_actor_queue_redraw (meta_backend_get_stage (priv->backend)); + g_signal_emit_by_name (stage_actor, "gl-video-memory-purged"); + clutter_actor_queue_redraw (stage_actor); break; default: