mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
gsk: Export gsk_vulkan_renderer_new()
This commit is contained in:
parent
cc5f2f8995
commit
3f24ad741a
@ -10,6 +10,7 @@ gsk_renderer_render_texture
|
||||
gsk_renderer_new_for_surface
|
||||
gsk_gl_renderer_new
|
||||
gsk_cairo_renderer_new
|
||||
gsk_vulkan_renderer_new
|
||||
gsk_broadway_renderer_new
|
||||
<SUBSECTION Standard>
|
||||
GSK_IS_RENDERER
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <gsk/gskcairorenderer.h>
|
||||
#include <gsk/gl/gskglrenderer.h>
|
||||
#include <gsk/broadway/gskbroadwayrenderer.h>
|
||||
#include <gsk/vulkan/gskvulkanrenderer.h>
|
||||
|
||||
#include <gsk/gsktypes.h>
|
||||
#include <gsk/gskenumtypes.h>
|
||||
|
@ -58,7 +58,7 @@
|
||||
#include "broadway/gskbroadwayrenderer.h"
|
||||
#endif
|
||||
#ifdef GDK_RENDERING_VULKAN
|
||||
#include "vulkan/gskvulkanrendererprivate.h"
|
||||
#include "vulkan/gskvulkanrenderer.h"
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
|
@ -71,6 +71,12 @@ gsk_public_broadway_headers = files([
|
||||
install_headers(gsk_public_broadway_headers, subdir: 'gtk-4.0/gsk/broadway')
|
||||
gsk_public_headers += gsk_public_broadway_headers
|
||||
|
||||
gsk_public_vulkan_headers = files([
|
||||
'vulkan/gskvulkanrenderer.h'
|
||||
])
|
||||
install_headers(gsk_public_vulkan_headers, subdir: 'gtk-4.0/gsk/vulkan')
|
||||
gsk_public_headers += gsk_public_vulkan_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()
|
||||
|
@ -364,3 +364,22 @@ gsk_vulkan_renderer_get_cached_glyph (GskVulkanRenderer *self,
|
||||
{
|
||||
return gsk_vulkan_glyph_cache_lookup (self->glyph_cache, FALSE, font, glyph, scale);
|
||||
}
|
||||
|
||||
/**
|
||||
* gsk_vulkan_renderer_new:
|
||||
*
|
||||
* Creates a new Vulkan renderer.
|
||||
*
|
||||
* The Vulkan renderer is a renderer that uses the Vulkan library for
|
||||
* rendering.
|
||||
*
|
||||
* This function is only available when GTK was compiled with Vulkan
|
||||
* support.
|
||||
*
|
||||
* Returns: a new Vulkan renderer
|
||||
**/
|
||||
GskRenderer *
|
||||
gsk_vulkan_renderer_new (void)
|
||||
{
|
||||
return g_object_new (GSK_TYPE_VULKAN_RENDERER, NULL);
|
||||
}
|
||||
|
51
gsk/vulkan/gskvulkanrenderer.h
Normal file
51
gsk/vulkan/gskvulkanrenderer.h
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright © 2016 Benjamin Otte
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#ifndef __GSK_VULKAN_RENDERER_H__
|
||||
#define __GSK_VULKAN_RENDERER_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gsk/gskrenderer.h>
|
||||
|
||||
#ifdef GDK_RENDERING_VULKAN
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GSK_TYPE_VULKAN_RENDERER (gsk_vulkan_renderer_get_type ())
|
||||
|
||||
#define GSK_VULKAN_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSK_TYPE_VULKAN_RENDERER, GskVulkanRenderer))
|
||||
#define GSK_IS_VULKAN_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSK_TYPE_VULKAN_RENDERER))
|
||||
#define GSK_VULKAN_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSK_TYPE_VULKAN_RENDERER, GskVulkanRendererClass))
|
||||
#define GSK_IS_VULKAN_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSK_TYPE_VULKAN_RENDERER))
|
||||
#define GSK_VULKAN_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSK_TYPE_VULKAN_RENDERER, GskVulkanRendererClass))
|
||||
|
||||
typedef struct _GskVulkanRenderer GskVulkanRenderer;
|
||||
typedef struct _GskVulkanRendererClass GskVulkanRendererClass;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gsk_vulkan_renderer_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GskRenderer * gsk_vulkan_renderer_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* GDK_WINDOWING_VULKAN */
|
||||
|
||||
#endif /* __GSK_VULKAN_RENDERER_H__ */
|
@ -1,26 +1,11 @@
|
||||
#ifndef __GSK_VULKAN_RENDERER_PRIVATE_H__
|
||||
#define __GSK_VULKAN_RENDERER_PRIVATE_H__
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <gsk/gskrenderer.h>
|
||||
|
||||
#include "gskvulkanrenderer.h"
|
||||
#include "gskvulkanimageprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GSK_TYPE_VULKAN_RENDERER (gsk_vulkan_renderer_get_type ())
|
||||
|
||||
#define GSK_VULKAN_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSK_TYPE_VULKAN_RENDERER, GskVulkanRenderer))
|
||||
#define GSK_IS_VULKAN_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSK_TYPE_VULKAN_RENDERER))
|
||||
#define GSK_VULKAN_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSK_TYPE_VULKAN_RENDERER, GskVulkanRendererClass))
|
||||
#define GSK_IS_VULKAN_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSK_TYPE_VULKAN_RENDERER))
|
||||
#define GSK_VULKAN_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSK_TYPE_VULKAN_RENDERER, GskVulkanRendererClass))
|
||||
|
||||
typedef struct _GskVulkanRenderer GskVulkanRenderer;
|
||||
typedef struct _GskVulkanRendererClass GskVulkanRendererClass;
|
||||
|
||||
GType gsk_vulkan_renderer_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GskVulkanImage * gsk_vulkan_renderer_ref_texture_image (GskVulkanRenderer *self,
|
||||
GdkTexture *texture,
|
||||
GskVulkanUploader *uploader);
|
||||
|
Loading…
Reference in New Issue
Block a user