forked from AuroraMiddleware/gtk
Partially revert GskTexture → GdkTexture rename
Excessive use of sed when moving GskTexture to GDK; the GskTextureNode should still live under the GSK namespace.
This commit is contained in:
parent
c5a631b999
commit
481b5d1b89
@ -43,8 +43,8 @@ gsk_render_node_get_bounds
|
||||
<SUBSECTION Nodes>
|
||||
gsk_color_node_new
|
||||
gsk_color_node_peek_color
|
||||
gdk_texture_node_new
|
||||
gdk_texture_node_get_texture
|
||||
gsk_texture_node_new
|
||||
gsk_texture_node_get_texture
|
||||
gsk_linear_gradient_node_new
|
||||
gsk_linear_gradient_node_peek_start
|
||||
gsk_linear_gradient_node_peek_end
|
||||
|
@ -31,7 +31,7 @@
|
||||
* @GSK_LINEAR_GRADIENT_NODE: A node drawing a linear gradient
|
||||
* @GSK_REPEATING_LINEAR_GRADIENT_NODE: A node drawing a repeating linear gradient
|
||||
* @GSK_BORDER_NODE: A node stroking a border around an area
|
||||
* @GDK_TEXTURE_NODE: A node drawing a #GdkTexture
|
||||
* @GSK_TEXTURE_NODE: A node drawing a #GdkTexture
|
||||
* @GSK_INSET_SHADOW_NODE: A node drawing an inset shadow
|
||||
* @GSK_OUTSET_SHADOW_NODE: A node drawing an outset shadow
|
||||
* @GSK_TRANSFORM_NODE: A node that renders its child after applying a matrix transform
|
||||
@ -58,7 +58,7 @@ typedef enum {
|
||||
GSK_LINEAR_GRADIENT_NODE,
|
||||
GSK_REPEATING_LINEAR_GRADIENT_NODE,
|
||||
GSK_BORDER_NODE,
|
||||
GDK_TEXTURE_NODE,
|
||||
GSK_TEXTURE_NODE,
|
||||
GSK_INSET_SHADOW_NODE,
|
||||
GSK_OUTSET_SHADOW_NODE,
|
||||
GSK_TRANSFORM_NODE,
|
||||
|
@ -798,9 +798,9 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self,
|
||||
|
||||
switch (gsk_render_node_get_node_type (node))
|
||||
{
|
||||
case GDK_TEXTURE_NODE:
|
||||
case GSK_TEXTURE_NODE:
|
||||
{
|
||||
GdkTexture *texture = gdk_texture_node_get_texture (node);
|
||||
GdkTexture *texture = gsk_texture_node_get_texture (node);
|
||||
int gl_min_filter = GL_NEAREST, gl_mag_filter = GL_NEAREST;
|
||||
|
||||
get_gl_scaling_filters (node, &gl_min_filter, &gl_mag_filter);
|
||||
|
@ -101,10 +101,10 @@ GDK_AVAILABLE_IN_3_94
|
||||
const GdkRGBA * gsk_color_node_peek_color (GskRenderNode *node);
|
||||
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
GskRenderNode * gdk_texture_node_new (GdkTexture *texture,
|
||||
GskRenderNode * gsk_texture_node_new (GdkTexture *texture,
|
||||
const graphene_rect_t *bounds);
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
GdkTexture * gdk_texture_node_get_texture (GskRenderNode *node);
|
||||
GdkTexture * gsk_texture_node_get_texture (GskRenderNode *node);
|
||||
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
GskRenderNode * gsk_linear_gradient_node_new (const graphene_rect_t *bounds,
|
||||
|
@ -655,11 +655,11 @@ gsk_border_node_new (const GskRoundedRect *outline,
|
||||
return &self->render_node;
|
||||
}
|
||||
|
||||
/*** GDK_TEXTURE_NODE ***/
|
||||
/*** GSK_TEXTURE_NODE ***/
|
||||
|
||||
typedef struct _GdkTextureNode GdkTextureNode;
|
||||
typedef struct _GskTextureNode GskTextureNode;
|
||||
|
||||
struct _GdkTextureNode
|
||||
struct _GskTextureNode
|
||||
{
|
||||
GskRenderNode render_node;
|
||||
|
||||
@ -667,18 +667,18 @@ struct _GdkTextureNode
|
||||
};
|
||||
|
||||
static void
|
||||
gdk_texture_node_finalize (GskRenderNode *node)
|
||||
gsk_texture_node_finalize (GskRenderNode *node)
|
||||
{
|
||||
GdkTextureNode *self = (GdkTextureNode *) node;
|
||||
GskTextureNode *self = (GskTextureNode *) node;
|
||||
|
||||
g_object_unref (self->texture);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_texture_node_draw (GskRenderNode *node,
|
||||
gsk_texture_node_draw (GskRenderNode *node,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GdkTextureNode *self = (GdkTextureNode *) node;
|
||||
GskTextureNode *self = (GskTextureNode *) node;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
surface = gdk_texture_download_surface (self->texture);
|
||||
@ -698,12 +698,12 @@ gdk_texture_node_draw (GskRenderNode *node,
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
#define GDK_TEXTURE_NODE_VARIANT_TYPE "(dddduuau)"
|
||||
#define GSK_TEXTURE_NODE_VARIANT_TYPE "(dddduuau)"
|
||||
|
||||
static GVariant *
|
||||
gdk_texture_node_serialize (GskRenderNode *node)
|
||||
gsk_texture_node_serialize (GskRenderNode *node)
|
||||
{
|
||||
GdkTextureNode *self = (GdkTextureNode *) node;
|
||||
GskTextureNode *self = (GskTextureNode *) node;
|
||||
cairo_surface_t *surface;
|
||||
GVariant *result;
|
||||
|
||||
@ -728,7 +728,7 @@ gdk_texture_node_serialize (GskRenderNode *node)
|
||||
}
|
||||
|
||||
static GskRenderNode *
|
||||
gdk_texture_node_deserialize (GVariant *variant,
|
||||
gsk_texture_node_deserialize (GVariant *variant,
|
||||
GError **error)
|
||||
{
|
||||
GskRenderNode *node;
|
||||
@ -738,7 +738,7 @@ gdk_texture_node_deserialize (GVariant *variant,
|
||||
GVariant *pixel_variant;
|
||||
gsize n_pixels;
|
||||
|
||||
if (!check_variant_type (variant, GDK_TEXTURE_NODE_VARIANT_TYPE, error))
|
||||
if (!check_variant_type (variant, GSK_TEXTURE_NODE_VARIANT_TYPE, error))
|
||||
return NULL;
|
||||
|
||||
g_variant_get (variant, "(dddduu@au)",
|
||||
@ -750,35 +750,35 @@ gdk_texture_node_deserialize (GVariant *variant,
|
||||
width, height, width * 4);
|
||||
g_variant_unref (pixel_variant);
|
||||
|
||||
node = gdk_texture_node_new (texture, &GRAPHENE_RECT_INIT(bounds[0], bounds[1], bounds[2], bounds[3]));
|
||||
node = gsk_texture_node_new (texture, &GRAPHENE_RECT_INIT(bounds[0], bounds[1], bounds[2], bounds[3]));
|
||||
|
||||
g_object_unref (texture);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
static const GskRenderNodeClass GDK_TEXTURE_NODE_CLASS = {
|
||||
GDK_TEXTURE_NODE,
|
||||
sizeof (GdkTextureNode),
|
||||
"GdkTextureNode",
|
||||
gdk_texture_node_finalize,
|
||||
gdk_texture_node_draw,
|
||||
gdk_texture_node_serialize,
|
||||
gdk_texture_node_deserialize
|
||||
static const GskRenderNodeClass GSK_TEXTURE_NODE_CLASS = {
|
||||
GSK_TEXTURE_NODE,
|
||||
sizeof (GskTextureNode),
|
||||
"GskTextureNode",
|
||||
gsk_texture_node_finalize,
|
||||
gsk_texture_node_draw,
|
||||
gsk_texture_node_serialize,
|
||||
gsk_texture_node_deserialize
|
||||
};
|
||||
|
||||
GdkTexture *
|
||||
gdk_texture_node_get_texture (GskRenderNode *node)
|
||||
gsk_texture_node_get_texture (GskRenderNode *node)
|
||||
{
|
||||
GdkTextureNode *self = (GdkTextureNode *) node;
|
||||
GskTextureNode *self = (GskTextureNode *) node;
|
||||
|
||||
g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GDK_TEXTURE_NODE), 0);
|
||||
g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_TEXTURE_NODE), 0);
|
||||
|
||||
return self->texture;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_texture_node_new:
|
||||
* gsk_texture_node_new:
|
||||
* @texture: the #GdkTexture
|
||||
* @bounds: the rectangle to render the texture into
|
||||
*
|
||||
@ -790,15 +790,15 @@ gdk_texture_node_get_texture (GskRenderNode *node)
|
||||
* Since: 3.90
|
||||
*/
|
||||
GskRenderNode *
|
||||
gdk_texture_node_new (GdkTexture *texture,
|
||||
gsk_texture_node_new (GdkTexture *texture,
|
||||
const graphene_rect_t *bounds)
|
||||
{
|
||||
GdkTextureNode *self;
|
||||
GskTextureNode *self;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_TEXTURE (texture), NULL);
|
||||
g_return_val_if_fail (bounds != NULL, NULL);
|
||||
|
||||
self = (GdkTextureNode *) gsk_render_node_new (&GDK_TEXTURE_NODE_CLASS, 0);
|
||||
self = (GskTextureNode *) gsk_render_node_new (&GSK_TEXTURE_NODE_CLASS, 0);
|
||||
|
||||
self->texture = g_object_ref (texture);
|
||||
graphene_rect_init_from_rect (&self->render_node.bounds, bounds);
|
||||
@ -4448,7 +4448,7 @@ static const GskRenderNodeClass *klasses[] = {
|
||||
[GSK_LINEAR_GRADIENT_NODE] = &GSK_LINEAR_GRADIENT_NODE_CLASS,
|
||||
[GSK_REPEATING_LINEAR_GRADIENT_NODE] = &GSK_REPEATING_LINEAR_GRADIENT_NODE_CLASS,
|
||||
[GSK_BORDER_NODE] = &GSK_BORDER_NODE_CLASS,
|
||||
[GDK_TEXTURE_NODE] = &GDK_TEXTURE_NODE_CLASS,
|
||||
[GSK_TEXTURE_NODE] = &GSK_TEXTURE_NODE_CLASS,
|
||||
[GSK_INSET_SHADOW_NODE] = &GSK_INSET_SHADOW_NODE_CLASS,
|
||||
[GSK_OUTSET_SHADOW_NODE] = &GSK_OUTSET_SHADOW_NODE_CLASS,
|
||||
[GSK_TRANSFORM_NODE] = &GSK_TRANSFORM_NODE_CLASS,
|
||||
|
@ -442,7 +442,7 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
|
||||
return;
|
||||
}
|
||||
|
||||
case GDK_TEXTURE_NODE:
|
||||
case GSK_TEXTURE_NODE:
|
||||
if (gsk_vulkan_clip_contains_rect (&constants->clip, &node->bounds))
|
||||
pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE;
|
||||
else if (constants->clip.type == GSK_VULKAN_CLIP_RECT)
|
||||
@ -678,11 +678,11 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self,
|
||||
|
||||
switch ((guint) gsk_render_node_get_node_type (node))
|
||||
{
|
||||
case GDK_TEXTURE_NODE:
|
||||
case GSK_TEXTURE_NODE:
|
||||
if (graphene_rect_equal (bounds, &node->bounds))
|
||||
{
|
||||
result = gsk_vulkan_renderer_ref_texture_image (GSK_VULKAN_RENDERER (gsk_vulkan_render_get_renderer (render)),
|
||||
gdk_texture_node_get_texture (node),
|
||||
gsk_texture_node_get_texture (node),
|
||||
uploader);
|
||||
gsk_vulkan_render_add_cleanup_image (render, result);
|
||||
*tex_rect = GRAPHENE_RECT_INIT(0, 0, 1, 1);
|
||||
@ -938,7 +938,7 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self,
|
||||
case GSK_VULKAN_OP_TEXTURE:
|
||||
{
|
||||
op->render.source = gsk_vulkan_renderer_ref_texture_image (GSK_VULKAN_RENDERER (gsk_vulkan_render_get_renderer (render)),
|
||||
gdk_texture_node_get_texture (op->render.node),
|
||||
gsk_texture_node_get_texture (op->render.node),
|
||||
uploader);
|
||||
op->render.source_rect = GRAPHENE_RECT_INIT(0, 0, 1, 1);
|
||||
gsk_vulkan_render_add_cleanup_image (render, op->render.source);
|
||||
|
@ -1240,7 +1240,7 @@ gtk_snapshot_append_texture (GtkSnapshot *snapshot,
|
||||
g_return_if_fail (bounds != NULL);
|
||||
|
||||
graphene_rect_offset_r (bounds, current_state->translate_x, current_state->translate_y, &real_bounds);
|
||||
node = gdk_texture_node_new (texture, &real_bounds);
|
||||
node = gsk_texture_node_new (texture, &real_bounds);
|
||||
|
||||
if (name && snapshot->record_names)
|
||||
{
|
||||
|
@ -524,7 +524,7 @@ append_node (GtkTreeModelRenderNode *nodemodel,
|
||||
|
||||
case GSK_CAIRO_NODE:
|
||||
case GSK_TEXT_NODE:
|
||||
case GDK_TEXTURE_NODE:
|
||||
case GSK_TEXTURE_NODE:
|
||||
case GSK_COLOR_NODE:
|
||||
case GSK_LINEAR_GRADIENT_NODE:
|
||||
case GSK_REPEATING_LINEAR_GRADIENT_NODE:
|
||||
|
@ -161,7 +161,7 @@ node_type_name (GskRenderNodeType type)
|
||||
return "Repeating Linear Gradient";
|
||||
case GSK_BORDER_NODE:
|
||||
return "Border";
|
||||
case GDK_TEXTURE_NODE:
|
||||
case GSK_TEXTURE_NODE:
|
||||
return "Texture";
|
||||
case GSK_INSET_SHADOW_NODE:
|
||||
return "Inset Shadow";
|
||||
@ -304,19 +304,19 @@ populate_render_node_properties (GtkListStore *store,
|
||||
|
||||
switch (gsk_render_node_get_node_type (node))
|
||||
{
|
||||
case GDK_TEXTURE_NODE:
|
||||
case GSK_TEXTURE_NODE:
|
||||
case GSK_CAIRO_NODE:
|
||||
{
|
||||
const char *text;
|
||||
cairo_surface_t *surface;
|
||||
gboolean show_inline;
|
||||
|
||||
if (gsk_render_node_get_node_type (node) == GDK_TEXTURE_NODE)
|
||||
if (gsk_render_node_get_node_type (node) == GSK_TEXTURE_NODE)
|
||||
{
|
||||
GdkTexture *texture;
|
||||
|
||||
text = "Texture";
|
||||
texture = gdk_texture_node_get_texture (node);
|
||||
texture = gsk_texture_node_get_texture (node);
|
||||
surface = gdk_texture_download_surface (texture);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user