From cb425fa4bbc763cee1f2f86719263bbd8115665d Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 4 Mar 2021 11:14:16 +0900 Subject: [PATCH] capi: fix incorrect composite api. Api prototype is completely wrong, now it's corrected. --- inc/thorvg_capi.h | 9 +++++---- src/bindings/capi/tvgCapi.cpp | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/inc/thorvg_capi.h b/inc/thorvg_capi.h index 25ccbdb2..87c9476d 100644 --- a/inc/thorvg_capi.h +++ b/inc/thorvg_capi.h @@ -579,15 +579,16 @@ TVG_EXPORT Tvg_Paint* tvg_paint_duplicate(Tvg_Paint* paint); TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h); /*! -* \fn TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(const Tvg_Paint* paint, Tvg_Composite_Method method) -* \brief The function set composition method -* \param[in] paint Tvg_Paint pointer +* \fn TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(Tvg_Paint* paint, Tvg_Paint* target, Tvg_Composite_Method method) +* \brief The function set composition method. +* \param[in] paint Tvg_Paint composition source +* \param[in] target Tvg_Paint composition target * \param[in] method Tvg_Composite_Method used composite method * \return Tvg_Result return value * - TVG_RESULT_SUCCESS: if ok. * - TVG_RESULT_INVALID_PARAMETERS: if paint is invalid */ -TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(const Tvg_Paint* paint, Tvg_Composite_Method method); +TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(Tvg_Paint* paint, Tvg_Paint* target, Tvg_Composite_Method method); /************************************************************************/ /* Shape API */ diff --git a/src/bindings/capi/tvgCapi.cpp b/src/bindings/capi/tvgCapi.cpp index 410a08f2..1384f2ce 100644 --- a/src/bindings/capi/tvgCapi.cpp +++ b/src/bindings/capi/tvgCapi.cpp @@ -191,10 +191,10 @@ TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, flo return (Tvg_Result) reinterpret_cast(paint)->bounds(x, y, w, h); } -TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(const Tvg_Paint* paint, Tvg_Composite_Method method) +TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(Tvg_Paint* paint, Tvg_Paint* target, Tvg_Composite_Method method) { if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->composite(unique_ptr((Paint*)(paint)), (CompositeMethod)method); + return (Tvg_Result) reinterpret_cast(paint)->composite(unique_ptr((Paint*)(target)), (CompositeMethod)method); } /************************************************************************/