/// <summary> /// Gets the texture set used by this renderer. /// </summary> /// <returns>The texture set used by the renderer.</returns> /// <since_tizen> 3 </since_tizen> public TextureSet GetTextures() { //to fix memory leak issue, match the handle count with native side. System.IntPtr cPtr = Interop.Renderer.GetTextures(SwigCPtr); HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as TextureSet; if (cPtr != null && ret == null) { ret = new TextureSet(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } return(ret); } Interop.BaseHandle.DeleteBaseHandle(CPtr); CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
internal Renderer GetRenderer(FrameData data) { Geometry geometry = CreateQuadGeometry(); Shader shader = CreateShader(); Texture texture = null; renderer = new Renderer(geometry, shader); textureSet = new TextureSet(); switch (data.Type) { case FrameData.FrameType.RemoteSurfaceTbmSurface: if (data.TbmSurface == null) { geometry.Dispose(); shader.Dispose(); return(null); } texture = new Texture(data.TbmSurface); textureSet.SetTexture(0, texture); renderer.SetTextures(textureSet); break; default: break; } texture?.Dispose(); geometry.Dispose(); shader.Dispose(); return(renderer); }
/// <summary> /// Sets the texture set to be used by this renderer. /// </summary> /// <param name="textureSet">The texture set to be used by this renderer.</param> /// <since_tizen> 3 </since_tizen> public void SetTextures(TextureSet textureSet) { NDalicPINVOKE.Renderer_SetTextures(swigCPtr, TextureSet.getCPtr(textureSet)); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextureSet obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }