[4.0] When native image is destroyed, It call TriggerEventInterface callback. 78/155678/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 16 Oct 2017 02:27:36 +0000 (11:27 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 16 Oct 2017 02:27:43 +0000 (11:27 +0900)
This reverts commit 42a87676ee90611c5f6085187919fb11e10b19f5.

Change-Id: I1efc39efdfcaf4b95829056626490e9a0964ba89

adaptors/public-api/adaptor-framework/native-image-source.cpp [changed mode: 0755->0644]
adaptors/public-api/adaptor-framework/native-image-source.h [changed mode: 0755->0644]
adaptors/tizen/native-image-source-impl-tizen.cpp [changed mode: 0755->0644]
adaptors/tizen/native-image-source-impl.h [changed mode: 0755->0644]
adaptors/x11/native-image-source-impl-x.cpp [changed mode: 0755->0644]
adaptors/x11/native-image-source-impl.h [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 3afb87b..fecf43b
@@ -29,6 +29,8 @@
 #include <gl/egl-factory.h>
 #include <adaptor-impl.h>
 #include <render-surface.h>
+#include <trigger-event-factory.h>
+
 
 // Allow this to be encoded and saved:
 #include <bitmap-saver.h>
@@ -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<TriggerEventInterface* >(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<unsigned char>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
 {
   if( mTbmSurface != NULL )
old mode 100755 (executable)
new mode 100644 (file)
index 505d8b2..a724d1e
@@ -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
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)