From: Joogab Yun Date: Tue, 26 Sep 2017 04:26:57 +0000 (+0900) Subject: [4.0] When native image is destroyed, It call TriggerEventInterface callback. X-Git-Tag: accepted/tizen/4.0/unified/20171010.163017~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=3d2425ed78131e450cea9f61ec19d4420e6a7aa4;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [4.0] When native image is destroyed, It call TriggerEventInterface callback. Change-Id: Ia9fdd0ba3025d3aee7494e76eb4fbad52e0cde1e --- diff --git a/adaptors/public-api/adaptor-framework/native-image-source.cpp b/adaptors/public-api/adaptor-framework/native-image-source.cpp old mode 100755 new mode 100644 diff --git a/adaptors/public-api/adaptor-framework/native-image-source.h b/adaptors/public-api/adaptor-framework/native-image-source.h old mode 100755 new mode 100644 diff --git a/adaptors/tizen/native-image-source-impl-tizen.cpp b/adaptors/tizen/native-image-source-impl-tizen.cpp old mode 100755 new mode 100644 index 3afb87b..fecf43b --- a/adaptors/tizen/native-image-source-impl-tizen.cpp +++ b/adaptors/tizen/native-image-source-impl-tizen.cpp @@ -29,6 +29,8 @@ #include #include #include +#include + // Allow this to be encoded and saved: #include @@ -88,7 +90,8 @@ NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, D mColorDepth( depth ), mEglImageKHR( NULL ), mEglImageExtensions( NULL ), - mSetSource( false ) + mSetSource( false ), + mNotification( NULL ) { DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() ); EglFactory& eglFactory = Adaptor::GetImplementation( Adaptor::Get() ).GetEGLFactory(); @@ -197,6 +200,11 @@ NativeImageSource::~NativeImageSource() if( mTbmSurface != NULL ) { tbm_surface_internal_unref( mTbmSurface ); + + if (mNotification != NULL) { + TriggerEventInterface* triggerEvent = static_cast(mNotification); + triggerEvent->Trigger(); + } } } } @@ -206,6 +214,12 @@ Any NativeImageSource::GetNativeImageSource() const return Any( mTbmSurface ); } + +void NativeImageSource::SetDestructorNotification(void* notification) +{ + mNotification = notification; +} + bool NativeImageSource::GetPixels(std::vector& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const { if( mTbmSurface != NULL ) diff --git a/adaptors/tizen/native-image-source-impl.h b/adaptors/tizen/native-image-source-impl.h old mode 100755 new mode 100644 index 505d8b2..a724d1e --- a/adaptors/tizen/native-image-source-impl.h +++ b/adaptors/tizen/native-image-source-impl.h @@ -63,6 +63,7 @@ public: */ Any GetNativeImageSource() const; + /** * @copydoc Dali::NativeImageSource::GetPixels() */ @@ -155,6 +156,11 @@ public: */ int GetEglImageTextureTarget(); + /** + * @copydoc Dali::NativeImageInterface::Extension::SetDestructorNotification((void *notification) + */ + void SetDestructorNotification(void* notification); + private: /** @@ -189,6 +195,7 @@ private: void* mEglImageKHR; ///< From EGL extension EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions bool mSetSource; + void *mNotification; }; } // namespace Adaptor diff --git a/adaptors/x11/native-image-source-impl-x.cpp b/adaptors/x11/native-image-source-impl-x.cpp old mode 100755 new mode 100644 diff --git a/adaptors/x11/native-image-source-impl.h b/adaptors/x11/native-image-source-impl.h old mode 100755 new mode 100644