summaryrefslogtreecommitdiff
path: root/gsk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-10-07 16:46:29 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-10-07 16:46:29 -0400
commitb7eb1d33100cb403f111e1665bb334f2e2adf02c (patch)
tree6810b6d195427186741cefc262368334b6b0f85d /gsk
parentf868c67429bc1198d6f33c3d1eec1d8c5f60fba8 (diff)
downloadgtk+-b7eb1d33100cb403f111e1665bb334f2e2adf02c.tar.gz
gsk: provide an ngl renderer
Provide a minimal renderer implementation that fails in realize. This avoids reusing the same type, which might give bindings trouble.
Diffstat (limited to 'gsk')
-rw-r--r--gsk/gl/gskglrenderer.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 7d0eebfaa7..0b1e9eddda 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -321,10 +321,36 @@ gsk_gl_renderer_try_compile_gl_shader (GskGLRenderer *renderer,
return program != NULL;
}
-GType
-gsk_ngl_renderer_get_type (void)
+typedef struct {
+ GskRenderer parent_instance;
+} GskNglRenderer;
+
+typedef struct {
+ GskRendererClass parent_class;
+} GskNglRendererClass;
+
+G_DEFINE_TYPE (GskNglRenderer, gsk_ngl_renderer, GSK_TYPE_RENDERER)
+
+static void
+gsk_ngl_renderer_init (GskNglRenderer *renderer)
+{
+}
+
+static gboolean
+gsk_ngl_renderer_realize (GskRenderer *renderer,
+ GdkSurface *surface,
+ GError **error)
+{
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_FAILED,
+ "please use the GL renderer instead");
+ return FALSE;
+}
+
+static void
+gsk_ngl_renderer_class_init (GskNglRendererClass *class)
{
- return gsk_gl_renderer_get_type ();
+ GSK_RENDERER_CLASS (class)->realize = gsk_ngl_renderer_realize;
}
/**
@@ -339,5 +365,7 @@ gsk_ngl_renderer_get_type (void)
GskRenderer *
gsk_ngl_renderer_new (void)
{
- return gsk_gl_renderer_new ();
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+ return g_object_new (gsk_ngl_renderer_get_type (), NULL);
+G_GNUC_END_IGNORE_DEPRECATIONS
}