mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
cogl/scanout: Add 'scanout-failed' signal
This will later be emitted when a scanout failed, e.g. by the not-test commit failing for some reason, or drmModePageFlip() failing even if the pre-conditions for scanout in the simple KMS backend passed. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2854>
This commit is contained in:
parent
625a9e274a
commit
af5d67251b
@ -29,11 +29,27 @@
|
|||||||
|
|
||||||
#include "cogl-scanout.h"
|
#include "cogl-scanout.h"
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
SCANOUT_FAILED,
|
||||||
|
|
||||||
|
N_SIGNALS
|
||||||
|
};
|
||||||
|
|
||||||
|
static guint signals[N_SIGNALS];
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (CoglScanout, cogl_scanout, G_TYPE_OBJECT)
|
G_DEFINE_INTERFACE (CoglScanout, cogl_scanout, G_TYPE_OBJECT)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cogl_scanout_default_init (CoglScanoutInterface *iface)
|
cogl_scanout_default_init (CoglScanoutInterface *iface)
|
||||||
{
|
{
|
||||||
|
signals[SCANOUT_FAILED] =
|
||||||
|
g_signal_new ("scanout-failed",
|
||||||
|
G_TYPE_FROM_INTERFACE (iface),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
0, NULL, NULL, NULL,
|
||||||
|
G_TYPE_NONE, 1,
|
||||||
|
COGL_TYPE_ONSCREEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -54,3 +70,10 @@ cogl_scanout_blit_to_framebuffer (CoglScanout *scanout,
|
|||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cogl_scanout_notify_failed (CoglScanout *scanout,
|
||||||
|
CoglOnscreen *onscreen)
|
||||||
|
{
|
||||||
|
g_signal_emit (scanout, signals[SCANOUT_FAILED], 0, onscreen);
|
||||||
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "cogl/cogl-types.h"
|
#include "cogl/cogl-types.h"
|
||||||
#include "cogl/cogl-framebuffer.h"
|
#include "cogl/cogl-framebuffer.h"
|
||||||
|
#include "cogl/cogl-onscreen.h"
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
@ -56,4 +57,8 @@ gboolean cogl_scanout_blit_to_framebuffer (CoglScanout *scanout,
|
|||||||
int y,
|
int y,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
COGL_EXPORT
|
||||||
|
void cogl_scanout_notify_failed (CoglScanout *scanout,
|
||||||
|
CoglOnscreen *onscreen);
|
||||||
|
|
||||||
#endif /* COGL_SCANOUT_H */
|
#endif /* COGL_SCANOUT_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user