color-lcms: rename get_cmlcms() to to_cmlcms()

"Get" might easily imply reference counting, but there is none here.
"to" is more descriptive for a cast.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2024-02-15 15:06:58 +02:00
parent f19b15e373
commit 952f3ef61d
4 changed files with 12 additions and 12 deletions

View File

@ -99,7 +99,7 @@ cmlcms_get_surface_color_transform(struct weston_color_manager *cm_base,
struct weston_output *output,
struct weston_surface_color_transform *surf_xform)
{
struct weston_color_manager_lcms *cm = get_cmlcms(cm_base);
struct weston_color_manager_lcms *cm = to_cmlcms(cm_base);
struct cmlcms_color_transform *xform;
/* TODO: take weston_output::eotf_mode into account */
@ -305,7 +305,7 @@ static struct weston_output_color_outcome *
cmlcms_create_output_color_outcome(struct weston_color_manager *cm_base,
struct weston_output *output)
{
struct weston_color_manager_lcms *cm = get_cmlcms(cm_base);
struct weston_color_manager_lcms *cm = to_cmlcms(cm_base);
struct weston_output_color_outcome *co;
co = zalloc(sizeof *co);
@ -349,7 +349,7 @@ lcms_error_logger(cmsContext context_id,
static bool
cmlcms_init(struct weston_color_manager *cm_base)
{
struct weston_color_manager_lcms *cm = get_cmlcms(cm_base);
struct weston_color_manager_lcms *cm = to_cmlcms(cm_base);
if (!(cm->base.compositor->capabilities & WESTON_CAP_COLOR_OPS)) {
weston_log("color-lcms: error: color operations capability missing. Is GL-renderer not in use?\n");
@ -376,7 +376,7 @@ cmlcms_init(struct weston_color_manager *cm_base)
static void
cmlcms_destroy(struct weston_color_manager *cm_base)
{
struct weston_color_manager_lcms *cm = get_cmlcms(cm_base);
struct weston_color_manager_lcms *cm = to_cmlcms(cm_base);
if (cm->sRGB_profile) {
/* TODO: when we fix the ugly bug described below, we should

View File

@ -48,7 +48,7 @@ struct weston_color_manager_lcms {
};
static inline struct weston_color_manager_lcms *
get_cmlcms(struct weston_color_manager *cm_base)
to_cmlcms(struct weston_color_manager *cm_base)
{
return container_of(cm_base, struct weston_color_manager_lcms, base);
}

View File

@ -343,7 +343,7 @@ cmlcms_color_profile_create(struct weston_color_manager_lcms *cm,
void
cmlcms_color_profile_destroy(struct cmlcms_color_profile *cprof)
{
struct weston_color_manager_lcms *cm = get_cmlcms(cprof->base.cm);
struct weston_color_manager_lcms *cm = to_cmlcms(cprof->base.cm);
wl_list_remove(&cprof->link);
cmsFreeToneCurveTriple(cprof->vcgt);
@ -450,7 +450,7 @@ err_close:
struct weston_color_profile *
cmlcms_get_stock_sRGB_color_profile(struct weston_color_manager *cm_base)
{
struct weston_color_manager_lcms *cm = get_cmlcms(cm_base);
struct weston_color_manager_lcms *cm = to_cmlcms(cm_base);
struct cmlcms_color_profile *cprof;
cprof = ref_cprof(cm->sRGB_profile);
@ -466,7 +466,7 @@ cmlcms_get_color_profile_from_icc(struct weston_color_manager *cm_base,
struct weston_color_profile **cprof_out,
char **errmsg)
{
struct weston_color_manager_lcms *cm = get_cmlcms(cm_base);
struct weston_color_manager_lcms *cm = to_cmlcms(cm_base);
cmsHPROFILE profile;
struct cmlcms_md5_sum md5sum;
struct cmlcms_color_profile *cprof = NULL;
@ -530,7 +530,7 @@ bool
cmlcms_send_image_desc_info(struct cm_image_desc_info *cm_image_desc_info,
struct weston_color_profile *cprof_base)
{
struct weston_color_manager_lcms *cm = get_cmlcms(cprof_base->cm);
struct weston_color_manager_lcms *cm = to_cmlcms(cprof_base->cm);
struct weston_compositor *compositor = cm->base.compositor;
struct cmlcms_color_profile *cprof = get_cprof(cprof_base);
const struct weston_color_primaries_info *primaries_info;

View File

@ -166,7 +166,7 @@ cmlcms_fill_in_3dlut(struct weston_color_transform *xform_base,
void
cmlcms_color_transform_destroy(struct cmlcms_color_transform *xform)
{
struct weston_color_manager_lcms *cm = get_cmlcms(xform->base.cm);
struct weston_color_manager_lcms *cm = to_cmlcms(xform->base.cm);
wl_list_remove(&xform->link);
@ -813,7 +813,7 @@ transform_factory(_cmsTransform2Fn *xform_fn,
xform = cmsGetContextUserData(context_id);
assert(xform);
cm = get_cmlcms(xform->base.cm);
cm = to_cmlcms(xform->base.cm);
/* Print pipeline before optimization */
weston_log_scope_printf(cm->optimizer_scope,
@ -880,7 +880,7 @@ profile_from_rgb_curves(cmsContext ctx, cmsToneCurve *const curveset[3])
static bool
xform_realize_chain(struct cmlcms_color_transform *xform)
{
struct weston_color_manager_lcms *cm = get_cmlcms(xform->base.cm);
struct weston_color_manager_lcms *cm = to_cmlcms(xform->base.cm);
struct cmlcms_color_profile *output_profile = xform->search_key.output_profile;
cmsHPROFILE chain[5];
unsigned chain_len = 0;