color-lcms: add wrapper API for refcounting cmlcms_color_profile
It is used for convenience when profile is cached. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
This commit is contained in:
parent
494ff5b23b
commit
a92fa34d1d
|
@ -180,4 +180,10 @@ cmlcms_color_transform_get(struct weston_color_manager_lcms *cm,
|
|||
void
|
||||
cmlcms_color_transform_destroy(struct cmlcms_color_transform *xform);
|
||||
|
||||
struct cmlcms_color_profile *
|
||||
ref_cprof(struct cmlcms_color_profile *cprof);
|
||||
|
||||
void
|
||||
unref_cprof(struct cmlcms_color_profile *cprof);
|
||||
|
||||
#endif /* WESTON_COLOR_LCMS_H */
|
||||
|
|
|
@ -114,6 +114,25 @@ cmlcms_color_profile_destroy(struct cmlcms_color_profile *cprof)
|
|||
free(cprof);
|
||||
}
|
||||
|
||||
struct cmlcms_color_profile *
|
||||
ref_cprof(struct cmlcms_color_profile *cprof)
|
||||
{
|
||||
if (!cprof)
|
||||
return NULL;
|
||||
|
||||
weston_color_profile_ref(&cprof->base);
|
||||
return cprof;
|
||||
}
|
||||
|
||||
void
|
||||
unref_cprof(struct cmlcms_color_profile *cprof)
|
||||
{
|
||||
if (!cprof)
|
||||
return;
|
||||
|
||||
weston_color_profile_unref(&cprof->base);
|
||||
}
|
||||
|
||||
static char *
|
||||
make_icc_file_description(cmsHPROFILE profile,
|
||||
const struct cmlcms_md5_sum *md5sum,
|
||||
|
|
Loading…
Reference in New Issue