[NUI] Add internal api to create Texture using TbmSurface (#1941)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Tue, 25 Aug 2020 04:31:31 +0000 (13:31 +0900)
committerGitHub <noreply@github.com>
Tue, 25 Aug 2020 04:31:31 +0000 (13:31 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.Texture.cs
src/Tizen.NUI/src/public/Texture.cs

index 921b9f3..4b493c6 100755 (executable)
@@ -46,6 +46,9 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Texture_GetHeight")]
             public static extern uint Texture_GetHeight(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Texture_TbmSurface")]
+            public static extern global::System.IntPtr Texture_New__TbmSurface(IntPtr jarg1);
         }
     }
 }
\ No newline at end of file
index c35a1f3..68873f7 100755 (executable)
@@ -14,6 +14,7 @@
  * limitations under the License.
  *
  */
+using System;
 using System.ComponentModel;
 
 namespace Tizen.NUI
@@ -46,6 +47,11 @@ namespace Tizen.NUI
 
         }
 
+        internal Texture(IntPtr tbmSurface) : this(Interop.Texture.Texture_New__TbmSurface(tbmSurface), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         internal Texture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Texture.Texture_SWIGUpcast(cPtr), cMemoryOwn)
         {
         }