[gtk/wip/otte/nodeeditor2: 55/59] gsk: Export gsk_gl_renderer_new()



commit efcd8a9436f97785e2c78aa94629d5f6b3af4e3b
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                      |  5 ++--
 8 files changed, 69 insertions(+), 28 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..dd9be5709d 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,7 +55,8 @@ gsk_public_headers = files([
   'gskroundedrect.h',
   'gsktransform.h',
   'gsktypes.h',
-  'gsk-autocleanup.h'
+  'gsk-autocleanup.h',
+  'gl/gskglrenderer.h'
 ])
 
 install_headers(gsk_public_headers, 'gsk.h', subdir: 'gtk-4.0/gsk')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]