[gtk/wip/otte/nodeeditor2: 52/57] gsk: Export gsk_gl_renderer_new()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/nodeeditor2: 52/57] gsk: Export gsk_gl_renderer_new()
- Date: Sun, 5 May 2019 05:21:27 +0000 (UTC)
commit 6594ccf71680e2784e65eb8a86b46235481f0b96
Author: Benjamin Otte <otte redhat com>
Date: Thu May 2 02:13:16 2019 +0200
gsk: Export gsk_gl_renderer_new()
docs/reference/gsk/gsk4-sections.txt | 1 +
gsk/gl/gskglrenderer.c | 16 +++++++++++-
gsk/gl/gskglrenderer.h | 47 ++++++++++++++++++++++++++++++++++++
gsk/gl/gskglrendererprivate.h | 23 ------------------
gsk/gl/gskglrenderopsprivate.h | 2 +-
gsk/gsk.h | 1 +
gsk/gskrenderer.c | 2 +-
gsk/meson.build | 11 ++++++---
gtk/meson.build | 2 ++
9 files changed, 76 insertions(+), 29 deletions(-)
---
diff --git a/docs/reference/gsk/gsk4-sections.txt b/docs/reference/gsk/gsk4-sections.txt
index 21f50cdc45..f37c5c3b2e 100644
--- a/docs/reference/gsk/gsk4-sections.txt
+++ b/docs/reference/gsk/gsk4-sections.txt
@@ -8,6 +8,7 @@ gsk_renderer_render
gsk_renderer_render_texture
<SUBSECTION>
gsk_renderer_new_for_surface
+gsk_gl_renderer_new
gsk_cairo_renderer_new
<SUBSECTION Standard>
GSK_IS_RENDERER
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 93a9765c35..9342a031d5 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1,6 +1,6 @@
#include "config.h"
-#include "gskglrendererprivate.h"
+#include "gskglrenderer.h"
#include "gskdebugprivate.h"
#include "gskenums.h"
@@ -3281,3 +3281,17 @@ gsk_gl_renderer_init (GskGLRenderer *self)
}
#endif
}
+
+/**
+ * gsk_gl_renderer_new:
+ *
+ * Creates a new #GskRenderer using OpenGL. This is the default renderer
+ * used by GTK.
+ *
+ * Returns: a new GL renderer
+ **/
+GskRenderer *
+gsk_gl_renderer_new (void)
+{
+ return g_object_new (GSK_TYPE_GL_RENDERER, NULL);
+}
diff --git a/gsk/gl/gskglrenderer.h b/gsk/gl/gskglrenderer.h
new file mode 100644
index 0000000000..64cf11e31c
--- /dev/null
+++ b/gsk/gl/gskglrenderer.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright © 2016 Endless
+ * 2018 Timm Bäder <mail baedert org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Timm Bäder <mail baedert org>
+ */
+
+#ifndef __GSK_GL_RENDERER_H__
+#define __GSK_GL_RENDERER_H__
+
+#include <gsk/gskrenderer.h>
+
+G_BEGIN_DECLS
+
+#define GSK_TYPE_GL_RENDERER (gsk_gl_renderer_get_type ())
+
+#define GSK_GL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSK_TYPE_GL_RENDERER,
GskGLRenderer))
+#define GSK_IS_GL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSK_TYPE_GL_RENDERER))
+#define GSK_GL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSK_TYPE_GL_RENDERER,
GskGLRendererClass))
+#define GSK_IS_GL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSK_TYPE_GL_RENDERER))
+#define GSK_GL_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSK_TYPE_GL_RENDERER,
GskGLRendererClass))
+
+typedef struct _GskGLRenderer GskGLRenderer;
+typedef struct _GskGLRendererClass GskGLRendererClass;
+
+GDK_AVAILABLE_IN_ALL
+GType gsk_gl_renderer_get_type (void) G_GNUC_CONST;
+
+GDK_AVAILABLE_IN_ALL
+GskRenderer * gsk_gl_renderer_new (void);
+
+G_END_DECLS
+
+#endif /* __GSK_GL_RENDERER_H__ */
diff --git a/gsk/gl/gskglrenderopsprivate.h b/gsk/gl/gskglrenderopsprivate.h
index 20765a62c7..91d5329dab 100644
--- a/gsk/gl/gskglrenderopsprivate.h
+++ b/gsk/gl/gskglrenderopsprivate.h
@@ -7,7 +7,7 @@
#include "gskgldriverprivate.h"
#include "gskroundedrectprivate.h"
-#include "gskglrendererprivate.h"
+#include "gskglrenderer.h"
#include "gskrendernodeprivate.h"
#define GL_N_VERTICES 6
diff --git a/gsk/gsk.h b/gsk/gsk.h
index 523b24c81a..5f0938b0e0 100644
--- a/gsk/gsk.h
+++ b/gsk/gsk.h
@@ -27,6 +27,7 @@
#include <gsk/gsktransform.h>
#include <gsk/gskcairorenderer.h>
+#include <gsk/gl/gskglrenderer.h>
#include <gsk/gsktypes.h>
#include <gsk/gskenumtypes.h>
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c
index 8f202d96ea..b5b07f9707 100644
--- a/gsk/gskrenderer.c
+++ b/gsk/gskrenderer.c
@@ -38,7 +38,7 @@
#include "gskcairorenderer.h"
#include "gskdebugprivate.h"
-#include "gl/gskglrendererprivate.h"
+#include "gl/gskglrenderer.h"
#include "gskprofilerprivate.h"
#include "gskrendernodeprivate.h"
diff --git a/gsk/meson.build b/gsk/meson.build
index d05d1d8292..b3d87fcec9 100644
--- a/gsk/meson.build
+++ b/gsk/meson.build
@@ -28,6 +28,7 @@ gsk_public_sources = files([
'gskrendernodeimpl.c',
'gskroundedrect.c',
'gsktransform.c',
+ 'gl/gskglrenderer.c',
])
gsk_private_sources = files([
@@ -38,7 +39,6 @@ gsk_private_sources = files([
'gskrendernodeparser.c',
'gl/gskshaderbuilder.c',
'gl/gskglprofiler.c',
- 'gl/gskglrenderer.c',
'gl/gskglglyphcache.c',
'gl/gskglimage.c',
'gl/gskgldriver.c',
@@ -55,11 +55,16 @@ gsk_public_headers = files([
'gskroundedrect.h',
'gsktransform.h',
'gsktypes.h',
- 'gsk-autocleanup.h'
+ 'gsk-autocleanup.h',
])
-
install_headers(gsk_public_headers, 'gsk.h', subdir: 'gtk-4.0/gsk')
+gsk_public_gl_headers = files([
+ 'gl/gskglrenderer.h'
+])
+install_headers(gsk_public_gl_headers, subdir: 'gtk-4.0/gsk/gl')
+gsk_public_headers += gsk_public_gl_headers
+
gsk_private_vulkan_shaders = []
# This is an odd split because we use configure_file() below to workaround
# a limitation in meson preventing using custom_target() with gnome.compile_resources()
diff --git a/gtk/meson.build b/gtk/meson.build
index 76fef838f5..1075ccf725 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -1083,6 +1083,8 @@ if build_gir
gtk_introspection_sources = [
gtk_public_headers,
gtk_public_sources,
+ gtk_deprecated_headers,
+ gtk_deprecated_sources,
a11y_headers,
a11y_sources,
gtktypebuiltins_h,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]