color: rename get_stock_sRGB_color_profile to ref_stock_sRGB_color_profile

This makes it more explicit that this indeed is increasing the reference
count, rather than just returning a pointer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2024-02-15 15:20:41 +02:00
parent ce51a04013
commit 4f796a52e1
7 changed files with 16 additions and 16 deletions

View File

@ -473,7 +473,7 @@ weston_color_manager_create(struct weston_compositor *compositor)
cm->base.init = cmlcms_init;
cm->base.destroy = cmlcms_destroy;
cm->base.destroy_color_profile = cmlcms_destroy_color_profile;
cm->base.get_stock_sRGB_color_profile = cmlcms_get_stock_sRGB_color_profile;
cm->base.ref_stock_sRGB_color_profile = cmlcms_ref_stock_sRGB_color_profile;
cm->base.get_color_profile_from_icc = cmlcms_get_color_profile_from_icc;
cm->base.send_image_desc_info = cmlcms_send_image_desc_info;
cm->base.destroy_color_transform = cmlcms_destroy_color_transform;

View File

@ -132,7 +132,7 @@ to_cmlcms_cprof(struct weston_color_profile *cprof_base)
}
struct weston_color_profile *
cmlcms_get_stock_sRGB_color_profile(struct weston_color_manager *cm_base);
cmlcms_ref_stock_sRGB_color_profile(struct weston_color_manager *cm_base);
bool
cmlcms_get_color_profile_from_icc(struct weston_color_manager *cm,

View File

@ -448,7 +448,7 @@ err_close:
}
struct weston_color_profile *
cmlcms_get_stock_sRGB_color_profile(struct weston_color_manager *cm_base)
cmlcms_ref_stock_sRGB_color_profile(struct weston_color_manager *cm_base)
{
struct weston_color_manager_lcms *cm = to_cmlcms(cm_base);
struct cmlcms_color_profile *cprof;

View File

@ -113,7 +113,7 @@ cmnoop_color_profile_create(struct weston_color_manager_noop *cm, char *desc)
}
static struct weston_color_profile *
cmnoop_get_stock_sRGB_color_profile(struct weston_color_manager *cm_base)
cmnoop_ref_stock_sRGB_color_profile(struct weston_color_manager *cm_base)
{
struct weston_color_manager_noop *cm = to_cmnoop(cm_base);
struct cmnoop_color_profile *cprof;
@ -253,7 +253,7 @@ weston_color_manager_noop_create(struct weston_compositor *compositor)
cm->base.init = cmnoop_init;
cm->base.destroy = cmnoop_destroy;
cm->base.destroy_color_profile = cmnoop_destroy_color_profile;
cm->base.get_stock_sRGB_color_profile = cmnoop_get_stock_sRGB_color_profile;
cm->base.ref_stock_sRGB_color_profile = cmnoop_ref_stock_sRGB_color_profile;
cm->base.get_color_profile_from_icc = cmnoop_get_color_profile_from_icc;
cm->base.send_image_desc_info = NULL;
cm->base.destroy_color_transform = cmnoop_destroy_color_transform;

View File

@ -280,13 +280,13 @@ struct weston_color_manager {
void
(*destroy_color_profile)(struct weston_color_profile *cprof);
/** Gets a reference to the stock sRGB color profile
/** Gets a new reference to the stock sRGB color profile
*
* \param cm The color manager.
* \return A reference to the stock sRGB profile, never returns NULL.
* \return A new reference to the stock sRGB profile, never returns NULL.
*/
struct weston_color_profile *
(*get_stock_sRGB_color_profile)(struct weston_color_manager *cm);
(*ref_stock_sRGB_color_profile)(struct weston_color_manager *cm);
/** Create a color profile from ICC data
*

View File

@ -859,7 +859,7 @@ weston_surface_update_preferred_color_profile(struct weston_surface *surface)
} else {
/* Unmapped surface and no outputs available, so let's pick
* stock sRGB color profile. */
new = cm->get_stock_sRGB_color_profile(cm);
new = cm->ref_stock_sRGB_color_profile(cm);
}
/* Nothing to do. */
@ -7583,7 +7583,7 @@ weston_output_set_color_profile(struct weston_output *output,
old = output->color_profile;
new = cprof ? weston_color_profile_ref(cprof) :
cm->get_stock_sRGB_color_profile(cm);
cm->ref_stock_sRGB_color_profile(cm);
/* Nothing to do. */
if (new == old) {
@ -7824,7 +7824,7 @@ weston_output_init(struct weston_output *output,
/* Set the stock sRGB color profile for the output. Libweston users are
* free to set the color profile to whatever they want later on. */
cm = compositor->color_manager;
output->color_profile = cm->get_stock_sRGB_color_profile(cm);
output->color_profile = cm->ref_stock_sRGB_color_profile(cm);
}
/** Adds weston_output object to pending output list.

View File

@ -170,7 +170,7 @@ mock_create_output_color_outcome(struct weston_color_manager *cm_base,
}
static struct weston_color_profile *
mock_cm_get_stock_sRGB_color_profile(struct weston_color_manager *mock_cm)
mock_cm_ref_stock_sRGB_color_profile(struct weston_color_manager *mock_cm)
{
struct weston_color_profile *mock_cprof;
@ -206,7 +206,7 @@ TEST_P(color_characteristics_config_error, config_cases)
size_t logsize;
struct mock_color_manager mock_cm = {
.base.create_output_color_outcome = mock_create_output_color_outcome,
.base.get_stock_sRGB_color_profile = mock_cm_get_stock_sRGB_color_profile,
.base.ref_stock_sRGB_color_profile = mock_cm_ref_stock_sRGB_color_profile,
.base.destroy_color_profile = mock_cm_destroy_color_profile,
};
struct weston_compositor mock_compositor = {
@ -248,7 +248,7 @@ TEST(weston_output_set_color_characteristics_null)
{
struct mock_color_manager mock_cm = {
.base.create_output_color_outcome = mock_create_output_color_outcome,
.base.get_stock_sRGB_color_profile = mock_cm_get_stock_sRGB_color_profile,
.base.ref_stock_sRGB_color_profile = mock_cm_ref_stock_sRGB_color_profile,
.base.destroy_color_profile = mock_cm_destroy_color_profile,
};
struct weston_compositor mock_compositor = {
@ -329,7 +329,7 @@ TEST_P(hdr_metadata_type1_errors, value_cases)
};
struct mock_color_manager mock_cm = {
.base.create_output_color_outcome = mock_create_output_color_outcome,
.base.get_stock_sRGB_color_profile = mock_cm_get_stock_sRGB_color_profile,
.base.ref_stock_sRGB_color_profile = mock_cm_ref_stock_sRGB_color_profile,
.base.destroy_color_profile = mock_cm_destroy_color_profile,
.test_hdr_meta = &meta,
};
@ -374,7 +374,7 @@ TEST(hdr_metadata_type1_ignore_unflagged)
};
struct mock_color_manager mock_cm = {
.base.create_output_color_outcome = mock_create_output_color_outcome,
.base.get_stock_sRGB_color_profile = mock_cm_get_stock_sRGB_color_profile,
.base.ref_stock_sRGB_color_profile = mock_cm_ref_stock_sRGB_color_profile,
.base.destroy_color_profile = mock_cm_destroy_color_profile,
.test_hdr_meta = &meta,
};