From: Benjamin Otte Date: Wed, 28 Jun 2023 02:30:35 +0000 (+0200) Subject: vulkan: Initialize ops differently X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~60^2~71 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7cf7870254dd40ccba500aa23d84fe5eed8c46ac;p=gtk4.git vulkan: Initialize ops differently Instead of creating the op manually, just pass in the renderpass and have the op created from there. This way ops aren't really initialized anymore, they are more appended to the queue, so instead of foo_op_init() we can just call the function foo_op(). --- diff --git a/gsk/vulkan/gskvulkancolormatrixop.c b/gsk/vulkan/gskvulkancolormatrixop.c index fdf00f3f21..2fcd151f1d 100644 --- a/gsk/vulkan/gskvulkancolormatrixop.c +++ b/gsk/vulkan/gskvulkancolormatrixop.c @@ -124,25 +124,19 @@ static const GskVulkanOpClass GSK_VULKAN_COLOR_MATRIX_OP_CLASS = { gsk_vulkan_color_matrix_op_command }; -gsize -gsk_vulkan_color_matrix_op_size (void) -{ - return GSK_VULKAN_COLOR_MATRIX_OP_CLASS.size; -} - void -gsk_vulkan_color_matrix_op_init (GskVulkanOp *op, - GskVulkanPipeline *pipeline, - GskVulkanImage *image, - const graphene_rect_t *rect, - const graphene_point_t *offset, - const graphene_rect_t *tex_rect, - const graphene_matrix_t *color_matrix, - const graphene_vec4_t *color_offset) +gsk_vulkan_color_matrix_op (GskVulkanRenderPass *render_pass, + GskVulkanPipeline *pipeline, + GskVulkanImage *image, + const graphene_rect_t *rect, + const graphene_point_t *offset, + const graphene_rect_t *tex_rect, + const graphene_matrix_t *color_matrix, + const graphene_vec4_t *color_offset) { - GskVulkanColorMatrixOp *self = (GskVulkanColorMatrixOp *) op; + GskVulkanColorMatrixOp *self; - gsk_vulkan_op_init (op, &GSK_VULKAN_COLOR_MATRIX_OP_CLASS); + self = (GskVulkanColorMatrixOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_COLOR_MATRIX_OP_CLASS); self->pipeline = pipeline; self->image = g_object_ref (image); diff --git a/gsk/vulkan/gskvulkancolormatrixopprivate.h b/gsk/vulkan/gskvulkancolormatrixopprivate.h index 3e6f104b76..0304ad21e8 100644 --- a/gsk/vulkan/gskvulkancolormatrixopprivate.h +++ b/gsk/vulkan/gskvulkancolormatrixopprivate.h @@ -4,9 +4,7 @@ G_BEGIN_DECLS -gsize gsk_vulkan_color_matrix_op_size (void) G_GNUC_CONST; - -void gsk_vulkan_color_matrix_op_init (GskVulkanOp *op, +void gsk_vulkan_color_matrix_op (GskVulkanRenderPass *render_pass, GskVulkanPipeline *pipeline, GskVulkanImage *image, const graphene_rect_t *rect, diff --git a/gsk/vulkan/gskvulkanoffscreenop.c b/gsk/vulkan/gskvulkanoffscreenop.c index 8bf4e7181d..6712580266 100644 --- a/gsk/vulkan/gskvulkanoffscreenop.c +++ b/gsk/vulkan/gskvulkanoffscreenop.c @@ -90,22 +90,16 @@ static const GskVulkanOpClass GSK_VULKAN_OFFSCREEN_OP_CLASS = { gsk_vulkan_offscreen_op_command }; -gsize -gsk_vulkan_offscreen_op_size (void) -{ - return GSK_VULKAN_OFFSCREEN_OP_CLASS.size; -} - GskVulkanImage * -gsk_vulkan_offscreen_op_init (GskVulkanOp *op, - GdkVulkanContext *context, - GskVulkanRender *render, - const graphene_vec2_t *scale, - const graphene_rect_t *viewport, - VkSemaphore signal_semaphore, - GskRenderNode *node) +gsk_vulkan_offscreen_op (GskVulkanRenderPass *render_pass, + GdkVulkanContext *context, + GskVulkanRender *render, + const graphene_vec2_t *scale, + const graphene_rect_t *viewport, + VkSemaphore signal_semaphore, + GskRenderNode *node) { - GskVulkanOffscreenOp *self = (GskVulkanOffscreenOp *) op; + GskVulkanOffscreenOp *self; graphene_rect_t view; cairo_region_t *clip; float scale_x, scale_y; @@ -117,7 +111,7 @@ gsk_vulkan_offscreen_op_init (GskVulkanOp *op, ceil (scale_x * viewport->size.width), ceil (scale_y * viewport->size.height)); - gsk_vulkan_op_init (op, &GSK_VULKAN_OFFSCREEN_OP_CLASS); + self = (GskVulkanOffscreenOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_OFFSCREEN_OP_CLASS); self->image = gsk_vulkan_image_new_for_offscreen (context, gdk_vulkan_context_get_offscreen_format (context, diff --git a/gsk/vulkan/gskvulkanoffscreenopprivate.h b/gsk/vulkan/gskvulkanoffscreenopprivate.h index 16687ead35..bb43dfb075 100644 --- a/gsk/vulkan/gskvulkanoffscreenopprivate.h +++ b/gsk/vulkan/gskvulkanoffscreenopprivate.h @@ -4,9 +4,7 @@ G_BEGIN_DECLS -gsize gsk_vulkan_offscreen_op_size (void) G_GNUC_CONST; - -GskVulkanImage * gsk_vulkan_offscreen_op_init (GskVulkanOp *op, +GskVulkanImage * gsk_vulkan_offscreen_op (GskVulkanRenderPass *render_pass, GdkVulkanContext *context, GskVulkanRender *render, const graphene_vec2_t *scale, diff --git a/gsk/vulkan/gskvulkanop.c b/gsk/vulkan/gskvulkanop.c index d0e38fad77..a8e304d13f 100644 --- a/gsk/vulkan/gskvulkanop.c +++ b/gsk/vulkan/gskvulkanop.c @@ -2,11 +2,17 @@ #include "gskvulkanopprivate.h" -void -gsk_vulkan_op_init (GskVulkanOp *op, - const GskVulkanOpClass *op_class) +GskVulkanOp * +gsk_vulkan_op_alloc (GskVulkanRenderPass *render_pass, + const GskVulkanOpClass *op_class) { + GskVulkanOp *op; + + op = gsk_vulkan_render_pass_alloc_op (render_pass, + op_class->size); op->op_class = op_class; + + return op; } void diff --git a/gsk/vulkan/gskvulkanopprivate.h b/gsk/vulkan/gskvulkanopprivate.h index f99a90a217..e943e9c466 100644 --- a/gsk/vulkan/gskvulkanopprivate.h +++ b/gsk/vulkan/gskvulkanopprivate.h @@ -12,6 +12,8 @@ typedef struct _GskVulkanOpClass GskVulkanOpClass; struct _GskVulkanOp { const GskVulkanOpClass *op_class; + + VkPipeline pipeline; }; struct _GskVulkanOpClass @@ -44,7 +46,7 @@ struct _GskVulkanOpClass /* ensures alignment of ops to multipes of 16 bytes - and that makes graphene happy */ #define GSK_VULKAN_OP_SIZE(struct_name) ((sizeof(struct_name) + 15) & ~15) -void gsk_vulkan_op_init (GskVulkanOp *op, +GskVulkanOp * gsk_vulkan_op_alloc (GskVulkanRenderPass *render_pass, const GskVulkanOpClass *op_class); void gsk_vulkan_op_finish (GskVulkanOp *op); diff --git a/gsk/vulkan/gskvulkanrenderpass.c b/gsk/vulkan/gskvulkanrenderpass.c index 9ef656eaef..0f6a236ea9 100644 --- a/gsk/vulkan/gskvulkanrenderpass.c +++ b/gsk/vulkan/gskvulkanrenderpass.c @@ -290,7 +290,7 @@ round_up (gsize number, gsize divisor) return (number + divisor - 1) / divisor * divisor; } -static gpointer +gpointer gsk_vulkan_render_pass_alloc_op (GskVulkanRenderPass *self, gsize size) { @@ -316,8 +316,7 @@ gsk_vulkan_render_pass_append_scissor (GskVulkanRenderPass *self, GskRenderNode *node, const GskVulkanParseState *state) { - gsk_vulkan_scissor_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_scissor_op_size ()), - &state->scissor); + gsk_vulkan_scissor_op (self, &state->scissor); } static void @@ -377,9 +376,7 @@ gsk_vulkan_render_pass_get_node_as_image (GskVulkanRenderPass *self, result = gsk_vulkan_renderer_get_texture_image (renderer, texture); if (result == NULL) { - result = gsk_vulkan_upload_op_init_texture (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_op_size ()), - self->vulkan, - texture); + result = gsk_vulkan_upload_op (self, self->vulkan, texture); gsk_vulkan_renderer_add_texture_image (renderer, texture, result); } @@ -397,11 +394,11 @@ gsk_vulkan_render_pass_get_node_as_image (GskVulkanRenderPass *self, if (clipped.size.width == 0 || clipped.size.height == 0) return NULL; - result = gsk_vulkan_upload_cairo_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_cairo_op_size ()), - self->vulkan, - node, - &state->scale, - &clipped); + result = gsk_vulkan_upload_cairo_op (self, + self->vulkan, + node, + &state->scale, + &clipped); *tex_bounds = clipped; return result; @@ -432,13 +429,13 @@ gsk_vulkan_render_pass_get_node_as_image (GskVulkanRenderPass *self, &semaphore); g_array_append_val (self->wait_semaphores, semaphore); - result = gsk_vulkan_offscreen_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_offscreen_op_size ()), - self->vulkan, - render, - &state->scale, - &clipped, - semaphore, - node); + result = gsk_vulkan_offscreen_op (self, + self->vulkan, + render, + &state->scale, + &clipped, + semaphore, + node); return result; } @@ -467,11 +464,11 @@ gsk_vulkan_render_pass_add_fallback_node (GskVulkanRenderPass *self, if (clipped.size.width == 0 || clipped.size.height == 0) return TRUE; - image = gsk_vulkan_upload_cairo_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_cairo_op_size ()), - self->vulkan, - node, - &state->scale, - &clipped); + image = gsk_vulkan_upload_cairo_op (self, + self->vulkan, + node, + &state->scale, + &clipped); if (gsk_vulkan_clip_contains_rect (&state->clip, &state->offset, &node->bounds)) pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE; @@ -480,13 +477,13 @@ gsk_vulkan_render_pass_add_fallback_node (GskVulkanRenderPass *self, else pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE_CLIP_ROUNDED; - gsk_vulkan_texture_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_texture_op_size ()), - gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), - image, - GSK_VULKAN_SAMPLER_DEFAULT, - &node->bounds, - &state->offset, - &clipped); + gsk_vulkan_texture_op (self, + gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), + image, + GSK_VULKAN_SAMPLER_DEFAULT, + &node->bounds, + &state->offset, + &clipped); return TRUE; } @@ -630,19 +627,17 @@ gsk_vulkan_render_pass_add_texture_node (GskVulkanRenderPass *self, image = gsk_vulkan_renderer_get_texture_image (renderer, texture); if (image == NULL) { - image = gsk_vulkan_upload_op_init_texture (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_op_size ()), - self->vulkan, - texture); + image = gsk_vulkan_upload_op (self, self->vulkan, texture); gsk_vulkan_renderer_add_texture_image (renderer, texture, image); } - gsk_vulkan_texture_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_texture_op_size ()), - gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), - image, - GSK_VULKAN_SAMPLER_DEFAULT, - &node->bounds, - &state->offset, - &node->bounds); + gsk_vulkan_texture_op (self, + gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), + image, + GSK_VULKAN_SAMPLER_DEFAULT, + &node->bounds, + &state->offset, + &node->bounds); return TRUE; } @@ -683,19 +678,17 @@ gsk_vulkan_render_pass_add_texture_scale_node (GskVulkanRenderPass *self, image = gsk_vulkan_renderer_get_texture_image (renderer, texture); if (image == NULL) { - image = gsk_vulkan_upload_op_init_texture (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_op_size ()), - self->vulkan, - texture); + image = gsk_vulkan_upload_op (self, self->vulkan, texture); gsk_vulkan_renderer_add_texture_image (renderer, texture, image); } - gsk_vulkan_texture_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_texture_op_size ()), - gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), - image, - sampler, - &node->bounds, - &state->offset, - &node->bounds); + gsk_vulkan_texture_op (self, + gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), + image, + sampler, + &node->bounds, + &state->offset, + &node->bounds); return TRUE; } @@ -946,14 +939,14 @@ gsk_vulkan_render_pass_add_opacity_node (GskVulkanRenderPass *self, }); graphene_vec4_init (&color_offset, 0.0, 0.0, 0.0, 0.0); - gsk_vulkan_color_matrix_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_color_matrix_op_size ()), - gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), - image, - &node->bounds, - &state->offset, - &tex_rect, - &color_matrix, - &color_offset); + gsk_vulkan_color_matrix_op (self, + gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), + image, + &node->bounds, + &state->offset, + &tex_rect, + &color_matrix, + &color_offset); return TRUE; } @@ -983,14 +976,14 @@ gsk_vulkan_render_pass_add_color_matrix_node (GskVulkanRenderPass *self, else pipeline_type = GSK_VULKAN_PIPELINE_COLOR_MATRIX_CLIP_ROUNDED; - gsk_vulkan_color_matrix_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_color_matrix_op_size ()), - gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), - image, - &node->bounds, - &state->offset, - &tex_rect, - gsk_color_matrix_node_get_color_matrix (node), - gsk_color_matrix_node_get_color_offset (node)); + gsk_vulkan_color_matrix_op (self, + gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), + image, + &node->bounds, + &state->offset, + &tex_rect, + gsk_color_matrix_node_get_color_matrix (node), + gsk_color_matrix_node_get_color_offset (node)); return TRUE; } @@ -1166,13 +1159,13 @@ gsk_vulkan_render_pass_add_repeat_node (GskVulkanRenderPass *self, g_array_append_val (self->wait_semaphores, semaphore); - image = gsk_vulkan_offscreen_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_offscreen_op_size ()), - self->vulkan, - render, - &state->scale, - child_bounds, - semaphore, - gsk_repeat_node_get_child (node)); + image = gsk_vulkan_offscreen_op (self, + self->vulkan, + render, + &state->scale, + child_bounds, + semaphore, + gsk_repeat_node_get_child (node)); if (gsk_vulkan_clip_contains_rect (&state->clip, &state->offset, &node->bounds)) pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE; @@ -1181,13 +1174,13 @@ gsk_vulkan_render_pass_add_repeat_node (GskVulkanRenderPass *self, else pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE_CLIP_ROUNDED; - gsk_vulkan_texture_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_texture_op_size ()), - gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), - image, - GSK_VULKAN_SAMPLER_REPEAT, - &node->bounds, - &state->offset, - child_bounds); + gsk_vulkan_texture_op (self, + gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type), + image, + GSK_VULKAN_SAMPLER_REPEAT, + &node->bounds, + &state->offset, + child_bounds); return TRUE; } diff --git a/gsk/vulkan/gskvulkanrenderpassprivate.h b/gsk/vulkan/gskvulkanrenderpassprivate.h index 18b1be1b40..cd5bb678c6 100644 --- a/gsk/vulkan/gskvulkanrenderpassprivate.h +++ b/gsk/vulkan/gskvulkanrenderpassprivate.h @@ -23,6 +23,9 @@ void gsk_vulkan_render_pass_add (GskVulk GskVulkanRender *render, GskRenderNode *node); +gpointer gsk_vulkan_render_pass_alloc_op (GskVulkanRenderPass *self, + gsize size); + void gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self, GskVulkanRender *render, GskVulkanUploader *uploader); diff --git a/gsk/vulkan/gskvulkanscissorop.c b/gsk/vulkan/gskvulkanscissorop.c index c8f792f7ca..7f9c9e6f6b 100644 --- a/gsk/vulkan/gskvulkanscissorop.c +++ b/gsk/vulkan/gskvulkanscissorop.c @@ -81,19 +81,13 @@ static const GskVulkanOpClass GSK_VULKAN_SCISSOR_OP_CLASS = { gsk_vulkan_scissor_op_command }; -gsize -gsk_vulkan_scissor_op_size (void) -{ - return GSK_VULKAN_SCISSOR_OP_CLASS.size; -} - void -gsk_vulkan_scissor_op_init (GskVulkanOp *op, - const cairo_rectangle_int_t *rect) +gsk_vulkan_scissor_op (GskVulkanRenderPass *render_pass, + const cairo_rectangle_int_t *rect) { - GskVulkanScissorOp *self = (GskVulkanScissorOp *) op; + GskVulkanScissorOp *self; - gsk_vulkan_op_init (op, &GSK_VULKAN_SCISSOR_OP_CLASS); + self = (GskVulkanScissorOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_SCISSOR_OP_CLASS); self->rect = *rect; } diff --git a/gsk/vulkan/gskvulkanscissoropprivate.h b/gsk/vulkan/gskvulkanscissoropprivate.h index 6e46512cf9..a4f637d8cc 100644 --- a/gsk/vulkan/gskvulkanscissoropprivate.h +++ b/gsk/vulkan/gskvulkanscissoropprivate.h @@ -4,9 +4,7 @@ G_BEGIN_DECLS -gsize gsk_vulkan_scissor_op_size (void) G_GNUC_CONST; - -void gsk_vulkan_scissor_op_init (GskVulkanOp *op, +void gsk_vulkan_scissor_op (GskVulkanRenderPass *render_pass, const cairo_rectangle_int_t *rect); diff --git a/gsk/vulkan/gskvulkantextureop.c b/gsk/vulkan/gskvulkantextureop.c index 873f524567..e798d85619 100644 --- a/gsk/vulkan/gskvulkantextureop.c +++ b/gsk/vulkan/gskvulkantextureop.c @@ -121,24 +121,18 @@ static const GskVulkanOpClass GSK_VULKAN_TEXTURE_OP_CLASS = { gsk_vulkan_texture_op_command }; -gsize -gsk_vulkan_texture_op_size (void) -{ - return GSK_VULKAN_TEXTURE_OP_CLASS.size; -} - void -gsk_vulkan_texture_op_init (GskVulkanOp *op, - GskVulkanPipeline *pipeline, - GskVulkanImage *image, - GskVulkanRenderSampler sampler, - const graphene_rect_t *rect, - const graphene_point_t *offset, - const graphene_rect_t *tex_rect) +gsk_vulkan_texture_op (GskVulkanRenderPass *render_pass, + GskVulkanPipeline *pipeline, + GskVulkanImage *image, + GskVulkanRenderSampler sampler, + const graphene_rect_t *rect, + const graphene_point_t *offset, + const graphene_rect_t *tex_rect) { - GskVulkanTextureOp *self = (GskVulkanTextureOp *) op; + GskVulkanTextureOp *self; - gsk_vulkan_op_init (op, &GSK_VULKAN_TEXTURE_OP_CLASS); + self = (GskVulkanTextureOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_TEXTURE_OP_CLASS); self->pipeline = pipeline; self->image = g_object_ref (image); diff --git a/gsk/vulkan/gskvulkantextureopprivate.h b/gsk/vulkan/gskvulkantextureopprivate.h index eb8e9f283f..2ca73066c1 100644 --- a/gsk/vulkan/gskvulkantextureopprivate.h +++ b/gsk/vulkan/gskvulkantextureopprivate.h @@ -4,9 +4,7 @@ G_BEGIN_DECLS -gsize gsk_vulkan_texture_op_size (void) G_GNUC_CONST; - -void gsk_vulkan_texture_op_init (GskVulkanOp *op, +void gsk_vulkan_texture_op (GskVulkanRenderPass *render_pass, GskVulkanPipeline *pipeline, GskVulkanImage *image, GskVulkanRenderSampler sampler, diff --git a/gsk/vulkan/gskvulkanuploadcairoop.c b/gsk/vulkan/gskvulkanuploadcairoop.c index 962714c289..ad84df6a77 100644 --- a/gsk/vulkan/gskvulkanuploadcairoop.c +++ b/gsk/vulkan/gskvulkanuploadcairoop.c @@ -106,22 +106,16 @@ static const GskVulkanOpClass GSK_VULKAN_UPLOAD_CAIRO_OP_CLASS = { gsk_vulkan_upload_cairo_op_command }; -gsize -gsk_vulkan_upload_cairo_op_size (void) -{ - return GSK_VULKAN_UPLOAD_CAIRO_OP_CLASS.size; -} - GskVulkanImage * -gsk_vulkan_upload_cairo_op_init (GskVulkanOp *op, - GdkVulkanContext *context, - GskRenderNode *node, - const graphene_vec2_t *scale, - const graphene_rect_t *viewport) +gsk_vulkan_upload_cairo_op (GskVulkanRenderPass *render_pass, + GdkVulkanContext *context, + GskRenderNode *node, + const graphene_vec2_t *scale, + const graphene_rect_t *viewport) { - GskVulkanUploadCairoOp *self = (GskVulkanUploadCairoOp *) op; + GskVulkanUploadCairoOp *self; - gsk_vulkan_op_init (op, &GSK_VULKAN_UPLOAD_CAIRO_OP_CLASS); + self = (GskVulkanUploadCairoOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_UPLOAD_CAIRO_OP_CLASS); self->node = gsk_render_node_ref (node); self->image = gsk_vulkan_image_new_for_upload (context, diff --git a/gsk/vulkan/gskvulkanuploadcairoopprivate.h b/gsk/vulkan/gskvulkanuploadcairoopprivate.h index 398f854fb3..5dc55413a2 100644 --- a/gsk/vulkan/gskvulkanuploadcairoopprivate.h +++ b/gsk/vulkan/gskvulkanuploadcairoopprivate.h @@ -4,9 +4,7 @@ G_BEGIN_DECLS -gsize gsk_vulkan_upload_cairo_op_size (void) G_GNUC_CONST; - -GskVulkanImage * gsk_vulkan_upload_cairo_op_init (GskVulkanOp *op, +GskVulkanImage * gsk_vulkan_upload_cairo_op (GskVulkanRenderPass *render_pass, GdkVulkanContext *context, GskRenderNode *node, const graphene_vec2_t *scale, diff --git a/gsk/vulkan/gskvulkanuploadop.c b/gsk/vulkan/gskvulkanuploadop.c index 52e159ad87..b01621c881 100644 --- a/gsk/vulkan/gskvulkanuploadop.c +++ b/gsk/vulkan/gskvulkanuploadop.c @@ -87,20 +87,14 @@ static const GskVulkanOpClass GSK_VULKAN_UPLOAD_OP_CLASS = { gsk_vulkan_upload_op_command }; -gsize -gsk_vulkan_upload_op_size (void) -{ - return GSK_VULKAN_UPLOAD_OP_CLASS.size; -} - GskVulkanImage * -gsk_vulkan_upload_op_init_texture (GskVulkanOp *op, - GdkVulkanContext *context, - GdkTexture *texture) +gsk_vulkan_upload_op (GskVulkanRenderPass *render_pass, + GdkVulkanContext *context, + GdkTexture *texture) { - GskVulkanUploadOp *self = (GskVulkanUploadOp *) op; + GskVulkanUploadOp *self; - gsk_vulkan_op_init (op, &GSK_VULKAN_UPLOAD_OP_CLASS); + self = (GskVulkanUploadOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_UPLOAD_OP_CLASS); self->texture = g_object_ref (texture); self->image = gsk_vulkan_image_new_for_upload (context, diff --git a/gsk/vulkan/gskvulkanuploadopprivate.h b/gsk/vulkan/gskvulkanuploadopprivate.h index 4e72bc62ea..fb683b2335 100644 --- a/gsk/vulkan/gskvulkanuploadopprivate.h +++ b/gsk/vulkan/gskvulkanuploadopprivate.h @@ -4,9 +4,7 @@ G_BEGIN_DECLS -gsize gsk_vulkan_upload_op_size (void) G_GNUC_CONST; - -GskVulkanImage * gsk_vulkan_upload_op_init_texture (GskVulkanOp *op, +GskVulkanImage * gsk_vulkan_upload_op (GskVulkanRenderPass *render_pass, GdkVulkanContext *context, GdkTexture *texture);