From fa2abbeefbd123ffe97b9ca08bb723486556fd8c Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 24 Aug 2024 11:07:58 +0200 Subject: [PATCH] render/color: return tranform in wlr_color_transform_ref() This is more consistent with the rest of the wlroots APIs and is more concise. --- include/wlr/render/color.h | 2 +- render/color.c | 3 ++- render/vulkan/pass.c | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wlr/render/color.h b/include/wlr/render/color.h index ddd4408b..43d9154b 100644 --- a/include/wlr/render/color.h +++ b/include/wlr/render/color.h @@ -44,7 +44,7 @@ struct wlr_color_transform *wlr_color_transform_init_srgb(void); /** * Increase the reference count of the color transform by 1. */ -void wlr_color_transform_ref(struct wlr_color_transform *tr); +struct wlr_color_transform *wlr_color_transform_ref(struct wlr_color_transform *tr); /** * Reduce the reference count of the color transform by 1; freeing it and diff --git a/render/color.c b/render/color.c index 639b004c..e68c2d50 100644 --- a/render/color.c +++ b/render/color.c @@ -20,8 +20,9 @@ static void color_transform_destroy(struct wlr_color_transform *tr) { free(tr); } -void wlr_color_transform_ref(struct wlr_color_transform *tr) { +struct wlr_color_transform *wlr_color_transform_ref(struct wlr_color_transform *tr) { tr->ref_count += 1; + return tr; } void wlr_color_transform_unref(struct wlr_color_transform *tr) { diff --git a/render/vulkan/pass.c b/render/vulkan/pass.c index 3697dcda..5820cf9d 100644 --- a/render/vulkan/pass.c +++ b/render/vulkan/pass.c @@ -954,8 +954,7 @@ struct wlr_vk_render_pass *vulkan_begin_render_pass(struct wlr_vk_renderer *rend pass->renderer = renderer; pass->srgb_pathway = using_srgb_pathway; if (options != NULL && options->color_transform != NULL) { - wlr_color_transform_ref(options->color_transform); - pass->color_transform = options->color_transform; + pass->color_transform = wlr_color_transform_ref(options->color_transform); } rect_union_init(&pass->updated_region);