mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
16c804c5e3
when doing get_node_as_image(), that may spawn a new buffer writer that writes into the samme buffer when rendering an offscreen with patterns. So as a more or less hacky workaround, we now abort the current buffer write and restart it once we've created the image.
64 lines
4.4 KiB
C
64 lines
4.4 KiB
C
#pragma once
|
|
|
|
#include "gskgputypesprivate.h"
|
|
#include "gskrendernode.h"
|
|
|
|
#include <graphene.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef struct _GskGpuBufferWriter GskGpuBufferWriter;
|
|
|
|
struct _GskGpuBufferWriter
|
|
{
|
|
gpointer user_data;
|
|
void (* ensure_size) (GskGpuBufferWriter *self,
|
|
gsize size);
|
|
gsize (* finish) (GskGpuBufferWriter *self,
|
|
gboolean commit);
|
|
|
|
guchar *data;
|
|
gsize initial_size;
|
|
gsize size;
|
|
gsize allocated;
|
|
};
|
|
|
|
gsize gsk_gpu_buffer_writer_commit (GskGpuBufferWriter *self);
|
|
void gsk_gpu_buffer_writer_abort (GskGpuBufferWriter *self);
|
|
|
|
gsize gsk_gpu_buffer_writer_get_size (GskGpuBufferWriter *self);
|
|
void gsk_gpu_buffer_writer_rewind (GskGpuBufferWriter *self,
|
|
gsize size);
|
|
guchar * gsk_gpu_buffer_writer_backup (GskGpuBufferWriter *self,
|
|
gsize *out_size);
|
|
void gsk_gpu_buffer_writer_ensure_size (GskGpuBufferWriter *self,
|
|
gsize size);
|
|
void gsk_gpu_buffer_writer_append (GskGpuBufferWriter *self,
|
|
gsize align,
|
|
const guchar *data,
|
|
gsize size);
|
|
|
|
void gsk_gpu_buffer_writer_append_float (GskGpuBufferWriter *self,
|
|
float f);
|
|
void gsk_gpu_buffer_writer_append_int (GskGpuBufferWriter *self,
|
|
gint32 i);
|
|
void gsk_gpu_buffer_writer_append_uint (GskGpuBufferWriter *self,
|
|
guint32 u);
|
|
void gsk_gpu_buffer_writer_append_matrix (GskGpuBufferWriter *self,
|
|
const graphene_matrix_t *matrix);
|
|
void gsk_gpu_buffer_writer_append_vec4 (GskGpuBufferWriter *self,
|
|
const graphene_vec4_t *vec4);
|
|
void gsk_gpu_buffer_writer_append_point (GskGpuBufferWriter *self,
|
|
const graphene_point_t *point,
|
|
const graphene_point_t *offset);
|
|
void gsk_gpu_buffer_writer_append_rect (GskGpuBufferWriter *self,
|
|
const graphene_rect_t *rect,
|
|
const graphene_point_t *offset);
|
|
void gsk_gpu_buffer_writer_append_rgba (GskGpuBufferWriter *self,
|
|
const GdkRGBA *rgba);
|
|
void gsk_gpu_buffer_writer_append_color_stops (GskGpuBufferWriter *self,
|
|
const GskColorStop *stops,
|
|
gsize n_stops);
|
|
|
|
G_END_DECLS
|