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

View File

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

View File

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