From: Eunki Hong Date: Thu, 26 Oct 2023 10:42:44 +0000 (+0900) Subject: Make NativeImageQueue generate valid url X-Git-Tag: accepted/tizen/8.0/unified/20240613.065534~159 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f63802dccf309ac8c18cc39df35bea684f68d587;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Make NativeImageQueue generate valid url Previously NativeImageQueue.GenerateUrl() binded to invalid csharp API. It will make some crash. So let we use valid bind API instead. Signed-off-by: Eunki Hong --- diff --git a/src/Tizen.NUI/src/internal/Common/NativeImageInterface.cs b/src/Tizen.NUI/src/internal/Common/NativeImageInterface.cs index be32543..dce8180 100755 --- a/src/Tizen.NUI/src/internal/Common/NativeImageInterface.cs +++ b/src/Tizen.NUI/src/internal/Common/NativeImageInterface.cs @@ -77,5 +77,12 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } + + public virtual ImageUrl GenerateUrl() + { + ImageUrl ret = new ImageUrl(Interop.NativeImageInterface.GenerateUrl(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageInterface.cs b/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageInterface.cs index ab0eb4e..dddf062 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageInterface.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageInterface.cs @@ -44,6 +44,9 @@ namespace Tizen.NUI [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool RequiresBlending(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageInterface_GenerateUrl")] + public static extern global::System.IntPtr GenerateUrl(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageInterface_SWIGUpcast")] public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1); } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs b/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs index f62344d..0ded636 100644 --- a/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs @@ -40,6 +40,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueue_EnqueueBuffer")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool EnqueueBuffer(IntPtr queue, IntPtr buffer); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueue_GenerateUrl")] + public static extern IntPtr GenerateUrl(IntPtr queue); } } } diff --git a/src/Tizen.NUI/src/public/Images/NativeImageQueue.cs b/src/Tizen.NUI/src/public/Images/NativeImageQueue.cs index 11153d4..4057e45 100644 --- a/src/Tizen.NUI/src/public/Images/NativeImageQueue.cs +++ b/src/Tizen.NUI/src/public/Images/NativeImageQueue.cs @@ -105,10 +105,10 @@ namespace Tizen.NUI /// /// The ImageUrl of NativeImageQueue. [EditorBrowsable(EditorBrowsableState.Never)] - public ImageUrl GenerateUrl() + public override ImageUrl GenerateUrl() { - ImageUrl ret = new ImageUrl(Interop.NativeImageSource.GenerateUrl(this.SwigCPtr.Handle), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); + ImageUrl ret = new ImageUrl(Interop.NativeImageQueue.GenerateUrl(this.SwigCPtr.Handle), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/Images/NativeImageSource.cs b/src/Tizen.NUI/src/public/Images/NativeImageSource.cs index 4e3bfe9..ea4df30 100644 --- a/src/Tizen.NUI/src/public/Images/NativeImageSource.cs +++ b/src/Tizen.NUI/src/public/Images/NativeImageSource.cs @@ -44,10 +44,10 @@ namespace Tizen.NUI /// This API should not be called at worker thread. /// [EditorBrowsable(EditorBrowsableState.Never)] - public ImageUrl GenerateUrl() + public override ImageUrl GenerateUrl() { ImageUrl ret = new ImageUrl(Interop.NativeImageSource.GenerateUrl(this.SwigCPtr.Handle), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; }