gsk: Export gsk_gl_renderer_new()

This commit is contained in:
Benjamin Otte 2019-05-02 02:13:16 +02:00
parent 559ae8b326
commit 6594ccf716
9 changed files with 76 additions and 29 deletions

View File

@ -8,6 +8,7 @@ gsk_renderer_render
gsk_renderer_render_texture gsk_renderer_render_texture
<SUBSECTION> <SUBSECTION>
gsk_renderer_new_for_surface gsk_renderer_new_for_surface
gsk_gl_renderer_new
gsk_cairo_renderer_new gsk_cairo_renderer_new
<SUBSECTION Standard> <SUBSECTION Standard>
GSK_IS_RENDERER GSK_IS_RENDERER

View File

@ -1,6 +1,6 @@
#include "config.h" #include "config.h"
#include "gskglrendererprivate.h" #include "gskglrenderer.h"
#include "gskdebugprivate.h" #include "gskdebugprivate.h"
#include "gskenums.h" #include "gskenums.h"
@ -3281,3 +3281,17 @@ gsk_gl_renderer_init (GskGLRenderer *self)
} }
#endif #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);
}

47
gsk/gl/gskglrenderer.h Normal file
View File

@ -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__ */

View File

@ -1,23 +0,0 @@
#ifndef __GSK_GL_RENDERER_PRIVATE_H__
#define __GSK_GL_RENDERER_PRIVATE_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;
GType gsk_gl_renderer_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GSK_GL_RENDERER_PRIVATE_H__ */

View File

@ -7,7 +7,7 @@
#include "gskgldriverprivate.h" #include "gskgldriverprivate.h"
#include "gskroundedrectprivate.h" #include "gskroundedrectprivate.h"
#include "gskglrendererprivate.h" #include "gskglrenderer.h"
#include "gskrendernodeprivate.h" #include "gskrendernodeprivate.h"
#define GL_N_VERTICES 6 #define GL_N_VERTICES 6

View File

@ -27,6 +27,7 @@
#include <gsk/gsktransform.h> #include <gsk/gsktransform.h>
#include <gsk/gskcairorenderer.h> #include <gsk/gskcairorenderer.h>
#include <gsk/gl/gskglrenderer.h>
#include <gsk/gsktypes.h> #include <gsk/gsktypes.h>
#include <gsk/gskenumtypes.h> #include <gsk/gskenumtypes.h>

View File

@ -38,7 +38,7 @@
#include "gskcairorenderer.h" #include "gskcairorenderer.h"
#include "gskdebugprivate.h" #include "gskdebugprivate.h"
#include "gl/gskglrendererprivate.h" #include "gl/gskglrenderer.h"
#include "gskprofilerprivate.h" #include "gskprofilerprivate.h"
#include "gskrendernodeprivate.h" #include "gskrendernodeprivate.h"

View File

@ -28,6 +28,7 @@ gsk_public_sources = files([
'gskrendernodeimpl.c', 'gskrendernodeimpl.c',
'gskroundedrect.c', 'gskroundedrect.c',
'gsktransform.c', 'gsktransform.c',
'gl/gskglrenderer.c',
]) ])
gsk_private_sources = files([ gsk_private_sources = files([
@ -38,7 +39,6 @@ gsk_private_sources = files([
'gskrendernodeparser.c', 'gskrendernodeparser.c',
'gl/gskshaderbuilder.c', 'gl/gskshaderbuilder.c',
'gl/gskglprofiler.c', 'gl/gskglprofiler.c',
'gl/gskglrenderer.c',
'gl/gskglglyphcache.c', 'gl/gskglglyphcache.c',
'gl/gskglimage.c', 'gl/gskglimage.c',
'gl/gskgldriver.c', 'gl/gskgldriver.c',
@ -55,11 +55,16 @@ gsk_public_headers = files([
'gskroundedrect.h', 'gskroundedrect.h',
'gsktransform.h', 'gsktransform.h',
'gsktypes.h', 'gsktypes.h',
'gsk-autocleanup.h' 'gsk-autocleanup.h',
]) ])
install_headers(gsk_public_headers, 'gsk.h', subdir: 'gtk-4.0/gsk') 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 = [] gsk_private_vulkan_shaders = []
# This is an odd split because we use configure_file() below to workaround # 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() # a limitation in meson preventing using custom_target() with gnome.compile_resources()

View File

@ -1083,6 +1083,8 @@ if build_gir
gtk_introspection_sources = [ gtk_introspection_sources = [
gtk_public_headers, gtk_public_headers,
gtk_public_sources, gtk_public_sources,
gtk_deprecated_headers,
gtk_deprecated_sources,
a11y_headers, a11y_headers,
a11y_sources, a11y_sources,
gtktypebuiltins_h, gtktypebuiltins_h,