diff --git a/libweston/color-lcms/color-lcms.c b/libweston/color-lcms/color-lcms.c index 992b87d6..fff198b7 100644 --- a/libweston/color-lcms/color-lcms.c +++ b/libweston/color-lcms/color-lcms.c @@ -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 diff --git a/libweston/color-lcms/color-lcms.h b/libweston/color-lcms/color-lcms.h index c199cb71..c70fc93d 100644 --- a/libweston/color-lcms/color-lcms.h +++ b/libweston/color-lcms/color-lcms.h @@ -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); } diff --git a/libweston/color-lcms/color-profile.c b/libweston/color-lcms/color-profile.c index c1a05123..23585539 100644 --- a/libweston/color-lcms/color-profile.c +++ b/libweston/color-lcms/color-profile.c @@ -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; diff --git a/libweston/color-lcms/color-transform.c b/libweston/color-lcms/color-transform.c index fba22ae4..0efba8b4 100644 --- a/libweston/color-lcms/color-transform.c +++ b/libweston/color-lcms/color-transform.c @@ -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;