From 509039a3457c98b8ec7418343f1eb8a7022e7a44 Mon Sep 17 00:00:00 2001 From: "taeyoon0.lee" Date: Wed, 8 Mar 2017 16:39:49 +0900 Subject: [PATCH] [3.0] Destroy a previous egl image if SetSource gets new native buffer - Destroy a previous egl image whenever SetSource gets new native buffer - It works in PrepareTexture() Change-Id: I0657832b046bc75042c3ffbbb4d70ca46c6d11ae --- adaptors/tizen/native-image-source-impl-tizen.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/adaptors/tizen/native-image-source-impl-tizen.cpp b/adaptors/tizen/native-image-source-impl-tizen.cpp index 591d8b5..c0e5da5 100755 --- a/adaptors/tizen/native-image-source-impl-tizen.cpp +++ b/adaptors/tizen/native-image-source-impl-tizen.cpp @@ -387,7 +387,7 @@ bool NativeImageSource::GlExtensionCreate() { // casting from an unsigned int to a void *, which should then be cast back // to an unsigned int in the driver. - EGLClientBuffer eglBuffer = reinterpret_cast< EGLClientBuffer > (mTbmSurface); + EGLClientBuffer eglBuffer = reinterpret_cast< EGLClientBuffer >(mTbmSurface); if( !eglBuffer ) { return false; @@ -417,9 +417,17 @@ unsigned int NativeImageSource::TargetTexture() void NativeImageSource::PrepareTexture() { - if( mSetSource && GlExtensionCreate() ) + if( mSetSource ) { - TargetTexture(); + void* eglImage = mEglImageKHR; + + if( GlExtensionCreate() ) + { + TargetTexture(); + } + + mEglImageExtensions->DestroyImageKHR( eglImage ); + mSetSource = false; } } -- 2.7.4