mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
ba7649b388
When attaching renderer-specific data, we need to make sure that we key it off the renderer that is in use, and cope with the absence of render data. This fixes recording nodes in the inspector.
60 lines
2.3 KiB
C
60 lines
2.3 KiB
C
#ifndef __GSK_RENDER_NODE_PRIVATE_H__
|
|
#define __GSK_RENDER_NODE_PRIVATE_H__
|
|
|
|
#include "gskrendernode.h"
|
|
#include <cairo.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef struct _GskRenderNodeClass GskRenderNodeClass;
|
|
|
|
#define GSK_IS_RENDER_NODE_TYPE(node,type) (GSK_IS_RENDER_NODE (node) && (node)->node_class->node_type == (type))
|
|
|
|
struct _GskRenderNode
|
|
{
|
|
const GskRenderNodeClass *node_class;
|
|
|
|
volatile int ref_count;
|
|
|
|
graphene_rect_t bounds;
|
|
};
|
|
|
|
struct _GskRenderNodeClass
|
|
{
|
|
GskRenderNodeType node_type;
|
|
gsize struct_size;
|
|
const char *type_name;
|
|
|
|
void (* finalize) (GskRenderNode *node);
|
|
void (* draw) (GskRenderNode *node,
|
|
cairo_t *cr);
|
|
gboolean (* can_diff) (GskRenderNode *node1,
|
|
GskRenderNode *node2);
|
|
void (* diff) (GskRenderNode *node1,
|
|
GskRenderNode *node2,
|
|
cairo_region_t *region);
|
|
};
|
|
|
|
GskRenderNode * gsk_render_node_new (const GskRenderNodeClass *node_class,
|
|
gsize extra_size);
|
|
|
|
gboolean gsk_render_node_can_diff (GskRenderNode *node1,
|
|
GskRenderNode *node2);
|
|
void gsk_render_node_diff (GskRenderNode *node1,
|
|
GskRenderNode *node2,
|
|
cairo_region_t *region);
|
|
void gsk_render_node_diff_impossible (GskRenderNode *node1,
|
|
GskRenderNode *node2,
|
|
cairo_region_t *region);
|
|
gboolean gsk_text_node_set_render_data (GskRenderNode *node,
|
|
gpointer key,
|
|
gpointer data);
|
|
gpointer gsk_text_node_get_render_data (GskRenderNode *node,
|
|
gpointer key);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GSK_RENDER_NODE_PRIVATE_H__ */
|