- Destroy a previous egl image whenever SetSource gets new native buffer
- It works in PrepareTexture()
Change-Id: I0657832b046bc75042c3ffbbb4d70ca46c6d11ae
{
// 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;
void NativeImageSource::PrepareTexture()
{
- if( mSetSource && GlExtensionCreate() )
+ if( mSetSource )
{
- TargetTexture();
+ void* eglImage = mEglImageKHR;
+
+ if( GlExtensionCreate() )
+ {
+ TargetTexture();
+ }
+
+ mEglImageExtensions->DestroyImageKHR( eglImage );
+
mSetSource = false;
}
}