From: taeyoon0.lee Date: Wed, 8 Mar 2017 07:39:49 +0000 (+0900) Subject: [3.0] Destroy a previous egl image if SetSource gets new native buffer X-Git-Tag: accepted/tizen/3.0/common/20170323.155239~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=509039a3457c98b8ec7418343f1eb8a7022e7a44;hp=e81f2e3973d3ffe64a290c5e12a3adabab1a537f;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [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 --- 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; } }