Merge branch 'devel/master' into tizen
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 28 May 2020 05:18:12 +0000 (14:18 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 28 May 2020 05:18:21 +0000 (14:18 +0900)
Change-Id: I32243b7d57c1fcad3c555176a4076f52858889ba

61 files changed:
automated-tests/src/dali-adaptor/utc-Dali-PixelBuffer.cpp
build/tizen/profiles/windows-profile.cmake
dali/devel-api/adaptor-framework/bitmap-saver.cpp
dali/devel-api/adaptor-framework/bitmap-saver.h
dali/devel-api/adaptor-framework/native-image-source-devel.cpp
dali/devel-api/adaptor-framework/native-image-source-devel.h
dali/devel-api/adaptor-framework/native-image-source-queue.cpp
dali/devel-api/adaptor-framework/native-image-source-queue.h
dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h
dali/devel-api/adaptor-framework/vector-animation-renderer.cpp
dali/devel-api/adaptor-framework/vector-animation-renderer.h
dali/devel-api/adaptor-framework/window-devel.cpp [changed mode: 0644->0755]
dali/devel-api/adaptor-framework/window-devel.h [changed mode: 0644->0755]
dali/integration-api/adaptor-framework/scene-holder-impl.cpp
dali/internal/accessibility/tizen-wayland/atspi/accessibility-impl.cpp
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/adaptor/common/combined-update-render-controller.h
dali/internal/adaptor/common/thread-controller-interface.h
dali/internal/graphics/common/graphics-interface.h
dali/internal/graphics/gles/egl-implementation.cpp
dali/internal/haptics/common/feedback-plugin-proxy.cpp
dali/internal/imaging/android/native-image-source-impl-android.cpp
dali/internal/imaging/android/native-image-source-impl-android.h
dali/internal/imaging/android/native-image-source-queue-impl-android.cpp
dali/internal/imaging/android/native-image-source-queue-impl-android.h
dali/internal/imaging/common/image-loader-plugin-proxy.cpp
dali/internal/imaging/common/native-image-source-impl.h
dali/internal/imaging/common/native-image-source-queue-impl.h
dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-impl-tizen.h
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h
dali/internal/imaging/windows/native-image-source-impl-win.cpp
dali/internal/imaging/windows/native-image-source-impl-win.h
dali/internal/input/common/key-impl.cpp
dali/internal/network/common/automation.cpp
dali/internal/system/common/capture-impl.cpp
dali/internal/system/common/capture-impl.h
dali/internal/system/common/color-controller-impl.cpp
dali/internal/system/common/thread-controller.cpp
dali/internal/system/common/thread-controller.h
dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp
dali/internal/vector-animation/common/vector-animation-renderer-impl.h
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h
dali/internal/video/common/video-player-impl.cpp
dali/internal/web-engine/common/web-engine-impl.cpp
dali/internal/window-system/common/window-impl.cpp [changed mode: 0644->0755]
dali/internal/window-system/common/window-impl.h [changed mode: 0644->0755]
dali/internal/window-system/common/window-render-surface.cpp
dali/public-api/adaptor-framework/native-image-source.cpp
dali/public-api/capture/capture.cpp
dali/public-api/capture/capture.h
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 709b2c9..055d4be 100644 (file)
@@ -243,7 +243,7 @@ int UtcDaliPixelBufferConvert(void)
     Actor a = Actor::New();
     a.AddRenderer(r);
     a.SetSize(10, 10);
-    a.SetParentOrigin(ParentOrigin::CENTER);
+    a.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     Stage::GetCurrent().Add(a);
 
     application.SendNotification();
index b190e23..e32175e 100644 (file)
@@ -80,5 +80,5 @@ SET( REQUIRED_LIBS
         unofficial::angle::libEGL
         unofficial::angle::libGLESv2
         unofficial::cairo::cairo
-        dali-core::dali-core
+        dali2-core::dali2-core
 )
index c39bb70..68adfc7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -91,13 +91,14 @@ bool EncodeToFormat( const unsigned char* pixelBuffer,
                      FileFormat formatEncoding,
                      std::size_t width,
                      std::size_t height,
-                     Pixel::Format pixelFormat )
+                     Pixel::Format pixelFormat,
+                     const uint32_t quality )
 {
   switch( formatEncoding )
   {
     case JPG_FORMAT:
     {
-      return TizenPlatform::EncodeToJpeg( pixelBuffer, encodedPixels, width, height, pixelFormat );
+      return TizenPlatform::EncodeToJpeg( pixelBuffer, encodedPixels, width, height, pixelFormat, quality );
       break;
     }
     case PNG_FORMAT:
@@ -122,10 +123,20 @@ bool EncodeToFile(const unsigned char* const pixelBuffer,
                   const std::size_t width,
                   const std::size_t height )
 {
+  return EncodeToFile( pixelBuffer, filename, pixelFormat, width, height, DEFAULT_JPG_QUALITY );
+}
+
+bool EncodeToFile(const unsigned char* const pixelBuffer,
+                  const std::string& filename,
+                  const Pixel::Format pixelFormat,
+                  const std::size_t width,
+                  const std::size_t height,
+                  const uint32_t quality )
+{
   DALI_ASSERT_DEBUG(pixelBuffer != 0 && filename.size() > 4 && width > 0 && height > 0);
   Vector< unsigned char > pixbufEncoded;
   const FileFormat format = GetFormatFromFileName( filename );
-  const bool encodeResult = EncodeToFormat( pixelBuffer, pixbufEncoded, format, width, height, pixelFormat );
+  const bool encodeResult = EncodeToFormat( pixelBuffer, pixbufEncoded, format, width, height, pixelFormat, quality );
   if(!encodeResult)
   {
     DALI_LOG_ERROR("Encoding pixels failed\n");
index e1f6ab7..1a5a8b1 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_ADAPTOR_BITMAP_SAVER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,8 @@
 namespace Dali
 {
 
+static constexpr uint32_t DEFAULT_JPG_QUALITY = 100;
+
 /**
  * Store the given pixel data to a file.
  * The suffix of the filename determines what type of file will be stored,
@@ -46,6 +48,27 @@ DALI_ADAPTOR_API bool EncodeToFile(const unsigned char* const pixelBuffer,
                                   const std::size_t width,
                                   const std::size_t height);
 
+/**
+ * Store the given pixel data to a file.
+ * The suffix of the filename determines what type of file will be stored,
+ * currently only jpeg and png formats are supported.
+ *
+ * @param[in] pixelBuffer Pointer to the pixel data
+ * @param[in] filename    Filename to save
+ * @param[in] pixelFormat The format of the buffer's pixels
+ * @param[in] width       The width of the image in pixels
+ * @param[in] height      The height of the image in pixels
+ * @param[in] quality     The value to control image quality for jpeg file format in the range [1, 100]
+ *
+ * @return true if the file was saved
+ */
+DALI_ADAPTOR_API bool EncodeToFile(const unsigned char* const pixelBuffer,
+                                  const std::string& filename,
+                                  const Pixel::Format pixelFormat,
+                                  const std::size_t width,
+                                  const std::size_t height,
+                                  const uint32_t quality);
+
 } // namespace Dali
 
 
index 3072690..3250d44 100755 (executable)
@@ -28,6 +28,11 @@ namespace Dali
 namespace DevelNativeImageSource\r
 {\r
 \r
+bool EncodeToFile( NativeImageSource& image, const std::string& filename, const uint32_t quality )\r
+{\r
+  return Dali::Internal::Adaptor::NativeImageSource::GetImplementation( image ).EncodeToFile( filename, quality );\r
+}\r
+\r
 uint8_t* AcquireBuffer( NativeImageSource& image, uint16_t& width, uint16_t& height, uint16_t& stride )\r
 {\r
   return Dali::Internal::Adaptor::NativeImageSource::GetImplementation( image ).AcquireBuffer( width, height, stride );\r
index 0c470c8..eeea436 100755 (executable)
@@ -27,6 +27,19 @@ namespace DevelNativeImageSource
 {\r
 \r
 /**\r
+ * @brief Converts the current pixel contents to either a JPEG or PNG format\r
+ * and write that to the filesystem.\r
+ *\r
+ * @param[in] image The instance of NativeImageSource.\r
+ * @param[in] filename Identify the filesystem location at which to write the encoded image.\r
+ *                     The extension determines the encoding used.\r
+ *                     The two valid encoding are (".jpeg"|".jpg") and ".png".\r
+ * @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]\r
+ * @return    @c true if the pixels were written, and @c false otherwise\r
+ */\r
+DALI_ADAPTOR_API bool EncodeToFile( NativeImageSource& image, const std::string& filename, const uint32_t quality );\r
+\r
+/**\r
  * @brief Acquire buffer and information of an internal native image.\r
  *\r
  * AcquireBuffer() and ReleaseBuffer() are a pair.\r
index 297fd2a..acb10d5 100755 (executable)
@@ -56,6 +56,11 @@ void NativeImageSourceQueue::SetSize( uint32_t width, uint32_t height )
   return mImpl->SetSize( width, height );
 }
 
+void NativeImageSourceQueue::IgnoreSourceImage()
+{
+  mImpl->IgnoreSourceImage();
+}
+
 bool NativeImageSourceQueue::GlExtensionCreate()
 {
   return mImpl->GlExtensionCreate();
index 32b08c3..0e02903 100755 (executable)
@@ -104,6 +104,13 @@ public:
    */
   void SetSize( uint32_t width, uint32_t height );
 
+  /**
+   * @brief Ignores a source image which is inserted to the queue.
+   *
+   * @note This can be called from worker threads.
+   */
+  void IgnoreSourceImage();
+
 private:   // native image
 
   /**
index c7b0011..d262cfc 100644 (file)
@@ -129,6 +129,11 @@ public:
   virtual bool GetMarkerInfo( const std::string& marker, uint32_t& startFrame, uint32_t& endFrame ) const = 0;
 
   /**
+   * @brief Ignores a rendered frame which is not shown yet.
+   */
+  virtual void IgnoreRenderedFrame() = 0;
+
+  /**
    * @brief Connect to this signal to be notified when the texture upload is completed.
    *
    * @return The signal to connect to.
index 9cd05ad..d06aac5 100755 (executable)
@@ -104,6 +104,11 @@ bool VectorAnimationRenderer::GetMarkerInfo( const std::string& marker, uint32_t
   return GetImplementation( *this ).GetMarkerInfo( marker, startFrame, endFrame );
 }
 
+void VectorAnimationRenderer::IgnoreRenderedFrame()
+{
+  GetImplementation( *this ).IgnoreRenderedFrame();
+}
+
 VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
 {
   return GetImplementation( *this ).UploadCompletedSignal();
index 0e2f14a..666f746 100755 (executable)
@@ -156,6 +156,11 @@ public:
    */
   bool GetMarkerInfo( const std::string& marker, uint32_t& startFrame, uint32_t& endFrame ) const;
 
+  /**
+   * @brief Ignores a rendered frame which is not shown yet.
+   */
+  void IgnoreRenderedFrame();
+
 public: // Signals
 
   /**
old mode 100644 (file)
new mode 100755 (executable)
index e2f503e..b9fadbb
@@ -143,6 +143,11 @@ void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::W
   GetImplementation( window ).SetAvailableOrientations( orientations );
 }
 
+int32_t GetNativeId( Window window )
+{
+  return GetImplementation( window ).GetNativeId();
+}
+
 } // namespace DevelWindow
 
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index 4687503..958b940
@@ -243,6 +243,13 @@ DALI_ADAPTOR_API Dali::Window::WindowOrientation GetCurrentOrientation( Window w
  */
 DALI_ADAPTOR_API void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations );
 
+/**
+ * @brief Gets current window ID.
+ *
+ * @param[in] window The window instance
+ */
+DALI_ADAPTOR_API int32_t GetNativeId( Window window );
+
 } // namespace DevelWindow
 
 } // namespace Dali
index 2440b35..7162a1c 100644 (file)
@@ -133,6 +133,8 @@ SceneHolder::~SceneHolder()
     mAdaptor->RemoveObserver( *mLifeCycleObserver.get() );
     mAdaptor->RemoveWindow( this );
 
+    mAdaptor->DeleteSurface( *mSurface.get() );
+
     mAdaptor = nullptr;
   }
 
index 30b9179..382e08b 100644 (file)
@@ -605,9 +605,9 @@ public:
   Dali::Rect<> GetExtents( Dali::Accessibility::CoordType ctype ) override
   {
     Vector2 screenPosition = actor.GetProperty( Dali::DevelActor::Property::SCREEN_POSITION ).Get< Vector2 >();
-    Vector3 size = actor.GetCurrentSize() * actor.GetCurrentWorldScale();
+    Vector3 size = actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) * actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE );
     bool positionUsesAnchorPoint = actor.GetProperty( Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >();
-    Vector3 anchorPointOffSet = size * ( positionUsesAnchorPoint ? actor.GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT );
+    Vector3 anchorPointOffSet = size * ( positionUsesAnchorPoint ? actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ) : AnchorPoint::TOP_LEFT );
     Vector2 position = Vector2( screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y );
 
     return { position.x, position.y, size.x, size.y };
@@ -646,7 +646,7 @@ public:
   }
   std::string GetName() override
   {
-    return actor.GetName();
+    return actor.GetProperty< std::string >( Dali::Actor::Property::NAME );
   }
   std::string GetDescription() override
   {
index e06310a..737845d 100755 (executable)
@@ -20,6 +20,8 @@
 #include <dali/internal/adaptor/common/adaptor-builder-impl.h>
 
 // EXTERNAL INCLUDES
+#include <errno.h>
+#include <sys/stat.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/object/any.h>
@@ -159,10 +161,11 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
 
   DALI_ASSERT_DEBUG( defaultWindow->GetSurface() && "Surface not initialized" );
 
-  mGraphics = &( graphicsFactory.Create() );
+  mGraphics = std::unique_ptr< GraphicsInterface >( &graphicsFactory.Create() );
   mGraphics->Initialize( mEnvironmentOptions );
 
-  auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
+  GraphicsInterface* graphics = mGraphics.get(); // This interface is temporary until Core has been updated to match
+  auto eglGraphics = static_cast<EglGraphics *>( graphics );
 
   // This will only be created once
   eglGraphics->Create();
@@ -299,11 +302,11 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
   std::string systemCachePath = GetSystemCachePath();
   if( ! systemCachePath.empty() )
   {
-    const int dir_err = system( std::string( "mkdir " + systemCachePath ).c_str() );
-    if (-1 == dir_err)
+    const int dir_err = mkdir( systemCachePath.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH );
+    if ( 0 != dir_err && errno != EEXIST )
     {
-        printf( "Error creating system cache directory: %s!\n", systemCachePath.c_str() );
-        exit(1);
+      DALI_LOG_ERROR( "Error creating system cache directory: %s!\n", systemCachePath.c_str() );
+      exit( 1 );
     }
   }
 
@@ -555,6 +558,16 @@ void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::Rende
   }
 }
 
+void Adaptor::DeleteSurface( Dali::RenderSurfaceInterface& surface )
+{
+  // Flush the event queue to give the update-render thread chance
+  // to start processing messages for new camera setup etc as soon as possible
+  ProcessCoreEvents();
+
+  // This method blocks until the render thread has finished rendering the current surface.
+  mThreadController->DeleteSurface( &surface );
+}
+
 Dali::RenderSurfaceInterface& Adaptor::GetSurface() const
 {
   return *mWindows.front()->GetSurface();
@@ -700,7 +713,7 @@ Dali::DisplayConnection& Adaptor::GetDisplayConnectionInterface()
 GraphicsInterface& Adaptor::GetGraphicsInterface()
 {
   DALI_ASSERT_DEBUG( mGraphics && "Graphics interface not created" );
-  return *mGraphics;
+  return *( mGraphics.get() );
 }
 
 Dali::Integration::PlatformAbstraction& Adaptor::GetPlatformAbstractionInterface()
@@ -791,7 +804,8 @@ Any Adaptor::GetGraphicsDisplay()
 
   if (mGraphics)
   {
-    auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
+    GraphicsInterface* graphics = mGraphics.get(); // This interface is temporary until Core has been updated to match
+    auto eglGraphics = static_cast<EglGraphics *>( graphics );
 
     EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
     display = eglImpl.GetDisplay();
@@ -1039,11 +1053,6 @@ bool Adaptor::IsMultipleWindowSupported() const
   return mConfigurationManager->IsMultipleWindowSupported();
 }
 
-bool Adaptor::IsRenderingWindows() const
-{
-  return ( mThreadController && mThreadController->IsRenderingWindows() );
-}
-
 void Adaptor::RequestUpdateOnce()
 {
   if( mThreadController )
index c2a9ad4..9e4c079 100755 (executable)
@@ -292,6 +292,12 @@ public: // AdaptorInternalServices implementation
   bool RemoveWindow( Dali::Internal::Adaptor::SceneHolder* childWindow );
 
   /**
+   * @brief Deletes the rendering surface
+   * @param[in] surface to delete
+   */
+  void DeleteSurface( Dali::RenderSurfaceInterface& surface );
+
+  /**
    * @brief Retrieve the window that the given actor is added to.
    *
    * @param[in] actor The actor
@@ -443,13 +449,6 @@ public:
    */
   bool IsMultipleWindowSupported() const;
 
-  /**
-   * @brief Checks whether the windows are being rendered in the render thread.
-   *
-   * @return true if the windows are being rendered in the render thread, or false if not.
-   */
-  bool IsRenderingWindows() const;
-
 public:  //AdaptorInternalServices
 
   /**
@@ -665,7 +664,7 @@ private: // Data
   Dali::Integration::Core*              mCore;                        ///< Dali Core
   ThreadController*                     mThreadController;            ///< Controls the threads
 
-  GraphicsInterface*                    mGraphics;                    ///< Graphics interface
+  std::unique_ptr< GraphicsInterface >  mGraphics;                    ///< Graphics interface
   Dali::DisplayConnection*              mDisplayConnection;           ///< Display connection
   WindowContainer                       mWindows;                     ///< A container of all the Windows that are currently created
 
index 80bc0a3..5c5840a 100644 (file)
@@ -115,12 +115,12 @@ CombinedUpdateRenderController::CombinedUpdateRenderController( AdaptorInternalS
   mPendingRequestUpdate( FALSE ),
   mUseElapsedTimeAfterWait( FALSE ),
   mNewSurface( NULL ),
+  mDeletedSurface( nullptr ),
   mPostRendering( FALSE ),
   mSurfaceResized( FALSE ),
   mForceClear( FALSE ),
   mUploadWithoutRendering( FALSE ),
-  mFirstFrameAfterResume( FALSE ),
-  mIsRenderingWindows( false )
+  mFirstFrameAfterResume( FALSE )
 {
   LOG_EVENT_TRACE;
 
@@ -324,6 +324,29 @@ void CombinedUpdateRenderController::ReplaceSurface( Dali::RenderSurfaceInterfac
   }
 }
 
+void CombinedUpdateRenderController::DeleteSurface( Dali::RenderSurfaceInterface* surface )
+{
+  LOG_EVENT_TRACE;
+
+  if( mUpdateRenderThread )
+  {
+    LOG_EVENT( "Starting to delete the surface, event-thread blocked" );
+
+    // Start replacing the surface.
+    {
+      ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
+      mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will delete the surface now
+      mDeletedSurface = surface;
+      mUpdateRenderThreadWaitCondition.Notify( lock );
+    }
+
+    // Wait until the surface has been deleted
+    sem_wait( &mEventThreadSemaphore );
+
+    LOG_EVENT( "Surface deleted, event-thread continuing" );
+  }
+}
+
 void CombinedUpdateRenderController::WaitForGraphicsInitialization()
 {
   LOG_EVENT_TRACE;
@@ -663,8 +686,6 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
     AddPerformanceMarker( PerformanceInterface::RENDER_START );
 
-    mIsRenderingWindows = true;
-
     // Upload shared resources
     mCore.PreRender( renderStatus, mForceClear, mUploadWithoutRendering );
 
@@ -676,33 +697,42 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
       for( auto&& window : windows )
       {
-        if ( window && !window->IsBeingDeleted() )
-        {
-          Dali::Integration::Scene scene = window->GetScene();
-          Dali::RenderSurfaceInterface* windowSurface = window->GetSurface();
+        Dali::Integration::Scene scene = window->GetScene();
+        Dali::RenderSurfaceInterface* windowSurface = window->GetSurface();
 
-          if ( scene && windowSurface )
-          {
-            windowSurface->InitializeGraphics();
+        if ( scene && windowSurface )
+        {
+          windowSurface->InitializeGraphics();
 
-            // Render off-screen frame buffers first if any
-            mCore.RenderScene( scene, true );
+          // Render off-screen frame buffers first if any
+          mCore.RenderScene( scene, true );
 
-            // Switch to the EGL context of the surface
-            windowSurface->PreRender( surfaceResized ); // Switch GL context
+          // Switch to the EGL context of the surface
+          windowSurface->PreRender( surfaceResized ); // Switch GL context
 
-            // Render the surface
-            mCore.RenderScene( scene, false );
+          // Render the surface
+          mCore.RenderScene( scene, false );
 
-            windowSurface->PostRender( false, false, surfaceResized ); // Swap Buffer
-          }
+          windowSurface->PostRender( false, false, surfaceResized ); // Swap Buffer
         }
       }
     }
 
     mCore.PostRender( mUploadWithoutRendering );
 
-    mIsRenderingWindows = false;
+    //////////////////////////////
+    // DELETE SURFACE
+    //////////////////////////////
+
+    Dali::RenderSurfaceInterface* deletedSurface = ShouldSurfaceBeDeleted();
+    if( DALI_UNLIKELY( deletedSurface ) )
+    {
+      LOG_UPDATE_RENDER_TRACE_FMT( "Deleting Surface" );
+
+      deletedSurface->DestroySurface();
+
+      SurfaceDeleted();
+    }
 
     AddPerformanceMarker( PerformanceInterface::RENDER_END );
 
@@ -764,7 +794,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     }
   }
 
-  // Inform core of context destruction & shutdown EGL
+  // Inform core of context destruction
   mCore.ContextDestroyed();
   currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
   if( currentSurface )
@@ -773,6 +803,9 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     currentSurface = nullptr;
   }
 
+  // Shutdown EGL
+  eglInterface->TerminateGles();
+
   LOG_UPDATE_RENDER( "THREAD DESTROYED" );
 
   // Uninstall the logging function
@@ -788,12 +821,14 @@ bool CombinedUpdateRenderController::UpdateRenderReady( bool& useElapsedTime, bo
            ( mUpdateRenderThreadCanSleep && ! updateRequired && ! mPendingRequestUpdate ) ) && // Ensure we wait if we're supposed to be sleeping AND do not require another update
          ! mDestroyUpdateRenderThread && // Ensure we don't wait if the update-render-thread is supposed to be destroyed
          ! mNewSurface &&  // Ensure we don't wait if we need to replace the surface
+         ! mDeletedSurface && // Ensure we don't wait if we need to delete the surface
          ! mSurfaceResized ) // Ensure we don't wait if we need to resize the surface
   {
     LOG_UPDATE_RENDER( "WAIT: mUpdateRenderRunCount:       %d", mUpdateRenderRunCount );
     LOG_UPDATE_RENDER( "      mUpdateRenderThreadCanSleep: %d, updateRequired: %d, mPendingRequestUpdate: %d", mUpdateRenderThreadCanSleep, updateRequired, mPendingRequestUpdate );
     LOG_UPDATE_RENDER( "      mDestroyUpdateRenderThread:  %d", mDestroyUpdateRenderThread );
     LOG_UPDATE_RENDER( "      mNewSurface:                 %d", mNewSurface );
+    LOG_UPDATE_RENDER( "      mDeletedSurface:             %d", mDeletedSurface );
     LOG_UPDATE_RENDER( "      mSurfaceResized:             %d", mSurfaceResized );
 
     // Reset the time when the thread is waiting, so the sleep-until time for
@@ -813,6 +848,7 @@ bool CombinedUpdateRenderController::UpdateRenderReady( bool& useElapsedTime, bo
   LOG_COUNTER_UPDATE_RENDER( "mUpdateRenderThreadCanSleep: %d, updateRequired: %d, mPendingRequestUpdate: %d", mUpdateRenderThreadCanSleep, updateRequired, mPendingRequestUpdate );
   LOG_COUNTER_UPDATE_RENDER( "mDestroyUpdateRenderThread:  %d", mDestroyUpdateRenderThread );
   LOG_COUNTER_UPDATE_RENDER( "mNewSurface:                 %d", mNewSurface );
+  LOG_COUNTER_UPDATE_RENDER( "mDeletedSurface:             %d", mDeletedSurface );
   LOG_COUNTER_UPDATE_RENDER( "mSurfaceResized:             %d", mSurfaceResized );
 
   mUseElapsedTimeAfterWait = FALSE;
@@ -846,6 +882,22 @@ void CombinedUpdateRenderController::SurfaceReplaced()
   sem_post( &mEventThreadSemaphore );
 }
 
+Dali::RenderSurfaceInterface* CombinedUpdateRenderController::ShouldSurfaceBeDeleted()
+{
+  ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
+
+  Dali::RenderSurfaceInterface* deletedSurface = mDeletedSurface;
+  mDeletedSurface = NULL;
+
+  return deletedSurface;
+}
+
+void CombinedUpdateRenderController::SurfaceDeleted()
+{
+  // Just increment the semaphore
+  sem_post( &mEventThreadSemaphore );
+}
+
 bool CombinedUpdateRenderController::ShouldSurfaceBeResized()
 {
   ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
@@ -907,6 +959,7 @@ void CombinedUpdateRenderController::PostRenderWaitForCompletion()
   ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
   while( mPostRendering &&
          ! mNewSurface &&                // We should NOT wait if we're replacing the surface
+         ! mDeletedSurface &&            // We should NOT wait if we're deleting the surface
          ! mDestroyUpdateRenderThread )
   {
     mUpdateRenderThreadWaitCondition.Wait( lock );
index ca22517..54cc67d 100644 (file)
@@ -128,6 +128,11 @@ public:
   virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
 
   /**
+   * @copydoc ThreadControllerInterface::DeleteSurface()
+   */
+  virtual void DeleteSurface( Dali::RenderSurfaceInterface* surface );
+
+  /**
    * @copydoc ThreadControllerInterface::ResizeSurface()
    */
   virtual void ResizeSurface();
@@ -152,11 +157,6 @@ public:
    */
   virtual void AddSurface( Dali::RenderSurfaceInterface* surface );
 
-  /**
-   * @copydoc ThreadControllerInterface::IsRenderingWindows()
-   */
-  bool IsRenderingWindows() const override { return mIsRenderingWindows; }
-
 private:
 
   // Undefined copy constructor.
@@ -250,6 +250,21 @@ private:
   void SurfaceReplaced();
 
   /**
+   * Checks to see if the surface needs to be deleted.
+   * This will lock the mutex in mUpdateRenderThreadWaitCondition.
+   *
+   * @return Pointer to the deleted surface, nullptr otherwise
+   */
+  Dali::RenderSurfaceInterface* ShouldSurfaceBeDeleted();
+
+  /**
+   * Called by the Update/Render thread after a surface has been deleted.
+   *
+   * This will lock the mutex in mEventThreadWaitCondition
+   */
+  void SurfaceDeleted();
+
+  /**
    * Checks to see if the surface needs to be resized.
    * This will lock the mutex in mUpdateRenderThreadWaitCondition.
    *
@@ -365,6 +380,7 @@ private:
   volatile unsigned int             mUseElapsedTimeAfterWait;          ///< Whether we should use the elapsed time after waiting (set by the event-thread, read by the update-render-thread).
 
   Dali::RenderSurfaceInterface* volatile mNewSurface;                  ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread).
+  Dali::RenderSurfaceInterface* volatile mDeletedSurface;              ///< Will be set to the deleted surface if requested (set by the event-thread, read & cleared by the update-render thread).
 
   volatile unsigned int             mPostRendering;                    ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread).
   volatile unsigned int             mSurfaceResized;                   ///< Will be set to resize the surface (set by the event-thread, read & cleared by the update-render thread).
@@ -373,8 +389,6 @@ private:
   volatile unsigned int             mUploadWithoutRendering;           ///< Will be set to upload the resource only (with no rendering)
 
   volatile unsigned int             mFirstFrameAfterResume;            ///< Will be set to check the first frame after resume (for log)
-
-  std::atomic<bool>                 mIsRenderingWindows;               ///< This is set only from the render thread and read only from the event thread
 };
 
 } // namespace Adaptor
index 94276ff..6b9055b 100644 (file)
@@ -93,6 +93,12 @@ public:
   virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface ) = 0;
 
   /**
+   * Deletes the surface.
+   * @param[in] surface The surface to be deleted
+   */
+  virtual void DeleteSurface( Dali::RenderSurfaceInterface* surface ) = 0;
+
+  /**
    * Resize the surface.
    */
   virtual void ResizeSurface() = 0;
@@ -118,11 +124,6 @@ public:
    */
   virtual void AddSurface( Dali::RenderSurfaceInterface* surface ) = 0;
 
-  /**
-   * @copydoc Dali::Adaptor::IsRenderingWindows()
-   */
-  virtual bool IsRenderingWindows() const = 0;
-
 protected:
 
   /**
index 5e80ef7..93c1b2f 100644 (file)
@@ -48,6 +48,11 @@ public:
   };
 
   /**
+   * Destructor
+   */
+  virtual ~GraphicsInterface() {}
+
+  /**
    * Initialize the graphics interface
    * @param[in]  environmentOptions  The environment options.
    */
@@ -76,12 +81,6 @@ public:
     return mStencilBufferRequired;
   };
 
-protected:
-  /**
-   * Virtual protected destructor - no deletion through this interface
-   */
-  virtual ~GraphicsInterface() {};
-
 
 protected:
 
index c653ab6..38851f9 100755 (executable)
@@ -195,10 +195,11 @@ bool EglImplementation::CreateWindowContext( EGLContext& eglContext )
 
 void EglImplementation::DestroyContext( EGLContext& eglContext )
 {
-  DALI_ASSERT_ALWAYS( mEglContext && "no EGL context" );
-
-  eglDestroyContext( mEglDisplay, eglContext );
-  eglContext = 0;
+  if( eglContext )
+  {
+    eglDestroyContext( mEglDisplay, eglContext );
+    eglContext = 0;
+  }
 }
 
 void EglImplementation::DestroySurface( EGLSurface& eglSurface )
index f8d7ce7..6829d21 100644 (file)
@@ -31,11 +31,7 @@ namespace Internal
 namespace Adaptor
 {
 
-#if _GLIBCXX_USE_CXX11_ABI
-const char * const FeedbackPluginProxy::DEFAULT_OBJECT_NAME( "libdali-feedback-plugin.so" );
-#else
-const char * const FeedbackPluginProxy::DEFAULT_OBJECT_NAME( "libdali-feedback-plugin-cxx03.so" );
-#endif
+const char * const FeedbackPluginProxy::DEFAULT_OBJECT_NAME( "libdali2-feedback-plugin.so" );
 
 FeedbackPluginProxy::FeedbackPluginProxy( const std::string& sharedObjectName )
 : mInitializeAttempted( false ),
index 53fdc8c..19312b5 100755 (executable)
@@ -29,7 +29,6 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 #include <dali/internal/graphics/common/egl-image-extensions.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
@@ -191,19 +190,6 @@ bool NativeImageSourceAndroid::GetPixels(std::vector<unsigned char>& pixbuf, uns
   return success;
 }
 
-bool NativeImageSourceAndroid::EncodeToFile(const std::string& filename) const
-{
-  std::vector< unsigned char > pixbuf;
-  unsigned int width(0), height(0);
-  Pixel::Format pixelFormat;
-
-  if( GetPixels( pixbuf, width, height, pixelFormat ) )
-  {
-    return Dali::EncodeToFile( &pixbuf[0], filename, pixelFormat, width, height );
-  }
-  return false;
-}
-
 void NativeImageSourceAndroid::SetSource( Any source )
 {
   if( mPixmap )
index 7d941ca..3b68f1c 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -69,11 +69,6 @@ public:
   bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
 
   /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  bool EncodeToFile(const std::string& filename) const override;
-
-  /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
    */
   void SetSource( Any source ) override;
index 7043979..45905bd 100644 (file)
@@ -72,6 +72,10 @@ void NativeImageSourceQueueAndroid::SetSize( uint32_t width, uint32_t height )
   mHeight = height;
 }
 
+void NativeImageSourceQueueAndroid::IgnoreSourceImage()
+{
+}
+
 bool NativeImageSourceQueueAndroid::GlExtensionCreate()
 {
   return true;
index e1cb045..be5b8b6 100644 (file)
@@ -65,6 +65,11 @@ public:
   void SetSize( uint32_t width, uint32_t height ) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  void IgnoreSourceImage() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueAndroid() override;
index 1c61731..126754a 100755 (executable)
@@ -35,7 +35,7 @@ namespace ImageLoaderPluginProxy
 {
 
 
-static const char * DEFAULT_OBJECT_NAME( "libdali-image-loader-plugin.so" );
+static const char * DEFAULT_OBJECT_NAME( "libdali2-image-loader-plugin.so" );
 
 static bool mInitializeAttempted = false;
 static void* mLibHandle = NULL;
index d5f292f..0833f51 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_IMPL_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/native-image-source.h>
+#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 
 namespace Dali
 {
@@ -37,6 +38,8 @@ class NativeImageSource
 {
 public:
 
+  static constexpr uint32_t DEFAULT_QUALITY = 100;
+
   /**
    * Create a new NativeImageSource internally.
    * Depending on hardware the width and height may have to be a power of two.
@@ -61,11 +64,6 @@ public:
   virtual bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const = 0;
 
   /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  virtual bool EncodeToFile(const std::string& filename) const = 0;
-
-  /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
    */
   virtual void SetSource( Any source ) = 0;
@@ -130,6 +128,37 @@ public:
    */
   virtual bool ReleaseBuffer() = 0;
 
+  /**
+   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
+   */
+  inline bool EncodeToFile( const std::string& filename ) const
+  {
+    return EncodeToFile( filename, DEFAULT_QUALITY );
+  }
+
+  /**
+   * @brief Converts the current pixel contents to either a JPEG or PNG format
+   * and write that to the filesystem.
+   *
+   * @param[in] filename Identify the filesystem location at which to write the encoded image.
+   *                     The extension determines the encoding used.
+   *                     The two valid encoding are (".jpeg"|".jpg") and ".png".
+   * @param[in] quality The quality of encoded jpeg image
+   * @return    @c true if the pixels were written, and @c false otherwise
+   */
+  inline bool EncodeToFile( const std::string& filename, const uint32_t quality ) const
+  {
+    std::vector< uint8_t > pixbuf;
+    uint32_t width( 0 ), height( 0 );
+    Pixel::Format pixelFormat;
+
+    if( GetPixels( pixbuf, width, height, pixelFormat ) )
+    {
+      return Dali::EncodeToFile( &pixbuf[0], filename, pixelFormat, width, height, quality );
+    }
+    return false;
+  }
+
 public:
   inline static Internal::Adaptor::NativeImageSource& GetImplementation( Dali::NativeImageSource& image ) { return *image.mImpl; }
 };
index 889935e..eeb87f2 100755 (executable)
@@ -53,6 +53,11 @@ public:
   virtual void SetSize( uint32_t width, uint32_t height ) = 0;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  virtual void IgnoreSourceImage() = 0;
+
+  /**
    * destructor
    */
   virtual ~NativeImageSourceQueue() = default;
index 2682522..096944c 100755 (executable)
@@ -30,9 +30,6 @@
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 
-// Allow this to be encoded and saved:
-#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
-
 namespace Dali
 {
 
@@ -301,10 +298,10 @@ bool NativeImageSourceTizen::GetPixels(std::vector<unsigned char>& pixbuf, unsig
           {
             cOffset = c*4;
             offset = cOffset + r*stride;
-            *(bufptr+cOffset) = ptr[offset];
-            *(bufptr+cOffset+1) = ptr[offset+3];
-            *(bufptr+cOffset+2) = ptr[offset+2];
-            *(bufptr+cOffset+3) = ptr[offset+1];
+            *(bufptr+cOffset)   = ptr[offset+2];
+            *(bufptr+cOffset+1) = ptr[offset+1];
+            *(bufptr+cOffset+2) = ptr[offset];
+            *(bufptr+cOffset+3) = ptr[offset+3];
           }
         }
         break;
@@ -333,19 +330,6 @@ bool NativeImageSourceTizen::GetPixels(std::vector<unsigned char>& pixbuf, unsig
   return false;
 }
 
-bool NativeImageSourceTizen::EncodeToFile(const std::string& filename) const
-{
-  std::vector< unsigned char > pixbuf;
-  unsigned int width(0), height(0);
-  Pixel::Format pixelFormat;
-
-  if(GetPixels(pixbuf, width, height, pixelFormat))
-  {
-    return Dali::EncodeToFile(&pixbuf[0], filename, pixelFormat, width, height);
-  }
-  return false;
-}
-
 void NativeImageSourceTizen::SetSource( Any source )
 {
   Dali::Mutex::ScopedLock lock( mMutex );
index d40142c..9264a25 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_IMPL_TIZEN_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -69,12 +69,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetPixels()
    */
-  bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const  override;
-
-  /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  bool EncodeToFile(const std::string& filename) const override;
+  bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
 
   /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
index e7fa554..f95ee1a 100644 (file)
@@ -189,6 +189,26 @@ void NativeImageSourceQueueTizen::SetSize( uint32_t width, uint32_t height )
   ResetEglImageList();
 }
 
+void NativeImageSourceQueueTizen::IgnoreSourceImage()
+{
+  Dali::Mutex::ScopedLock lock( mMutex );
+  tbm_surface_h surface;
+
+  if( tbm_surface_queue_can_acquire( mTbmQueue, 0 ) )
+  {
+    if( tbm_surface_queue_acquire( mTbmQueue, &surface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
+    {
+      DALI_LOG_ERROR( "NativeImageSourceQueueTizen::IgnoreSourceImage: Failed to aquire a tbm_surface\n" );
+      return;
+    }
+
+    if( tbm_surface_internal_is_valid( surface ) )
+    {
+      tbm_surface_queue_release( mTbmQueue, surface );
+    }
+  }
+}
+
 bool NativeImageSourceQueueTizen::GlExtensionCreate()
 {
   mEglImageExtensions = mEglGraphics->GetImageExtensions();
index 88b27cb..7f16352 100755 (executable)
@@ -69,6 +69,11 @@ public:
   void SetSize( uint32_t width, uint32_t height ) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  void IgnoreSourceImage() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueTizen() override;
index 51c89d3..c222d3b 100755 (executable)
@@ -28,7 +28,6 @@
 #include <dali/internal/graphics/common/egl-image-extensions.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 
 namespace Dali
@@ -264,19 +263,6 @@ bool NativeImageSourceX::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
   return success;
 }
 
-bool NativeImageSourceX::EncodeToFile(const std::string& filename) const
-{
-  std::vector< unsigned char > pixbuf;
-  unsigned int width(0), height(0);
-  Pixel::Format pixelFormat;
-
-  if(GetPixels(pixbuf, width, height, pixelFormat))
-  {
-    return Dali::EncodeToFile(&pixbuf[0], filename, pixelFormat, width, height);
-  }
-  return false;
-}
-
 void NativeImageSourceX::SetSource( Any source )
 {
   mPixmap = GetPixmapFromAny( source );
index 5306938..1f37eaa 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -69,11 +69,6 @@ public:
   bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
 
   /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  bool EncodeToFile(const std::string& filename) const override;
-
-  /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
    */
   void SetSource( Any source ) override;
index 4bd539b..6488487 100644 (file)
@@ -73,6 +73,10 @@ void NativeImageSourceQueueX::SetSize( uint32_t width, uint32_t height )
   mHeight = height;
 }
 
+void NativeImageSourceQueueX::IgnoreSourceImage()
+{
+}
+
 bool NativeImageSourceQueueX::GlExtensionCreate()
 {
   return true;
index c252bec..689f733 100755 (executable)
@@ -65,6 +65,11 @@ public:
   void SetSize( uint32_t width, uint32_t height ) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
+   */
+  void IgnoreSourceImage() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueX() override;
index 12db4fd..aabcdff 100755 (executable)
@@ -26,7 +26,6 @@
 #include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/window-system/windows/platform-implement-win.h>
-#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 
 namespace Dali
@@ -119,19 +118,6 @@ bool NativeImageSourceWin::GetPixels(std::vector<uint8_t>& pixbuf, unsigned& wid
   return success;
 }
 
-bool NativeImageSourceWin::EncodeToFile(const std::string& filename) const
-{
-  std::vector< uint8_t > pixbuf;
-  uint32_t width(0), height(0);
-  Pixel::Format pixelFormat;
-
-  if(GetPixels(pixbuf, width, height, pixelFormat))
-  {
-    return Dali::EncodeToFile(&pixbuf[0], filename, pixelFormat, width, height);
-  }
-  return false;
-}
-
 void NativeImageSourceWin::SetSource( Any source )
 {
   mPixmap = GetPixmapFromAny( source );
index 6fe3fab..bc2a257 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -64,11 +64,6 @@ public:
   bool GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const override;
 
   /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  bool EncodeToFile(const std::string& filename) const override;
-
-  /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
    */
   void SetSource( Any source ) override;
index 30c6893..fe81d22 100644 (file)
@@ -45,11 +45,7 @@ Debug::Filter* gKeyExtensionLogFilter = Debug::Filter::New(Debug::NoLogging, fal
 #endif
 
 // Path for loading extension keys
-#if _GLIBCXX_USE_CXX11_ABI
-const char* KEY_EXTENSION_PLUGIN_SO( "libdali-key-extension.so" );
-#else
-const char* KEY_EXTENSION_PLUGIN_SO( "libdali-key-extension-cxx03.so" );
-#endif
+const char* KEY_EXTENSION_PLUGIN_SO( "libdali2-key-extension.so" );
 
 class KeyMap
 {
@@ -213,7 +209,7 @@ class KeyMap
 
     if( mHandle == NULL )
     {
-      DALI_LOG_INFO( gKeyExtensionLogFilter, Debug::General, "Failed to get handle from libdali-key-extension.so\n" );
+      DALI_LOG_INFO( gKeyExtensionLogFilter, Debug::General, "Failed to get handle from libdali2-key-extension.so\n" );
       return;
     }
 
index ce17605..7c5be2b 100644 (file)
@@ -334,8 +334,8 @@ std::string DumpJson( Dali::Actor actor, int level )
 {
   // All the information about this actor
   std::ostringstream msg;
-  msg << "{ " << Quote( "Name" ) << " : " << Quote( actor.GetName() ) << ", " << Quote( "level" ) << " : " << level << ", " << Quote( "id" ) << " : " << actor.GetId() << ", " << Quote( "IsVisible" )
-      << " : " << actor.IsVisible() << ", " << Quote( "IsSensitive" ) << " : " << actor.IsSensitive();
+  msg << "{ " << Quote( "Name" ) << " : " << Quote( actor.GetProperty< std::string >( Actor::Property::NAME ) ) << ", " << Quote( "level" ) << " : " << level << ", " << Quote( "id" ) << " : " << actor.GetId() << ", " << Quote( "IsVisible" )
+      << " : " << actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) << ", " << Quote( "IsSensitive" ) << " : " << actor.GetProperty< bool >( Actor::Property::SENSITIVE );
 
   msg << ", " << Quote( "properties" ) << ": [ ";
 
index 8dc77b9..2836fb3 100644 (file)
@@ -28,6 +28,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <dali/devel-api/adaptor-framework/native-image-source-devel.h>
 
 namespace
 {
@@ -44,7 +45,8 @@ namespace Adaptor
 {
 
 Capture::Capture()
-: mTimer(),
+: mQuality( DEFAULT_QUALITY ),
+  mTimer(),
   mPath(),
   mNativeImageSourcePtr( NULL ),
   mFileSave( false )
@@ -52,7 +54,8 @@ Capture::Capture()
 }
 
 Capture::Capture( Dali::CameraActor cameraActor )
-: mCameraActor( cameraActor ),
+: mQuality( DEFAULT_QUALITY ),
+  mCameraActor( cameraActor ),
   mTimer(),
   mPath(),
   mNativeImageSourcePtr( NULL ),
@@ -79,6 +82,12 @@ CapturePtr Capture::New( Dali::CameraActor cameraActor )
   return pWorker;
 }
 
+void Capture::Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor, const uint32_t quality )
+{
+  mQuality = quality;
+  Start( source, size, path, clearColor );
+}
+
 void Capture::Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor )
 {
   DALI_ASSERT_ALWAYS(path.size() > 4 && "Path is invalid.");
@@ -100,8 +109,6 @@ void Capture::Start( Dali::Actor source, const Dali::Vector2& size, const std::s
 
 Dali::NativeImageSourcePtr Capture::GetNativeImageSource() const
 {
-  DALI_ASSERT_ALWAYS( mNativeImageSourcePtr && "mNativeImageSourcePtr is NULL.");
-
   return mNativeImageSourcePtr;
 }
 
@@ -124,8 +131,6 @@ void Capture::CreateNativeImageSource( const Vector2& size )
 
 void Capture::DeleteNativeImageSource()
 {
-  DALI_ASSERT_ALWAYS(mNativeImageSourcePtr && "mNativeImageSource is NULL.");
-
   mNativeImageSourcePtr.Reset();
 }
 
@@ -179,8 +184,8 @@ void Capture::SetupRenderTask( Dali::Actor source, const Dali::Vector4& clearCol
   if( !mCameraActor )
   {
     mCameraActor = Dali::CameraActor::New( stageSize );
-    mCameraActor.SetParentOrigin( ParentOrigin::CENTER );
-    mCameraActor.SetAnchorPoint( AnchorPoint::CENTER );
+    mCameraActor.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+    mCameraActor.SetProperty( Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
   }
 
   stage.Add( mCameraActor );
@@ -306,7 +311,7 @@ bool Capture::SaveFile()
 {
   DALI_ASSERT_ALWAYS(mNativeImageSourcePtr && "mNativeImageSourcePtr is NULL");
 
-  return mNativeImageSourcePtr->EncodeToFile( mPath );
+  return Dali::DevelNativeImageSource::EncodeToFile( *mNativeImageSourcePtr, mPath, mQuality );
 }
 
 }  // End of namespace Adaptor
index 61e116a..11c29e9 100644 (file)
@@ -48,6 +48,9 @@ typedef IntrusivePtr<Capture> CapturePtr;
 class Capture : public BaseObject, public ConnectionTracker
 {
 public:
+
+  static constexpr uint32_t DEFAULT_QUALITY = 100;
+
   /**
    * @brief Constructor.
    */
@@ -68,6 +71,11 @@ public:
   /**
    * @copydoc Dali::Capture::Start
    */
+  void Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor, const uint32_t quality );
+
+  /**
+   * @copydoc Dali::Capture::Start
+   */
   void Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor );
 
   /**
@@ -186,6 +194,7 @@ private:
   Capture& operator=( const Capture& rhs );
 
 private:
+  uint32_t                                    mQuality;
   Dali::Texture                               mNativeTexture;
   Dali::FrameBuffer                           mFrameBuffer;
   Dali::RenderTask                            mRenderTask;
index c7630b2..242696d 100644 (file)
@@ -35,7 +35,7 @@ namespace Adaptor
 
 namespace // unnamed namespace
 {
-const char* COLOR_CONTROLLER_PLUGIN_SO( "libdali-color-controller-plugin.so" );
+const char* COLOR_CONTROLLER_PLUGIN_SO( "libdali2-color-controller-plugin.so" );
 }
 
 Dali::ColorController ColorController::Get()
index 605c76d..a9054ec 100644 (file)
@@ -90,6 +90,11 @@ void ThreadController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface
   mThreadControllerInterface->ReplaceSurface( newSurface );
 }
 
+void ThreadController::DeleteSurface( Dali::RenderSurfaceInterface* surface )
+{
+  mThreadControllerInterface->DeleteSurface( surface );
+}
+
 void ThreadController::ResizeSurface()
 {
   mThreadControllerInterface->ResizeSurface();
@@ -115,11 +120,6 @@ void ThreadController::AddSurface( Dali::RenderSurfaceInterface* newSurface )
   mThreadControllerInterface->AddSurface( newSurface );
 }
 
-bool ThreadController::IsRenderingWindows() const
-{
-  return mThreadControllerInterface->IsRenderingWindows();
-}
-
 } // namespace Adaptor
 
 } // namespace Internal
index 471a5f9..c4f3961 100644 (file)
@@ -112,6 +112,12 @@ public:
   void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
 
   /**
+   * Deletes the surface.
+   * @param surface The surface to be deleted
+   */
+  void DeleteSurface( Dali::RenderSurfaceInterface* surface );
+
+  /**
    * Resize the surface.
    */
   void ResizeSurface();
@@ -138,11 +144,6 @@ public:
    */
   void AddSurface( Dali::RenderSurfaceInterface* surface );
 
-  /**
-   * @copydoc Dali::Adaptor::IsRenderingWindows()
-   */
-  bool IsRenderingWindows() const;
-
 private:
 
   // Undefined copy constructor.
index 1b76ff3..9b1c9da 100644 (file)
@@ -110,6 +110,11 @@ bool VectorAnimationRenderer::GetMarkerInfo( const std::string& marker, uint32_t
   return mPlugin.GetMarkerInfo( marker, startFrame, endFrame );
 }
 
+void VectorAnimationRenderer::IgnoreRenderedFrame()
+{
+  mPlugin.IgnoreRenderedFrame();
+}
+
 Dali::VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
 {
   return mPlugin.UploadCompletedSignal();
index b635683..0d2a428 100755 (executable)
@@ -102,6 +102,11 @@ public:
   bool GetMarkerInfo( const std::string& marker, uint32_t& startFrame, uint32_t& endFrame ) const;
 
   /**
+   * @copydoc Dali::VectorAnimationRenderer::IgnoreRenderedFrame()
+   */
+  void IgnoreRenderedFrame();
+
+  /**
    * @copydoc Dali::VectorAnimationRenderer::UploadCompletedSignal()
    */
   Dali::VectorAnimationRenderer::UploadCompletedSignalType& UploadCompletedSignal();
index 6eae9bf..b2e2eac 100644 (file)
@@ -35,7 +35,7 @@ namespace
 {
 
 // The default plugin name
-const char* DEFAULT_OBJECT_NAME( "libdali-vector-animation-renderer-plugin.so" );
+const char* DEFAULT_OBJECT_NAME( "libdali2-vector-animation-renderer-plugin.so" );
 
 }
 
@@ -186,6 +186,14 @@ bool VectorAnimationRendererPluginProxy::GetMarkerInfo( const std::string& marke
   return false;
 }
 
+void VectorAnimationRendererPluginProxy::IgnoreRenderedFrame()
+{
+  if( mPlugin )
+  {
+    mPlugin->IgnoreRenderedFrame();
+  }
+}
+
 VectorAnimationRendererPlugin::UploadCompletedSignalType& VectorAnimationRendererPluginProxy::UploadCompletedSignal()
 {
   if( mPlugin )
index 1480aca..d63faa3 100644 (file)
@@ -98,6 +98,11 @@ public:
   bool GetMarkerInfo( const std::string& marker, uint32_t& startFrame, uint32_t& endFrame ) const;
 
   /**
+   * @copydoc Dali::VectorAnimationRendererPlugin::IgnoreRenderedFrame()
+   */
+  void IgnoreRenderedFrame();
+
+  /**
    * @copydoc Dali::VectorAnimationRendererPlugin::UploadCompletedSignal()
    */
   VectorAnimationRendererPlugin::UploadCompletedSignalType& UploadCompletedSignal();
index a431ecb..64ed46a 100755 (executable)
@@ -39,11 +39,7 @@ namespace Adaptor
 namespace // unnamed namespace
 {
 
-#if _GLIBCXX_USE_CXX11_ABI
-const char* VIDEO_PLUGIN_SO( "libdali-video-player-plugin.so" );
-#else
-const char* VIDEO_PLUGIN_SO( "libdali-video-player-plugin-cxx03.so" );
-#endif
+const char* VIDEO_PLUGIN_SO( "libdali2-video-player-plugin.so" );
 
 Dali::BaseHandle Create()
 {
index a8c40b5..e467bb4 100644 (file)
@@ -41,9 +41,9 @@ namespace Adaptor
 namespace // unnamed namespace
 {
 
-constexpr char const * const kPluginFullNamePrefix = "libdali-web-engine-";
+constexpr char const * const kPluginFullNamePrefix = "libdali2-web-engine-";
 constexpr char const * const kPluginFullNamePostfix = "-plugin.so";
-constexpr char const * const kPluginFullNameDefault = "libdali-web-engine-plugin.so";
+constexpr char const * const kPluginFullNameDefault = "libdali2-web-engine-plugin.so";
 
 // Note: Dali WebView policy does not allow to use multiple web engines in an application.
 // So once pluginName is set to non-empty string, it will not change.
old mode 100644 (file)
new mode 100755 (executable)
index a0fd809..b21ca77
@@ -99,13 +99,6 @@ Window::Window()
 
 Window::~Window()
 {
-  mIsBeingDeleted = true;
-
-  while ( mAdaptor && mAdaptor->IsRenderingWindows() )
-  {
-    std::this_thread::yield(); // to allow other threads to run
-  }
-
   if ( mEventHandler )
   {
     mEventHandler->RemoveObserver( *this );
@@ -917,6 +910,11 @@ void Window::SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOr
   SetAvailableAnlges( mAvailableAngles );
 }
 
+int32_t Window::GetNativeId() const
+{
+  return mWindowBase->GetNativeWindowId();
+}
+
 } // Adaptor
 
 } // Internal
old mode 100644 (file)
new mode 100755 (executable)
index 0d4a4e1..ca1d3bf
@@ -371,6 +371,11 @@ public: // Dali::Internal::Adaptor::SceneHolder
    */
   bool IsVisible() const override;
 
+  /**
+   * @copydoc Dali::DevelWindow::GetNativeId()
+   */
+  int32_t GetNativeId() const;
+
 private:
 
   /**
index f86d7c2..c95d508 100644 (file)
@@ -85,11 +85,6 @@ WindowRenderSurface::~WindowRenderSurface()
   {
     delete mRotationTrigger;
   }
-
-  if ( mEGLSurface )
-  {
-    DestroySurface();
-  }
 }
 
 void WindowRenderSurface::Initialize( Any surface )
@@ -204,9 +199,10 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi
 
 void WindowRenderSurface::InitializeGraphics()
 {
-
   mGraphics = &mAdaptor->GetGraphicsInterface();
 
+  DALI_ASSERT_ALWAYS( mGraphics && "Graphics interface is not created" );
+
   auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
   mEGL = &eglGraphics->GetEglInterface();
 
@@ -258,13 +254,21 @@ void WindowRenderSurface::DestroySurface()
   DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
 
   auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+  if( eglGraphics )
+  {
+    DALI_LOG_RELEASE_INFO("WindowRenderSurface::DestroySurface: WinId (%d)\n", mWindowBase->GetNativeWindowId() );
 
-  DALI_LOG_RELEASE_INFO("WindowRenderSurface::DestroySurface: WinId (%d)\n", mWindowBase->GetNativeWindowId() );
+    Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
-  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-  eglImpl.DestroySurface( mEGLSurface );
+    eglImpl.DestroySurface( mEGLSurface );
+    mEGLSurface = nullptr;
 
-  mWindowBase->DestroyEglWindow();
+    // Destroy context also
+    eglImpl.DestroyContext( mEGLContext );
+    mEGLContext = nullptr;
+
+    mWindowBase->DestroyEglWindow();
+  }
 }
 
 bool WindowRenderSurface::ReplaceGraphicsSurface()
index 9672c60..5aa9262 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ bool NativeImageSource::GetPixels( std::vector<unsigned char> &pixbuf, unsigned
 
 bool NativeImageSource::EncodeToFile(const std::string& filename) const
 {
-  return mImpl->EncodeToFile(filename);
+  return mImpl->EncodeToFile( filename );
 }
 
 void NativeImageSource::SetSource( Any source )
index 701db7d..ca7c098 100644 (file)
@@ -62,6 +62,11 @@ Capture& Capture::operator=( const Capture& rhs )
   return *this;
 }
 
+void Capture::Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor, const uint32_t quality )
+{
+  GetImpl( *this ).Start( source, size, path, clearColor, quality );
+}
+
 void Capture::Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor )
 {
   GetImpl( *this ).Start( source, size, path, clearColor );
index b3ec14f..5585603 100755 (executable)
@@ -171,6 +171,19 @@ public:
   /**
    * @brief Start capture and save the image as a file.
    *
+   * @SINCE_1_9.12
+   *
+   * @param[in] source source actor to be used for capture.
+   * @param[in] size captured size.
+   * @param[in] path image file path to be saved as a file.
+   * @param[in] clearColor background color of captured scene
+   * @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]
+   */
+  void Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor, const uint32_t quality );
+
+  /**
+   * @brief Start capture and save the image as a file.
+   *
    * @SINCE_1_3_4
    *
    * @param[in] source source actor to be used for capture.
index be1f621..9b87b79 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int ADAPTOR_MAJOR_VERSION = 1;
 const unsigned int ADAPTOR_MINOR_VERSION = 9;
-const unsigned int ADAPTOR_MICRO_VERSION = 10;
+const unsigned int ADAPTOR_MICRO_VERSION = 13;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 2b7c39d..a295973 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.9.10
+Version:    1.9.13
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT