mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 09:40:10 +00:00
gsk: Deprecate GskGLShader and the rendernode
The new renderers don't support them due to the required complexity of integrating them with Vulkan and the assumptions those nodes make about the renderer (the GL renderer exports its internal APIs into the GLShader). There haven't been any complaints that I'm aware of since 4.14 was released where the default renderer does not support the nodes, so usage in public seems to be close to nonexistant. The 2 uses I know of were workarounds about missing features in GTK that have stopped since GTK now supports them: 1. GStreamer used in to do premultiplication when the old GL renderer did not do so in hardware but on the CPU. 2. Adwaita used it for masking before the mask node wa added in 4.10.
This commit is contained in:
parent
53ac80d6c8
commit
32625381fa
@ -170,6 +170,7 @@ update_paintable (GtkWidget *widget,
|
||||
static GtkWidget *
|
||||
create_cogs (void)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GtkWidget *picture;
|
||||
static GskGLShader *cog_shader = NULL;
|
||||
GdkPaintable *paintable;
|
||||
@ -182,6 +183,7 @@ create_cogs (void)
|
||||
gtk_widget_add_tick_callback (picture, update_paintable, NULL, NULL);
|
||||
|
||||
return picture;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include "gtkshadertoy.h"
|
||||
#include "gskshaderpaintable.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static GtkWidget *demo_window = NULL;
|
||||
|
||||
static void
|
||||
@ -360,3 +362,5 @@ do_gltransition (GtkWidget *do_widget)
|
||||
|
||||
return demo_window;
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gskshaderpaintable.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GskShaderPaintable:
|
||||
*
|
||||
@ -332,3 +334,5 @@ gsk_shader_paintable_update_time (GskShaderPaintable *self,
|
||||
|
||||
g_bytes_unref (args);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <gsk/gsk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GSK_TYPE_SHADER_PAINTABLE (gsk_shader_paintable_get_type ())
|
||||
@ -41,3 +43,5 @@ void gsk_shader_paintable_update_time (GskShaderPaintable *self
|
||||
int time_idx,
|
||||
gint64 frame_time);
|
||||
G_END_DECLS
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "gtkshaderbin.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
typedef struct {
|
||||
GskGLShader *shader;
|
||||
GtkStateFlags state;
|
||||
@ -262,3 +264,5 @@ gtk_shader_bin_new (void)
|
||||
|
||||
return GTK_WIDGET (self);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_SHADER_BIN (gtk_shader_bin_get_type ())
|
||||
@ -18,3 +20,5 @@ void gtk_shader_bin_set_child (GtkShaderBin *self,
|
||||
GtkWidget *gtk_shader_bin_get_child (GtkShaderBin *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "gtkshaderstack.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
struct _GtkShaderStack
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
@ -359,3 +361,5 @@ gtk_shader_stack_set_active (GtkShaderStack *self,
|
||||
self->current = MIN (index, self->children->len);
|
||||
update_child_visible (self);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_SHADER_STACK (gtk_shader_stack_get_type ())
|
||||
@ -18,3 +20,5 @@ void gtk_shader_stack_set_active (GtkShaderStack *self,
|
||||
int index);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -245,6 +245,7 @@ gsk_gl_driver_dispose (GObject *object)
|
||||
#undef GSK_GL_DEFINE_PROGRAM
|
||||
#undef GSK_GL_DEFINE_PROGRAM_NO_CLIP
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
if (self->shader_cache != NULL)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
@ -262,6 +263,7 @@ gsk_gl_driver_dispose (GObject *object)
|
||||
|
||||
g_clear_pointer (&self->shader_cache, g_hash_table_unref);
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
if (self->command_queue != NULL)
|
||||
{
|
||||
@ -1230,6 +1232,8 @@ gsk_gl_driver_release_render_target (GskGLDriver *self,
|
||||
return release_render_target (self, render_target, release_texture, TRUE);
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* gsk_gl_driver_lookup_shader:
|
||||
* @self: a `GskGLDriver`
|
||||
@ -1347,6 +1351,8 @@ gsk_gl_driver_lookup_shader (GskGLDriver *self,
|
||||
return program;
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
#if 0
|
||||
void
|
||||
gsk_gl_driver_save_texture_to_png (GskGLDriver *driver,
|
||||
|
@ -177,9 +177,11 @@ void gsk_gl_driver_add_texture_slices (GskGLDriver *s
|
||||
gboolean ensure_mipmap,
|
||||
GskGLTextureSlice **out_slices,
|
||||
guint *out_n_slices);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GskGLProgram * gsk_gl_driver_lookup_shader (GskGLDriver *self,
|
||||
GskGLShader *shader,
|
||||
GError **error);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
#if 0
|
||||
void gsk_gl_driver_save_texture_to_png (GskGLDriver *self,
|
||||
|
@ -525,6 +525,8 @@ gsk_gl_renderer_init (GskGLRenderer *self)
|
||||
{
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
gboolean
|
||||
gsk_gl_renderer_try_compile_gl_shader (GskGLRenderer *renderer,
|
||||
GskGLShader *shader,
|
||||
@ -540,3 +542,4 @@ gsk_gl_renderer_try_compile_gl_shader (GskGLRenderer *renderer,
|
||||
return program != NULL;
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -26,9 +26,13 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
gboolean gsk_gl_renderer_try_compile_gl_shader (GskGLRenderer *renderer,
|
||||
GskGLShader *shader,
|
||||
GError **error);
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -3501,6 +3501,7 @@ static inline void
|
||||
gsk_gl_render_job_visit_gl_shader_node (GskGLRenderJob *job,
|
||||
const GskRenderNode *node)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GError *error = NULL;
|
||||
GskGLShader *shader;
|
||||
GskGLProgram *program;
|
||||
@ -3612,6 +3613,7 @@ gsk_gl_render_job_visit_gl_shader_node (GskGLRenderJob *job,
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -132,6 +132,15 @@
|
||||
* fragColor = position * source1 + (1.0 - position) * source2;
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* # Deprecation
|
||||
*
|
||||
* This feature was deprecated in GTK 4.16 after the new rendering infrastructure
|
||||
* introduced in 4.14 did not support it.
|
||||
* The lack of Vulkan inegration would have made it a very hard feature to support.
|
||||
*
|
||||
* If you want to use OpenGL directly, you should look at [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* which uses a different approach and is still well supported.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@ -141,6 +150,8 @@
|
||||
|
||||
#include "gl/gskglrendererprivate.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static GskGLUniformType
|
||||
uniform_type_from_glsl (const char *str)
|
||||
{
|
||||
@ -481,6 +492,10 @@ gsk_gl_shader_init (GskGLShader *shader)
|
||||
* Creates a `GskGLShader` that will render pixels using the specified code.
|
||||
*
|
||||
* Returns: (transfer full): A new `GskGLShader`
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GskGLShader *
|
||||
gsk_gl_shader_new_from_bytes (GBytes *sourcecode)
|
||||
@ -500,6 +515,10 @@ gsk_gl_shader_new_from_bytes (GBytes *sourcecode)
|
||||
* Creates a `GskGLShader` that will render pixels using the specified code.
|
||||
*
|
||||
* Returns: (transfer full): A new `GskGLShader`
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GskGLShader *
|
||||
gsk_gl_shader_new_from_resource (const char *resource_path)
|
||||
@ -531,6 +550,10 @@ gsk_gl_shader_new_from_resource (const char *resource_path)
|
||||
* widget snapshot.
|
||||
*
|
||||
* Returns: %TRUE on success, %FALSE if an error occurred
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
gboolean
|
||||
gsk_gl_shader_compile (GskGLShader *shader,
|
||||
@ -555,6 +578,10 @@ gsk_gl_shader_compile (GskGLShader *shader,
|
||||
* Gets the GLSL sourcecode being used to render this shader.
|
||||
*
|
||||
* Returns: (transfer none): The source code for the shader
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GBytes *
|
||||
gsk_gl_shader_get_source (GskGLShader *shader)
|
||||
@ -572,6 +599,10 @@ gsk_gl_shader_get_source (GskGLShader *shader)
|
||||
* to render this shader.
|
||||
*
|
||||
* Returns: (transfer none) (nullable): The resource path for the shader
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
const char *
|
||||
gsk_gl_shader_get_resource (GskGLShader *shader)
|
||||
@ -592,6 +623,10 @@ gsk_gl_shader_get_resource (GskGLShader *shader)
|
||||
* u_textureN value that the shader defines.
|
||||
*
|
||||
* Returns: The number of texture inputs required by @shader
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
int
|
||||
gsk_gl_shader_get_n_textures (GskGLShader *shader)
|
||||
@ -608,6 +643,10 @@ gsk_gl_shader_get_n_textures (GskGLShader *shader)
|
||||
* Get the number of declared uniforms for this shader.
|
||||
*
|
||||
* Returns: The number of declared uniforms
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
int
|
||||
gsk_gl_shader_get_n_uniforms (GskGLShader *shader)
|
||||
@ -625,6 +664,10 @@ gsk_gl_shader_get_n_uniforms (GskGLShader *shader)
|
||||
* Get the name of the declared uniform for this shader at index @idx.
|
||||
*
|
||||
* Returns: (transfer none): The name of the declared uniform
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
const char *
|
||||
gsk_gl_shader_get_uniform_name (GskGLShader *shader,
|
||||
@ -645,6 +688,10 @@ gsk_gl_shader_get_uniform_name (GskGLShader *shader,
|
||||
* of the uniform, or -1 if it was not found.
|
||||
*
|
||||
* Returns: The index of the uniform, or -1
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
int
|
||||
gsk_gl_shader_find_uniform_by_name (GskGLShader *shader,
|
||||
@ -670,6 +717,10 @@ gsk_gl_shader_find_uniform_by_name (GskGLShader *shader,
|
||||
* Get the type of the declared uniform for this shader at index @idx.
|
||||
*
|
||||
* Returns: The type of the declared uniform
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GskGLUniformType
|
||||
gsk_gl_shader_get_uniform_type (GskGLShader *shader,
|
||||
@ -689,6 +740,10 @@ gsk_gl_shader_get_uniform_type (GskGLShader *shader,
|
||||
* Get the offset into the data block where data for this uniforms is stored.
|
||||
*
|
||||
* Returns: The data offset
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
int
|
||||
gsk_gl_shader_get_uniform_offset (GskGLShader *shader,
|
||||
@ -715,6 +770,10 @@ gsk_gl_shader_get_uniforms (GskGLShader *shader,
|
||||
* Get the size of the data block used to specify arguments for this shader.
|
||||
*
|
||||
* Returns: The size of the data block
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
gsize
|
||||
gsk_gl_shader_get_args_size (GskGLShader *shader)
|
||||
@ -749,6 +808,10 @@ gsk_gl_shader_find_uniform (GskGLShader *shader,
|
||||
* The uniform must be of float type.
|
||||
*
|
||||
* Returns: The value
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
float
|
||||
gsk_gl_shader_get_arg_float (GskGLShader *shader,
|
||||
@ -782,6 +845,10 @@ gsk_gl_shader_get_arg_float (GskGLShader *shader,
|
||||
* The uniform must be of int type.
|
||||
*
|
||||
* Returns: The value
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
gint32
|
||||
gsk_gl_shader_get_arg_int (GskGLShader *shader,
|
||||
@ -815,6 +882,10 @@ gsk_gl_shader_get_arg_int (GskGLShader *shader,
|
||||
* The uniform must be of uint type.
|
||||
*
|
||||
* Returns: The value
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
guint32
|
||||
gsk_gl_shader_get_arg_uint (GskGLShader *shader,
|
||||
@ -848,6 +919,10 @@ gsk_gl_shader_get_arg_uint (GskGLShader *shader,
|
||||
* The uniform must be of bool type.
|
||||
*
|
||||
* Returns: The value
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
gboolean
|
||||
gsk_gl_shader_get_arg_bool (GskGLShader *shader,
|
||||
@ -880,6 +955,10 @@ gsk_gl_shader_get_arg_bool (GskGLShader *shader,
|
||||
* Gets the value of the uniform @idx in the @args block.
|
||||
*
|
||||
* The uniform must be of vec2 type.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_gl_shader_get_arg_vec2 (GskGLShader *shader,
|
||||
@ -913,6 +992,10 @@ gsk_gl_shader_get_arg_vec2 (GskGLShader *shader,
|
||||
* Gets the value of the uniform @idx in the @args block.
|
||||
*
|
||||
* The uniform must be of vec3 type.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_gl_shader_get_arg_vec3 (GskGLShader *shader,
|
||||
@ -946,6 +1029,10 @@ gsk_gl_shader_get_arg_vec3 (GskGLShader *shader,
|
||||
* Gets the value of the uniform @idx in the @args block.
|
||||
*
|
||||
* The uniform must be of vec4 type.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_gl_shader_get_arg_vec4 (GskGLShader *shader,
|
||||
@ -989,6 +1076,10 @@ gsk_gl_shader_get_arg_vec4 (GskGLShader *shader,
|
||||
*
|
||||
* Returns: (transfer full): A newly allocated block of data which can be
|
||||
* passed to [ctor@Gsk.GLShaderNode.new].
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GBytes *
|
||||
gsk_gl_shader_format_args_va (GskGLShader *shader,
|
||||
@ -1073,6 +1164,10 @@ gsk_gl_shader_format_args_va (GskGLShader *shader,
|
||||
*
|
||||
* Returns: (transfer full): A newly allocated block of data which can be
|
||||
* passed to [ctor@Gsk.GLShaderNode.new].
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GBytes *
|
||||
gsk_gl_shader_format_args (GskGLShader *shader,
|
||||
@ -1109,6 +1204,10 @@ G_DEFINE_BOXED_TYPE (GskShaderArgsBuilder, gsk_shader_args_builder,
|
||||
*
|
||||
* Returns: (transfer full): The newly allocated builder, free with
|
||||
* [method@Gsk.ShaderArgsBuilder.unref]
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GskShaderArgsBuilder *
|
||||
gsk_shader_args_builder_new (GskGLShader *shader,
|
||||
@ -1147,9 +1246,12 @@ gsk_shader_args_builder_new (GskGLShader *shader,
|
||||
* This function is intended primarily for bindings. C code should use
|
||||
* [method@Gsk.ShaderArgsBuilder.free_to_args].
|
||||
*
|
||||
*
|
||||
* Returns: (transfer full): the newly allocated buffer with
|
||||
* all the args added to @builder
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GBytes *
|
||||
gsk_shader_args_builder_to_args (GskShaderArgsBuilder *builder)
|
||||
@ -1170,6 +1272,10 @@ gsk_shader_args_builder_to_args (GskShaderArgsBuilder *builder)
|
||||
*
|
||||
* Returns: (transfer full): the newly allocated buffer with
|
||||
* all the args added to @builder
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GBytes *
|
||||
gsk_shader_args_builder_free_to_args (GskShaderArgsBuilder *builder)
|
||||
@ -1193,6 +1299,10 @@ gsk_shader_args_builder_free_to_args (GskShaderArgsBuilder *builder)
|
||||
* Decreases the reference count of a `GskShaderArgBuilder` by one.
|
||||
*
|
||||
* If the resulting reference count is zero, frees the builder.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_shader_args_builder_unref (GskShaderArgsBuilder *builder)
|
||||
@ -1217,6 +1327,10 @@ gsk_shader_args_builder_unref (GskShaderArgsBuilder *builder)
|
||||
* Increases the reference count of a `GskShaderArgsBuilder` by one.
|
||||
*
|
||||
* Returns: the passed in `GskShaderArgsBuilder`
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GskShaderArgsBuilder *
|
||||
gsk_shader_args_builder_ref (GskShaderArgsBuilder *builder)
|
||||
@ -1264,6 +1378,10 @@ gsk_shader_args_builder_set_float (GskShaderArgsBuilder *builder,
|
||||
* Sets the value of the uniform @idx.
|
||||
*
|
||||
* The uniform must be of int type.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_shader_args_builder_set_int (GskShaderArgsBuilder *builder,
|
||||
@ -1292,6 +1410,10 @@ gsk_shader_args_builder_set_int (GskShaderArgsBuilder *builder,
|
||||
* Sets the value of the uniform @idx.
|
||||
*
|
||||
* The uniform must be of uint type.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_shader_args_builder_set_uint (GskShaderArgsBuilder *builder,
|
||||
@ -1320,6 +1442,10 @@ gsk_shader_args_builder_set_uint (GskShaderArgsBuilder *builder,
|
||||
* Sets the value of the uniform @idx.
|
||||
*
|
||||
* The uniform must be of bool type.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_shader_args_builder_set_bool (GskShaderArgsBuilder *builder,
|
||||
@ -1348,6 +1474,10 @@ gsk_shader_args_builder_set_bool (GskShaderArgsBuilder *builder,
|
||||
* Sets the value of the uniform @idx.
|
||||
*
|
||||
* The uniform must be of vec2 type.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_shader_args_builder_set_vec2 (GskShaderArgsBuilder *builder,
|
||||
@ -1376,6 +1506,10 @@ gsk_shader_args_builder_set_vec2 (GskShaderArgsBuilder *builder,
|
||||
* Sets the value of the uniform @idx.
|
||||
*
|
||||
* The uniform must be of vec3 type.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_shader_args_builder_set_vec3 (GskShaderArgsBuilder *builder,
|
||||
@ -1404,6 +1538,10 @@ gsk_shader_args_builder_set_vec3 (GskShaderArgsBuilder *builder,
|
||||
* Sets the value of the uniform @idx.
|
||||
*
|
||||
* The uniform must be of vec4 type.
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gsk_shader_args_builder_set_vec4 (GskShaderArgsBuilder *builder,
|
||||
@ -1422,3 +1560,5 @@ gsk_shader_args_builder_set_vec4 (GskShaderArgsBuilder *builder,
|
||||
args_dest = builder->data + u->offset;
|
||||
graphene_vec4_to_float (value, (float *)args_dest);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <gsk/gsktypes.h>
|
||||
#include <gsk/gskenums.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GSK_TYPE_SHADER_ARGS_BUILDER (gsk_shader_args_builder_get_type ())
|
||||
@ -36,126 +38,127 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* An object to build the uniforms data for a `GskGLShader`.
|
||||
*/
|
||||
typedef struct _GskShaderArgsBuilder GskShaderArgsBuilder;
|
||||
typedef struct _GskGLShader GskGLShader GDK_DEPRECATED_TYPE_IN_4_16_FOR(GtkGLArea);
|
||||
typedef struct _GskShaderArgsBuilder GskShaderArgsBuilder GDK_DEPRECATED_TYPE_IN_4_16_FOR(GtkGLArea);
|
||||
|
||||
#define GSK_TYPE_GL_SHADER (gsk_gl_shader_get_type ())
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
G_DECLARE_FINAL_TYPE (GskGLShader, gsk_gl_shader, GSK, GL_SHADER, GObject)
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GskGLShader * gsk_gl_shader_new_from_bytes (GBytes *sourcecode);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GskGLShader * gsk_gl_shader_new_from_resource (const char *resource_path);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
gboolean gsk_gl_shader_compile (GskGLShader *shader,
|
||||
GskRenderer *renderer,
|
||||
GError **error);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GBytes * gsk_gl_shader_get_source (GskGLShader *shader);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
const char * gsk_gl_shader_get_resource (GskGLShader *shader);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
int gsk_gl_shader_get_n_textures (GskGLShader *shader);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
int gsk_gl_shader_get_n_uniforms (GskGLShader *shader);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
const char * gsk_gl_shader_get_uniform_name (GskGLShader *shader,
|
||||
int idx);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
int gsk_gl_shader_find_uniform_by_name (GskGLShader *shader,
|
||||
const char *name);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GskGLUniformType gsk_gl_shader_get_uniform_type (GskGLShader *shader,
|
||||
int idx);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
int gsk_gl_shader_get_uniform_offset (GskGLShader *shader,
|
||||
int idx);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
gsize gsk_gl_shader_get_args_size (GskGLShader *shader);
|
||||
|
||||
|
||||
/* Helpers for managing shader args */
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GBytes * gsk_gl_shader_format_args_va (GskGLShader *shader,
|
||||
va_list uniforms);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GBytes * gsk_gl_shader_format_args (GskGLShader *shader,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
float gsk_gl_shader_get_arg_float (GskGLShader *shader,
|
||||
GBytes *args,
|
||||
int idx);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
gint32 gsk_gl_shader_get_arg_int (GskGLShader *shader,
|
||||
GBytes *args,
|
||||
int idx);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
guint32 gsk_gl_shader_get_arg_uint (GskGLShader *shader,
|
||||
GBytes *args,
|
||||
int idx);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
gboolean gsk_gl_shader_get_arg_bool (GskGLShader *shader,
|
||||
GBytes *args,
|
||||
int idx);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_gl_shader_get_arg_vec2 (GskGLShader *shader,
|
||||
GBytes *args,
|
||||
int idx,
|
||||
graphene_vec2_t *out_value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_gl_shader_get_arg_vec3 (GskGLShader *shader,
|
||||
GBytes *args,
|
||||
int idx,
|
||||
graphene_vec3_t *out_value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_gl_shader_get_arg_vec4 (GskGLShader *shader,
|
||||
GBytes *args,
|
||||
int idx,
|
||||
graphene_vec4_t *out_value);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GType gsk_shader_args_builder_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GskShaderArgsBuilder *gsk_shader_args_builder_new (GskGLShader *shader,
|
||||
GBytes *initial_values);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GBytes * gsk_shader_args_builder_to_args (GskShaderArgsBuilder *builder);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GBytes * gsk_shader_args_builder_free_to_args (GskShaderArgsBuilder *builder);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GskShaderArgsBuilder *gsk_shader_args_builder_ref (GskShaderArgsBuilder *builder);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_shader_args_builder_unref (GskShaderArgsBuilder *builder);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_shader_args_builder_set_float (GskShaderArgsBuilder *builder,
|
||||
int idx,
|
||||
float value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_shader_args_builder_set_int (GskShaderArgsBuilder *builder,
|
||||
int idx,
|
||||
gint32 value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_shader_args_builder_set_uint (GskShaderArgsBuilder *builder,
|
||||
int idx,
|
||||
guint32 value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_shader_args_builder_set_bool (GskShaderArgsBuilder *builder,
|
||||
int idx,
|
||||
gboolean value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_shader_args_builder_set_vec2 (GskShaderArgsBuilder *builder,
|
||||
int idx,
|
||||
const graphene_vec2_t *value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_shader_args_builder_set_vec3 (GskShaderArgsBuilder *builder,
|
||||
int idx,
|
||||
const graphene_vec3_t *value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gsk_shader_args_builder_set_vec4 (GskShaderArgsBuilder *builder,
|
||||
int idx,
|
||||
const graphene_vec4_t *value);
|
||||
@ -163,3 +166,4 @@ void gsk_shader_args_builder_set_vec4 (GskShaderArgsBuilder *builder,
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <gsk/gskglshader.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct {
|
||||
@ -15,3 +17,5 @@ const GskGLUniform *gsk_gl_shader_get_uniforms (GskGLShader *shader,
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
|
@ -196,7 +196,7 @@ typedef struct _GskCrossFadeNode GskCrossFadeNode;
|
||||
typedef struct _GskTextNode GskTextNode;
|
||||
typedef struct _GskBlurNode GskBlurNode;
|
||||
typedef struct _GskMaskNode GskMaskNode;
|
||||
typedef struct _GskGLShaderNode GskGLShaderNode;
|
||||
typedef struct _GskGLShaderNode GskGLShaderNode GDK_DEPRECATED_TYPE_IN_4_16_FOR(GtkGLArea);
|
||||
typedef struct _GskSubsurfaceNode GskSubsurfaceNode;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@ -574,24 +574,28 @@ GskRenderNode * gsk_mask_node_get_mask (const GskRender
|
||||
GDK_AVAILABLE_IN_4_10
|
||||
GskMaskMode gsk_mask_node_get_mask_mode (const GskRenderNode *node);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GType gsk_gl_shader_node_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GskRenderNode * gsk_gl_shader_node_new (GskGLShader *shader,
|
||||
const graphene_rect_t *bounds,
|
||||
GBytes *args,
|
||||
GskRenderNode **children,
|
||||
guint n_children);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
guint gsk_gl_shader_node_get_n_children (const GskRenderNode *node) G_GNUC_PURE;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GskRenderNode * gsk_gl_shader_node_get_child (const GskRenderNode *node,
|
||||
guint idx) G_GNUC_PURE;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GBytes * gsk_gl_shader_node_get_args (const GskRenderNode *node) G_GNUC_PURE;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
GskGLShader * gsk_gl_shader_node_get_shader (const GskRenderNode *node) G_GNUC_PURE;
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
GType gsk_subsurface_node_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
|
@ -6717,6 +6717,7 @@ gsk_debug_node_get_message (const GskRenderNode *node)
|
||||
/* }}} */
|
||||
/* {{{ GSK_GL_SHADER_NODE */
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
/**
|
||||
* GskGLShaderNode:
|
||||
*
|
||||
@ -6826,6 +6827,10 @@ gsk_gl_shader_node_class_init (gpointer g_class,
|
||||
* renderer before using it.
|
||||
*
|
||||
* Returns: (transfer full) (type GskGLShaderNode): A new `GskRenderNode`
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GskRenderNode *
|
||||
gsk_gl_shader_node_new (GskGLShader *shader,
|
||||
@ -6877,6 +6882,10 @@ gsk_gl_shader_node_new (GskGLShader *shader,
|
||||
* Returns the number of children
|
||||
*
|
||||
* Returns: The number of children
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
guint
|
||||
gsk_gl_shader_node_get_n_children (const GskRenderNode *node)
|
||||
@ -6894,6 +6903,10 @@ gsk_gl_shader_node_get_n_children (const GskRenderNode *node)
|
||||
* Gets one of the children.
|
||||
*
|
||||
* Returns: (transfer none): the @idx'th child of @node
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GskRenderNode *
|
||||
gsk_gl_shader_node_get_child (const GskRenderNode *node,
|
||||
@ -6927,6 +6940,10 @@ gsk_gl_shader_node_get_shader (const GskRenderNode *node)
|
||||
* Gets args for the node.
|
||||
*
|
||||
* Returns: (transfer none): A `GBytes` with the uniform arguments
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [GtkGLArea](../gtk4/class.GLArea.html)
|
||||
* for OpenGL rendering.
|
||||
*/
|
||||
GBytes *
|
||||
gsk_gl_shader_node_get_args (const GskRenderNode *node)
|
||||
@ -6935,6 +6952,7 @@ gsk_gl_shader_node_get_args (const GskRenderNode *node)
|
||||
|
||||
return self->args;
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
/* }}} */
|
||||
/* {{{ GSK_SUBSURFACE_NODE */
|
||||
@ -7283,10 +7301,12 @@ gsk_render_node_init_types_once (void)
|
||||
gsk_mask_node_class_init);
|
||||
gsk_render_node_types[GSK_MASK_NODE] = node_type;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
node_type = gsk_render_node_type_register_static (I_("GskGLShaderNode"),
|
||||
sizeof (GskGLShaderNode),
|
||||
gsk_gl_shader_node_class_init);
|
||||
gsk_render_node_types[GSK_GL_SHADER_NODE] = node_type;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
node_type = gsk_render_node_type_register_static (I_("GskDebugNode"),
|
||||
sizeof (GskDebugNode),
|
||||
|
@ -1645,6 +1645,7 @@ parse_inset_shadow_node (GtkCssParser *parser,
|
||||
return gsk_inset_shadow_node_new (&outline, &color, dx, dy, spread, blur);
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
typedef union {
|
||||
gint32 i;
|
||||
double v[4];
|
||||
@ -1887,6 +1888,7 @@ parse_glshader_node (GtkCssParser *parser,
|
||||
|
||||
return node;
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
static GskRenderNode *
|
||||
parse_mask_node (GtkCssParser *parser,
|
||||
@ -3113,12 +3115,14 @@ printer_init_duplicates_for_node (Printer *printer,
|
||||
|
||||
case GSK_GL_SHADER_NODE:
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < gsk_gl_shader_node_get_n_children (node); i++)
|
||||
{
|
||||
printer_init_duplicates_for_node (printer, gsk_gl_shader_node_get_child (node, i));
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
break;
|
||||
|
||||
@ -4294,6 +4298,7 @@ render_node_print (Printer *p,
|
||||
|
||||
case GSK_GL_SHADER_NODE:
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GskGLShader *shader = gsk_gl_shader_node_get_shader (node);
|
||||
GBytes *args = gsk_gl_shader_node_get_args (node);
|
||||
|
||||
@ -4407,6 +4412,7 @@ render_node_print (Printer *p,
|
||||
}
|
||||
|
||||
end_node (p);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -91,6 +91,7 @@ struct _GtkSnapshotState {
|
||||
struct {
|
||||
graphene_rect_t bounds;
|
||||
} clip;
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
struct {
|
||||
GskGLShader *shader;
|
||||
GBytes *args;
|
||||
@ -98,6 +99,7 @@ struct _GtkSnapshotState {
|
||||
GskRenderNode **nodes;
|
||||
GskRenderNode *internal_nodes[4];
|
||||
} glshader;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
struct {
|
||||
graphene_rect_t bounds;
|
||||
int node_idx;
|
||||
@ -917,6 +919,8 @@ gtk_snapshot_push_clip (GtkSnapshot *snapshot,
|
||||
gtk_graphene_rect_scale_affine (bounds, scale_x, scale_y, dx, dy, &state->data.clip.bounds);
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static GskRenderNode *
|
||||
gtk_snapshot_collect_gl_shader (GtkSnapshot *snapshot,
|
||||
GtkSnapshotState *state,
|
||||
@ -1045,6 +1049,10 @@ gtk_snapshot_collect_gl_shader_texture (GtkSnapshot *snapshot,
|
||||
* re-rendered.
|
||||
*
|
||||
* For details on how to write shaders, see [class@Gsk.GLShader].
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [class@Gtk.GLArea] for
|
||||
* OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gtk_snapshot_push_gl_shader (GtkSnapshot *snapshot,
|
||||
@ -1126,6 +1134,8 @@ gtk_snapshot_collect_rounded_clip (GtkSnapshot *snapshot,
|
||||
return clip_node;
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* gtk_snapshot_push_rounded_clip:
|
||||
* @snapshot: a `GtkSnapshot`
|
||||
@ -1956,6 +1966,10 @@ gtk_snapshot_pop (GtkSnapshot *snapshot)
|
||||
* This must be called the same number of times as the number
|
||||
* of textures is needed for the shader in
|
||||
* [method@Gtk.Snapshot.push_gl_shader].
|
||||
*
|
||||
* Deprecated: 4.16: GTK's new Vulkan-focused rendering
|
||||
* does not support this feature. Use [class@Gtk.GLArea] for
|
||||
* OpenGL rendering.
|
||||
*/
|
||||
void
|
||||
gtk_snapshot_gl_shader_pop_texture (GtkSnapshot *snapshot)
|
||||
|
@ -109,13 +109,15 @@ void gtk_snapshot_push_mask (GtkSnapshot
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_snapshot_push_cross_fade (GtkSnapshot *snapshot,
|
||||
double progress);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gtk_snapshot_push_gl_shader (GtkSnapshot *snapshot,
|
||||
GskGLShader *shader,
|
||||
const graphene_rect_t *bounds,
|
||||
GBytes *take_args);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_16_FOR(GtkGLArea)
|
||||
void gtk_snapshot_gl_shader_pop_texture (GtkSnapshot *snapshot);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_snapshot_pop (GtkSnapshot *snapshot);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
@ -328,6 +328,7 @@ create_list_model_for_render_node (GskRenderNode *node)
|
||||
|
||||
case GSK_GL_SHADER_NODE:
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GListStore *store = g_list_store_new (GDK_TYPE_PAINTABLE);
|
||||
|
||||
for (guint i = 0; i < gsk_gl_shader_node_get_n_children (node); i++)
|
||||
@ -343,6 +344,7 @@ create_list_model_for_render_node (GskRenderNode *node)
|
||||
}
|
||||
|
||||
return G_LIST_MODEL (store);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
case GSK_CONTAINER_NODE:
|
||||
@ -1240,6 +1242,7 @@ populate_render_node_properties (GListStore *store,
|
||||
|
||||
case GSK_GL_SHADER_NODE:
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GskGLShader *shader = gsk_gl_shader_node_get_shader (node);
|
||||
GBytes *args = gsk_gl_shader_node_get_args (node);
|
||||
int i;
|
||||
@ -1315,6 +1318,7 @@ populate_render_node_properties (GListStore *store,
|
||||
}
|
||||
g_free (title);
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -142,6 +142,7 @@ node_attach (const GskRenderNode *node,
|
||||
|
||||
case GSK_GL_SHADER_NODE:
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GskRenderNode **children;
|
||||
|
||||
children = g_newa (GskRenderNode *, gsk_gl_shader_node_get_n_children (node));
|
||||
@ -155,6 +156,7 @@ node_attach (const GskRenderNode *node,
|
||||
for (int i = 0; i < gsk_gl_shader_node_get_n_children (node); i++)
|
||||
gsk_render_node_unref (children[i]);
|
||||
return res;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
case GSK_MASK_NODE:
|
||||
|
@ -191,7 +191,9 @@ test_renderer (GskRenderer *renderer)
|
||||
GdkSurface *surface;
|
||||
gboolean res;
|
||||
GError *error = NULL;
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GskGLShader *shader;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
GBytes *bytes;
|
||||
|
||||
g_assert (GSK_IS_RENDERER (renderer));
|
||||
@ -217,6 +219,7 @@ test_renderer (GskRenderer *renderer)
|
||||
g_assert_true (gsk_renderer_is_realized (renderer));
|
||||
g_assert_true (gsk_renderer_get_surface (renderer) == surface);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
bytes = g_bytes_new_static (shader1, sizeof (shader1));
|
||||
shader = gsk_gl_shader_new_from_bytes (bytes);
|
||||
g_bytes_unref (bytes);
|
||||
@ -232,6 +235,7 @@ test_renderer (GskRenderer *renderer)
|
||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
gsk_renderer_unrealize (renderer);
|
||||
|
||||
|
@ -302,6 +302,7 @@ replay_debug_node (GskRenderNode *node, GtkSnapshot *snapshot)
|
||||
static void
|
||||
replay_gl_shader_node (GskRenderNode *node, GtkSnapshot *snapshot)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
graphene_rect_t bounds;
|
||||
gsk_render_node_get_bounds (node, &bounds);
|
||||
GskGLShader *shader = gsk_gl_shader_node_get_shader (node);
|
||||
@ -315,6 +316,7 @@ replay_gl_shader_node (GskRenderNode *node, GtkSnapshot *snapshot)
|
||||
gtk_snapshot_gl_shader_pop_texture (snapshot);
|
||||
}
|
||||
gtk_snapshot_pop (snapshot);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/* shader fragment as found in nature */
|
||||
const char shader0[] =
|
||||
"// author: bobylito\n"
|
||||
@ -303,3 +305,5 @@ main (int argc,
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
@ -129,12 +129,14 @@ test_type (gconstpointer data)
|
||||
GBytes *bytes = g_bytes_new_static (pixels, sizeof (pixels));
|
||||
instance = (GObject *) gdk_memory_texture_new (1, 1, GDK_MEMORY_DEFAULT, bytes, 4);
|
||||
g_bytes_unref (bytes);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else if (g_type_is_a (type, GSK_TYPE_GL_SHADER))
|
||||
{
|
||||
GBytes *bytes = g_bytes_new_static ("", 0);
|
||||
instance = g_object_new (type, "source", bytes, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else if (g_type_is_a (type, GDK_TYPE_CLIPBOARD) ||
|
||||
g_str_equal (g_type_name (type), "GdkX11Cursor"))
|
||||
@ -193,10 +195,12 @@ test_type (gconstpointer data)
|
||||
strcmp (pspec->name, "display") == 0)
|
||||
check = FALSE;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
/* set in the constructor */
|
||||
if (g_type_is_a (type, GSK_TYPE_GL_SHADER) &&
|
||||
strcmp (pspec->name, "source") == 0)
|
||||
check = FALSE;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
/* This one has a special-purpose default value */
|
||||
if (g_type_is_a (type, GTK_TYPE_DIALOG) &&
|
||||
|
@ -555,12 +555,14 @@ test_type (gconstpointer data)
|
||||
GBytes *bytes = g_bytes_new_static (pixels, sizeof (pixels));
|
||||
instance = (GObject *) gdk_memory_texture_new (1, 1, GDK_MEMORY_DEFAULT, bytes, 4);
|
||||
g_bytes_unref (bytes);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else if (g_type_is_a (type, GSK_TYPE_GL_SHADER))
|
||||
{
|
||||
GBytes *bytes = g_bytes_new_static ("", 0);
|
||||
instance = g_object_new (type, "source", bytes, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else if (g_type_is_a (type, GTK_TYPE_FILTER_LIST_MODEL) ||
|
||||
g_type_is_a (type, GTK_TYPE_NO_SELECTION) ||
|
||||
|
@ -75,12 +75,14 @@ test_finalize_object (gconstpointer data)
|
||||
GBytes *bytes = g_bytes_new_static (pixels, sizeof (pixels));
|
||||
object = (GObject *) gdk_memory_texture_new (1, 1, GDK_MEMORY_DEFAULT, bytes, 4);
|
||||
g_bytes_unref (bytes);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else if (g_type_is_a (test_type, GSK_TYPE_GL_SHADER))
|
||||
{
|
||||
GBytes *bytes = g_bytes_new_static ("", 0);
|
||||
object = g_object_new (test_type, "source", bytes, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else if (g_type_is_a (test_type, GTK_TYPE_FILTER_LIST_MODEL) ||
|
||||
g_type_is_a (test_type, GTK_TYPE_NO_SELECTION) ||
|
||||
|
@ -236,8 +236,10 @@ extract_from_node (GskRenderNode *node)
|
||||
break;
|
||||
|
||||
case GSK_GL_SHADER_NODE:
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
for (unsigned int i = 0; i < gsk_gl_shader_node_get_n_children (node); i++)
|
||||
extract_from_node (gsk_gl_shader_node_get_child (node, i));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
break;
|
||||
|
||||
case GSK_MASK_NODE:
|
||||
|
@ -116,11 +116,13 @@ count_nodes (GskRenderNode *node,
|
||||
break;
|
||||
|
||||
case GSK_GL_SHADER_NODE:
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
for (unsigned int i = 0; i < gsk_gl_shader_node_get_n_children (node); i++)
|
||||
{
|
||||
count_nodes (gsk_gl_shader_node_get_child (node, i), counts, &dd);
|
||||
d = MAX (d, dd);
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
break;
|
||||
|
||||
case GSK_TEXTURE_SCALE_NODE:
|
||||
|
Loading…
Reference in New Issue
Block a user