gpu: Make the region argument transfer full

I want to modify the region while using it, and everybody destroys it
right after, so now there's no need to do a copy.
This commit is contained in:
Benjamin Otte 2024-08-03 15:18:02 +02:00
parent dbeddd4417
commit 1328c1409a
3 changed files with 6 additions and 8 deletions

View File

@ -632,7 +632,7 @@ gsk_gpu_frame_record (GskGpuFrame *self,
gint64 timestamp,
GskGpuImage *target,
GdkColorState *target_color_state,
const cairo_region_t *clip,
cairo_region_t *clip,
GskRenderNode *node,
const graphene_rect_t *viewport,
GdkTexture **texture)
@ -654,6 +654,8 @@ gsk_gpu_frame_record (GskGpuFrame *self,
if (texture)
gsk_gpu_download_op (self, target, TRUE, copy_texture, texture);
cairo_region_destroy (clip);
}
static void
@ -692,7 +694,7 @@ gsk_gpu_frame_render (GskGpuFrame *self,
gint64 timestamp,
GskGpuImage *target,
GdkColorState *target_color_state,
const cairo_region_t *region,
cairo_region_t *clip,
GskRenderNode *node,
const graphene_rect_t *viewport,
GdkTexture **texture)
@ -701,7 +703,7 @@ gsk_gpu_frame_render (GskGpuFrame *self,
gsk_gpu_frame_cleanup (self);
gsk_gpu_frame_record (self, timestamp, target, target_color_state, region, node, viewport, texture);
gsk_gpu_frame_record (self, timestamp, target, target_color_state, clip, node, viewport, texture);
gsk_gpu_frame_submit (self, pass_type);
}

View File

@ -102,7 +102,7 @@ void gsk_gpu_frame_render (GskGpuF
gint64 timestamp,
GskGpuImage *target,
GdkColorState *target_color_state,
const cairo_region_t *region,
cairo_region_t *clip,
GskRenderNode *node,
const graphene_rect_t *viewport,
GdkTexture **texture);

View File

@ -323,7 +323,6 @@ gsk_gpu_renderer_fallback_render_texture (GskGpuRenderer *self,
image_height),
&texture);
g_object_unref (frame);
cairo_region_destroy (clip_region);
g_assert (texture);
gdk_texture_downloader_init (&downloader, texture);
@ -400,7 +399,6 @@ gsk_gpu_renderer_render_texture (GskRenderer *renderer,
&rounded_viewport,
&texture);
cairo_region_destroy (clip_region);
g_object_unref (frame);
g_object_unref (image);
@ -461,8 +459,6 @@ gsk_gpu_renderer_render (GskRenderer *renderer,
gsk_gpu_frame_end (frame, priv->context);
gsk_gpu_device_queue_gc (priv->device);
g_clear_pointer (&render_region, cairo_region_destroy);
}
static double