From: Eunki Hong Date: Thu, 19 Aug 2021 09:55:44 +0000 (+0900) Subject: Remove ReleaseFunction enum at PixelData (#3436) X-Git-Tag: submit/tizen/20210824.151735~1^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2951987b9232e1fe24c8d2d98334fbb3ed03327;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Remove ReleaseFunction enum at PixelData (#3436) PixelData buffer's allocate / release function is only need for C++ side memory. And C# cannot control that allocation method. So ReleaseFunction enum is unneccesary arguments at NUI. Signed-off-by: Eunki, Hong Co-authored-by: Eunki, Hong --- diff --git a/src/Tizen.NUI.Wearable/src/public/Title.cs b/src/Tizen.NUI.Wearable/src/public/Title.cs index 660198b09..5d3fb1e1d 100755 --- a/src/Tizen.NUI.Wearable/src/public/Title.cs +++ b/src/Tizen.NUI.Wearable/src/public/Title.cs @@ -270,7 +270,7 @@ namespace Tizen.NUI.Components pixelBuffer[6] = (byte)(0xFF * color2.Z); pixelBuffer[7] = (byte)(0xFF * color2.W); - PixelData pixelData = new PixelData(pixelBuffer, size, width, height, PixelFormat.RGBA8888, PixelData.ReleaseFunction.DeleteArray ); + PixelData pixelData = new PixelData(pixelBuffer, size, width, height, PixelFormat.RGBA8888); Texture texture = new Texture(TextureType.TEXTURE_2D, PixelFormat.RGBA8888, width, height); texture.Upload(pixelData); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.PixelData.cs b/src/Tizen.NUI/src/internal/Interop/Interop.PixelData.cs index 75d424fbc..50813bb9e 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.PixelData.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.PixelData.cs @@ -25,7 +25,7 @@ namespace Tizen.NUI public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PixelData_New")] - public static extern global::System.IntPtr New([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg1, uint jarg2, uint jarg3, uint jarg4, int jarg5, int jarg6); + public static extern global::System.IntPtr New([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg1, uint jarg2, uint jarg3, uint jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_PixelData__SWIG_0")] public static extern global::System.IntPtr NewPixelData(); diff --git a/src/Tizen.NUI/src/public/Images/PixelData.cs b/src/Tizen.NUI/src/public/Images/PixelData.cs index a001174c2..6b0ec8f01 100755 --- a/src/Tizen.NUI/src/public/Images/PixelData.cs +++ b/src/Tizen.NUI/src/public/Images/PixelData.cs @@ -45,11 +45,10 @@ namespace Tizen.NUI /// Buffer width in pixels. /// Buffer height in pixels. /// The pixel format. - /// The function used to release the memory. /// 5 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public PixelData(byte[] buffer, uint bufferSize, uint width, uint height, PixelFormat pixelFormat, PixelData.ReleaseFunction releaseFunction) : this(Interop.PixelData.New(buffer, bufferSize, width, height, (int)pixelFormat, (int)releaseFunction), true) + public PixelData(byte[] buffer, uint bufferSize, uint width, uint height, PixelFormat pixelFormat) : this(Interop.PixelData.New(buffer, bufferSize, width, height, (int)pixelFormat), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -59,25 +58,6 @@ namespace Tizen.NUI { } - /// - /// Enumeration for function to release the pixel buffer. - /// - /// 5 - /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public enum ReleaseFunction - { - /// - /// Use free function to release the pixel buffer. - /// - Free, - - /// - /// Use delete[] operator to release the pixel buffer. - /// - DeleteArray - } - /// /// Generate Url from pixel data. /// diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Images/TSPixelData.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Images/TSPixelData.cs index e58cf7bfb..27af0d302 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Images/TSPixelData.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Images/TSPixelData.cs @@ -41,7 +41,7 @@ namespace Tizen.NUI.Devel.Tests byte[] buffer = new byte[1024]; - var testingTarget = new PixelData(buffer, 1024, 100, 150, PixelFormat.L8, PixelData.ReleaseFunction.Free); + var testingTarget = new PixelData(buffer, 1024, 100, 150, PixelFormat.L8); Assert.IsNotNull(testingTarget, "Can't create success object PixelData"); Assert.IsInstanceOf(testingTarget, "Should be an instance of PixelData type."); @@ -63,7 +63,7 @@ namespace Tizen.NUI.Devel.Tests byte[] buffer = new byte[10]; - using (PixelData pixelData = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free)) + using (PixelData pixelData = new PixelData(buffer, 10, 1, 2, PixelFormat.L8)) { var testingTarget = new PixelData(PixelData.getCPtr(pixelData).Handle, true); Assert.IsNotNull(testingTarget, "Can't create success object PixelData"); @@ -89,7 +89,7 @@ namespace Tizen.NUI.Devel.Tests byte[] buffer = new byte[10]; - var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free); + var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8); Assert.IsNotNull(testingTarget, "Can't create success object PixelData"); Assert.IsInstanceOf(testingTarget, "Should be an instance of PixelData type."); @@ -114,7 +114,7 @@ namespace Tizen.NUI.Devel.Tests byte[] buffer = new byte[10]; - var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free); + var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8); Assert.IsNotNull(testingTarget, "Can't create success object PixelData"); Assert.IsInstanceOf(testingTarget, "Should be an instance of PixelData type."); @@ -139,7 +139,7 @@ namespace Tizen.NUI.Devel.Tests byte[] buffer = new byte[10]; - var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free); + var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8); Assert.IsNotNull(testingTarget, "Can't create success object PixelData"); Assert.IsInstanceOf(testingTarget, "Should be an instance of PixelData type."); @@ -164,7 +164,7 @@ namespace Tizen.NUI.Devel.Tests byte[] buffer = new byte[10]; - var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.BGR8888, PixelData.ReleaseFunction.Free); + var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.BGR8888); Assert.IsNotNull(testingTarget, "Can't create success object PixelData"); Assert.IsInstanceOf(testingTarget, "Should be an instance of PixelData type.");