From: Adeel Kazmi Date: Tue, 28 Feb 2017 13:05:55 +0000 (-0800) Subject: Merge "Remove unused mEglImageKHRContainer from NativeImageSource and add error check... X-Git-Tag: dali_1.2.29~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=afdbf909870dea6ddf0144db823a4bf6a0b414f2;hp=e7f49c5071c090c5f10644b1dfaa6f9fbf64c10c;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Merge "Remove unused mEglImageKHRContainer from NativeImageSource and add error check" into devel/master --- diff --git a/adaptors/tizen/native-image-source-impl-tizen.cpp b/adaptors/tizen/native-image-source-impl-tizen.cpp index fe249e5..591d8b5 100755 --- a/adaptors/tizen/native-image-source-impl-tizen.cpp +++ b/adaptors/tizen/native-image-source-impl-tizen.cpp @@ -330,14 +330,6 @@ void NativeImageSource::SetSource( Any source ) mWidth = tbm_surface_get_width( mTbmSurface ); mHeight = tbm_surface_get_height( mTbmSurface ); } - - if( mEglImageKHRContainer.Size() > 2 ) - { - mEglImageExtensions->DestroyImageKHR(mEglImageKHRContainer[0]); - mEglImageKHRContainer.Erase( mEglImageKHRContainer.Begin() ); - } - - mEglImageKHRContainer.PushBack( mEglImageKHR ); } bool NativeImageSource::IsColorDepthSupported( Dali::NativeImageSource::ColorDepth colorDepth ) @@ -396,6 +388,10 @@ 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); + if( !eglBuffer ) + { + return false; + } mEglImageKHR = mEglImageExtensions->CreateImageKHR( eglBuffer ); @@ -404,9 +400,12 @@ bool NativeImageSource::GlExtensionCreate() void NativeImageSource::GlExtensionDestroy() { - mEglImageExtensions->DestroyImageKHR(mEglImageKHR); + if( mEglImageKHR ) + { + mEglImageExtensions->DestroyImageKHR(mEglImageKHR); - mEglImageKHR = NULL; + mEglImageKHR = NULL; + } } unsigned int NativeImageSource::TargetTexture() diff --git a/adaptors/tizen/native-image-source-impl.h b/adaptors/tizen/native-image-source-impl.h index 9bed6e7..505d8b2 100755 --- a/adaptors/tizen/native-image-source-impl.h +++ b/adaptors/tizen/native-image-source-impl.h @@ -34,12 +34,8 @@ namespace Internal namespace Adaptor { -class EglImageExtensions; -namespace -{ - typedef Dali::Vector< void* > EglImageContainer; -}; +class EglImageExtensions; /** * Dali internal NativeImageSource. @@ -193,7 +189,6 @@ private: void* mEglImageKHR; ///< From EGL extension EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions bool mSetSource; - EglImageContainer mEglImageKHRContainer; }; } // namespace Adaptor