From: Mira Grudzinska Date: Tue, 12 Oct 2021 12:49:31 +0000 (+0200) Subject: capi: tvg_gradient_duplicate() added X-Git-Tag: accepted/tizen/6.5/unified/20211103.015235~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57fb05c1057dd707d325f6c6a5378be0a1134cfa;p=platform%2Fcore%2Fgraphics%2Ftizenvg.git capi: tvg_gradient_duplicate() added --- diff --git a/src/bindings/capi/thorvg_capi.h b/src/bindings/capi/thorvg_capi.h index d42e22a..826ec77 100644 --- a/src/bindings/capi/thorvg_capi.h +++ b/src/bindings/capi/thorvg_capi.h @@ -1662,6 +1662,18 @@ TVG_EXPORT Tvg_Result tvg_gradient_get_spread(Tvg_Gradient* grad, Tvg_Stroke_Fil /*! +* \brief Duplicates the given Tvg_Gradient object. +* +* Creates a new object and sets its all properties as in the original object. +* +* \param[in] grad The Tvg_Gradient object to be copied. +* +* \return A copied Tvg_Gradient object if succeed, @c nullptr otherwise. +*/ +TVG_EXPORT Tvg_Gradient* tvg_gradient_duplicate(Tvg_Gradient* grad); + + +/*! * \brief Deletes the given gradient object. * * \param[in] grad The gradient object to be deleted. diff --git a/src/bindings/capi/tvgCapi.cpp b/src/bindings/capi/tvgCapi.cpp index cb8d1f1..5409432 100644 --- a/src/bindings/capi/tvgCapi.cpp +++ b/src/bindings/capi/tvgCapi.cpp @@ -515,6 +515,13 @@ TVG_EXPORT Tvg_Gradient* tvg_radial_gradient_new() } +TVG_EXPORT Tvg_Gradient* tvg_gradient_duplicate(Tvg_Gradient* grad) +{ + if (!grad) return nullptr; + return (Tvg_Gradient*) reinterpret_cast(grad)->duplicate(); +} + + TVG_EXPORT Tvg_Result tvg_gradient_del(Tvg_Gradient* grad) { if (!grad) return TVG_RESULT_INVALID_ARGUMENT;