Merge branch 'devel/master' into tizen
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 10 Jun 2019 05:32:47 +0000 (14:32 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 10 Jun 2019 05:32:51 +0000 (14:32 +0900)
Change-Id: If7a95358b390021a4706feb68cc24b0172d916ac

12 files changed:
dali/devel-api/adaptor-framework/pixel-buffer.cpp
dali/devel-api/adaptor-framework/pixel-buffer.h
dali/devel-api/adaptor-framework/window-devel.h
dali/integration-api/adaptor.h
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/adaptor.cpp
dali/internal/imaging/common/image-operations.cpp
dali/internal/imaging/common/pixel-buffer-impl.cpp
dali/internal/imaging/common/pixel-buffer-impl.h
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 8ba24a0..94af7f8 100755 (executable)
@@ -136,6 +136,11 @@ bool PixelBuffer::Rotate( Degree angle )
   return GetImplementation(*this).Rotate( angle );
 }
 
+bool PixelBuffer::IsAlphaPreMultiplied() const
+{
+  return GetImplementation(*this).IsAlphaPreMultiplied();
+}
+
 } // namespace Devel
 
 } // namespace Dali
index 449bc02..2a9add4 100755 (executable)
@@ -242,6 +242,12 @@ public:
    */
   bool Rotate( Degree angle );
 
+  /**
+   * @brief Returns pixel-buffer is premultiplied or not.
+   * @return true if alpha is pre-multiplied.
+   */
+  bool IsAlphaPreMultiplied() const;
+
 public:
 
   /**
index bbdac10..3da549e 100644 (file)
@@ -53,7 +53,7 @@ DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize
  * @param[in] window The window instance
  * @return A valid handle to a RenderTaskList
  */
-Dali::RenderTaskList GetRenderTaskList( Window window );
+DALI_ADAPTOR_API Dali::RenderTaskList GetRenderTaskList( Window window );
 
 /**
  * @brief Retrieve the window that the given actor is added to.
index 25b5a6b..570ff19 100755 (executable)
@@ -44,6 +44,8 @@ namespace Dali
 
 class RenderSurfaceInterface;
 
+using WindowContainer = std::vector<Window>;
+
 namespace Integration
 {
 class SceneHolder;
@@ -122,6 +124,7 @@ class DALI_ADAPTOR_API Adaptor
 public:
 
   typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals
+  typedef Signal< void (Window&) > WindowCreatedSignalType;  ///< Window created signal type
 
 public:
   /**
@@ -427,6 +430,12 @@ public:
    */
   void UnregisterProcessor( Integration::Processor& processor );
 
+  /**
+   * @brief Get the list of windows created.
+   * @return The list of windows
+   */
+  Dali::WindowContainer GetWindows() const;
+
 public:  // Signals
 
   /**
@@ -444,6 +453,13 @@ public:  // Signals
    */
   AdaptorSignalType& LanguageChangedSignal();
 
+  /**
+   * @brief This signal is emitted when a new window is created
+   *
+   * @return The signal to connect to
+   */
+  WindowCreatedSignalType& WindowCreatedSignal();
+
 private:
 
   // Undefined
index 6bce4d5..28417ee 100755 (executable)
@@ -182,6 +182,12 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
 
   defaultWindow->SetAdaptor( Get() );
 
+  Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( ( &defaultWindow )->Get() ) );
+  if ( window )
+  {
+    mWindowCreatedSignal.Emit( window );
+  }
+
   const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval();
   if( 0u < timeInterval )
   {
@@ -572,6 +578,13 @@ bool Adaptor::AddWindow( Dali::Integration::SceneHolder* childWindow, const std:
 
   // Add the new Window to the container - the order is not important
   mWindows.push_back( SceneHolderPtr( &windowImpl ) );
+
+  Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( &windowImpl ) );
+  if ( window )
+  {
+    mWindowCreatedSignal.Emit( window );
+  }
+
   return true;
 }
 
@@ -1008,9 +1021,27 @@ Dali::Internal::Adaptor::SceneHolder* Adaptor::GetWindow( Dali::Actor& actor )
   return nullptr;
 }
 
+Dali::WindowContainer Adaptor::GetWindows() const
+{
+  Dali::WindowContainer windows;
+
+  for ( auto iter = mWindows.begin(); iter != mWindows.end(); ++iter )
+  {
+    // Downcast to Dali::Window
+    Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( iter->Get() ) );
+    if ( window )
+    {
+      windows.push_back( window );
+    }
+  }
+
+  return windows;
+}
+
 Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions)
 : mResizedSignal(),
   mLanguageChangedSignal(),
+  mWindowCreatedSignal(),
   mAdaptor( adaptor ),
   mState( READY ),
   mCore( nullptr ),
index 29bb7d5..d36f8a6 100755 (executable)
@@ -97,9 +97,10 @@ class Adaptor : public Integration::RenderController,
 {
 public:
 
-  typedef Dali::Adaptor::AdaptorSignalType AdaptorSignalType;
+  using AdaptorSignalType =  Dali::Adaptor::AdaptorSignalType;
+  using WindowCreatedSignalType = Dali::Adaptor::WindowCreatedSignalType;
 
-  typedef Uint16Pair SurfaceSize;          ///< Surface size type
+  using SurfaceSize = Uint16Pair;          ///< Surface size type
 
   /**
    * Creates a New Adaptor
@@ -302,6 +303,11 @@ public: // AdaptorInternalServices implementation
    */
   Dali::Internal::Adaptor::SceneHolder* GetWindow( Dali::Actor& actor );
 
+  /**
+   * @copydoc Dali::Adaptor::GetWindows()
+   */
+  Dali::WindowContainer GetWindows() const;
+
 public:
 
   /**
@@ -503,6 +509,14 @@ public: // Signals
     return mLanguageChangedSignal;
   }
 
+  /**
+   * @copydoc Dali::Adaptor::WindowCreatedSignal
+   */
+  WindowCreatedSignalType& WindowCreatedSignal()
+  {
+    return mWindowCreatedSignal;
+  }
+
 public: // From Dali::Internal::Adaptor::CoreEventInterface
 
   /**
@@ -632,6 +646,7 @@ private: // Data
 
   AdaptorSignalType                     mResizedSignal;               ///< Resized signal.
   AdaptorSignalType                     mLanguageChangedSignal;       ///< Language changed signal.
+  WindowCreatedSignalType               mWindowCreatedSignal;         ///< Window created signal.
 
   Dali::Adaptor&                        mAdaptor;                     ///< Reference to public adaptor instance.
   State                                 mState;                       ///< Current state of the adaptor
index a183350..17b0805 100755 (executable)
@@ -141,6 +141,11 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
   return mImpl->LanguageChangedSignal();
 }
 
+Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
+{
+  return mImpl->WindowCreatedSignal();
+}
+
 Dali::RenderSurfaceInterface& Adaptor::GetSurface()
 {
   return mImpl->GetSurface();
@@ -236,6 +241,11 @@ void Adaptor::UnregisterProcessor( Integration::Processor& processor )
   mImpl->UnregisterProcessor( processor );
 }
 
+Dali::WindowContainer Adaptor::GetWindows() const
+{
+  return mImpl->GetWindows();
+}
+
 Adaptor::Adaptor()
 : mImpl( NULL )
 {
index 2fdeb4f..b44a024 100755 (executable)
@@ -1470,7 +1470,7 @@ void DownscaleInPlacePow2( unsigned char * const pixels,
       }
       else
       {
-        DALI_ASSERT_DEBUG( false == "Inner branch conditions don't match outer branch." );
+        DALI_ASSERT_DEBUG( false && "Inner branch conditions don't match outer branch." );
       }
     }
   }
@@ -1726,7 +1726,7 @@ void PointSample( const unsigned char * inPixels,
     }
     else
     {
-      DALI_ASSERT_DEBUG( false == "Inner branch conditions don't match outer branch." );
+      DALI_ASSERT_DEBUG( 0 == "Inner branch conditions don't match outer branch." );
     }
   }
   else
@@ -2135,7 +2135,7 @@ void LinearSample( const unsigned char * __restrict__ inPixels,
     }
     else
     {
-      DALI_ASSERT_DEBUG( false == "Inner branch conditions don't match outer branch." );
+      DALI_ASSERT_DEBUG( 0 == "Inner branch conditions don't match outer branch." );
     }
   }
   else
index 85c5c8a..7490bf4 100755 (executable)
@@ -52,7 +52,8 @@ PixelBuffer::PixelBuffer( unsigned char* buffer,
   mBufferSize( bufferSize ),
   mWidth( width ),
   mHeight( height ),
-  mPixelFormat( pixelFormat )
+  mPixelFormat( pixelFormat ),
+  mPreMultiplied( false )
 {
 }
 
@@ -466,6 +467,12 @@ void PixelBuffer::MultiplyColorByAlpha()
       pixel += bytesPerPixel;
     }
   }
+  mPreMultiplied = true;
+}
+
+bool PixelBuffer::IsAlphaPreMultiplied() const
+{
+  return mPreMultiplied;
 }
 
 }// namespace Adaptor
index d912022..b0a0bdc 100755 (executable)
@@ -222,6 +222,11 @@ public:
    */
   bool Rotate( Degree angle );
 
+  /**
+   * @copydoc Devel::PixelBuffer::IsAlphaPreMultiplied()
+   */
+  bool IsAlphaPreMultiplied() const;
+
 private:
   /*
    * Undefined copy constructor.
@@ -283,6 +288,7 @@ private:
   unsigned int                    mWidth;            ///< Buffer width in pixels
   unsigned int                    mHeight;           ///< Buffer height in pixels
   Pixel::Format                   mPixelFormat;      ///< Pixel format
+  bool                            mPreMultiplied; ///< PreMultiplied
 };
 
 } // namespace Adaptor
index b3a52c6..c4bbe1c 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int ADAPTOR_MAJOR_VERSION = 1;
 const unsigned int ADAPTOR_MINOR_VERSION = 4;
-const unsigned int ADAPTOR_MICRO_VERSION = 22;
+const unsigned int ADAPTOR_MICRO_VERSION = 23;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 720ac34..3abe668 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.4.22
+Version:    1.4.23
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT