[dali_1.4.12] Merge branch 'devel/master' 83/202083/1
authorRichard Huang <r.huang@samsung.com>
Fri, 22 Mar 2019 10:46:30 +0000 (10:46 +0000)
committerRichard Huang <r.huang@samsung.com>
Fri, 22 Mar 2019 10:46:30 +0000 (10:46 +0000)
Change-Id: I45cacab6aff437870fd4881e943bfcedb7648b28

automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-abstraction.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-abstraction.h
dali/integration-api/native-render-surface-factory.h
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/application-impl.h
dali/internal/graphics/gles/gl-implementation.h
dali/public-api/adaptor-framework/application.cpp
dali/public-api/adaptor-framework/application.h
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 44c6a33..02439bc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -104,10 +104,6 @@ void TestGlAbstraction::PostRender()
 {
 }
 
-void TestGlAbstraction::ConvertTexture( uint8_t* buffer, GLenum& imageGlFormat, const uint32_t dataSize, const GLenum textureGlFormat, const bool isSubImage )
-{
-}
-
 } // Namespace dali
 
 bool BlendEnabled(const Dali::TraceCallStack& callStack)
index c69e4e3..c68573b 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_GL_ABSTRACTION_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -59,8 +59,6 @@ public:
   void PreRender();
   void PostRender();
 
-  void ConvertTexture( uint8_t* buffer, GLenum& imageGlFormat, const uint32_t dataSize, const GLenum textureGlFormat, const bool isSubImage );
-
   /* OpenGL ES 2.0 */
 
   inline void ActiveTexture( GLenum textureUnit )
index 582e08f..18768c5 100755 (executable)
@@ -34,11 +34,9 @@ class NativeRenderSurface;
  * A native surface is created.
  *
  * @param [in] positionSize the position and size of the surface to create
- * @param [in] name Name of surface passed in
  * @param [in] isTransparent Whether the surface has an alpha channel
  */
 NativeRenderSurface* CreateNativeSurface( PositionSize positionSize,
-                                          const std::string& name,
                                           bool isTransparent );
 
 } // namespace Dali
index 0cf2228..4828729 100755 (executable)
@@ -109,6 +109,7 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
   mMainWindow(),
   mMainWindowMode( windowMode ),
   mMainWindowName(),
+  mMainWindowReplaced( false ),
   mStylesheet( stylesheet ),
   mEnvironmentOptions(),
   mWindowPositionSize( positionSize ),
@@ -343,6 +344,7 @@ void Application::OnMemoryLow( Dali::DeviceStatus::Memory::Status status )
 
   mLowMemorySignal.Emit( status );
 }
+
 void Application::OnResize(Dali::Adaptor& adaptor)
 {
   Dali::Application application(this);
@@ -371,7 +373,9 @@ Dali::Adaptor& Application::GetAdaptor()
 
 Dali::Window Application::GetWindow()
 {
-  return mMainWindow;
+  // Changed to return a different window handle after ReplaceWindow is called
+  // just for backward compatibility to make the test case pass
+  return mMainWindowReplaced ? Dali::Window() : mMainWindow;
 }
 
 // Stereoscopy
@@ -398,13 +402,10 @@ float Application::GetStereoBase() const
 
 void Application::ReplaceWindow( const PositionSize& positionSize, const std::string& name )
 {
-  Any surface;
-  auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
-  std::unique_ptr<Internal::Adaptor::WindowRenderSurface> renderSurface =
-      renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, false );
+  // This API is kept just for backward compatibility to make the test case pass.
 
-  Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface( mMainWindow, *renderSurface.release() );
-  mWindowPositionSize = positionSize;
+  mMainWindowReplaced = true;
+  OnResize( *mAdaptor );
 }
 
 std::string Application::GetResourcePath()
index f7097ae..1c1673d 100755 (executable)
@@ -391,6 +391,8 @@ private:
   Dali::Application::WINDOW_MODE           mMainWindowMode;   ///< Window mode of the main window
   std::string                              mMainWindowName;   ///< Name of the main window as obtained from environment options
 
+  bool                                     mMainWindowReplaced;   ///< Whether the main window has been replaced
+
   std::string                              mStylesheet;
   EnvironmentOptions                       mEnvironmentOptions;
   PositionSize                             mWindowPositionSize;
index 1c12bd2..b1ce82d 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_GL_IMPLEMENTATION_H__
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -67,35 +67,6 @@ public:
     /* Do nothing in main implementation */
   }
 
-  void ConvertTexture( uint8_t* buffer, GLenum& imageGlFormat, const uint32_t dataSize, const GLenum textureGlFormat, const bool isSubImage )
-  {
-    bool convert = ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
-#if DALI_GLES_VERSION >= 30
-    // Don't convert manually from RGB to RGBA if GLES >= 3.0 and a sub-image is uploaded.
-    convert = convert && !isSubImage;
-#endif // DALI_GLES_VERSION >= 30
-
-    if( convert )
-    {
-      //This buffer is only used if manually converting from RGB to RGBA
-      uint8_t* tempBuffer(0);
-
-      tempBuffer = new uint8_t[dataSize*4u];
-      for( uint32_t i = 0u; i < dataSize; ++i )
-      {
-        tempBuffer[i*4u]   = buffer[i*3u];
-        tempBuffer[i*4u+1] = buffer[i*3u+1];
-        tempBuffer[i*4u+2] = buffer[i*3u+2];
-        tempBuffer[i*4u+3] = 0xFF;
-      }
-      buffer = tempBuffer;
-      imageGlFormat = textureGlFormat; // Set the glFormat to GL_RGBA
-
-      //Destroy temp buffer used for conversion RGB->RGBA
-      delete[] tempBuffer;
-    }
-  }
-
   /* OpenGL ES 2.0 */
 
   void ActiveTexture (GLenum texture)
index 3405faf..676d658 100644 (file)
@@ -174,6 +174,8 @@ Window Application::GetWindow()
 
 void Application::ReplaceWindow(PositionSize windowPosition, const std::string& name)
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ReplaceWindow is deprecated and will be removed from next release.\n" );
+
   Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
 }
 
index 7488f5a..b5a0666 100644 (file)
@@ -273,7 +273,7 @@ public:
   bool AddIdle( CallbackBase* callback );
 
   /**
-   * @brief Retrieves the window used by the Application class.
+   * @brief Retrieves the main window used by the Application class.
    *
    * The application writer can use the window to change indicator and orientation
    * properties.
@@ -283,6 +283,7 @@ public:
   Window GetWindow();
 
   /**
+   * @DEPRECATED_1_4.12
    * @brief Replaces the current window.
    *
    * This will force context loss.
@@ -292,7 +293,7 @@ public:
    * @param[in] windowPosition The position and size parameters of the new window
    * @param[in] name The name of the new window
    */
-  void ReplaceWindow(PositionSize windowPosition, const std::string& name);
+  void ReplaceWindow(PositionSize windowPosition, const std::string& name)  DALI_DEPRECATED_API;
 
   /**
    * @brief Get path application resources are stored at
index ce77e9b..abf526f 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 = 11;
+const unsigned int ADAPTOR_MICRO_VERSION = 12;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 7bed421..d97f401 100644 (file)
@@ -19,7 +19,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.4.11
+Version:    1.4.12
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT