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