[dali_1.3.47] Merge branch 'devel/master' 92/191992/1
authorgreynaga <g.reynaga@samsung.com>
Fri, 26 Oct 2018 11:24:38 +0000 (12:24 +0100)
committergreynaga <g.reynaga@samsung.com>
Fri, 26 Oct 2018 11:24:38 +0000 (12:24 +0100)
Change-Id: I6a6b6012b00e5e4c55893ed07eaa7c4f69b4fe99

134 files changed:
automated-tests/src/dali-adaptor/dali-test-suite-utils/adaptor-test-application.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-sync-abstraction.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-sync-abstraction.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-harness.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-harness.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-native-image.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-native-image.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.h
build/tizen/adaptor/Makefile.am
dali/devel-api/adaptor-framework/application-devel.cpp
dali/devel-api/adaptor-framework/application-devel.h
dali/devel-api/adaptor-framework/color-controller.cpp
dali/devel-api/adaptor-framework/image-loading.cpp
dali/devel-api/adaptor-framework/image-loading.h
dali/devel-api/adaptor-framework/native-image-source-queue.cpp
dali/devel-api/text-abstraction/font-client.cpp
dali/devel-api/text-abstraction/font-client.h
dali/integration-api/adaptor.h
dali/integration-api/render-surface.h
dali/internal/accessibility/common/accessibility-adaptor-impl.cpp
dali/internal/accessibility/file.list
dali/internal/accessibility/tizen-wayland/tizen-common/accessibility-adaptor-impl-tizen.cpp [moved from dali/internal/accessibility/tizen-common/accessibility-adaptor-impl-tizen.cpp with 97% similarity]
dali/internal/accessibility/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp [moved from dali/internal/accessibility/tizen-ivi/accessibility-adaptor-impl-ivi.cpp with 98% similarity]
dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp [moved from dali/internal/accessibility/tizen-mobile/accessibility-adaptor-impl-mobile.cpp with 98% similarity]
dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h [moved from dali/internal/accessibility/tizen-mobile/accessibility-adaptor-impl-mobile.h with 100% similarity]
dali/internal/accessibility/tizen-wayland/tizen-tv/accessibility-adaptor-impl-tv.cpp [moved from dali/internal/accessibility/tizen-tv/accessibility-adaptor-impl-tv.cpp with 97% similarity]
dali/internal/accessibility/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp [moved from dali/internal/accessibility/tizen-wearable/accessibility-adaptor-impl-wearable.cpp with 98% similarity]
dali/internal/accessibility/tizen-wayland/tts-player-factory-tizen.cpp [moved from dali/internal/accessibility/tizen/tts-player-factory-tizen.cpp with 92% similarity]
dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.cpp [moved from dali/internal/accessibility/tizen/tts-player-impl-tizen.cpp with 99% similarity]
dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.h [moved from dali/internal/accessibility/tizen/tts-player-impl-tizen.h with 100% similarity]
dali/internal/adaptor/common/adaptor-builder-impl.cpp [moved from dali/internal/system/tizen-ivi/system-settings-ivi.cpp with 58% similarity]
dali/internal/adaptor/common/adaptor-builder-impl.h [new file with mode: 0644]
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/adaptor-internal-services.h
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/application-impl.h
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/adaptor/common/combined-update-render-controller.h
dali/internal/adaptor/file.list
dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp [moved from dali/internal/adaptor/tizen/adaptor-impl-tizen.cpp with 96% similarity]
dali/internal/adaptor/tizen-wayland/framework-ecore-wl.cpp [deleted file]
dali/internal/adaptor/tizen-wayland/framework-tizen.cpp [moved from dali/internal/adaptor/tizen/framework-tizen.cpp with 99% similarity]
dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.cpp [moved from dali/internal/adaptor/tizen-wearable/watch-application-impl.cpp with 97% similarity]
dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h [moved from dali/internal/adaptor/tizen-wearable/watch-application-impl.h with 100% similarity]
dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application.cpp [moved from dali/internal/adaptor/tizen-wearable/watch-application.cpp with 96% similarity]
dali/internal/graphics/common/graphics-factory-interface.h [new file with mode: 0644]
dali/internal/graphics/common/graphics-interface.h [new file with mode: 0644]
dali/internal/graphics/common/render-helper.cpp [deleted file]
dali/internal/graphics/common/render-helper.h [deleted file]
dali/internal/graphics/file.list
dali/internal/graphics/gles20/egl-factory-interface.h
dali/internal/graphics/gles20/egl-factory.cpp [deleted file]
dali/internal/graphics/gles20/egl-factory.h [deleted file]
dali/internal/graphics/gles20/egl-graphics-factory.cpp [moved from dali/internal/system/tizen-wearable/system-settings-wearable.cpp with 54% similarity]
dali/internal/graphics/gles20/egl-graphics-factory.h [new file with mode: 0644]
dali/internal/graphics/gles20/egl-graphics.cpp [new file with mode: 0644]
dali/internal/graphics/gles20/egl-graphics.h [new file with mode: 0644]
dali/internal/graphics/ubuntu/egl-image-extensions-ubuntu.cpp [moved from dali/internal/graphics/ubuntu-gl/egl-image-extensions.cpp with 100% similarity]
dali/internal/imaging/common/image-loader.cpp
dali/internal/imaging/common/image-loader.h
dali/internal/imaging/common/native-bitmap-buffer-impl.cpp
dali/internal/imaging/common/native-bitmap-buffer-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/input/common/long-press-gesture-detector.cpp
dali/internal/input/file.list
dali/internal/input/ubuntu-x11/key-mapping-x.cpp [moved from dali/internal/input/ubuntu/key-mapping-ubuntu.cpp with 100% similarity]
dali/internal/system/common/color-controller-impl.h [moved from dali/internal/system/generic/color-controller-impl.h with 100% similarity]
dali/internal/system/common/object-profiler.cpp
dali/internal/system/common/object-profiler.h
dali/internal/system/common/system-settings.h [moved from dali/internal/system/generic/system-settings.h with 100% similarity]
dali/internal/system/common/thread-controller.h
dali/internal/system/file.list
dali/internal/system/generic/system-settings.cpp [deleted file]
dali/internal/system/linux/callback-manager-ecore.cpp [moved from dali/internal/system/common/callback-manager-ecore.cpp with 98% similarity]
dali/internal/system/linux/callback-manager-ecore.h [moved from dali/internal/system/common/callback-manager-ecore.h with 100% similarity]
dali/internal/system/linux/file-descriptor-monitor-ecore.cpp [moved from dali/internal/system/common/file-descriptor-monitor-ecore.cpp with 100% similarity]
dali/internal/system/linux/timer-impl-ecore.cpp [moved from dali/internal/system/common/timer-impl-ecore.cpp with 100% similarity]
dali/internal/system/tizen-mobile/color-controller-impl-mobile.cpp [deleted file]
dali/internal/system/tizen-tv/color-controller-impl-tv.cpp [deleted file]
dali/internal/system/tizen-tv/system-settings-tv.cpp [deleted file]
dali/internal/system/tizen-wayland/color-controller-impl-tizen.cpp [moved from dali/internal/system/tizen-ivi/color-controller-impl-ivi.cpp with 94% similarity]
dali/internal/system/tizen-wayland/system-settings-tizen.cpp [moved from dali/internal/system/tizen-mobile/system-settings-mobile.cpp with 88% similarity]
dali/internal/system/tizen-wayland/tizen-wearable/capture-impl-tizen.cpp [moved from dali/internal/system/tizen/capture-impl-tizen.cpp with 98% similarity]
dali/internal/system/tizen-wayland/tizen-wearable/capture-impl.h [moved from dali/internal/system/tizen/capture-impl.h with 100% similarity]
dali/internal/system/tizen-wayland/tizen-wearable/capture.cpp [moved from dali/internal/system/tizen-wearable/capture.cpp with 93% similarity]
dali/internal/system/tizen-wayland/tizen-wearable/watch-time.cpp [moved from dali/internal/system/tizen-wearable/watch-time.cpp with 100% similarity]
dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp [moved from dali/internal/system/tizen/widget-application-impl-tizen.cpp with 97% similarity]
dali/internal/system/tizen-wayland/widget-application-impl-tizen.h [moved from dali/internal/system/tizen/widget-application-impl-tizen.h with 100% similarity]
dali/internal/system/tizen-wayland/widget-controller-tizen.cpp [moved from dali/internal/system/tizen/widget-controller-tizen.cpp with 91% similarity]
dali/internal/system/tizen-wayland/widget-controller-tizen.h [moved from dali/internal/system/tizen/widget-controller-tizen.h with 100% similarity]
dali/internal/system/tizen-wearable/color-controller-impl-wearable.cpp [deleted file]
dali/internal/system/ubuntu-x11/color-controller-impl-x.cpp [moved from dali/internal/system/generic/color-controller-impl.cpp with 90% similarity]
dali/internal/system/ubuntu-x11/system-settings-x.cpp
dali/internal/system/ubuntu-x11/widget-application-impl-x.cpp [moved from dali/internal/system/ubuntu/widget-application-impl-ubuntu.cpp with 93% similarity]
dali/internal/system/ubuntu-x11/widget-application-impl-x.h [moved from dali/internal/system/ubuntu/widget-application-impl-ubuntu.h with 95% similarity]
dali/internal/system/ubuntu-x11/widget-controller-x.cpp [moved from dali/internal/system/ubuntu/widget-controller-ubuntu.cpp with 88% similarity]
dali/internal/system/ubuntu-x11/widget-controller-x.h [moved from dali/internal/system/ubuntu/widget-controller-ubuntu.h with 100% similarity]
dali/internal/system/ubuntu/color-controller-impl-ubuntu.cpp [deleted file]
dali/internal/system/ubuntu/system-settings-ubuntu.cpp [deleted file]
dali/internal/text/text-abstraction/font-client-impl.cpp
dali/internal/text/text-abstraction/font-client-impl.h
dali/internal/text/text-abstraction/font-client-plugin-impl.cpp
dali/internal/text/text-abstraction/font-client-plugin-impl.h
dali/internal/video/common/video-player-impl.cpp
dali/internal/window-system/common/display-connection-impl.h
dali/internal/window-system/common/display-connection.cpp
dali/internal/window-system/common/display-connection.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-render-surface.cpp
dali/internal/window-system/common/window-render-surface.h
dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h
dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h
dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp
dali/internal/window-system/ubuntu-x11/display-connection-impl-x.h
dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h
dali/public-api/adaptor-framework/application.h
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 270ab57..421fb11 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_ADAPTOR_TEST_APPLICATION_H__
 
 /*
- * Copyright (c) 2017 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.
@@ -36,10 +36,8 @@ public:
                           size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
                           float  horizontalDpi = DEFAULT_HORIZONTAL_DPI,
                           float  verticalDpi   = DEFAULT_VERTICAL_DPI )
-  : TestApplication( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
+  : TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
   {
-    Initialize();
-
     Internal::Adaptor::Adaptor::SetAvailable();
   }
 
index cf97813..b9c8245 100644 (file)
@@ -26,9 +26,9 @@
 
 using namespace Dali;
 
-int test_return_value = TET_UNDEF;
+int32_t test_return_value = TET_UNDEF;
 
-void tet_result(int value)
+void tet_result(int32_t value)
 {
   // First TET_PASS should set to zero
   // first TET_FAIL should prevent any further TET_PASS from setting back to zero
@@ -81,14 +81,14 @@ void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHand
   DALI_TEST_EQUALS< const BaseHandle& >( baseHandle1, baseHandle2, location );
 }
 
-void DALI_TEST_EQUALS( const size_t value1, const unsigned int value2, const char* location )
+void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* location )
 {
-  DALI_TEST_EQUALS< unsigned int>( ( unsigned int )( value1 ), value2, location );
+  DALI_TEST_EQUALS< uint32_t >( ( uint32_t )( value1 ), value2, location );
 }
 
-void DALI_TEST_EQUALS( const unsigned int value1, const size_t value2, const char* location )
+void DALI_TEST_EQUALS( const uint32_t value1, const size_t value2, const char* location )
 {
-  DALI_TEST_EQUALS< unsigned int >( value1, ( unsigned int )( value2 ), location );
+  DALI_TEST_EQUALS< uint32_t >( value1, ( uint32_t )( value2 ), location );
 }
 
 void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const char* location)
@@ -97,7 +97,7 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const cha
   const float* m2 = matrix2.AsFloat();
   bool equivalent = true;
 
-  for (int i=0;i<9;++i)
+  for (int32_t i=0;i<9;++i)
   {
     if( ! (fabsf(m1[i] - m2[i])< GetRangedEpsilon(m1[i], m2[i])) )
     {
@@ -132,7 +132,7 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, float eps
   const float* m2 = matrix2.AsFloat();
   bool equivalent = true;
 
-  for (int i=0;i<9;++i)
+  for (int32_t i=0;i<9;++i)
   {
     equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
   }
@@ -164,7 +164,7 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char*
   const float* m2 = matrix2.AsFloat();
   bool identical = true;
 
-  int i;
+  int32_t i;
   for (i=0;i<16;++i)
   {
     if(m1[i] != m2[i])
@@ -203,7 +203,7 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, float epsil
   const float* m2 = matrix2.AsFloat();
   bool equivalent = true;
 
-  for (int i=0;i<16;++i)
+  for (int32_t i=0;i<16;++i)
   {
     equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
   }
@@ -328,7 +328,7 @@ void ConstraintAppliedCheck::CheckSignalNotReceived()
   }
 }
 
-BufferImage CreateBufferImage(int width, int height, const Vector4& color)
+BufferImage CreateBufferImage(int32_t width, int32_t height, const Vector4& color)
 {
   BufferImage image = BufferImage::New(width, height, Pixel::RGBA8888);
 
@@ -352,15 +352,15 @@ BufferImage CreateBufferImage()
   return CreateBufferImage(4, 4, Color::WHITE);
 }
 
-void PrepareResourceImage( TestApplication& application, unsigned int imageWidth, unsigned int imageHeight, Pixel::Format pixelFormat )
+void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat )
 {
   TestPlatformAbstraction& platform = application.GetPlatform();
   platform.SetClosestImageSize(Vector2( imageWidth, imageHeight));
 
   Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
   Integration::PixelBuffer* pixbuffer = bitmap->GetPackedPixelsProfile()->ReserveBuffer( pixelFormat, imageWidth, imageHeight, imageWidth, imageHeight );
-  unsigned int bytesPerPixel = GetBytesPerPixel(  pixelFormat );
-  unsigned int initialColor = 0xFF;
+  uint32_t bytesPerPixel = GetBytesPerPixel(  pixelFormat );
+  uint32_t initialColor = 0xFF;
   memset( pixbuffer, initialColor, imageHeight*imageWidth*bytesPerPixel);
 
   Integration::ResourcePointer resourcePtr(bitmap);
index 4f71920..ed1a65f 100644 (file)
@@ -64,9 +64,9 @@ constexpr int32_t basenameIndex( const char * const path, const int32_t index =
 #define TET_FAIL 1
 #define TET_PASS 0
 
-extern int test_return_value;
+extern int32_t test_return_value;
 
-void tet_result(int value);
+void tet_result(int32_t value);
 
 #define END_TEST \
   return ((test_return_value>0)?1:0)
@@ -199,20 +199,20 @@ inline void DALI_TEST_EQUALS<TimePeriod>( TimePeriod value1, TimePeriod value2,
 void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location );
 
 /**
- * Test whether a size_t value and an unsigned int are equal.
+ * Test whether a size_t value and an uint32_t are equal.
  * @param[in] value1 The first value
  * @param[in] value2 The second value
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const size_t value1, const unsigned int value2, const char* location );
+void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* location );
 
 /**
- * Test whether an unsigned int and a size_t value and are equal.
+ * Test whether an uint32_t and a size_t value and are equal.
  * @param[in] value1 The first value
  * @param[in] value2 The second value
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const unsigned int value1, const size_t value2, const char* location );
+void DALI_TEST_EQUALS( const uint32_t value1, const size_t value2, const char* location );
 
 /**
  * Test whether two Matrix3 objects are equal.
@@ -374,11 +374,11 @@ struct DefaultFunctionCoverage
 
 // Helper to Create buffer image
 BufferImage CreateBufferImage();
-BufferImage CreateBufferImage(int width, int height, const Vector4& color);
+BufferImage CreateBufferImage(int32_t width, int32_t height, const Vector4& color);
 
 
 // Prepare a resource image to be loaded. Should be called before creating the ResourceImage
-void PrepareResourceImage( TestApplication& application, unsigned int imageWidth, unsigned int imageHeight, Pixel::Format pixelFormat );
+void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat );
 
 // Test namespace to prevent pollution of Dali namespace, add Test helper functions here
 namespace Test
index 8bb7176..a20ef6d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -21,42 +21,22 @@ namespace Dali
 {
 
 
-TestApplication::TestApplication( size_t surfaceWidth,
-                                  size_t surfaceHeight,
-                                  float  horizontalDpi,
-                                  float  verticalDpi,
+TestApplication::TestApplication( uint32_t surfaceWidth,
+                                  uint32_t surfaceHeight,
+                                  uint32_t  horizontalDpi,
+                                  uint32_t  verticalDpi,
                                   ResourcePolicy::DataRetention policy)
 : mCore( NULL ),
   mSurfaceWidth( surfaceWidth ),
   mSurfaceHeight( surfaceHeight ),
   mFrame( 0u ),
-  mDpi( horizontalDpi, verticalDpi ),
+  mDpi{ horizontalDpi, verticalDpi },
   mLastVSyncTime(0u),
   mDataRetentionPolicy( policy )
 {
   Initialize();
 }
 
-TestApplication::TestApplication( bool   initialize,
-                                  size_t surfaceWidth,
-                                  size_t surfaceHeight,
-                                  float  horizontalDpi,
-                                  float  verticalDpi,
-                                  ResourcePolicy::DataRetention policy)
-: mCore( NULL ),
-  mSurfaceWidth( surfaceWidth ),
-  mSurfaceHeight( surfaceHeight ),
-  mFrame( 0u ),
-  mDpi( horizontalDpi, verticalDpi ),
-  mLastVSyncTime(0u),
-  mDataRetentionPolicy( policy )
-{
-  if ( initialize )
-  {
-    Initialize();
-  }
-}
-
 void TestApplication::Initialize()
 {
   // We always need the first update!
@@ -165,7 +145,7 @@ void TestApplication::SendNotification()
   mCore->ProcessEvents();
 }
 
-void TestApplication::SetSurfaceWidth( unsigned int width, unsigned height )
+void TestApplication::SetSurfaceWidth( uint32_t width, uint32_t height )
 {
   mSurfaceWidth = width;
   mSurfaceHeight = height;
@@ -173,12 +153,12 @@ void TestApplication::SetSurfaceWidth( unsigned int width, unsigned height )
   mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
 }
 
-void TestApplication::SetTopMargin( unsigned int margin )
+void TestApplication::SetTopMargin( uint32_t margin )
 {
   mCore->SetTopMargin( margin );
 }
 
-void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* location )
+void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* location )
 {
   if( GetUpdateStatus() == 0 &&
       mRenderStatus.NeedsUpdate() == false &&
@@ -187,8 +167,8 @@ void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* l
     fprintf(stderr, "WARNING - Update not required :%s\n", location==NULL?"NULL":location);
   }
 
-  unsigned int nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
-  float elapsedSeconds = intervalMilliseconds / 1e3f;
+  uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
+  float elapsedSeconds = static_cast<float>( intervalMilliseconds ) * 0.001f;
 
   mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false );
 
@@ -197,7 +177,7 @@ void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* l
   mLastVSyncTime = nextVSyncTime;
 }
 
-bool TestApplication::Render( unsigned int intervalMilliseconds, const char* location )
+bool TestApplication::Render( uint32_t intervalMilliseconds, const char* location )
 {
   DoUpdate( intervalMilliseconds, location );
   mCore->Render( mRenderStatus, false );
@@ -207,12 +187,12 @@ bool TestApplication::Render( unsigned int intervalMilliseconds, const char* loc
   return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
 }
 
-unsigned int TestApplication::GetUpdateStatus()
+uint32_t TestApplication::GetUpdateStatus()
 {
   return mStatus.KeepUpdating();
 }
 
-bool TestApplication::UpdateOnly( unsigned int intervalMilliseconds  )
+bool TestApplication::UpdateOnly( uint32_t intervalMilliseconds  )
 {
   DoUpdate( intervalMilliseconds );
   return mStatus.KeepUpdating();
@@ -240,11 +220,11 @@ void TestApplication::ResetContext()
   mCore->ContextCreated();
 }
 
-unsigned int TestApplication::Wait( unsigned int durationToWait )
+uint32_t TestApplication::Wait( uint32_t durationToWait )
 {
   int time = 0;
 
-  for(unsigned int i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++)
+  for(uint32_t i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++)
   {
     SendNotification();
     Render(RENDER_FRAME_INTERVAL);
index 6b8b236..49f2b3c 100644 (file)
@@ -36,32 +36,25 @@ class DALI_CORE_API TestApplication : public ConnectionTracker
 public:
 
   // Default values derived from H2 device.
-  static const unsigned int DEFAULT_SURFACE_WIDTH = 480;
-  static const unsigned int DEFAULT_SURFACE_HEIGHT = 800;
+  static const uint32_t DEFAULT_SURFACE_WIDTH = 480;
+  static const uint32_t DEFAULT_SURFACE_HEIGHT = 800;
 
 #ifdef _CPP11
-  static constexpr float DEFAULT_HORIZONTAL_DPI = 220.0f;
-  static constexpr float DEFAULT_VERTICAL_DPI   = 217.0f;
+  static constexpr uint32_t DEFAULT_HORIZONTAL_DPI = 220;
+  static constexpr uint32_t DEFAULT_VERTICAL_DPI   = 217;
 #else
-  static const float DEFAULT_HORIZONTAL_DPI = 220.0f;
-  static const float DEFAULT_VERTICAL_DPI   = 217.0f;
+  static const uint32_t DEFAULT_HORIZONTAL_DPI = 220;
+  static const uint32_t DEFAULT_VERTICAL_DPI   = 217;
 #endif
 
-  static const unsigned int DEFAULT_RENDER_INTERVAL = 1;
+  static const uint32_t DEFAULT_RENDER_INTERVAL = 1;
 
-  static const unsigned int RENDER_FRAME_INTERVAL = 16;
+  static const uint32_t RENDER_FRAME_INTERVAL = 16;
 
-  TestApplication( size_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
-                   size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
-                   float  horizontalDpi = DEFAULT_HORIZONTAL_DPI,
-                   float  verticalDpi   = DEFAULT_VERTICAL_DPI,
-                   ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA);
-
-  TestApplication( bool   initialize,
-                   size_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
-                   size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
-                   float  horizontalDpi = DEFAULT_HORIZONTAL_DPI,
-                   float  verticalDpi   = DEFAULT_VERTICAL_DPI,
+  TestApplication( uint32_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
+                   uint32_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
+                   uint32_t horizontalDpi = DEFAULT_HORIZONTAL_DPI,
+                   uint32_t verticalDpi   = DEFAULT_VERTICAL_DPI,
                    ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA);
 
   void Initialize();
@@ -76,18 +69,18 @@ public:
   TestGestureManager& GetGestureManager();
   void ProcessEvent(const Integration::Event& event);
   void SendNotification();
-  void SetSurfaceWidth( unsigned int width, unsigned height );
-  void SetTopMargin( unsigned int margin );
-  bool Render( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
-  unsigned int GetUpdateStatus();
-  bool UpdateOnly( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
+  void SetSurfaceWidth( uint32_t width, unsigned height );
+  void SetTopMargin( uint32_t margin );
+  bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
+  uint32_t GetUpdateStatus();
+  bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
   bool RenderOnly( );
   void ResetContext();
   bool GetRenderNeedsUpdate();
-  unsigned int Wait( unsigned int durationToWait );
+  uint32_t Wait( uint32_t durationToWait );
 
 private:
-  void DoUpdate( unsigned int intervalMilliseconds, const char* location=NULL );
+  void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL );
 
 protected:
   TestPlatformAbstraction   mPlatformAbstraction;
@@ -101,12 +94,12 @@ protected:
 
   Integration::Core* mCore;
 
-  unsigned int mSurfaceWidth;
-  unsigned int mSurfaceHeight;
-  unsigned int mFrame;
+  uint32_t mSurfaceWidth;
+  uint32_t mSurfaceHeight;
+  uint32_t mFrame;
 
-  Vector2 mDpi;
-  unsigned int mLastVSyncTime;
+  struct { uint32_t x; uint32_t y; } mDpi;
+  uint32_t mLastVSyncTime;
   ResourcePolicy::DataRetention mDataRetentionPolicy;
 };
 
index 65a884e..858e930 100644 (file)
@@ -132,9 +132,9 @@ void TestGlSyncAbstraction::ResetTrace() { mTrace.Reset(); }
  */
 TraceCallStack& TestGlSyncAbstraction::GetTrace() { return mTrace; }
 
-int TestGlSyncAbstraction::GetNumberOfSyncObjects()
+int32_t TestGlSyncAbstraction::GetNumberOfSyncObjects()
 {
-  return mSyncObjects.size();
+  return static_cast<int32_t>( mSyncObjects.size() );
 }
 
 
index 979987b..c2db8d2 100644 (file)
@@ -105,7 +105,7 @@ public: // TEST FUNCTIONS
    *
    * @return the number of sync objects
    */
-  int GetNumberOfSyncObjects();
+  int32_t GetNumberOfSyncObjects();
 
 private:
 
index 645d74b..c4a27d1 100644 (file)
@@ -27,7 +27,7 @@
 namespace TestHarness
 {
 
-typedef std::map<int, TestCase> RunningTestCases;
+typedef std::map<int32_t, TestCase> RunningTestCases;
 
 const char* basename(const char* path)
 {
@@ -41,9 +41,9 @@ const char* basename(const char* path)
   return slash;
 }
 
-int RunTestCase( struct ::testcase_s& testCase )
+int32_t RunTestCase( struct ::testcase_s& testCase )
 {
-  int result = EXIT_STATUS_TESTCASE_FAILED;
+  int32_t result = EXIT_STATUS_TESTCASE_FAILED;
 
 // dont want to catch exception as we want to be able to get
 // gdb stack trace from the first error
@@ -69,11 +69,11 @@ int RunTestCase( struct ::testcase_s& testCase )
 }
 
 
-int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutput )
+int32_t RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutput )
 {
-  int testResult = EXIT_STATUS_TESTCASE_FAILED;
+  int32_t testResult = EXIT_STATUS_TESTCASE_FAILED;
 
-  int pid = fork();
+  int32_t pid = fork();
   if( pid == 0 ) // Child process
   {
     if( suppressOutput )
@@ -84,12 +84,12 @@ int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutpu
     else
     {
       printf("\n");
-      for(int i=0; i<80; ++i) printf("#");
+      for(int32_t i=0; i<80; ++i) printf("#");
       printf("\nTC: %s\n", testCase.name);
       fflush(stdout);
     }
 
-    int status = RunTestCase( testCase );
+    int32_t status = RunTestCase( testCase );
 
     if( ! suppressOutput )
     {
@@ -107,8 +107,8 @@ int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutpu
   }
   else // Parent process
   {
-    int status = 0;
-    int childPid = waitpid(pid, &status, 0);
+    int32_t status = 0;
+    int32_t childPid = waitpid(pid, &status, 0);
     if( childPid == -1 )
     {
       perror("waitpid");
@@ -127,7 +127,7 @@ int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutpu
     }
     else if(WIFSIGNALED(status) )
     {
-      int signal = WTERMSIG(status);
+      int32_t signal = WTERMSIG(status);
       testResult = EXIT_STATUS_TESTCASE_ABORTED;
       if( signal == SIGABRT )
       {
@@ -148,7 +148,7 @@ int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutpu
   return testResult;
 }
 
-void OutputStatistics( const char* processName, int numPasses, int numFailures )
+void OutputStatistics( const char* processName, int32_t numPasses, int32_t numFailures )
 {
   FILE* fp=fopen("summary.xml", "a");
   if( fp != NULL )
@@ -175,15 +175,15 @@ void OutputStatistics( const char* processName, int numPasses, int numFailures )
   }
 }
 
-int RunAll( const char* processName, ::testcase tc_array[] )
+int32_t RunAll( const char* processName, ::testcase tc_array[] )
 {
-  int numFailures = 0;
-  int numPasses = 0;
+  int32_t numFailures = 0;
+  int32_t numPasses = 0;
 
   // Run test cases in child process( to kill output/handle signals ), but run serially.
-  for( unsigned int i=0; tc_array[i].name; i++)
+  for( uint32_t i=0; tc_array[i].name; i++)
   {
-    int result = RunTestCaseInChildProcess( tc_array[i], false );
+    int32_t result = RunTestCaseInChildProcess( tc_array[i], false );
     if( result == 0 )
     {
       numPasses++;
@@ -200,26 +200,26 @@ int RunAll( const char* processName, ::testcase tc_array[] )
 }
 
 // Constantly runs up to MAX_NUM_CHILDREN processes
-int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRunFailed)
+int32_t RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRunFailed)
 {
-  int numFailures = 0;
-  int numPasses = 0;
+  int32_t numFailures = 0;
+  int32_t numPasses = 0;
 
   RunningTestCases children;
-  std::vector<int> failedTestCases;
+  std::vector<int32_t> failedTestCases;
 
   // Fork up to MAX_NUM_CHILDREN processes, then
   // wait. As soon as a proc completes, fork the next.
 
-  int nextTestCase = 0;
-  int numRunningChildren = 0;
+  int32_t nextTestCase = 0;
+  int32_t numRunningChildren = 0;
 
   while( tc_array[nextTestCase].name || numRunningChildren > 0)
   {
     // Create more children (up to the max number or til the end of the array)
     while( numRunningChildren < MAX_NUM_CHILDREN && tc_array[nextTestCase].name )
     {
-      int pid = fork();
+      int32_t pid = fork();
       if( pid == 0 ) // Child process
       {
         close(STDOUT_FILENO);
@@ -242,8 +242,8 @@ int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRu
 
     // Wait for the next child to finish
 
-    int status=0;
-    int childPid = waitpid(-1, &status, 0);
+    int32_t status=0;
+    int32_t childPid = waitpid(-1, &status, 0);
     if( childPid == -1 )
     {
       perror("waitpid");
@@ -254,7 +254,7 @@ int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRu
     {
       if( childPid > 0 )
       {
-        int testResult = WEXITSTATUS(status);
+        int32_t testResult = WEXITSTATUS(status);
         if( testResult )
         {
           printf("Test case %s failed: %d\n", children[childPid].testCaseName, testResult);
@@ -296,12 +296,12 @@ int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRu
 
   if( reRunFailed )
   {
-    for( unsigned int i=0; i<failedTestCases.size(); i++)
+    for( uint32_t i=0; i<failedTestCases.size(); i++)
     {
       char* testCaseStrapline;
-      int numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name );
+      int32_t numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name );
       printf("\n%s\n", testCaseStrapline);
-      for(int j=0; j<numChars; j++)
+      for(int32_t j=0; j<numChars; j++)
       {
         printf("=");
       }
@@ -315,11 +315,11 @@ int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRu
 
 
 
-int FindAndRunTestCase(::testcase tc_array[], const char* testCaseName)
+int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName)
 {
-  int result = EXIT_STATUS_TESTCASE_NOT_FOUND;
+  int32_t result = EXIT_STATUS_TESTCASE_NOT_FOUND;
 
-  for( int i = 0; tc_array[i].name; i++ )
+  for( int32_t i = 0; tc_array[i].name; i++ )
   {
     if( !strcmp(testCaseName, tc_array[i].name) )
     {
index 53ac0b9..e40492c 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_HARNESS_H
 
 /*
- * Copyright (c) 2014 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.
@@ -19,6 +19,7 @@
 
 #include <stdio.h>
 #include <testcase.h>
+#include <cstdint>
 
 namespace TestHarness
 {
@@ -34,11 +35,11 @@ enum ExitStatus
   EXIT_STATUS_TESTCASE_NOT_FOUND    // 6
 };
 
-const int MAX_NUM_CHILDREN(16);
+const int32_t MAX_NUM_CHILDREN(16);
 
 struct TestCase
 {
-  int testCase;
+  int32_t testCase;
   const char* testCaseName;
 
   TestCase()
@@ -47,7 +48,7 @@ struct TestCase
   {
   }
 
-  TestCase(int tc, const char* name)
+  TestCase(int32_t tc, const char* name)
   : testCase(tc),
     testCaseName(name)
   {
@@ -70,7 +71,7 @@ struct TestCase
  * Run a test case
  * @param[in] testCase The Testkit-lite test case to run
  */
-int RunTestCase( struct testcase_s& testCase );
+int32_t RunTestCase( struct testcase_s& testCase );
 
 /**
  * Run all test cases in parallel
@@ -79,7 +80,7 @@ int RunTestCase( struct testcase_s& testCase );
  * @param[in] reRunFailed True if failed test cases should be re-run
  * @return 0 on success
  */
-int RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFailed);
+int32_t RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFailed);
 
 /**
  * Run all test cases in serial
@@ -87,7 +88,7 @@ int RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFai
  * @param[in] tc_array The array of auto-generated testkit-lite test cases
  * @return 0 on success
  */
-int RunAll( const char* processName, testcase tc_array[] );
+int32_t RunAll( const char* processName, testcase tc_array[] );
 
 /**
  * Find the named test case in the given array, and run it
@@ -95,7 +96,7 @@ int RunAll( const char* processName, testcase tc_array[] );
  * @param[in] testCaseName the name of the test case to run
  * @return 0 on success
  */
-int FindAndRunTestCase(::testcase tc_array[], const char* testCaseName);
+int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName);
 
 /**
  * Display usage instructions for this program
index da4e7e8..ee6c17a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
 namespace Dali
 {
 
-TestNativeImagePointer TestNativeImage::New(int width, int height)
+TestNativeImagePointer TestNativeImage::New(uint32_t width, uint32_t height)
 {
   return new TestNativeImage(width, height);
 }
 
-TestNativeImage::TestNativeImage(int width, int height)
+TestNativeImage::TestNativeImage(uint32_t width, uint32_t height)
 : mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
 {
   mExtension = new TestNativeImageExtension();
@@ -39,12 +39,12 @@ TestNativeImage::~TestNativeImage()
 }
 
 
-TestNativeImageNoExtPointer TestNativeImageNoExt::New(int width, int height)
+TestNativeImageNoExtPointer TestNativeImageNoExt::New(uint32_t width, uint32_t height)
 {
   return new TestNativeImageNoExt(width, height);
 }
 
-TestNativeImageNoExt::TestNativeImageNoExt(int width, int height)
+TestNativeImageNoExt::TestNativeImageNoExt(uint32_t width, uint32_t height)
 : mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
 {
 }
index 5cb4b27..a664107 100644 (file)
@@ -36,35 +36,35 @@ public:
   inline const char* GetCustomFragmentPreFix(){return "#extension GL_OES_EGL_image_external:require\n";}
   inline const char* GetCustomSamplerTypename(){return "samplerExternalOES";}
 
-  inline int GetEglImageTextureTarget(){return GL_TEXTURE_EXTERNAL_OES;}
+  inline int32_t GetEglImageTextureTarget(){return GL_TEXTURE_EXTERNAL_OES;}
 
 };
 
 class DALI_CORE_API TestNativeImage : public Dali::NativeImageInterface
 {
 public:
-  static TestNativeImagePointer New(int width, int height);
+  static TestNativeImagePointer New(uint32_t width, uint32_t height);
 
   inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
   inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
   inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
   inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 0;};
   inline virtual void PrepareTexture() {};
-  inline virtual unsigned int GetWidth() const {return mWidth;};
-  inline virtual unsigned int GetHeight() const {return mHeight;};
+  inline virtual uint32_t GetWidth() const {return mWidth;};
+  inline virtual uint32_t GetHeight() const {return mHeight;};
   inline virtual bool RequiresBlending() const {return true;};
   inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return mExtension;}
 
 private:
-  TestNativeImage(int width, int height);
+  TestNativeImage(uint32_t width, uint32_t height);
   virtual ~TestNativeImage();
 
-  int mWidth;
-  int mHeight;
+  uint32_t mWidth;
+  uint32_t mHeight;
 public:
-  int mExtensionCreateCalls;
-  int mExtensionDestroyCalls;
-  int mTargetTextureCalls;
+  int32_t mExtensionCreateCalls;
+  int32_t mExtensionDestroyCalls;
+  int32_t mTargetTextureCalls;
 
   bool createResult;
   TestNativeImageExtension* mExtension;
@@ -74,27 +74,27 @@ public:
 class DALI_CORE_API TestNativeImageNoExt : public Dali::NativeImageInterface
 {
 public:
-  static TestNativeImageNoExtPointer New(int width, int height);
+  static TestNativeImageNoExtPointer New(uint32_t width, uint32_t height);
 
   inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
   inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
   inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
   inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 1;};
   inline virtual void PrepareTexture() {};
-  inline virtual unsigned int GetWidth() const {return mWidth;};
-  inline virtual unsigned int GetHeight() const {return mHeight;};
+  inline virtual uint32_t GetWidth() const {return mWidth;};
+  inline virtual uint32_t GetHeight() const {return mHeight;};
   inline virtual bool RequiresBlending() const {return true;};
 
 private:
-  TestNativeImageNoExt(int width, int height);
+  TestNativeImageNoExt(uint32_t width, uint32_t height);
   virtual ~TestNativeImageNoExt();
 
-  int mWidth;
-  int mHeight;
+  uint32_t mWidth;
+  uint32_t mHeight;
 public:
-  int mExtensionCreateCalls;
-  int mExtensionDestroyCalls;
-  int mTargetTextureCalls;
+  int32_t mExtensionCreateCalls;
+  int32_t mExtensionDestroyCalls;
+  int32_t mTargetTextureCalls;
   bool createResult;
 };
 
index cb0b39c..190aa63 100644 (file)
@@ -43,7 +43,7 @@ ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string&
                                                               SamplingMode::Type samplingMode,
                                                               bool orientationCorrection )
 {
-  ImageDimensions closestSize = ImageDimensions( mClosestSize.x, mClosestSize.y );
+  ImageDimensions closestSize = ImageDimensions( mClosestSize );
   mTrace.PushCall("GetClosestImageSize", "");
   return closestSize;
 }
@@ -54,7 +54,7 @@ ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::Resou
                                                    SamplingMode::Type samplingMode,
                                                    bool orientationCorrection )
 {
-  ImageDimensions closestSize = ImageDimensions( mClosestSize.x, mClosestSize.y );
+  ImageDimensions closestSize = ImageDimensions( mClosestSize );
   mTrace.PushCall("GetClosestImageSize", "");
   return closestSize;
 }
@@ -115,9 +115,9 @@ void TestPlatformAbstraction::ClearReadyResources()
   mDecodedBitmap.Reset();
 }
 
-void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
+void TestPlatformAbstraction::SetClosestImageSize( const Vector2& size )
 {
-  mClosestSize = size;
+  mClosestSize = ImageDimensions( static_cast<uint32_t>( size.x ), static_cast<uint32_t>( size.y ) );
 }
 
 void TestPlatformAbstraction::SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer )
index f31561e..dfa4d6c 100644 (file)
@@ -129,7 +129,7 @@ public: // TEST FUNCTIONS
    * @brief Sets the value returned by GetClosestImageSize.
    * @param[in] size The size that should be returned.
    */
-  void SetClosestImageSize(const Vector2& size);
+  void SetClosestImageSize( const Vector2& size );
 
   /**
    * @brief Sets the result return by LoadFile.
@@ -177,7 +177,7 @@ private:
 
   mutable TraceCallStack        mTrace;
   bool                          mIsLoadingResult;
-  Vector2                       mClosestSize;
+  ImageDimensions               mClosestSize;
 
   LoadFileResult                mLoadFileResult;
   bool                          mSaveFileResult;
index f57dc50..f894389 100644 (file)
@@ -164,14 +164,14 @@ bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std:
  * @param[in] params A comma separated list of parameter values
  * @return index in the stack where the method was found or -1 otherwise
  */
-int TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string params) const
+int32_t TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string params) const
 {
-  int index = -1;
+  int32_t index = -1;
   for( size_t i=0; i < mCallStack.size(); i++ )
   {
     if( 0 == mCallStack[i].method.compare(method) && 0 == mCallStack[i].paramList.compare(params) )
     {
-      index = i;
+      index = static_cast<int32_t>( i );
       break;
     }
   }
@@ -180,7 +180,7 @@ int TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string
 
 int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const TraceCallStack::NamedParams& params) const
 {
-  int index = -1;
+  int32_t index = -1;
   for( size_t i=0; i < mCallStack.size(); i++ )
   {
     if( 0 == mCallStack[i].method.compare(method) )
@@ -198,7 +198,7 @@ int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const Trace
       }
       if( match == true )
       {
-        index = i;
+        index = static_cast<int32_t>( i );
         break;
       }
     }
index d32f619..d569cba 100644 (file)
@@ -165,8 +165,8 @@ public:
   std::string GetTraceString()
   {
     std::stringstream traceStream;
-    int functionCount = mCallStack.size();
-    for( int i = 0; i < functionCount; ++i )
+    std::size_t functionCount = mCallStack.size();
+    for( std::size_t i = 0; i < functionCount; ++i )
     {
       Dali::TraceCallStack::FunctionCall functionCall = mCallStack[ i ];
       traceStream << "StackTrace: Index:" << i << ",  Function:" << functionCall.method << ",  ParamList:" << functionCall.paramList << std::endl;
index 5a6123e..7e472e0 100644 (file)
@@ -43,13 +43,11 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_devel_api_text_abstraction_src_files) \
                   $(adaptor_graphics_common_src_files) \
                   $(adaptor_graphics_gles20_src_files) \
-                  $(adaptor_graphics_ubuntu_gl_src_files) \
                   $(adaptor_graphics_ubuntu_src_files) \
                   $(adaptor_haptics_common_src_files) \
                   $(adaptor_imaging_common_src_files) \
                   $(adaptor_imaging_ubuntu_x11_src_files) \
                   $(adaptor_input_common_src_files) \
-                  $(adaptor_input_ubuntu_src_files) \
                   $(adaptor_input_ubuntu_x11_src_files) \
                   $(adaptor_legacy_common_src_files) \
                   $(adaptor_network_common_src_files) \
@@ -58,7 +56,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_sensor_ubuntu_src_files) \
                   $(adaptor_styling_common_src_files) \
                   $(adaptor_system_common_src_files) \
-                  $(adaptor_system_ubuntu_src_files) \
+                  $(adaptor_system_linux_src_files) \
                   $(adaptor_system_ubuntu_x11_src_files) \
                   $(adaptor_text_common_src_files) \
                   $(adaptor_text_ubuntu_src_files) \
@@ -89,10 +87,9 @@ endif
 if MOBILE_PROFILE
 LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_accessibility_common_src_files) \
-                  $(adaptor_accessibility_tizen_src_files) \
+                  $(adaptor_accessibility_tizen_wayland_src_files) \
                   $(adaptor_accessibility_tizen_mobile_src_files) \
                   $(adaptor_adaptor_common_src_files) \
-                  $(adaptor_adaptor_tizen_src_files) \
                   $(adaptor_adaptor_tizen_wayland_src_files) \
                   $(adaptor_clipboard_common_src_files) \
                   $(adaptor_clipboard_tizen_wayland_src_files) \
@@ -113,7 +110,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_sensor_tizen_src_files) \
                   $(adaptor_styling_common_src_files) \
                   $(adaptor_system_common_src_files) \
-                  $(adaptor_system_tizen_mobile_src_files) \
+                  $(adaptor_system_linux_src_files) \
+                  $(adaptor_system_tizen_wayland_src_files) \
                   $(adaptor_text_common_src_files) \
                   $(adaptor_resampler_src_files) \
                   $(adaptor_video_common_src_files) \
@@ -151,10 +149,9 @@ endif
 if IVI_PROFILE
 LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_accessibility_common_src_files) \
-                  $(adaptor_accessibility_tizen_src_files) \
+                  $(adaptor_accessibility_tizen_wayland_src_files) \
                   $(adaptor_accessibility_tizen_ivi_src_files) \
                   $(adaptor_adaptor_common_src_files) \
-                  $(adaptor_adaptor_tizen_src_files) \
                   $(adaptor_adaptor_tizen_wayland_src_files) \
                   $(adaptor_clipboard_common_src_files) \
                   $(adaptor_clipboard_tizen_wayland_src_files) \
@@ -176,7 +173,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_sensor_tizen_src_files) \
                   $(adaptor_styling_common_src_files) \
                   $(adaptor_system_common_src_files) \
-                  $(adaptor_system_tizen_ivi_src_files) \
+                  $(adaptor_system_linux_src_files) \
+                  $(adaptor_system_tizen_wayland_src_files) \
                   $(adaptor_text_common_src_files) \
                   $(adaptor_resampler_src_files) \
                   $(adaptor_video_common_src_files) \
@@ -214,10 +212,9 @@ endif
 if TV_PROFILE
 LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_accessibility_common_src_files) \
-                  $(adaptor_accessibility_tizen_src_files) \
+                  $(adaptor_accessibility_tizen_wayland_src_files) \
                   $(adaptor_accessibility_tizen_tv_src_files) \
                   $(adaptor_adaptor_common_src_files) \
-                  $(adaptor_adaptor_tizen_src_files) \
                   $(adaptor_adaptor_tizen_wayland_src_files) \
                   $(adaptor_clipboard_common_src_files) \
                   $(adaptor_clipboard_tizen_wayland_src_files) \
@@ -238,7 +235,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_sensor_tizen_src_files) \
                   $(adaptor_styling_common_src_files) \
                   $(adaptor_system_common_src_files) \
-                  $(adaptor_system_tizen_tv_src_files) \
+                  $(adaptor_system_linux_src_files) \
+                  $(adaptor_system_tizen_wayland_src_files) \
                   $(adaptor_text_common_src_files) \
                   $(adaptor_resampler_src_files) \
                   $(adaptor_video_common_src_files) \
@@ -275,10 +273,9 @@ endif
 if COMMON_PROFILE
 LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_accessibility_common_src_files) \
-                  $(adaptor_accessibility_tizen_src_files) \
+                  $(adaptor_accessibility_tizen_wayland_src_files) \
                   $(adaptor_accessibility_tizen_common_src_files) \
                   $(adaptor_adaptor_common_src_files) \
-                  $(adaptor_adaptor_tizen_src_files) \
                   $(adaptor_adaptor_tizen_wayland_src_files) \
                   $(adaptor_clipboard_common_src_files) \
                   $(adaptor_clipboard_tizen_wayland_src_files) \
@@ -299,7 +296,8 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_sensor_tizen_src_files) \
                   $(adaptor_styling_common_src_files) \
                   $(adaptor_system_common_src_files) \
-                  $(adaptor_system_generic_src_files) \
+                  $(adaptor_system_linux_src_files) \
+                  $(adaptor_system_tizen_wayland_src_files) \
                   $(adaptor_text_common_src_files) \
                   $(adaptor_resampler_src_files) \
                   $(adaptor_video_common_src_files) \
@@ -338,10 +336,9 @@ endif
 if WEARABLE_PROFILE
 LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_accessibility_common_src_files) \
-                  $(adaptor_accessibility_tizen_src_files) \
+                  $(adaptor_accessibility_tizen_wayland_src_files) \
                   $(adaptor_accessibility_tizen_wearable_src_files) \
                   $(adaptor_adaptor_common_src_files) \
-                  $(adaptor_adaptor_tizen_src_files) \
                   $(adaptor_adaptor_tizen_wayland_src_files) \
                   $(adaptor_adaptor_tizen_wearable_src_files) \
                   $(adaptor_clipboard_common_src_files) \
@@ -363,6 +360,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(adaptor_sensor_tizen_src_files) \
                   $(adaptor_styling_common_src_files) \
                   $(adaptor_system_common_src_files) \
+                  $(adaptor_system_linux_src_files) \
                   $(adaptor_system_tizen_wearable_src_files) \
                   $(adaptor_text_common_src_files) \
                   $(adaptor_resampler_src_files) \
index 85a4347..8444e89 100644 (file)
@@ -35,6 +35,29 @@ bool AddIdleWithReturnValue( Application application, CallbackBase* callback )
   return Internal::Adaptor::GetImplementation( application ).AddIdle( callback, true );
 }
 
+Dali::Window CreateWindow( Application application, PositionSize childPosSize, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode )
+{
+  auto& adaptor = Internal::Adaptor::GetImplementation( application ).GetAdaptor();
+
+  Dali::Window childWindow = Dali::Window::New( childPosSize, childWindowName, childWindowClassName, childWindowMode );
+  Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &childWindow, childWindowName, childWindowClassName, childWindowMode );
+  return childWindow;
+}
+
+bool DestroyWindow( Application application, Dali::Window* childWindow )
+{
+  auto& adaptor = Internal::Adaptor::GetImplementation( application ).GetAdaptor();
+
+  return Internal::Adaptor::Adaptor::GetImplementation( adaptor ).RemoveWindow( childWindow );
+}
+
+bool DestroyWindow( Application application, const std::string& childWindowName )
+{
+  auto& adaptor = Internal::Adaptor::GetImplementation( application ).GetAdaptor();
+
+  return Internal::Adaptor::Adaptor::GetImplementation( adaptor ).RemoveWindow( childWindowName );
+}
+
 } // namespace DevelApplication
 
 } // namespace Dali
index 5ffbd2e..080d1db 100644 (file)
@@ -53,6 +53,37 @@ DALI_ADAPTOR_API void PreInitialize( int* argc, char** argv[] );
  */
 DALI_ADAPTOR_API bool AddIdleWithReturnValue( Application application, CallbackBase* callback );
 
+/**
+ * @brief Create and Add a child window to the application instance
+ * @param[in] application A handle to the Application
+ * @param[in] childPosSize The position and size of the child window to be created
+ * @param[in] childWindowName The title of the child window
+ * @param[in] childWindowClassName The class name of the child window
+ * @param[in] childWindowMode The mode of the newly created child window
+ * @return @c a window handle if added successfully, @c null otherwise
+ *
+ * @note Function must be called from main event thread only
+ */
+DALI_ADAPTOR_API Dali::Window CreateWindow( Application application, PositionSize childPosSize, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode );
+
+/**
+ * @brief Removes a previously created Window instance from the Adaptor internal list
+ * @note Function must be called from the main event thread only.
+ * @param[in] application A handle to the Application
+ * @param[in] childWindow The created Window instance
+ * @return true if removed successfully, false otherwise
+ */
+DALI_ADAPTOR_API bool DestroyWindow( Application application, Dali::Window* childWindow );
+
+/**
+ * @brief Removes a previously created Window instance from the Adaptor internal list
+ * @note Function must be called from the main event thread only.
+ * @param[in] application A handle to the Application
+ * @param[in] childWindowName The title of the window
+ * @return true if removed successfully, false otherwise
+ */
+DALI_ADAPTOR_API bool DestroyWindow( Application application, const std::string& childWindowName );
+
 } // namespace DevelApplication
 
 } // namespace Dali
index 580435a..ee1f7df 100644 (file)
@@ -19,7 +19,7 @@
 #include <dali/devel-api/adaptor-framework/color-controller.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/generic/color-controller-impl.h>
+#include <dali/internal/system/common/color-controller-impl.h>
 
 namespace Dali
 {
index 60dabc1..af05256 100644 (file)
@@ -33,8 +33,6 @@ namespace
 // limit maximum image down load size to 50 MB
 const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE  = 50 * 1024 * 1024 ;
 
-static unsigned int gMaxTextureSize = 4096;
-
 }
 
 Devel::PixelBuffer LoadImageFromFile( const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
@@ -114,14 +112,9 @@ Devel::PixelBuffer DownloadImageSynchronously( const std::string& url, ImageDime
   return Dali::Devel::PixelBuffer();
 }
 
-void SetMaxTextureSize( unsigned int size )
-{
-  gMaxTextureSize = size;
-}
-
 unsigned int GetMaxTextureSize()
 {
-  return gMaxTextureSize;
+  return TizenPlatform::ImageLoader::GetMaxTextureSize();
 }
 
 } // namespace Dali
index 3c19be0..a7995ba 100755 (executable)
@@ -90,13 +90,6 @@ DALI_ADAPTOR_API Devel::PixelBuffer DownloadImageSynchronously(
   bool orientationCorrection = true );
 
 /**
- * @brief Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE.
- *
- * @param [in] size The maximum texture size to set
- */
-DALI_ADAPTOR_API void SetMaxTextureSize( unsigned int size );
-
-/**
  * @brief get the maximum texture size.
  *
  * @return The maximum texture size
index 7774cf1..1538f66 100755 (executable)
@@ -29,13 +29,21 @@ NativeImageSourceQueuePtr NativeImageSourceQueue::New( unsigned int width, unsig
 {
   Any empty;
   NativeImageSourceQueuePtr image = new NativeImageSourceQueue( width, height, depth, empty );
-  return image;
+  if( image->mImpl )
+  {
+    return image;
+  }
+  return nullptr;
 }
 
 NativeImageSourceQueuePtr NativeImageSourceQueue::New( Any nativeImageSourceQueue )
 {
   NativeImageSourceQueuePtr image = new NativeImageSourceQueue( 0, 0, COLOR_DEPTH_DEFAULT, nativeImageSourceQueue );
-  return image;
+  if( image->mImpl )
+  {
+    return image;
+  }
+  return nullptr;
 }
 
 Any NativeImageSourceQueue::GetNativeImageSourceQueue()
index 2dcb128..00b7528 100644 (file)
@@ -207,6 +207,11 @@ bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex )
   return GetImplementation(*this).IsColorGlyph( fontId, glyphIndex );
 }
 
+bool FontClient::AddCustomFontDirectory( const FontPath& path )
+{
+  return GetImplementation(*this).AddCustomFontDirectory( path );
+}
+
 FontClient::FontClient( Internal::FontClient* internal )
 : BaseHandle( internal )
 {
index 167607d..c444eb8 100755 (executable)
@@ -408,6 +408,15 @@ public:
    */
   bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex );
 
+  /**
+   * @brief  Add custom fonts directory
+   *
+   * @param[in] path to the fonts directory
+   *
+   * @return true if the fonts can be added.
+   */
+  bool AddCustomFontDirectory( const FontPath& path );
+
 public: // Not intended for application developers
   /**
    * @brief This constructor is used by FontClient::Get().
index 8044163..f7a47ea 100755 (executable)
@@ -1,5 +1,5 @@
-#ifndef __DALI_INTEGRATION_ADAPTOR_H__
-#define __DALI_INTEGRATION_ADAPTOR_H__
+#ifndef DALI_INTEGRATION_ADAPTOR_H
+#define DALI_INTEGRATION_ADAPTOR_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
@@ -46,6 +46,7 @@ namespace Internal
 {
 namespace Adaptor
 {
+class GraphicsFactory;
 class Adaptor;
 }
 }
@@ -415,4 +416,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_INTEGRATION_ADAPTOR_H__
+#endif // DALI_INTEGRATION_ADAPTOR_H
index ceca9d3..e9e8921 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_RENDER_SURFACE_H__
-#define __DALI_RENDER_SURFACE_H__
+#ifndef DALI_RENDER_SURFACE_H
+#define DALI_RENDER_SURFACE_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-adaptor-common.h>
 
+
 namespace Dali
 {
 
-class EglInterface;
 class DisplayConnection;
 class ThreadSynchronizationInterface;
 
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class GraphicsInterface;
+
+} // namespace Adaptor
+
+} // namespace Internal
+
 namespace Integration
 {
 
@@ -95,32 +107,31 @@ public:
   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0;
 
   /**
-   * Initialize EGL, RenderSurface should create egl display and initialize
-   * @param egl implementation to use for the creation
+   * @brief InitializeGraphics the platform specific graphics surface interfaces
+   * @param[in] graphics The abstracted graphics interface
+   * @param[in] displayConnection The display connection interface
    */
-  virtual void InitializeEgl( EglInterface& egl ) = 0;
+  virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) = 0;
 
   /**
-   * @brief Creates EGL Surface
-   * @param egl implementation to use for the creation
+   * @brief Creates the Surface
    */
-  virtual void CreateEglSurface( EglInterface& egl ) = 0;
+  virtual void CreateSurface() = 0;
 
   /**
-   * @brief Destroys EGL Surface
-   * @param egl implementation to use for the destruction
+   * @brief Destroys the Surface
    */
-  virtual void DestroyEglSurface( EglInterface& egl ) = 0;
+  virtual void DestroySurface() = 0;
 
   /**
-   * @brief Replace the EGL Surface
-   * @param egl implementation to use for the creation
+   * @brief Replace the Surface
    * @return true if context was lost
    */
-  virtual bool ReplaceEGLSurface( EglInterface& egl ) = 0;
+  virtual bool ReplaceGraphicsSurface() = 0;
 
   /**
    * @brief Resizes the underlying surface.
+   * @param[in] The dimensions of the new position
    */
   virtual void MoveResize( Dali::PositionSize positionSize ) = 0;
 
@@ -139,23 +150,18 @@ public:
    * @brief Invoked by render thread before Core::Render
    * If the operation fails, then Core::Render should not be called until there is
    * a surface to render onto.
-   * @param[in] egl The Egl interface
-   * @param[in] glAbstraction OpenGLES abstraction interface
    * @param[in] resizingSurface True if the surface is being resized
    * @return True if the operation is successful, False if the operation failed
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) = 0;
+  virtual bool PreRender( bool resizingSurface ) = 0;
 
   /**
    * @brief Invoked by render thread after Core::Render
-   * @param[in] egl The Egl interface
-   * @param[in] glAbstraction OpenGLES abstraction interface
-   * @param[in] displayConnection display connection
+   * @param[in] renderToFbo True if render to FBO.
    * @param[in] replacingSurface True if the surface is being replaced.
    * @param[in] resizingSurface True if the surface is being resized.
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) = 0;
-
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) = 0;
   /**
    * @brief Invoked by render thread when the thread should be stop
    */
@@ -193,4 +199,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_RENDER_SURFACE_H__
+#endif // DALI_RENDER_SURFACE_H
index d6d7f3b..6c6cb95 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -26,7 +26,7 @@
 #include <dali/integration-api/events/gesture-requests.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
 
 namespace Dali
 {
index 8ccdb83..01fd0aa 100644 (file)
@@ -7,30 +7,30 @@ adaptor_accessibility_common_src_files=\
     ${adaptor_accessibility_dir}/common/accessibility-adaptor-impl.cpp \
     ${adaptor_accessibility_dir}/common/accessibility-gesture-detector.cpp
 
-# module: accessibility, backend: tizen
-adaptor_accessibility_tizen_src_files=\
-    ${adaptor_accessibility_dir}/tizen/tts-player-factory-tizen.cpp \
-    ${adaptor_accessibility_dir}/tizen/tts-player-impl-tizen.cpp
+# module: accessibility, backend: tizen-wayland
+adaptor_accessibility_tizen_wayland_src_files=\
+    ${adaptor_accessibility_dir}/tizen-wayland/tts-player-factory-tizen.cpp \
+    ${adaptor_accessibility_dir}/tizen-wayland/tts-player-impl-tizen.cpp
 
 # module: accessibility, backend: tizen-common profile
 adaptor_accessibility_tizen_common_src_files=\
-    ${adaptor_accessibility_dir}/tizen-common/accessibility-adaptor-impl-tizen.cpp
+    ${adaptor_accessibility_dir}/tizen-wayland/tizen-common/accessibility-adaptor-impl-tizen.cpp
 
 # module: accessibility, backend: tizen-ivi profile
 adaptor_accessibility_tizen_ivi_src_files=\
-    ${adaptor_accessibility_dir}/tizen-ivi/accessibility-adaptor-impl-ivi.cpp
+    ${adaptor_accessibility_dir}/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp
 
 # module: accessibility, backend: tizen-mobile profile
 adaptor_accessibility_tizen_mobile_src_files=\
-    ${adaptor_accessibility_dir}/tizen-mobile/accessibility-adaptor-impl-mobile.cpp
+    ${adaptor_accessibility_dir}/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp
 
 # module: accessibility, backend: tizen-tv profile
 adaptor_accessibility_tizen_tv_src_files=\
-    ${adaptor_accessibility_dir}/tizen-tv/accessibility-adaptor-impl-tv.cpp
+    ${adaptor_accessibility_dir}/tizen-wayland/tizen-tv/accessibility-adaptor-impl-tv.cpp
 
 # module: accessibility, backend: tizen-wearable profile
 adaptor_accessibility_tizen_wearable_src_files=\
-    ${adaptor_accessibility_dir}/tizen-wearable/accessibility-adaptor-impl-wearable.cpp
+    ${adaptor_accessibility_dir}/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp
 
 # module: accessibility, backend: ubuntu
 adaptor_accessibility_ubuntu_src_files=\
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -26,7 +26,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
 
 namespace Dali
 {
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/accessibility/tizen-mobile/accessibility-adaptor-impl-mobile.h>
+#include <dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
 
 // EXTERNAL INCLUDES
 #include <vconf.h>
@@ -35,7 +35,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
 
 #ifndef WAYLAND
 #define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/accessibility/tizen-mobile/accessibility-adaptor-impl-mobile.h>
+#include <dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
 
 // EXTERNAL INCLUDES
 #include <vconf.h>
@@ -35,7 +35,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
 
 #ifndef WAYLAND
 #define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -26,7 +26,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
 
 namespace Dali
 {
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/accessibility/tizen-mobile/accessibility-adaptor-impl-mobile.h>
+#include <dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
 
 // EXTERNAL INCLUDES
 #include <vconf.h>
@@ -35,7 +35,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
 
 #ifndef WAYLAND
 #define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
@@ -16,7 +16,7 @@
  */
 
 #include <dali/internal/accessibility/common/tts-player-factory.h>
-#include <dali/internal/accessibility/tizen/tts-player-impl-tizen.h>
+#include <dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/accessibility/tizen/tts-player-impl-tizen.h>
+#include <dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.h>
 
 // EXTERNAL INCLUDES
 #include <tts.h>
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
  *
  */
 
-// EXTERNAL INCLUDES
-#include <system_settings.h>
+// CLASS HEADER
+#include <dali/internal/adaptor/common/adaptor-builder-impl.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+#include <dali/internal/window-system/common/display-utils.h>
+
 
 namespace Dali
 {
@@ -30,14 +33,15 @@ namespace Internal
 namespace Adaptor
 {
 
-int GetLongPressTime( int defaultTime )
+AdaptorBuilder::AdaptorBuilder()
 {
-  return defaultTime;
+  // Construct Graphics Factory
+  mGraphicsFactory = Utils::MakeUnique< GraphicsFactory >();
 }
 
-int GetElmAccessActionOver()
+GraphicsFactory& AdaptorBuilder::GetGraphicsFactory() const
 {
-  return 0;
+  return *mGraphicsFactory.get();
 }
 
 } // namespace Adaptor
diff --git a/dali/internal/adaptor/common/adaptor-builder-impl.h b/dali/internal/adaptor/common/adaptor-builder-impl.h
new file mode 100644 (file)
index 0000000..b382b4b
--- /dev/null
@@ -0,0 +1,80 @@
+#ifndef DALI_INTERNAL_ADAPTOR_BUILDER_IMPL_H
+#define DALI_INTERNAL_ADAPTOR_BUILDER_IMPL_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-options.h>
+#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Implementation of the Adaptor Builder class.
+ */
+class AdaptorBuilder
+{
+public:
+
+  /**
+   * Constructor
+   */
+  AdaptorBuilder();
+
+
+  /**
+   * Destructor
+   */
+  ~AdaptorBuilder() {};
+
+
+public:
+
+  /**
+   * @return reference to the GraphicsFactory object
+   */
+  GraphicsFactory& GetGraphicsFactory() const;
+
+
+private:
+  // Eliminate copy and assigned operations
+  AdaptorBuilder(const AdaptorBuilder&) = delete;
+  AdaptorBuilder& operator=(AdaptorBuilder&) = delete;
+
+
+private:
+  std::unique_ptr< GraphicsFactory > mGraphicsFactory; ///< GraphicsFactory object
+
+};
+
+} // namespace Internal
+
+} // namespace Adaptor
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_ADAPTOR_BUILDER_IMPL_H
index 272a019..33dce23 100755 (executable)
@@ -17,6 +17,7 @@
 
 // CLASS HEADER
 #include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/adaptor-builder-impl.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/stage.h>
@@ -36,6 +37,9 @@
 #include <dali/internal/system/common/performance-interface-factory.h>
 #include <dali/internal/adaptor/common/lifecycle-observer.h>
 
+#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h> // Temporary until Core is abstracted
+
 #include <dali/devel-api/text-abstraction/font-client.h>
 
 #include <dali/internal/system/common/callback-manager.h>
@@ -47,7 +51,6 @@
 #include <dali/internal/graphics/gles20/gl-implementation.h>
 #include <dali/internal/graphics/gles20/egl-sync-implementation.h>
 #include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-factory.h>
 #include <dali/internal/clipboard/common/clipboard-impl.h>
 #include <dali/internal/graphics/common/vsync-monitor.h>
 #include <dali/internal/system/common/object-profiler.h>
 #include <dali/internal/window-system/common/window-render-surface.h>
 
 #include <dali/internal/system/common/logging.h>
-#include <dali/devel-api/adaptor-framework/image-loading.h>
 
 #include <dali/internal/system/common/locale-utils.h>
 #include <dali/internal/imaging/common/image-loader-plugin-proxy.h>
+#include <dali/internal/imaging/common/image-loader.h>
+
 
 using Dali::TextAbstraction::FontClient;
 
@@ -77,13 +81,18 @@ namespace
 thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get
 } // unnamed namespace
 
+
 Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
 {
   Dali::Adaptor* adaptor = new Dali::Adaptor;
   Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions );
   adaptor->mImpl = impl;
 
-  impl->Initialize(configuration);
+  Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder = new AdaptorBuilder();
+  auto graphicsFactory = mAdaptorBuilder->GetGraphicsFactory();
+
+  impl->Initialize( graphicsFactory, configuration );
+  delete mAdaptorBuilder; // Not needed anymore as the graphics interface has now been created
 
   return adaptor;
 }
@@ -92,13 +101,34 @@ Dali::Adaptor* Adaptor::New( Dali::Window window, Dali::Configuration::ContextLo
 {
   Any winId = window.GetNativeHandle();
 
-  Window& windowImpl = Dali::GetImplementation(window);
+  Window& windowImpl = Dali::GetImplementation( window );
   Dali::Adaptor* adaptor = New( winId, windowImpl.GetSurface(), configuration, environmentOptions );
-  windowImpl.SetAdaptor(*adaptor);
+  windowImpl.SetAdaptor( *adaptor );
   return adaptor;
 }
 
-void Adaptor::Initialize( Dali::Configuration::ContextLoss configuration )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+{
+  Dali::Adaptor* adaptor = new Dali::Adaptor; // Public adaptor
+  Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions ); // Impl adaptor
+  adaptor->mImpl = impl;
+
+  impl->Initialize( graphicsFactory, configuration );
+
+  return adaptor;
+} // Called second
+
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Window window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+{
+  Any winId = window.GetNativeHandle();
+
+  Window& windowImpl = Dali::GetImplementation( window );
+  Dali::Adaptor* adaptor = New( graphicsFactory, winId, windowImpl.GetSurface(), configuration, environmentOptions );
+  windowImpl.SetAdaptor( *adaptor );
+  return adaptor;
+} // Called first
+
+void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration::ContextLoss configuration )
 {
   // all threads here (event, update, and render) will send their logs to TIZEN Platform's LogMessage handler.
   Dali::Integration::Log::LogFunction logFunction( Dali::TizenPlatform::LogMessage );
@@ -116,8 +146,8 @@ void Adaptor::Initialize( Dali::Configuration::ContextLoss configuration )
   {
     dataRetentionPolicy = ResourcePolicy::DALI_DISCARDS_ALL_DATA;
   }
-  // Note, Tizen does not use DALI_RETAINS_ALL_DATA, as it can reload images from
-  // files automatically.
+
+  // Note, Tizen does not use DALI_RETAINS_ALL_DATA, as it can reload images from files automatically.
 
   if( mEnvironmentOptions->PerformanceServerRequired() )
   {
@@ -129,35 +159,28 @@ void Adaptor::Initialize( Dali::Configuration::ContextLoss configuration )
 
   mCallbackManager = CallbackManager::New();
 
-  PositionSize size = mSurface->GetPositionSize();
+  WindowPane defaultWindow = mWindowFrame.front();
+  PositionSize size = defaultWindow.surface->GetPositionSize();
 
   mGestureManager = new GestureManager(*this, Vector2(size.width, size.height), mCallbackManager, *mEnvironmentOptions);
 
-  if( mEnvironmentOptions->GetGlesCallTime() > 0 )
-  {
-    mGLES = new GlProxyImplementation( *mEnvironmentOptions );
-  }
-  else
-  {
-    mGLES = new GlImplementation();
-  }
-
-  const Integration::DepthBufferAvailable depthBufferAvailable = static_cast< Integration::DepthBufferAvailable >( mEnvironmentOptions->DepthBufferRequired() );
-  const Integration::StencilBufferAvailable stencilBufferAvailable = static_cast< Integration::StencilBufferAvailable >( mEnvironmentOptions->StencilBufferRequired() );
+  mGraphics = &( graphicsFactory.Create() );
+  mGraphics->Initialize( mEnvironmentOptions );
 
-  mEglFactory = new EglFactory( mEnvironmentOptions->GetMultiSamplingLevel(), depthBufferAvailable, stencilBufferAvailable );
+  auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
 
-  EglSyncImplementation* eglSyncImpl = mEglFactory->GetSyncImplementation();
+  GlImplementation& mGLES = eglGraphics->GetGlesInterface();
+  EglSyncImplementation& eglSyncImpl = eglGraphics->GetSyncImplementation();
 
   mCore = Integration::Core::New( *this,
                                   *mPlatformAbstraction,
-                                  *mGLES,
-                                  *eglSyncImpl,
+                                  mGLES,
+                                  eglSyncImpl,
                                   *mGestureManager,
                                   dataRetentionPolicy ,
                                   ( 0u != mEnvironmentOptions->GetRenderToFboInterval() ) ? Integration::RenderToFrameBuffer::TRUE : Integration::RenderToFrameBuffer::FALSE,
-                                  depthBufferAvailable,
-                                  stencilBufferAvailable );
+                                  mGraphics->GetDepthBufferRequired(),
+                                  mGraphics->GetStencilBufferRequired() );
 
   const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval();
   if( 0u < timeInterval )
@@ -169,6 +192,15 @@ void Adaptor::Initialize( Dali::Configuration::ContextLoss configuration )
 
   mVSyncMonitor = new VSyncMonitor;
 
+  if( defaultWindow.surface )
+  {
+    mDisplayConnection = Dali::DisplayConnection::New( *mGraphics, defaultWindow.surface->GetSurfaceType() );
+  }
+  else
+  {
+    mDisplayConnection = Dali::DisplayConnection::New( *mGraphics );
+  }
+
   mThreadController = new ThreadController( *this, *mEnvironmentOptions );
 
   // Should be called after Core creation
@@ -240,7 +272,7 @@ void Adaptor::Initialize( Dali::Configuration::ContextLoss configuration )
   // Set max texture size
   if( mEnvironmentOptions->GetMaxTextureSize() > 0 )
   {
-    Dali::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() );
+    Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() );
   }
 
   SetupSystemInformation();
@@ -265,13 +297,15 @@ Adaptor::~Adaptor()
   delete mObjectProfiler;
 
   delete mCore;
-  delete mEglFactory;
-  delete mGLES;
+
   delete mGestureManager;
+  delete mDisplayConnection;
   delete mPlatformAbstraction;
   delete mCallbackManager;
   delete mPerformanceInterface;
 
+  mGraphics->Destroy();
+
   // uninstall it on this thread (main actor thread)
   Dali::Integration::Log::UninstallLogFunction();
 
@@ -284,8 +318,7 @@ Adaptor::~Adaptor()
 
 void Adaptor::Start()
 {
-  // it doesn't support restart after stop at this moment
-  // to support restarting, need more testing
+  // It doesn't support restart after stop at this moment to support restarting, need more testing
   if( READY != mState )
   {
     return;
@@ -294,8 +327,10 @@ void Adaptor::Start()
   // Start the callback manager
   mCallbackManager->Start();
 
-  // create event handler
-  mEventHandler = new EventHandler( mSurface, *this, *mGestureManager, *this, mDragAndDropDetector );
+  WindowPane defaultWindow = mWindowFrame.front();
+
+  // Create event handler
+  mEventHandler = new EventHandler( defaultWindow.surface, *this, *mGestureManager, *this, mDragAndDropDetector );
 
   if( mDeferredRotationObserver != NULL )
   {
@@ -305,7 +340,8 @@ void Adaptor::Start()
 
   unsigned int dpiHor, dpiVer;
   dpiHor = dpiVer = 0;
-  mSurface->GetDpi( dpiHor, dpiVer );
+
+  defaultWindow.surface->GetDpi( dpiHor, dpiVer );
 
   // tell core about the DPI value
   mCore->SetDpi(dpiHor, dpiVer);
@@ -315,7 +351,8 @@ void Adaptor::Start()
   fontClient.SetDpi( dpiHor, dpiVer );
 
   // Tell the core the size of the surface just before we start the render-thread
-  PositionSize size = mSurface->GetPositionSize();
+  PositionSize size = defaultWindow.surface->GetPositionSize();
+
   mCore->SurfaceResized( size.width, size.height );
 
   // Initialize the thread controller
@@ -378,7 +415,7 @@ void Adaptor::Resume()
       (*iter)->OnResume();
     }
 
-    // trigger processing of events queued up while paused
+    // Trigger processing of events queued up while paused
     mCore->ProcessEvents();
 
     // Do at end to ensure our first update/render after resumption includes the processed messages as well
@@ -399,6 +436,9 @@ void Adaptor::Stop()
 
     mThreadController->Stop();
 
+    // Clear out all the handles to Windows
+    mWindowFrame.clear();
+
     // Delete the TTS player
     for(int i =0; i < Dali::TtsPlayer::MODE_NUM; i++)
     {
@@ -451,34 +491,45 @@ void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
   mEventHandler->FeedKeyEvent( keyEvent );
 }
 
-void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
+void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& newSurface )
 {
-  PositionSize positionSize = surface.GetPositionSize();
+  PositionSize positionSize = newSurface.GetPositionSize();
 
-  // let the core know the surface size has changed
+  // Let the core know the surface size has changed
   mCore->SurfaceResized( positionSize.width, positionSize.height );
 
   mResizedSignal.Emit( mAdaptor );
 
-  mNativeWindow = nativeWindow;
-  mSurface = &surface;
+  WindowPane newDefaultWindow;
+  newDefaultWindow.nativeWindow = nativeWindow;
+  newDefaultWindow.surface = &newSurface;
+
+  // Must delete the old Window first before replacing it with the new one
+  WindowPane oldDefaultWindow = mWindowFrame.front();
+  oldDefaultWindow.surface->DestroySurface();
 
-  // flush the event queue to give the update-render thread chance
+  // Update WindowFrame
+  std::vector<WindowPane>::iterator iter = mWindowFrame.begin();
+  iter = mWindowFrame.insert( iter, newDefaultWindow );
+
+  // 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 completed the replace.
-  mThreadController->ReplaceSurface(mSurface);
+  // This method blocks until the render thread has completed the replace.
+  mThreadController->ReplaceSurface( newDefaultWindow.surface );
 }
 
 RenderSurface& Adaptor::GetSurface() const
 {
-  return *mSurface;
+  WindowPane defaultWindow = mWindowFrame.front();
+  return *(defaultWindow.surface);
 }
 
 void Adaptor::ReleaseSurfaceLock()
 {
-  mSurface->ReleaseLock();
+  WindowPane defaultWindow = mWindowFrame.front();
+  defaultWindow.surface->ReleaseLock();
 }
 
 Dali::TtsPlayer Adaptor::GetTtsPlayer(Dali::TtsPlayer::Mode mode)
@@ -515,6 +566,52 @@ void Adaptor::SetPreRenderCallback( CallbackBase* callback )
   mThreadController->SetPreRenderCallback( callback );
 }
 
+bool Adaptor::AddWindow( Dali::Window* childWindow, const std::string& childWindowName, const std::string& childWindowClassName, const bool& childWindowMode )
+{
+  // This is any Window that is not the main (default) one
+  WindowPane additionalWindow;
+  additionalWindow.instance = childWindow;
+  additionalWindow.window_name = childWindowName;
+  additionalWindow.class_name = childWindowClassName;
+  additionalWindow.window_mode = childWindowMode;
+
+  // Add the new Window to the Frame - the order is not important
+  mWindowFrame.push_back( additionalWindow );
+
+  Window& windowImpl = Dali::GetImplementation( *childWindow );
+  windowImpl.SetAdaptor( Get() );
+
+  return true;
+}
+
+bool Adaptor::RemoveWindow( Dali::Window* childWindow )
+{
+  for ( WindowFrames::iterator iter = mWindowFrame.begin(); iter != mWindowFrame.end(); ++iter )
+  {
+    if( iter->instance == childWindow )
+    {
+      mWindowFrame.erase( iter );
+      return true;
+    }
+  }
+
+  return false;
+}
+
+bool Adaptor::RemoveWindow( std::string childWindowName )
+{
+  for ( WindowFrames::iterator iter = mWindowFrame.begin(); iter != mWindowFrame.end(); ++iter )
+  {
+    if( iter->window_name == childWindowName )
+    {
+      mWindowFrame.erase( iter );
+      return true;
+    }
+  }
+
+  return false;
+}
+
 Dali::Adaptor& Adaptor::Get()
 {
   DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
@@ -546,21 +643,16 @@ void Adaptor::SetUseHardwareVSync( bool useHardware )
   mVSyncMonitor->SetUseHardwareVSync( useHardware );
 }
 
-EglFactory& Adaptor::GetEGLFactory() const
+Dali::DisplayConnection& Adaptor::GetDisplayConnectionInterface()
 {
-  DALI_ASSERT_DEBUG( mEglFactory && "EGL Factory not created" );
-  return *mEglFactory;
+  DALI_ASSERT_DEBUG( mDisplayConnection && "Display connection not created" );
+  return *mDisplayConnection;
 }
 
-EglFactoryInterface& Adaptor::GetEGLFactoryInterface() const
+GraphicsInterface& Adaptor::GetGraphicsInterface()
 {
-  return *mEglFactory;
-}
-
-Integration::GlAbstraction& Adaptor::GetGlAbstraction() const
-{
-  DALI_ASSERT_DEBUG( mGLES && "GLImplementation not created" );
-  return *mGLES;
+  DALI_ASSERT_DEBUG( mGraphics && "Graphics interface not created" );
+  return *mGraphics;
 }
 
 Dali::Integration::PlatformAbstraction& Adaptor::GetPlatformAbstractionInterface()
@@ -568,11 +660,6 @@ Dali::Integration::PlatformAbstraction& Adaptor::GetPlatformAbstractionInterface
   return *mPlatformAbstraction;
 }
 
-Dali::Integration::GlAbstraction& Adaptor::GetGlesInterface()
-{
-  return *mGLES;
-}
-
 TriggerEventInterface& Adaptor::GetProcessCoreEventsTrigger()
 {
   return *mNotificationTrigger;
@@ -590,7 +677,15 @@ SocketFactoryInterface& Adaptor::GetSocketFactoryInterface()
 
 RenderSurface* Adaptor::GetRenderSurfaceInterface()
 {
-  return mSurface;
+  if( !mWindowFrame.empty())
+  {
+    WindowPane defaultWindow = mWindowFrame.front();
+    return defaultWindow.surface;
+  }
+  else
+  {
+    return nullptr;
+  }
 }
 
 VSyncMonitorInterface* Adaptor::GetVSyncMonitorInterface()
@@ -660,22 +755,22 @@ void Adaptor::SetMinimumPinchDistance(float distance)
 
 Any Adaptor::GetNativeWindowHandle()
 {
-  return mNativeWindow;
+  WindowPane defaultWindow = mWindowFrame.front();
+  return defaultWindow.nativeWindow;
 }
 
 Any Adaptor::GetGraphicsDisplay()
 {
   Any display;
 
-  if( mEglFactory )
+  if (mGraphics)
   {
-    EglInterface* egl = mEglFactory->GetImplementation();
-    if( egl )
-    {
-      auto eglImpl = static_cast<EglImplementation*>(egl);
-      display = eglImpl->GetDisplay();
-    }
+    auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
+
+    EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+    display = eglImpl.GetDisplay();
   }
+
   return display;
 }
 
@@ -802,7 +897,7 @@ void Adaptor::OnDamaged( const DamageArea& area )
 
 void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
 {
-  // let the core know the surface size has changed
+  // Let the core know the surface size has changed
   mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
 
   mResizedSignal.Emit( mAdaptor );
@@ -810,7 +905,7 @@ void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
 
 void Adaptor::SurfaceResizeComplete( SurfaceSize surfaceSize )
 {
-  // flush the event queue to give the update-render thread chance
+  // 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();
 
@@ -824,7 +919,7 @@ void Adaptor::NotifySceneCreated()
   // Start thread controller after the scene has been created
   mThreadController->Start();
 
-  // process after surface is created (registering to remote surface provider if required)
+  // Process after surface is created (registering to remote surface provider if required)
   SurfaceInitialized();
 
   mState = RUNNING;
@@ -855,7 +950,7 @@ void Adaptor::RequestUpdateOnce()
 
 void Adaptor::IndicatorSizeChanged(int height)
 {
-  // let the core know the indicator height is changed
+  // Let the core know the indicator height is changed
   mCore->SetTopMargin(height);
 }
 
@@ -874,37 +969,41 @@ Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surfac
   mLanguageChangedSignal(),
   mAdaptor( adaptor ),
   mState( READY ),
-  mCore( NULL ),
-  mThreadController( NULL ),
-  mVSyncMonitor( NULL ),
-  mGLES( NULL ),
-  mGlSync( NULL ),
-  mEglFactory( NULL ),
-  mNativeWindow( nativeWindow ),
-  mSurface( surface ),
-  mPlatformAbstraction( NULL ),
-  mEventHandler( NULL ),
-  mCallbackManager( NULL ),
+  mCore( nullptr ),
+  mThreadController( nullptr ),
+  mVSyncMonitor( nullptr ),
+  mDisplayConnection( nullptr ),
+  mPlatformAbstraction( nullptr ),
+  mEventHandler( nullptr ),
+  mCallbackManager( nullptr ),
   mNotificationOnIdleInstalled( false ),
-  mNotificationTrigger( NULL ),
-  mGestureManager( NULL ),
+  mNotificationTrigger( nullptr ),
+  mGestureManager( nullptr ),
   mDaliFeedbackPlugin(),
-  mFeedbackController( NULL ),
+  mFeedbackController( nullptr ),
   mTtsPlayers(),
   mObservers(),
   mDragAndDropDetector(),
-  mDeferredRotationObserver( NULL ),
+  mDeferredRotationObserver( nullptr ),
   mEnvironmentOptions( environmentOptions ? environmentOptions : new EnvironmentOptions /* Create the options if not provided */),
-  mPerformanceInterface( NULL ),
+  mPerformanceInterface( nullptr ),
   mKernelTracer(),
   mSystemTracer(),
   mTriggerEventFactory(),
-  mObjectProfiler( NULL ),
+  mObjectProfiler( nullptr ),
   mSocketFactory(),
   mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ ),
   mUseRemoteSurface( false )
 {
   DALI_ASSERT_ALWAYS( !IsAvailable() && "Cannot create more than one Adaptor per thread" );
+
+  WindowPane defaultWindow;
+  defaultWindow.nativeWindow = nativeWindow;
+  defaultWindow.surface = surface;
+
+  std::vector<WindowPane>::iterator iter = mWindowFrame.begin();
+  iter = mWindowFrame.insert( iter, defaultWindow );
+
   gThreadLocalAdaptor = this;
 }
 
@@ -912,7 +1011,9 @@ Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surfac
 
 void Adaptor::SetViewMode( ViewMode viewMode )
 {
-  mSurface->SetViewMode( viewMode );
+  WindowPane defaultWindow = mWindowFrame.front();
+  defaultWindow.surface->SetViewMode( viewMode );
+
   mCore->SetViewMode( viewMode );
 }
 
index 53e9c43..26c3bb7 100755 (executable)
@@ -1,5 +1,5 @@
-#ifndef __DALI_INTERNAL_ADAPTOR_IMPL_H__
-#define __DALI_INTERNAL_ADAPTOR_IMPL_H__
+#ifndef DALI_INTERNAL_ADAPTOR_IMPL_H
+#define DALI_INTERNAL_ADAPTOR_IMPL_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
@@ -31,6 +31,8 @@
 #include <dali/public-api/adaptor-framework/tts-player.h>
 #include <dali/devel-api/adaptor-framework/clipboard.h>
 
+#include <dali/internal/graphics/common/graphics-interface.h>
+
 #include <dali/internal/legacy/common/tizen-platform-abstraction.h>
 #include <dali/internal/adaptor/common/adaptor-internal-services.h>
 #include <dali/internal/system/common/environment-options.h>
@@ -43,6 +45,7 @@
 #include <dali/integration-api/trigger-event-factory.h>
 #include <dali/internal/network/common/socket-factory.h>
 
+
 namespace Dali
 {
 
@@ -60,8 +63,9 @@ namespace Internal
 
 namespace Adaptor
 {
+class DisplayConnection;
+class GraphicsFactory;
 class EventHandler;
-class EglFactory;
 class GestureManager;
 class GlImplementation;
 class GlSyncImplementation;
@@ -111,12 +115,44 @@ public:
    * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
-  static Dali::Adaptor* New( Dali::Window window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions );
+  static Dali::Adaptor* New( Dali::Window window,
+                             Dali::Configuration::ContextLoss configuration,
+                             EnvironmentOptions* environmentOptions );
+
+  /**
+   * Creates a New Adaptor
+   * @param[in]  graphicsFactory     A factory that creates the graphics interface
+   * @param[in]  nativeWindow        Native window handle
+   * @param[in]  surface             A render surface can be one of the following
+   *                                  - Pixmap, adaptor will use existing Pixmap to draw on to
+   *                                  - Window, adaptor will use existing Window to draw on to
+   * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
+   * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
+   */
+  static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
+                             Any nativeWindow,
+                             RenderSurface* surface,
+                             Dali::Configuration::ContextLoss configuration,
+                             EnvironmentOptions* environmentOptions );
+
+  /**
+   * Creates a New Adaptor
+   * @param[in]  graphicsFactory     A factory that creates the graphics interface
+   * @param[in]  nativeWindow        native window handle
+   * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
+   * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
+   */
+  static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
+                             Dali::Window window,
+                             Dali::Configuration::ContextLoss configuration,
+                             EnvironmentOptions* environmentOptions );
 
   /**
    * 2-step initialisation, this should be called after creating an adaptor instance.
+   * @param[in]  graphicsFactory     A factory that creates the graphics interface
+   * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    */
-  void Initialize(Dali::Configuration::ContextLoss configuration);
+  void Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration::ContextLoss configuration );
 
   /**
    * Virtual destructor.
@@ -212,6 +248,31 @@ public: // AdaptorInternalServices implementation
   virtual bool AddIdle( CallbackBase* callback, bool hasReturnValue, bool forceAdd );
 
   /**
+   * Adds a new Window instance to the Adaptor
+   * @param[in]  childWindow The child window instance
+   * @param[in]  childWindowName The child window title/name
+   * @param[in]  childWindowClassName The class name that the child window belongs to
+   * @param[in]  childWindowMode The mode of the child window
+   */
+  virtual bool AddWindow( Dali::Window* childWindow,
+                          const std::string& childWindowName,
+                          const std::string& childWindowClassName,
+                          const bool& childWindowMode );
+
+  /**
+   * Removes an existing Window instance from the Adaptor
+   * @param[in]  window The Window instance
+   */
+  virtual bool RemoveWindow( Dali::Window* childWindow );
+
+  /**
+   * Removes an existing Window instance from the Adaptor
+   * @param[in]  windowName The Window name
+   * @note If two Windows have the same name, the first one that matches will be removed
+   */
+  virtual bool RemoveWindow( std::string childWindowName );
+
+  /**
    * @copydoc Dali::Adaptor::RemoveIdle()
    */
   virtual void RemoveIdle( CallbackBase* callback );
@@ -239,17 +300,6 @@ public:
   void SetUseHardwareVSync(bool useHardware);
 
   /**
-   * @return reference to EglFactory class
-   */
-  EglFactory& GetEGLFactory() const;
-
-  /**
-   * Return GlAbstraction.
-   * @return the GlAbstraction.
-   */
-  Integration::GlAbstraction& GetGlAbstraction() const;
-
-  /**
    * Return the PlatformAbstraction.
    * @return The PlatformAbstraction.
    */
@@ -269,7 +319,7 @@ public:
   void SetRotationObserver( RotationObserver* observer );
 
   /**
-   * Destroy the TtsPlayer of sepcific mode.
+   * Destroy the TtsPlayer of specific mode.
    * @param[in] mode The mode of TtsPlayer to destroy
    */
   void DestroyTtsPlayer(Dali::TtsPlayer::Mode mode);
@@ -297,7 +347,7 @@ public:
   Any GetGraphicsDisplay();
 
   /**
-   * Sets use remote surface for eglSurface output
+   * Sets use remote surface for Surface output
    * @param[in] useRemoteSurface True if the remote surface is used
    */
   void SetUseRemoteSurface(bool useRemoteSurface);
@@ -382,14 +432,14 @@ public:  //AdaptorInternalServices
   virtual Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface();
 
   /**
-   * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetGlesInterface()
+   * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetDisplayConnectionInterface()
    */
-  virtual Dali::Integration::GlAbstraction& GetGlesInterface();
+  virtual Dali::DisplayConnection& GetDisplayConnectionInterface();
 
   /**
-  * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetEGLFactoryInterface()
-  */
-  virtual EglFactoryInterface& GetEGLFactoryInterface() const;
+   * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetGraphicsInterface()
+   */
+  virtual GraphicsInterface& GetGraphicsInterface();
 
   /**
    * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetTriggerEventInterface()
@@ -517,8 +567,8 @@ private: // From Dali::Internal::Adaptor::DamageObserver
 private:
 
   // Undefined
-  Adaptor(const Adaptor&);
-  Adaptor& operator=(Adaptor&);
+  Adaptor(const Adaptor&) = delete;
+  Adaptor& operator=(Adaptor&) = delete;
 
 private:
 
@@ -589,6 +639,19 @@ private: // Types
     STOPPED,             ///< Adaptor has been stopped.
   };
 
+  // A structure to encapsulate each Window instance for the Adaptor to track them
+  typedef struct WindowPane
+  {
+    Dali::Window*  instance;     ///< Window object
+    std::string    window_name;  ///< Name (title)_of the window
+    std::string    class_name;   ///< Class name that the window belongs to
+    bool           window_mode;  ///< Display mode of the window
+    Any            nativeWindow; ///< window identifier
+    RenderSurface* surface;      ///< The surface the Window is bound to
+  } WindowPane;
+
+  typedef std::vector<WindowPane> WindowFrames;
+
   typedef std::vector<LifeCycleObserver*>  ObserverContainer;
 
 private: // Data
@@ -601,12 +664,11 @@ private: // Data
   Dali::Integration::Core*              mCore;                        ///< Dali Core
   ThreadController*                     mThreadController;            ///< Controls the threads
   VSyncMonitor*                         mVSyncMonitor;                ///< Monitors VSync events
-  GlImplementation*                     mGLES;                        ///< GL implementation
-  GlSyncImplementation*                 mGlSync;                      ///< GL Sync implementation
-  EglFactory*                           mEglFactory;                  ///< EGL Factory
 
-  Any                                   mNativeWindow;                ///< window identifier
-  RenderSurface*                        mSurface;                     ///< Current surface
+  GraphicsInterface*                    mGraphics;                    ///< Graphics interface
+  Dali::DisplayConnection*              mDisplayConnection;           ///< Display connection
+  WindowFrames                          mWindowFrame;                 ///< A container of all the Windows that are currently created
+
   TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction;      ///< Platform abstraction
 
   EventHandler*                         mEventHandler;                ///< event handler
@@ -629,8 +691,9 @@ private: // Data
   SocketFactory                         mSocketFactory;               ///< Socket factory
   const bool                            mEnvironmentOptionsOwned:1;   ///< Whether we own the EnvironmentOptions (and thus, need to delete it)
   bool                                  mUseRemoteSurface;            ///< whether the remoteSurface is used or not
+
 public:
-  inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) {return *adaptor.mImpl;}
+  inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) { return *adaptor.mImpl; }
 };
 
 } // namespace Internal
@@ -639,4 +702,4 @@ public:
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_ADAPTOR_IMPL_H__
+#endif // DALI_INTERNAL_ADAPTOR_IMPL_H
index 5d52f9a..0cc2d32 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H__
-#define __DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H__
+#ifndef DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
+#define DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
 
 /*
  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
@@ -25,6 +25,8 @@
 // INTERNAL INCLUDES
 #include <dali/integration-api/trigger-event-interface.h>
 #include <dali/integration-api/trigger-event-factory-interface.h>
+#include <dali/internal/window-system/common/display-connection.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
 #include <dali/internal/graphics/gles20/egl-factory-interface.h>
 #include <dali/internal/network/common/socket-factory-interface.h>
 #include <dali/internal/system/common/performance-interface.h>
@@ -61,23 +63,26 @@ public:
   /**
    * @return platform abstraction
    */
-  virtual Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface()  = 0;
+  virtual Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface() = 0;
 
   /**
-   * @return gles abstraction
+   * Used to access the Display Connection interface from the Render thread
+   * @return the Display Connection interface
    */
-  virtual Dali::Integration::GlAbstraction& GetGlesInterface()  = 0;
+  virtual Dali::DisplayConnection& GetDisplayConnectionInterface() = 0;
 
   /**
-   * @return egl factory
+   * Used to access the abstracted graphics interface
+   * This also contains the depth and stencil buffers
+   * @return the graphics interface
    */
-  virtual EglFactoryInterface& GetEGLFactoryInterface() const  = 0;
+  virtual GraphicsInterface& GetGraphicsInterface() = 0;
 
   /**
    * Used by update-thread to notify core (main-thread) it has messages to process
    * @return trigger event ProcessCoreEvents
    */
-  virtual TriggerEventInterface& GetProcessCoreEventsTrigger()  = 0;
+  virtual TriggerEventInterface& GetProcessCoreEventsTrigger() = 0;
 
   /**
    * @return trigger event factory interface
@@ -92,27 +97,27 @@ public:
   /**
    * @return render surface
    */
-  virtual RenderSurface* GetRenderSurfaceInterface()  = 0;
+  virtual RenderSurface* GetRenderSurfaceInterface() = 0;
 
   /**
    * @return vsync monitor interface
    */
-  virtual VSyncMonitorInterface* GetVSyncMonitorInterface()  = 0;
+  virtual VSyncMonitorInterface* GetVSyncMonitorInterface() = 0;
 
   /**
    * @return performance interface
    */
-  virtual PerformanceInterface* GetPerformanceInterface()  = 0;
+  virtual PerformanceInterface* GetPerformanceInterface() = 0;
 
   /**
    * @return interface for logging to the kernel ( e.g. using ftrace )
    */
-  virtual TraceInterface& GetKernelTraceInterface()  = 0;
+  virtual TraceInterface& GetKernelTraceInterface() = 0;
 
   /**
    * @return system trace interface, e.g. for using Tizen Trace (ttrace) or Android Trace (atrace)
    */
-  virtual TraceInterface& GetSystemTraceInterface()  = 0;
+  virtual TraceInterface& GetSystemTraceInterface() = 0;
 
 
 protected:
@@ -132,10 +137,10 @@ protected:
   };
 
   // Undefined copy constructor.
-  AdaptorInternalServices( const AdaptorInternalServices& );
+  AdaptorInternalServices( const AdaptorInternalServices& ) = delete;
 
   // Undefined assignment operator.
-  AdaptorInternalServices& operator=( const AdaptorInternalServices& );
+  AdaptorInternalServices& operator=( const AdaptorInternalServices& ) = delete;
 };
 
 } // namespace Internal
@@ -144,4 +149,4 @@ protected:
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H__
+#endif // DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
index d2ccfda..47c42d5 100644 (file)
@@ -24,7 +24,6 @@
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/style-monitor.h>
 #include <dali/internal/system/common/command-line-options.h>
-#include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/adaptor/common/framework.h>
 #include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/adaptor/common/lifecycle-controller-impl.h>
@@ -88,15 +87,16 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
   mRegionChangedSignal(),
   mBatteryLowSignal(),
   mMemoryLowSignal(),
-  mEventLoop( NULL ),
-  mFramework( NULL ),
+  mEventLoop( nullptr ),
+  mFramework( nullptr ),
   mContextLossConfiguration( Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ),
-  mCommandLineOptions( NULL ),
+  mCommandLineOptions( nullptr ),
   mSingletonService( SingletonService::New() ),
-  mAdaptor( NULL ),
-  mWindow(),
-  mWindowMode( windowMode ),
-  mName(),
+  mAdaptorBuilder( nullptr ),
+  mAdaptor( nullptr ),
+  mMainWindow(),
+  mMainWindowMode( windowMode ),
+  mMainWindowName(),
   mStylesheet( stylesheet ),
   mEnvironmentOptions(),
   mWindowPositionSize( positionSize ),
@@ -104,11 +104,11 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
   mSlotDelegate( this )
 {
   // Get mName from environment options
-  mName = mEnvironmentOptions.GetWindowName();
-  if( mName.empty() && argc && ( *argc > 0 ) )
+  mMainWindowName = mEnvironmentOptions.GetWindowName();
+  if( mMainWindowName.empty() && argc && ( *argc > 0 ) )
   {
     // Set mName from command-line args if environment option not set
-    mName = (*argv)[0];
+    mMainWindowName = (*argv)[0];
   }
 
   mCommandLineOptions = new CommandLineOptions(argc, argv);
@@ -120,8 +120,9 @@ Application::~Application()
 {
   mSingletonService.UnregisterAll();
 
-  mWindow.Reset();
+  mMainWindow.Reset();
   delete mAdaptor;
+  delete mAdaptorBuilder;
   delete mCommandLineOptions;
   delete mFramework;
 }
@@ -145,29 +146,36 @@ void Application::CreateWindow()
   }
 
   const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
-  mWindow = Dali::Window::New( mWindowPositionSize, mName, windowClassName, mWindowMode == Dali::Application::TRANSPARENT );
+  mMainWindow = Dali::Window::New( mWindowPositionSize, mMainWindowName, windowClassName, mMainWindowMode == Dali::Application::TRANSPARENT );
 
   int indicatorVisibleMode = mEnvironmentOptions.GetIndicatorVisibleMode();
   if( indicatorVisibleMode >= Dali::Window::INVISIBLE && indicatorVisibleMode <= Dali::Window::AUTO )
   {
-    GetImplementation( mWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
+    GetImplementation( mMainWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
   }
 
   // Quit the application when the window is closed
-  GetImplementation( mWindow ).DeleteRequestSignal().Connect( mSlotDelegate, &Application::Quit );
+  GetImplementation( mMainWindow ).DeleteRequestSignal().Connect( mSlotDelegate, &Application::Quit );
 }
 
 void Application::CreateAdaptor()
 {
-  DALI_ASSERT_ALWAYS( mWindow && "Window required to create adaptor" );
+  DALI_ASSERT_ALWAYS( mMainWindow && "Window required to create adaptor" );
 
-  mAdaptor = Dali::Internal::Adaptor::Adaptor::New( mWindow, mContextLossConfiguration, &mEnvironmentOptions );
+  auto graphicsFactory = mAdaptorBuilder->GetGraphicsFactory();
+
+  mAdaptor = Dali::Internal::Adaptor::Adaptor::New( graphicsFactory, mMainWindow, mContextLossConfiguration, &mEnvironmentOptions );
 
   mAdaptor->ResizedSignal().Connect( mSlotDelegate, &Application::OnResize );
 
   Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetUseRemoteSurface( mUseRemoteSurface );
 }
 
+void Application::CreateAdaptorBuilder()
+{
+  mAdaptorBuilder = new AdaptorBuilder();
+}
+
 void Application::MainLoop(Dali::Configuration::ContextLoss configuration)
 {
   mContextLossConfiguration = configuration;
@@ -179,7 +187,7 @@ void Application::MainLoop(Dali::Configuration::ContextLoss configuration)
 void Application::Lower()
 {
   // Lower the application without quitting it.
-  mWindow.Lower();
+  mMainWindow.Lower();
 }
 
 void Application::Quit()
@@ -199,6 +207,8 @@ void Application::QuitFromMainLoop()
 
 void Application::DoInit()
 {
+  CreateAdaptorBuilder();
+
   // If an application was pre-initialized, a window was made in advance
   if( mLaunchpadState == Launchpad::NONE )
   {
@@ -246,7 +256,7 @@ void Application::DoTerminate()
     mAdaptor->Stop();
   }
 
-  mWindow.Reset();
+  mMainWindow.Reset(); // This only resets (clears) the default Window
 }
 
 void Application::DoPause()
@@ -289,7 +299,7 @@ void Application::OnInit()
 
 void Application::OnTerminate()
 {
-  // we've been told to quit by AppCore, ecore_x_destroy has been called, need to quit synchronously
+  // We've been told to quit by AppCore, ecore_x_destroy has been called, need to quit synchronously
   // delete the window as ecore_x has been destroyed by AppCore
 
   Dali::Application application(this);
@@ -394,7 +404,7 @@ Dali::Adaptor& Application::GetAdaptor()
 
 Dali::Window Application::GetWindow()
 {
-  return mWindow;
+  return mMainWindow;
 }
 
 // Stereoscopy
@@ -419,10 +429,9 @@ float Application::GetStereoBase() const
   return Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).GetStereoBase();
 }
 
-
 void Application::ReplaceWindow( const PositionSize& positionSize, const std::string& name )
 {
-  Dali::Window newWindow = Dali::Window::New( positionSize, name, mWindowMode == Dali::Application::TRANSPARENT );
+  Dali::Window newWindow = Dali::Window::New( positionSize, name, mMainWindowMode == Dali::Application::TRANSPARENT );
   Window& windowImpl = GetImplementation(newWindow);
   windowImpl.SetAdaptor(*mAdaptor);
 
@@ -436,7 +445,7 @@ void Application::ReplaceWindow( const PositionSize& positionSize, const std::st
 
   Any nativeWindow = newWindow.GetNativeHandle();
   Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
-  mWindow = newWindow;
+  mMainWindow = newWindow;
   mWindowPositionSize = positionSize;
 }
 
@@ -450,7 +459,6 @@ void Application::SetStyleSheet( const std::string& stylesheet )
   mStylesheet = stylesheet;
 }
 
-
 ApplicationPtr Application::GetPreInitializedApplication()
 {
   return gPreInitializedApplication;
index 2a16014..e906520 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_INTERNAL_APPLICATION_H__
-#define __DALI_INTERNAL_APPLICATION_H__
+#ifndef DALI_INTERNAL_APPLICATION_H
+#define DALI_INTERNAL_APPLICATION_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
@@ -29,6 +29,7 @@
 #include <dali/internal/adaptor/common/framework.h>
 #include <dali/internal/window-system/common/window-impl.h>
 #include <dali/internal/system/common/environment-options.h>
+#include <dali/internal/adaptor/common/adaptor-builder-impl.h>
 
 namespace Dali
 {
@@ -376,6 +377,11 @@ protected:
   void CreateAdaptor();
 
   /**
+   * Creates the adaptor builder
+   */
+  void CreateAdaptorBuilder();
+
+  /**
    * Quits from the main loop
    */
   void QuitFromMainLoop();
@@ -402,16 +408,21 @@ private:
   Dali::Configuration::ContextLoss      mContextLossConfiguration;
   CommandLineOptions*                   mCommandLineOptions;
 
-  Dali::SingletonService                mSingletonService;
-  Dali::Adaptor*                        mAdaptor;
-  Dali::Window                          mWindow;
-  Dali::Application::WINDOW_MODE        mWindowMode;
-  std::string                           mName;
-  std::string                           mStylesheet;
-  EnvironmentOptions                    mEnvironmentOptions;
-  PositionSize                          mWindowPositionSize;
-  Launchpad::State                      mLaunchpadState;
-  bool                                  mUseRemoteSurface;
+  Dali::SingletonService                   mSingletonService;
+  Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder;   ///< The adaptor builder
+  Dali::Adaptor*                           mAdaptor;
+
+  // The Main Window is that window created by the Application during initial startup
+  // (previously this was the only window)
+  Dali::Window                             mMainWindow;       ///< Main Window instance
+  Dali::Application::WINDOW_MODE           mMainWindowMode;   ///< Window mode of the main window
+  std::string                              mMainWindowName;   ///< Name of the main window as obtained from environment options
+
+  std::string                              mStylesheet;
+  EnvironmentOptions                       mEnvironmentOptions;
+  PositionSize                             mWindowPositionSize;
+  Launchpad::State                         mLaunchpadState;
+  bool                                     mUseRemoteSurface;
 
   SlotDelegate< Application >           mSlotDelegate;
 
@@ -429,7 +440,7 @@ inline Application& GetImplementation(Dali::Application& application)
 
 inline const Application& GetImplementation(const Dali::Application& application)
 {
-  DALI_ASSERT_ALWAYS(application && "Timre handle is empty");
+  DALI_ASSERT_ALWAYS(application && "application handle is empty");
 
   const BaseObject& handle = application.GetBaseObject();
 
@@ -443,4 +454,4 @@ inline const Application& GetImplementation(const Dali::Application& application
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_APPLICATION_H__
+#endif // DALI_INTERNAL_APPLICATION_H
index 60ce74c..a73104a 100644 (file)
@@ -87,7 +87,6 @@ const unsigned int MAXIMUM_UPDATE_REQUESTS = 2;
 CombinedUpdateRenderController::CombinedUpdateRenderController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions )
 : mFpsTracker( environmentOptions ),
   mUpdateStatusLogger( environmentOptions ),
-  mRenderHelper( adaptorInterfaces ),
   mEventThreadSemaphore(),
   mUpdateRenderThreadWaitCondition(),
   mAdaptorInterfaces( adaptorInterfaces ),
@@ -154,7 +153,7 @@ void CombinedUpdateRenderController::Initialize()
   int error = pthread_create( mUpdateRenderThread, NULL, InternalUpdateRenderThreadEntryFunc, this );
   DALI_ASSERT_ALWAYS( !error && "Return code from pthread_create() when creating UpdateRenderThread" );
 
-  // The Update/Render thread will now run and initialise EGL etc. and will then wait for Start to be called
+  // The Update/Render thread will now run and initialise the graphics interface etc. and will then wait for Start to be called
   // When this function returns, the application initialisation on the event thread should occur
 }
 
@@ -170,7 +169,11 @@ void CombinedUpdateRenderController::Start()
     sem_wait( &mEventThreadSemaphore );
   }
 
-  mRenderHelper.Start();
+  RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+  if( currentSurface )
+  {
+    currentSurface->StartRender();
+  }
 
   mRunning = TRUE;
 
@@ -212,7 +215,11 @@ void CombinedUpdateRenderController::Stop()
   LOG_EVENT_TRACE;
 
   // Stop Rendering and the Update/Render Thread
-  mRenderHelper.Stop();
+  RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+  if( currentSurface )
+  {
+    currentSurface->StopRender();
+  }
 
   StopUpdateRenderThread();
 
@@ -400,9 +407,13 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
   LOG_UPDATE_RENDER( "THREAD CREATED" );
 
-  mRenderHelper.InitializeEgl();
+  RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+  if( currentSurface )
+  {
+    currentSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() );
+  }
 
-  // tell core it has a context
+  // Tell core it has a context
   mCore.ContextCreated();
 
   NotifyThreadInitialised();
@@ -451,7 +462,14 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     if( DALI_UNLIKELY( newSurface ) )
     {
       LOG_UPDATE_RENDER_TRACE_FMT( "Replacing Surface" );
-      mRenderHelper.ReplaceSurface( newSurface );
+
+      // This is designed for replacing pixmap surfaces, but should work for window as well
+      // we need to delete the surface and renderable (pixmap / window)
+      // Then create a new pixmap/window and new surface
+      // If the new surface has a different display connection, then the context will be lost
+
+      mAdaptorInterfaces.GetDisplayConnectionInterface().Initialize();
+      newSurface->ReplaceGraphicsSurface();
       SurfaceReplaced();
     }
 
@@ -500,11 +518,9 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     bool surfaceResized = ShouldSurfaceBeResized();
     if( DALI_UNLIKELY( surfaceResized ) )
     {
-      // RenderHelper::ResizeSurface() should be called right after a viewport is changed.
       if( updateStatus.SurfaceRectChanged() )
       {
         LOG_UPDATE_RENDER_TRACE_FMT( "Resizing Surface" );
-        mRenderHelper.ResizeSurface();
         SurfaceResized();
       }
     }
@@ -516,7 +532,8 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     // RENDER
     //////////////////////////////
 
-    mRenderHelper.ConsumeEvents();
+    mAdaptorInterfaces.GetDisplayConnectionInterface().ConsumeEvents();
+
     if( mPreRenderCallback != NULL )
     {
       bool keepCallback = CallbackBase::ExecuteReturn<bool>(*mPreRenderCallback);
@@ -526,7 +543,12 @@ void CombinedUpdateRenderController::UpdateRenderThread()
         mPreRenderCallback = NULL;
       }
     }
-    mRenderHelper.PreRender();
+
+    RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+    if( currentSurface )
+    {
+      currentSurface->PreRender( mSurfaceResized );
+    }
 
     Integration::RenderStatus renderStatus;
 
@@ -538,12 +560,14 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
     if( renderStatus.NeedsPostRender() )
     {
-      mRenderHelper.PostRender( isRenderingToFbo );
+      if( currentSurface )
+      {
+        currentSurface->PostRender( isRenderingToFbo, ( mNewSurface != NULL ), mSurfaceResized );
+      }
     }
 
     // Trigger event thread to request Update/Render thread to sleep if update not required
-    if( ( Integration::KeepUpdating::NOT_REQUESTED == keepUpdatingStatus ) &&
-        ! renderStatus.NeedsUpdate() )
+    if( ( Integration::KeepUpdating::NOT_REQUESTED == keepUpdatingStatus ) && !renderStatus.NeedsUpdate() )
     {
       mSleepTrigger->Trigger();
       updateRequired = false;
@@ -600,7 +624,11 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
   // Inform core of context destruction & shutdown EGL
   mCore.ContextDestroyed();
-  mRenderHelper.ShutdownEgl();
+  if( currentSurface )
+  {
+    currentSurface->DestroySurface();
+    currentSurface = nullptr;
+  }
 
   LOG_UPDATE_RENDER( "THREAD DESTROYED" );
 
index 7760c7e..6eafcf1 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
-#define __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
+#ifndef DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
+#define DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
 #include <dali/integration-api/thread-synchronization-interface.h>
 #include <dali/internal/system/common/performance-interface.h>
 #include <dali/internal/system/common/fps-tracker.h>
-#include <dali/internal/graphics/common/render-helper.h>
 #include <dali/internal/adaptor/common/thread-controller-interface.h>
 #include <dali/internal/system/common/update-status-logger.h>
+#include <dali/internal/window-system/common/display-connection.h>
+
 
 namespace Dali
 {
@@ -299,8 +300,6 @@ private:
   FpsTracker                        mFpsTracker;                       ///< Object that tracks the FPS
   UpdateStatusLogger                mUpdateStatusLogger;               ///< Object that logs the update-status as required.
 
-  RenderHelper                      mRenderHelper;                     ///< Helper class for EGL, pre & post rendering
-
   sem_t                             mEventThreadSemaphore;             ///< Used by the event thread to ensure all threads have been initialised, and when replacing the surface.
 
   ConditionalWait                   mUpdateRenderThreadWaitCondition;  ///< The wait condition for the update-render-thread.
@@ -339,7 +338,7 @@ private:
 
   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).
-  volatile unsigned int             mForceClear;                       ///< Will be set to clear forcely
+  volatile unsigned int             mForceClear;                       ///< Will be set to clear forcibly
 };
 
 } // namespace Adaptor
@@ -348,4 +347,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
+#endif // DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
index 81cea18..fa47a4b 100644 (file)
@@ -5,24 +5,22 @@ adaptor_adaptor_common_src_files=\
     ${adaptor_adaptor_dir}/common/lifecycle-controller-impl.cpp \
     ${adaptor_adaptor_dir}/common/adaptor-impl.cpp \
     ${adaptor_adaptor_dir}/common/adaptor.cpp \
+    ${adaptor_adaptor_dir}/common/adaptor-builder-impl.cpp \
     ${adaptor_adaptor_dir}/common/application-impl.cpp \
     ${adaptor_adaptor_dir}/common/combined-update-render-controller.cpp
 
-# module: adaptor, backend: tizen
-adaptor_adaptor_tizen_src_files=\
-    ${adaptor_adaptor_dir}/tizen/adaptor-impl-tizen.cpp \
-    ${adaptor_adaptor_dir}/tizen/framework-tizen.cpp
+# module: adaptor, backend: tizen-wayland
+adaptor_adaptor_tizen_wayland_src_files=\
+    ${adaptor_adaptor_dir}/tizen-wayland/adaptor-impl-tizen.cpp \
+    ${adaptor_adaptor_dir}/tizen-wayland/framework-tizen.cpp
 
 # module: adaptor, backend: tizen-wearable
 adaptor_adaptor_tizen_wearable_src_files=\
-    ${adaptor_adaptor_dir}/tizen-wearable/watch-application.cpp \
-    ${adaptor_adaptor_dir}/tizen-wearable/watch-application-impl.cpp
+    ${adaptor_adaptor_dir}/tizen-wayland/tizen-wearable/watch-application.cpp \
+    ${adaptor_adaptor_dir}/tizen-wayland/tizen-wearable/watch-application-impl.cpp
 
 # module: adaptor, backend: ubuntu
 adaptor_adaptor_ubuntu_src_files=\
     ${adaptor_adaptor_dir}/ubuntu/adaptor-impl-ubuntu.cpp \
     ${adaptor_adaptor_dir}/ubuntu/framework-ubuntu.cpp
 
-# module: adaptor, backend: tizen-wayland
-adaptor_adaptor_tizen_wayland_src_files=\
-    ${adaptor_adaptor_dir}/tizen-wayland/framework-ecore-wl.cpp
\ No newline at end of file
@@ -112,11 +112,12 @@ void Adaptor::SurfaceInitialized()
   // Use strdup() in app_get_id(), so need to free memory
   if( appId )
   {
+    WindowPane defaultWindow = mWindowFrame.front();
 #ifdef ECORE_WAYLAND2
-    Ecore_Wl2_Window* ecoreWlWindow = AnyCast< Ecore_Wl2_Window* >( mNativeWindow );
+    Ecore_Wl2_Window* ecoreWlWindow = AnyCast< Ecore_Wl2_Window* >( defaultWindow.nativeWindow );
     screen_connector_provider_remote_enable( appId, ecore_wl2_window_surface_get( ecoreWlWindow ) );
 #else
-    Ecore_Wl_Window* ecoreWlWindow = AnyCast< Ecore_Wl_Window* >( mNativeWindow );
+    Ecore_Wl_Window* ecoreWlWindow = AnyCast< Ecore_Wl_Window* >( defaultWindow.nativeWindow );
     screen_connector_provider_remote_enable( appId, ecore_wl_window_surface_get( ecoreWlWindow ) );
 #endif
     free( appId );
diff --git a/dali/internal/adaptor/tizen-wayland/framework-ecore-wl.cpp b/dali/internal/adaptor/tizen-wayland/framework-ecore-wl.cpp
deleted file mode 100644 (file)
index c8ae72e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/adaptor/common/framework.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-void Framework::InitThreads()
-{
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -833,6 +833,10 @@ void Framework::AbortCallback( )
   }
 }
 
+void Framework::InitThreads()
+{
+}
+
 void Framework::SetLanguage( const std::string& language )
 {
   mImpl->SetLanguage( language );
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/adaptor/tizen-wearable/watch-application-impl.h>
+#include <dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h>
 
 namespace Dali
 {
@@ -22,7 +22,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/adaptor/tizen-wearable/watch-application-impl.h>
+#include <dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h>
 
 namespace Dali
 {
diff --git a/dali/internal/graphics/common/graphics-factory-interface.h b/dali/internal/graphics/common/graphics-factory-interface.h
new file mode 100644 (file)
index 0000000..bcec0af
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef DALI_INTERNAL_BASE_GRAPHICS_FACTORY_INTERFACE_H
+#define DALI_INTERNAL_BASE_GRAPHICS_FACTORY_INTERFACE_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-options.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
+
+namespace Dali
+{
+class GraphicsInterface;
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Factory interface for creating Graphics Factory implementation
+ */
+class GraphicsFactoryInterface
+{
+public:
+  /**
+   * Create a Graphics interface implementation
+   * @return An implementation of the Graphics interface
+   */
+  virtual GraphicsInterface& Create() = 0;
+
+  /**
+   * Destroy the Graphics Factory implementation
+   */
+  virtual void Destroy() = 0;
+
+protected:
+  /**
+   * Virtual protected destructor - no deletion through this interface
+   */
+  virtual ~GraphicsFactoryInterface() {};
+};
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
+
+#endif // DALI_INTERNAL_BASE_GRAPHICS_FACTORY_INTERFACE_H
diff --git a/dali/internal/graphics/common/graphics-interface.h b/dali/internal/graphics/common/graphics-interface.h
new file mode 100644 (file)
index 0000000..5e80ef7
--- /dev/null
@@ -0,0 +1,98 @@
+#ifndef DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_H
+#define DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-options.h>
+#include <dali/integration-api/core-enumerations.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Factory interface for creating Graphics Factory implementation
+ */
+class GraphicsInterface
+{
+public:
+
+  /**
+   * Constructor
+   */
+  GraphicsInterface()
+: mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ),
+  mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE )
+  {
+  };
+
+  /**
+   * Initialize the graphics interface
+   * @param[in]  environmentOptions  The environment options.
+   */
+  virtual void Initialize( EnvironmentOptions* environmentOptions ) = 0;
+
+  /**
+   * Destroy the Graphics Factory implementation
+   */
+  virtual void Destroy() = 0;
+
+  /**
+   * Get whether the depth buffer is required
+   * @return TRUE if the depth buffer is required
+   */
+  Integration::DepthBufferAvailable& GetDepthBufferRequired()
+  {
+    return mDepthBufferRequired;
+  };
+
+  /**
+   * Get whether the stencil buffer is required
+   * @return TRUE if the stencil buffer is required
+   */
+  Integration::StencilBufferAvailable GetStencilBufferRequired()
+  {
+    return mStencilBufferRequired;
+  };
+
+protected:
+  /**
+   * Virtual protected destructor - no deletion through this interface
+   */
+  virtual ~GraphicsInterface() {};
+
+
+protected:
+
+  Integration::DepthBufferAvailable mDepthBufferRequired;       ///< Whether the depth buffer is required
+  Integration::StencilBufferAvailable mStencilBufferRequired;   ///< Whether the stencil buffer is required
+};
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
+
+#endif // DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_H
diff --git a/dali/internal/graphics/common/render-helper.cpp b/dali/internal/graphics/common/render-helper.cpp
deleted file mode 100644 (file)
index 95155c0..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/graphics/common/render-helper.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/adaptor/common/adaptor-internal-services.h>
-#include <dali/internal/window-system/common/display-connection.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-RenderHelper::RenderHelper( AdaptorInternalServices& adaptorInterfaces )
-: mGLES( adaptorInterfaces.GetGlesInterface() ),
-  mEglFactory( &adaptorInterfaces.GetEGLFactoryInterface()),
-  mEGL( NULL ),
-  mSurfaceReplaced( false ),
-  mSurfaceResized( false )
-{
-  // set the initial values before render thread starts
-  mSurface = adaptorInterfaces.GetRenderSurfaceInterface();
-
-  if( mSurface )
-  {
-    mDisplayConnection = Dali::DisplayConnection::New( mSurface->GetSurfaceType() );
-  }
-  else
-  {
-    mDisplayConnection = Dali::DisplayConnection::New();
-  }
-}
-
-RenderHelper::~RenderHelper()
-{
-  if (mDisplayConnection)
-  {
-    delete mDisplayConnection;
-    mDisplayConnection = NULL;
-  }
-
-  mEglFactory->Destroy();
-}
-
-void RenderHelper::Start()
-{
-  if( mSurface )
-  {
-    mSurface->StartRender();
-  }
-}
-
-void RenderHelper::Stop()
-{
-  if( mSurface )
-  {
-    // Tell surface we have stopped rendering
-    mSurface->StopRender();
-  }
-}
-
-void RenderHelper::ConsumeEvents()
-{
-  mDisplayConnection->ConsumeEvents();
-}
-
-void RenderHelper::InitializeEgl()
-{
-  mEGL = mEglFactory->Create();
-
-  DALI_ASSERT_ALWAYS( mSurface && "NULL surface" );
-
-  // Initialize EGL & OpenGL
-  mDisplayConnection->InitializeEgl( *mEGL );
-  mSurface->InitializeEgl( *mEGL );
-
-  // create the OpenGL context
-  mEGL->CreateContext();
-
-  // create the OpenGL surface
-  mSurface->CreateEglSurface(*mEGL);
-
-  // Make it current
-  mEGL->MakeContextCurrent();
-}
-
-void RenderHelper::ReplaceSurface( RenderSurface* newSurface )
-{
-  if( mSurface )
-  {
-    mSurface->DestroyEglSurface(*mEGL);
-  }
-
-  // This is designed for replacing pixmap surfaces, but should work for window as well
-  // we need to delete the egl surface and renderable (pixmap / window)
-  // Then create a new pixmap/window and new egl surface
-  // If the new surface has a different display connection, then the context will be lost
-  DALI_ASSERT_ALWAYS(newSurface && "NULL surface");
-
-  mDisplayConnection->InitializeEgl(*mEGL);
-
-  newSurface->ReplaceEGLSurface(*mEGL);
-
-  // use the new surface from now on
-  mSurface = newSurface;
-  mSurfaceReplaced = true;
-}
-
-void RenderHelper::ResizeSurface()
-{
-  mSurfaceResized = true;
-}
-
-void RenderHelper::ShutdownEgl()
-{
-  if( mSurface )
-  {
-    // give a chance to destroy the OpenGL surface that created externally
-    mSurface->DestroyEglSurface( *mEGL );
-
-    mSurface = NULL;
-  }
-
-  // delete the GL context / egl surface
-  mEGL->TerminateGles();
-}
-
-bool RenderHelper::PreRender()
-{
-  if( mSurface )
-  {
-    mSurface->PreRender( *mEGL, mGLES, mSurfaceResized );
-  }
-  mGLES.PreRender();
-  return true;
-}
-
-void RenderHelper::PostRender( bool renderToFbo )
-{
-  // Inform the gl implementation that rendering has finished before informing the surface
-  mGLES.PostRender();
-
-  if( renderToFbo )
-  {
-    mGLES.Flush();
-    mGLES.Finish();
-  }
-  else
-  {
-    if( mSurface )
-    {
-      // Inform the surface that rendering this frame has finished.
-      mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced, mSurfaceResized );
-    }
-  }
-  mSurfaceReplaced = false;
-  mSurfaceResized = false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/graphics/common/render-helper.h b/dali/internal/graphics/common/render-helper.h
deleted file mode 100644 (file)
index 641a0cb..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-#ifndef DALI_INTERNAL_RENDER_HELPER_H
-#define DALI_INTERNAL_RENDER_HELPER_H
-
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/egl-interface.h>
-#include <dali/integration-api/render-surface.h>
-
-namespace Dali
-{
-
-class RenderSurface;
-class DisplayConnection;
-
-namespace Integration
-{
-class GlAbstraction;
-}
-
-namespace Internal
-{
-namespace Adaptor
-{
-
-class AdaptorInternalServices;
-class EglFactoryInterface;
-
-/**
- * Helper class for EGL, surface, pre & post rendering
- */
-class RenderHelper
-{
-public:
-
-  /**
-   * Create a RenderHelper.
-   * @param[in] adaptorInterfaces base adaptor interface
-   */
-  RenderHelper( AdaptorInternalServices& adaptorInterfaces );
-
-  /**
-   * Non-virtual Destructor
-   */
-  ~RenderHelper();
-
-  /////////////////////////////////////////////////////////////////////////////////////////////////
-  // Called on the Event Thread
-  /////////////////////////////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Sets up all render related objects to start rendering.
-   */
-  void Start();
-
-  /**
-   * Sets up all render related objects to stop rendering.
-   */
-  void Stop();
-
-  /////////////////////////////////////////////////////////////////////////////////////////////////
-  // Called on the Rendering Thread
-  /////////////////////////////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Consumes any pending events to avoid memory leaks
-   *
-   * @note Called from rendering thread
-   */
-  void ConsumeEvents();
-
-  /**
-   * Initializes EGL.
-   *
-   * @note Called from rendering thread
-   */
-  void InitializeEgl();
-
-  /**
-   * Replaces the rendering surface
-   *
-   * Used for replacing pixmaps due to resizing
-   * @param newSurface to use
-   *
-   * @note Called from render thread
-   */
-  void ReplaceSurface( RenderSurface* newSurface );
-
-  /**
-   * Resize the rendering surface.
-   *
-   * @note Called from render thread
-   */
-  void ResizeSurface();
-
-  /**
-   * Shuts down EGL.
-   *
-   * @note Called from render thread
-   */
-  void ShutdownEgl();
-
-  /**
-   * Called before core renders the scene
-   *
-   * @return true if successful and Core::Render should be called.
-   *
-   * @note Called from render thread
-   */
-  bool PreRender();
-
-  /**
-   * Called after core has rendered the scene
-   *
-   * @note Called from render thread
-   *
-   * @param[in] renderToFbo Whether to render to a Frame Buffer Object.
-   */
-  void PostRender( bool renderToFbo );
-
-private:
-
-  // Undefined
-  RenderHelper( const RenderHelper& RenderHelper );
-
-  // Undefined
-  RenderHelper& operator=( const RenderHelper& RenderHelper );
-
-private: // Data
-
-  Integration::GlAbstraction&   mGLES;                   ///< GL abstraction reference
-  EglFactoryInterface*          mEglFactory;             ///< Factory class to create EGL implementation
-  EglInterface*                 mEGL;                    ///< Interface to EGL implementation
-  RenderSurface*                mSurface;                ///< Current surface
-  Dali::DisplayConnection*      mDisplayConnection;      ///< Display connection
-  bool                          mSurfaceReplaced;        ///< True when new surface has been initialized.
-  bool                          mSurfaceResized;         ///< True when the surface is resized.
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_RENDER_HELPER_H
index 31217fb..1949b28 100644 (file)
@@ -1,27 +1,21 @@
 
 
-# module: graphics, backend: common
-adaptor_graphics_common_src_files=\
-    ${adaptor_graphics_dir}/common/render-helper.cpp
-
 # module: graphics, backend: gles20
 adaptor_graphics_gles20_src_files=\
     ${adaptor_graphics_dir}/gles20/egl-debug.cpp \
-    ${adaptor_graphics_dir}/gles20/egl-factory.cpp \
     ${adaptor_graphics_dir}/gles20/egl-implementation.cpp \
     ${adaptor_graphics_dir}/gles20/egl-sync-implementation.cpp \
     ${adaptor_graphics_dir}/gles20/gl-extensions.cpp \
-    ${adaptor_graphics_dir}/gles20/gl-proxy-implementation.cpp
+    ${adaptor_graphics_dir}/gles20/gl-proxy-implementation.cpp \
+    ${adaptor_graphics_dir}/gles20/egl-graphics-factory.cpp \
+    ${adaptor_graphics_dir}/gles20/egl-graphics.cpp
 
 # module: graphics, backend: tizen
 adaptor_graphics_tizen_src_files=\
     ${adaptor_graphics_dir}/tizen/egl-image-extensions-tizen.cpp \
     ${adaptor_graphics_dir}/tizen/vsync-monitor-tizen.cpp
 
-# module: graphics, backend: ubuntu-gl
-adaptor_graphics_ubuntu_gl_src_files=\
-    ${adaptor_graphics_dir}/ubuntu-gl/egl-image-extensions.cpp
-
 # module: graphics, backend: ubuntu
 adaptor_graphics_ubuntu_src_files=\
-    ${adaptor_graphics_dir}/ubuntu/vsync-monitor-ubuntu.cpp
\ No newline at end of file
+    ${adaptor_graphics_dir}/ubuntu/egl-image-extensions-ubuntu.cpp \
+    ${adaptor_graphics_dir}/ubuntu/vsync-monitor-ubuntu.cpp
index 42a6029..3a8f9f6 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H__
-#define __DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H__
+#ifndef DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H
+#define DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H
 
 /*
  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
@@ -56,4 +56,4 @@ protected:
 } // Internal
 } // Dali
 
-#endif // __DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H__
+#endif // DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H
diff --git a/dali/internal/graphics/gles20/egl-factory.cpp b/dali/internal/graphics/gles20/egl-factory.cpp
deleted file mode 100644 (file)
index c5250fb..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/graphics/gles20/egl-factory.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/graphics/gles20/egl-implementation.h>
-#include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-sync-implementation.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-
-EglFactory::EglFactory( int multiSamplingLevel,
-                        Integration::DepthBufferAvailable depthBufferRequired,
-                        Integration::StencilBufferAvailable stencilBufferRequired )
-: mEglImplementation(NULL),
-  mEglImageExtensions(NULL),
-  mEglSync(new EglSyncImplementation), // Created early, as needed by Core constructor
-  mMultiSamplingLevel( multiSamplingLevel ),
-  mDepthBufferRequired( depthBufferRequired ),
-  mStencilBufferRequired( stencilBufferRequired )
-{
-}
-
-EglFactory::~EglFactory()
-{
-  // Ensure the EGL implementation is destroyed
-  delete mEglImageExtensions;
-  delete mEglImplementation;
-  delete mEglSync;
-}
-
-EglInterface* EglFactory::Create()
-{
-  // Created by RenderThread (After Core construction)
-  mEglImplementation = new EglImplementation( mMultiSamplingLevel, mDepthBufferRequired, mStencilBufferRequired );
-  mEglImageExtensions = new EglImageExtensions( mEglImplementation );
-
-  mEglSync->Initialize(mEglImplementation); // The sync impl needs the EglDisplay
-  return mEglImplementation;
-}
-
-void EglFactory::Destroy()
-{
-  delete mEglImageExtensions;
-  mEglImageExtensions = NULL;
-  delete mEglImplementation;
-  mEglImplementation = NULL;
-}
-
-EglInterface* EglFactory::GetImplementation()
-{
-  return mEglImplementation;
-}
-
-EglImageExtensions* EglFactory::GetImageExtensions()
-{
-  return mEglImageExtensions;
-}
-
-EglSyncImplementation* EglFactory::GetSyncImplementation()
-{
-  return mEglSync;
-}
-
-} // Adaptor
-} // Internal
-} // Dali
diff --git a/dali/internal/graphics/gles20/egl-factory.h b/dali/internal/graphics/gles20/egl-factory.h
deleted file mode 100644 (file)
index 7f7bf1c..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H
-#define DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H
-
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/core-enumerations.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/graphics/gles20/egl-factory-interface.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-class EglImplementation;
-class EglImageExtensions;
-class EglSyncImplementation;
-
-class EglFactory : public EglFactoryInterface
-{
-public:
-
-  /**
-   * Constructor
-   * @param[in] multiSamplingLevel The Multi-sampling level required
-   * @param[in] depthBufferRequired Whether the depth buffer is required
-   * @param[in] stencilBufferRequired Whether the stencil buffer is required
-   */
-  EglFactory( int multiSamplingLevel,
-              Integration::DepthBufferAvailable depthBufferRequired,
-              Integration::StencilBufferAvailable stencilBufferRequired );
-
-  /**
-   * Destructor
-   */
-  virtual ~EglFactory();
-
-  /**
-   * Create an EGL Implementation
-   * @return[in] An implementation
-   */
-  EglInterface* Create();
-
-  /**
-   * Destroy the EGL Implementation
-   */
-  void Destroy();
-
-  /**
-   * Get an implementation if one has been created.
-   * @return An implementation, or NULL if one has not yet been created.
-   */
-  EglInterface* GetImplementation();
-
-  /**
-   * Get the image extension
-   */
-  EglImageExtensions* GetImageExtensions();
-
-  /**
-   * Get the fence sync implementation
-   * @return An implementation of fence sync
-   */
-  EglSyncImplementation* GetSyncImplementation();
-
-private:
-  /** Undefined */
-  EglFactory(const EglFactory& rhs);
-  EglFactory& operator=(const EglFactory& rhs);
-
-private:
-  EglImplementation* mEglImplementation;
-  EglImageExtensions* mEglImageExtensions;
-  EglSyncImplementation* mEglSync;
-
-  int mMultiSamplingLevel;
-  Integration::DepthBufferAvailable mDepthBufferRequired;
-  Integration::StencilBufferAvailable mStencilBufferRequired;
-};
-
-} // namespace Adaptor
-} // namespace Internal
-} // namespace Dali
-
-#endif // DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
  *
  */
 
-// EXTERNAL INCLUDES
-#include <system_settings.h>
+
+// CLASS HEADER
+#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 namespace Adaptor
 {
 
-int GetLongPressTime( int defaultTime )
+GraphicsFactory::GraphicsFactory()
 {
-  return defaultTime;
 }
 
-int GetElmAccessActionOver()
+GraphicsFactory::~GraphicsFactory()
 {
-  return 0;
+  /* Deleted by Adaptor destructor */
 }
 
-} // namespace Adaptor
+GraphicsInterface& GraphicsFactory::Create()
+{
+  GraphicsInterface* eglGraphicsInterface = new EglGraphics;
+  return *eglGraphicsInterface;
+}
 
-} // namespace Internal
+void GraphicsFactory::Destroy()
+{
+  /* Deleted by EglGraphics */
+}
 
-} // namespace Dali
+} // Adaptor
+} // Internal
+} // Dali
diff --git a/dali/internal/graphics/gles20/egl-graphics-factory.h b/dali/internal/graphics/gles20/egl-graphics-factory.h
new file mode 100644 (file)
index 0000000..6ba1d91
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef DALI_INTERNAL_GRAPHICS_FACTORY_H
+#define DALI_INTERNAL_GRAPHICS_FACTORY_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/graphics/common/graphics-factory-interface.h>
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class GraphicsFactory : public GraphicsFactoryInterface
+{
+public:
+
+  /**
+   * Constructor
+   */
+  GraphicsFactory();
+
+  /**
+   * Destructor
+   */
+  virtual ~GraphicsFactory();
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::GraphicsFactoryInterface::Create()
+   */
+  GraphicsInterface& Create() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::GraphicsFactoryInterface::Destroy()
+   */
+  void Destroy();
+};
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
+
+#endif // DALI_INTERNAL_GRAPHICS_FACTORY_H
diff --git a/dali/internal/graphics/gles20/egl-graphics.cpp b/dali/internal/graphics/gles20/egl-graphics.cpp
new file mode 100644 (file)
index 0000000..3df7198
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+// CLASS HEADER
+#include <dali/internal/graphics/gles20/egl-graphics.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/display-utils.h> // For Utils::MakeUnique
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+EglGraphics::EglGraphics( )
+: mMultiSamplingLevel( 0 )
+{
+}
+
+EglGraphics::~EglGraphics()
+{
+}
+
+
+void EglGraphics::Initialize( EnvironmentOptions* environmentOptions )
+{
+  if( environmentOptions->GetGlesCallTime() > 0 )
+  {
+    mGLES = Utils::MakeUnique< GlProxyImplementation >( *environmentOptions );
+  }
+  else
+  {
+    mGLES.reset ( new GlImplementation() );
+  }
+
+  mDepthBufferRequired = static_cast< Integration::DepthBufferAvailable >( environmentOptions->DepthBufferRequired() );
+  mStencilBufferRequired = static_cast< Integration::StencilBufferAvailable >( environmentOptions->StencilBufferRequired() );
+
+  mMultiSamplingLevel = environmentOptions->GetMultiSamplingLevel();
+
+  mEglSync = Utils::MakeUnique< EglSyncImplementation >();
+}
+
+EglInterface* EglGraphics::Create()
+{
+  mEglImplementation = Utils::MakeUnique< EglImplementation >( mMultiSamplingLevel, mDepthBufferRequired, mStencilBufferRequired );
+  mEglImageExtensions = Utils::MakeUnique< EglImageExtensions >( mEglImplementation.get() );
+
+  mEglSync->Initialize( mEglImplementation.get() ); // The sync impl needs the EglDisplay
+
+  return mEglImplementation.get();
+}
+
+void EglGraphics::Destroy()
+{
+}
+
+//Dali::Integration::GlAbstraction& EglGraphics::GetGlesInterface()
+GlImplementation& EglGraphics::GetGlesInterface()
+{
+  return *mGLES;
+}
+
+Integration::GlAbstraction& EglGraphics::GetGlAbstraction() const
+{
+  DALI_ASSERT_DEBUG( mGLES && "GLImplementation not created" );
+  return *mGLES;
+}
+
+EglImplementation& EglGraphics::GetEglImplementation() const
+{
+  DALI_ASSERT_DEBUG( mEglImplementation && "EGLImplementation not created" );
+  return *mEglImplementation;
+}
+
+EglInterface& EglGraphics::GetEglInterface() const
+{
+  DALI_ASSERT_DEBUG( mEglImplementation && "EGLImplementation not created" );
+  EglInterface* eglInterface = mEglImplementation.get();
+  return *eglInterface;
+}
+
+EglSyncImplementation& EglGraphics::GetSyncImplementation()
+{
+  DALI_ASSERT_DEBUG( mEglSync && "EglSyncImplementation not created" );
+  return *mEglSync;
+}
+
+EglImageExtensions* EglGraphics::GetImageExtensions()
+{
+  DALI_ASSERT_DEBUG( mEglImageExtensions && "EglImageExtensions not created" );
+  return mEglImageExtensions.get();
+}
+
+} // Adaptor
+} // Internal
+} // Dali
diff --git a/dali/internal/graphics/gles20/egl-graphics.h b/dali/internal/graphics/gles20/egl-graphics.h
new file mode 100644 (file)
index 0000000..603b584
--- /dev/null
@@ -0,0 +1,139 @@
+#ifndef DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H
+#define DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-interface.h>
+#include <dali/internal/graphics/gles20/gl-proxy-implementation.h>
+#include <dali/internal/graphics/gles20/gl-implementation.h>
+#include <dali/integration-api/egl-interface.h>
+
+#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/common/egl-image-extensions.h>
+#include <dali/internal/graphics/gles20/egl-sync-implementation.h>
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class EglGraphics : public GraphicsInterface
+{
+public:
+
+  /**
+   * Constructor
+   */
+  EglGraphics();
+
+  /**
+   * Destructor
+   */
+  virtual ~EglGraphics();
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Initialize()
+   */
+  void Initialize( EnvironmentOptions* environmentOptions ) override;
+
+  /**
+   * Creates the graphics interface for EGL
+   * @return The graphics interface for EGL
+   */
+  EglInterface* Create();
+
+  /**
+   * Gets the GL abstraction
+   * @return The GL abstraction
+   */
+  Integration::GlAbstraction& GetGlAbstraction() const;
+
+  /**
+   * Gets the implementation of EGL
+   * @return The implementation of EGL
+   */
+  EglImplementation& GetEglImplementation() const;
+
+  /**
+   * Gets the graphics interface for EGL
+   * @return The graphics interface for EGL
+   */
+  EglInterface& GetEglInterface() const;
+
+  /**
+   * @copydoc Dali::Integration::GlAbstraction& GetGlesInterface()
+   */
+  GlImplementation& GetGlesInterface();
+
+  /**
+   * Gets the implementation of GlSyncAbstraction for EGL.
+   * @return The implementation of GlSyncAbstraction for EGL.
+   */
+  EglSyncImplementation& GetSyncImplementation();
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetDepthBufferRequired()
+   */
+  Integration::DepthBufferAvailable& GetDepthBufferRequired();
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetStencilBufferRequired()
+   */
+  Integration::StencilBufferAvailable GetStencilBufferRequired();
+
+  /**
+   * Gets the EGL image extension
+   * @return The EGL image extension
+   */
+  EglImageExtensions* GetImageExtensions();
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Destroy()
+   */
+  void Destroy() override;
+
+private:
+  // Eliminate copy and assigned operations
+  EglGraphics(const EglGraphics& rhs) = delete;
+  EglGraphics& operator=(const EglGraphics& rhs) = delete;
+
+
+private:
+  std::unique_ptr< GlImplementation > mGLES;                    ///< GL implementation
+  std::unique_ptr< EglImplementation > mEglImplementation;      ///< EGL implementation
+  std::unique_ptr< EglImageExtensions > mEglImageExtensions;    ///< EGL image extension
+  std::unique_ptr< EglSyncImplementation > mEglSync;            ///< GlSyncAbstraction implementation for EGL
+
+  int mMultiSamplingLevel;                                      ///< The multiple sampling level
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // __DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H__
index 09c1d00..b83878e 100755 (executable)
@@ -45,6 +45,7 @@ namespace
 Integration::Log::Filter* gLogFilter = Debug::Filter::New( Debug::Concise, false, "LOG_IMAGE_LOADING" );
 #endif
 
+static unsigned int gMaxTextureSize = 4096;
 
 /**
  * Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE
@@ -414,6 +415,16 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer
   return ImageDimensions( width, height );
 }
 
+void SetMaxTextureSize( unsigned int size )
+{
+  gMaxTextureSize = size;
+}
+
+unsigned int GetMaxTextureSize()
+{
+  return gMaxTextureSize;
+}
+
 } // ImageLoader
 } // TizenPlatform
 } // Dali
index bedd3fa..64e10c5 100644 (file)
@@ -81,6 +81,20 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer
                           SamplingMode::Type samplingMode,
                           bool orientationCorrection );
 
+/**
+ * @brief Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE.
+ *
+ * @param [in] size The maximum texture size to set
+ */
+void SetMaxTextureSize( unsigned int size );
+
+/**
+ * @brief Get the maximum texture size.
+ *
+ * @return The maximum texture size
+ */
+unsigned int GetMaxTextureSize();
+
 } // ImageLoader
 } // TizenPlatform
 } // Dali
index d81bbd8..7bd4570 100644 (file)
@@ -24,6 +24,7 @@
 
 // INTERNAL HEADERS
 #include <dali/internal/graphics/gles20/gl-implementation.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
 
 namespace Dali
 {
@@ -35,14 +36,18 @@ namespace Adaptor
 {
 
 NativeBitmapBuffer::NativeBitmapBuffer( Adaptor* adaptor, unsigned int width, unsigned int height, Pixel::Format pFormat )
-: mWidth(width),
+: mGlAbstraction( nullptr),
+  mWidth(width),
   mHeight(height),
   mPixelFormat(pFormat),
   mLastReadBuffer(NULL)
 {
   DALI_ASSERT_ALWAYS( adaptor );
   mBuffer = new Integration::LocklessBuffer( width * height * Pixel::GetBytesPerPixel(pFormat) );
-  mGlAbstraction = &(adaptor->GetGlAbstraction());
+
+  GraphicsInterface* graphics = &(adaptor->GetGraphicsInterface());
+  auto eglGraphics = static_cast<EglGraphics *>(graphics);
+  mGlAbstraction = &(eglGraphics->GetGlAbstraction());
 }
 
 NativeBitmapBuffer::~NativeBitmapBuffer()
index 865bd0e..fc8d55d 100644 (file)
@@ -27,6 +27,7 @@
 
 // INTERNAL HEADERS
 #include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
 
 namespace Dali
 {
index 3cd791f..e4bcc00 100644 (file)
@@ -26,7 +26,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/integration-api/render-surface.h>
 
@@ -87,13 +87,14 @@ NativeImageSourceTizen::NativeImageSourceTizen( unsigned int width, unsigned int
   mBlendingRequired( false ),
   mColorDepth( depth ),
   mEglImageKHR( NULL ),
+  mEglGraphics( NULL ),
   mEglImageExtensions( NULL ),
   mSetSource( false )
 {
   DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() );
-  EglFactory& eglFactory = Adaptor::GetImplementation( Adaptor::Get() ).GetEGLFactory();
-  mEglImageExtensions = eglFactory.GetImageExtensions();
-  DALI_ASSERT_DEBUG( mEglImageExtensions );
+
+  GraphicsInterface* graphics = &( Adaptor::GetImplementation( Adaptor::Get() ).GetGraphicsInterface() );
+  mEglGraphics = static_cast<EglGraphics *>(graphics);
 
   mTbmSurface = GetSurfaceFromAny( nativeImageSource );
 
@@ -406,6 +407,9 @@ bool NativeImageSourceTizen::GlExtensionCreate()
     return false;
   }
 
+  mEglImageExtensions = mEglGraphics->GetImageExtensions();
+  DALI_ASSERT_DEBUG( mEglImageExtensions );
+
   mEglImageKHR = mEglImageExtensions->CreateImageKHR( eglBuffer );
 
   return mEglImageKHR != NULL;
index 8578d69..fdf1ed0 100755 (executable)
@@ -36,6 +36,7 @@ namespace Internal
 namespace Adaptor
 {
 
+class EglGraphics;
 class EglImageExtensions;
 
 /**
@@ -186,6 +187,7 @@ private:
   bool mBlendingRequired;                      ///< Whether blending is required
   Dali::NativeImageSource::ColorDepth mColorDepth;  ///< color depth of image
   void* mEglImageKHR;                         ///< From EGL extension
+  EglGraphics* mEglGraphics;                  ///< EGL Graphics
   EglImageExtensions* mEglImageExtensions;    ///< The EGL Image Extensions
   bool mSetSource;
 };
index 157d3b8..8223c81 100644 (file)
@@ -25,7 +25,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 
 namespace Dali
@@ -79,14 +79,15 @@ NativeImageSourceQueueTizen::NativeImageSourceQueueTizen( unsigned int width, un
   mTbmQueue( NULL ),
   mConsumeSurface( NULL ),
   mEglImages(),
+  mEglGraphics( NULL ),
   mEglImageExtensions( NULL ),
   mOwnTbmQueue( false ),
   mBlendingRequired( false )
 {
   DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() );
-  EglFactory& eglFactory = Adaptor::GetImplementation( Adaptor::Get() ).GetEGLFactory();
-  mEglImageExtensions = eglFactory.GetImageExtensions();
-  DALI_ASSERT_DEBUG( mEglImageExtensions );
+
+  GraphicsInterface* graphics = &( Adaptor::GetImplementation( Adaptor::Get() ).GetGraphicsInterface() );
+  mEglGraphics = static_cast<EglGraphics *>(graphics);
 
   mTbmQueue = GetSurfaceFromAny( nativeImageSourceQueue );
 
@@ -183,6 +184,9 @@ void NativeImageSourceQueueTizen::SetSource( Any source )
 
 bool NativeImageSourceQueueTizen::GlExtensionCreate()
 {
+  mEglImageExtensions = mEglGraphics->GetImageExtensions();
+  DALI_ASSERT_DEBUG( mEglImageExtensions );
+
   return true;
 }
 
@@ -206,48 +210,46 @@ void NativeImageSourceQueueTizen::PrepareTexture()
 {
   tbm_surface_h oldSurface = mConsumeSurface;
 
-  bool needToWait = ( mConsumeSurface == NULL ) ? true : false;
-
-  if( tbm_surface_queue_can_acquire( mTbmQueue, needToWait ) )
+  if( tbm_surface_queue_can_acquire( mTbmQueue, 0 ) )
   {
     if( tbm_surface_queue_acquire( mTbmQueue, &mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
     {
       DALI_LOG_ERROR( "Failed to aquire a tbm_surface\n" );
       return;
     }
-  }
 
-  if( oldSurface && oldSurface != mConsumeSurface )
-  {
-    if( tbm_surface_internal_is_valid( oldSurface ) )
+    if( oldSurface )
     {
-      tbm_surface_queue_release( mTbmQueue, oldSurface );
+      if( tbm_surface_internal_is_valid( oldSurface ) )
+      {
+        tbm_surface_queue_release( mTbmQueue, oldSurface );
+      }
     }
-  }
 
-  if( mConsumeSurface )
-  {
-    bool existing = false;
-    for( auto&& iter : mEglImages )
+    if( mConsumeSurface )
     {
-      if( iter.first == mConsumeSurface )
+      bool existing = false;
+      for( auto&& iter : mEglImages )
       {
-        // Find the surface in the existing list
-        existing = true;
-        mEglImageExtensions->TargetTextureKHR( iter.second );
-        break;
+        if( iter.first == mConsumeSurface )
+        {
+          // Find the surface in the existing list
+          existing = true;
+          mEglImageExtensions->TargetTextureKHR( iter.second );
+          break;
+        }
       }
-    }
 
-    if( !existing )
-    {
-      // Push the surface
-      tbm_surface_internal_ref( mConsumeSurface );
+      if( !existing )
+      {
+        // Push the surface
+        tbm_surface_internal_ref( mConsumeSurface );
 
-      void* eglImageKHR = mEglImageExtensions->CreateImageKHR( reinterpret_cast< EGLClientBuffer >( mConsumeSurface ) );
-      mEglImageExtensions->TargetTextureKHR( eglImageKHR );
+        void* eglImageKHR = mEglImageExtensions->CreateImageKHR( reinterpret_cast< EGLClientBuffer >( mConsumeSurface ) );
+        mEglImageExtensions->TargetTextureKHR( eglImageKHR );
 
-      mEglImages.push_back( EglImagePair( mConsumeSurface, eglImageKHR) );
+        mEglImages.push_back( EglImagePair( mConsumeSurface, eglImageKHR) );
+      }
     }
   }
 }
index 8d25513..19e50a7 100755 (executable)
@@ -36,6 +36,7 @@ namespace Internal
 namespace Adaptor
 {
 
+class EglGraphics;
 class EglImageExtensions;
 
 /**
@@ -166,6 +167,7 @@ private:
   tbm_surface_queue_h              mTbmQueue;             ///< Tbm surface queue handle
   tbm_surface_h                    mConsumeSurface;       ///< The current tbm surface
   std::vector< EglImagePair >      mEglImages;            ///< EGL Image vector
+  EglGraphics*                     mEglGraphics;          ///< EGL Graphics
   EglImageExtensions*              mEglImageExtensions;   ///< The EGL Image Extensions
   bool                             mOwnTbmQueue;          ///< Whether we created tbm queue
   bool                             mBlendingRequired;     ///< Whether blending is required
index 9fed477..be32323 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 #include <dali/integration-api/render-surface.h>
 
+
 namespace Dali
 {
 
@@ -97,8 +98,12 @@ NativeImageSourceX::NativeImageSourceX( unsigned int width, unsigned int height,
   mEglImageExtensions( NULL )
 {
   DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() );
-  EglFactory& eglFactory = Adaptor::GetImplementation( Adaptor::Get() ).GetEGLFactory();
-  mEglImageExtensions = eglFactory.GetImageExtensions();
+
+  GraphicsInterface* graphics = &( Adaptor::GetImplementation( Adaptor::Get() ).GetGraphicsInterface() );
+  auto eglGraphics = static_cast<EglGraphics *>(graphics);
+
+  mEglImageExtensions = eglGraphics->GetImageExtensions();
+
   DALI_ASSERT_DEBUG( mEglImageExtensions );
 
   // assign the pixmap
@@ -159,7 +164,7 @@ bool NativeImageSourceX::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
   XImageJanitor xImageJanitor( XGetImage( displayConnection,
                                           mPixmap,
                                           0, 0, // x,y of subregion to extract.
-                                          width, height, // of suregion to extract.
+                                          width, height, // of subregion to extract.
                                           0xFFFFFFFF,
                                           ZPixmap ) );
   XImage* const  pXImage = xImageJanitor.mXImage;
index 75f9312..9b74b2a 100755 (executable)
@@ -22,6 +22,8 @@
 #include <Ecore_X.h>
 
 // INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-interface.h>
+
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 
 #include <dali/internal/imaging/common/native-image-source-impl.h>
index c56ead3..4d0b028 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -28,7 +28,7 @@
 #include <dali/integration-api/events/long-press-gesture-event.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/core-event-interface.h>
index 1d45842..705e8ff 100755 (executable)
@@ -23,12 +23,9 @@ adaptor_input_tizen_wayland_src_files=\
     ${adaptor_input_dir}/tizen-wayland/key-mapping-ecore-wl.cpp \
     ${adaptor_input_dir}/tizen-wayland/virtual-keyboard-impl-ecore-wl.cpp
 
-# module: input, backend: ubuntu
-adaptor_input_ubuntu_src_files=\
-    ${adaptor_input_dir}/ubuntu/key-mapping-ubuntu.cpp
-
 # module: input, backend: ubuntu-x11
 adaptor_input_ubuntu_x11_src_files=\
     ${adaptor_input_dir}/ubuntu-x11/input-method-context-factory-x.cpp \
     ${adaptor_input_dir}/ubuntu-x11/input-method-context-impl-x.cpp \
+    ${adaptor_input_dir}/ubuntu-x11/key-mapping-x.cpp \
     ${adaptor_input_dir}/ubuntu-x11/virtual-keyboard-impl-x.cpp
index 48bba93..6ddc44b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 20187 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.
@@ -37,7 +37,7 @@ namespace Internal
 namespace Adaptor
 {
 
-ObjectProfiler::ObjectProfiler( unsigned int timeInterval )
+ObjectProfiler::ObjectProfiler( uint32_t timeInterval )
 {
   // This class must be created after the Stage; this means it doesn't count the initial objects
   // that are created by the stage (base layer, default camera actor)
@@ -59,7 +59,7 @@ void ObjectProfiler::DisplayInstanceCounts()
 {
   for( auto&& element : mInstanceCountContainer )
   {
-    int memorySize = GetMemorySize( element.first, element.second );
+    std::size_t memorySize = GetMemorySize( element.first, element.second );
     if( memorySize > 0 )
     {
       LogMessage( Debug::DebugInfo, "%-30s: % 4d  Memory MemorySize: ~% 6.1f kB\n",
@@ -134,12 +134,12 @@ void ObjectProfiler::OnObjectDestroyed(const Dali::RefObject* object)
   }
 }
 
-int ObjectProfiler::GetMemorySize(const std::string& name, int count)
+std::size_t ObjectProfiler::GetMemorySize( const std::string& name, uint32_t count )
 {
   struct MemoryMemorySize
   {
     std::string name;
-    int memorySize;
+    std::size_t memorySize;
   };
   MemoryMemorySize memoryMemorySizes[] =
     {
index c6a265c..7d38783 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_ADAPTOR_OBJECT_PROFILER_H__
 
 /*
- * Copyright (c) 2017 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.
@@ -19,6 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+#include <cstddef> // size_t
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/object-registry.h>
 #include <dali/public-api/object/type-registry.h>
@@ -45,7 +47,7 @@ public:
    * Constructor
    * @param timeInterval to specify the frequency of reporting
    */
-  ObjectProfiler( unsigned int timeInterval );
+  ObjectProfiler( uint32_t timeInterval );
 
   /**
    * Destructor
@@ -67,22 +69,22 @@ private:
    * Callback used when objects are created. Increases instance count for that object type
    * @param[in] handle of the created object
    */
-  void OnObjectCreated(BaseHandle handle);
+  void OnObjectCreated( BaseHandle handle );
 
   /**
    * Callback used when objects are created. Decreases instance count for that object type
    * @param[in] object The object being destroyed
    */
-  void OnObjectDestroyed(const Dali::RefObject* object);
+  void OnObjectDestroyed( const Dali::RefObject* object );
 
   /**
    * Get the memory size of the given object
    */
-  int GetMemorySize(const std::string& name, int count);
+  std::size_t GetMemorySize( const std::string& name, uint32_t count );
 
 private:
 
-  using InstanceCountPair = std::pair< const std::string, int >;
+  using InstanceCountPair = std::pair< const std::string, uint32_t >;
   using InstanceTypePair = std::pair< BaseObject*, std::string >;
 
   Dali::ObjectRegistry    mObjectRegistry;
index 9429525..e4c3541 100644 (file)
@@ -19,6 +19,9 @@
  */
 #include <dali/public-api/signals/callback.h>
 
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/display-connection.h>
+
 namespace Dali
 {
 
@@ -122,10 +125,10 @@ public:
 private:
 
   // Undefined copy constructor.
-  ThreadController( const ThreadController& );
+  ThreadController( const ThreadController& ) = delete;
 
   // Undefined assignment operator.
-  ThreadController& operator=( const ThreadController& );
+  ThreadController& operator=( const ThreadController& ) = delete;
 
 private:
 
index 1b9dbd2..62798c8 100644 (file)
@@ -27,59 +27,36 @@ adaptor_system_common_src_files=\
     ${adaptor_system_dir}/common/trigger-event-factory.cpp \
     ${adaptor_system_dir}/common/update-status-logger.cpp \
     ${adaptor_system_dir}/common/widget-application-impl.cpp \
-    ${adaptor_system_dir}/common/logging.cpp \
-    ${adaptor_system_dir}/common/callback-manager-ecore.cpp \
-    ${adaptor_system_dir}/common/file-descriptor-monitor-ecore.cpp \
-    ${adaptor_system_dir}/common/timer-impl-ecore.cpp
+    ${adaptor_system_dir}/common/logging.cpp
 
-# module: system, backend: generic
-adaptor_system_generic_src_files=\
-    ${adaptor_system_dir}/generic/color-controller-impl.cpp \
-    ${adaptor_system_dir}/generic/system-settings.cpp \
-    ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
-    ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp
+# module: system, backend: linux
+adaptor_system_linux_src_files=\
+    ${adaptor_system_dir}/linux/callback-manager-ecore.cpp \
+    ${adaptor_system_dir}/linux/file-descriptor-monitor-ecore.cpp \
+    ${adaptor_system_dir}/linux/timer-impl-ecore.cpp
 
-# module: system, backend: tizen-ivi
-adaptor_system_tizen_ivi_src_files=\
-    ${adaptor_system_dir}/tizen-ivi/color-controller-impl-ivi.cpp \
-    ${adaptor_system_dir}/tizen-ivi/system-settings-ivi.cpp \
-    ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
-    ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp
-
-# module: system, backend: tizen-mobile
-adaptor_system_tizen_mobile_src_files=\
-    ${adaptor_system_dir}/tizen-mobile/color-controller-impl-mobile.cpp \
-    ${adaptor_system_dir}/tizen-mobile/system-settings-mobile.cpp \
-    ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
-    ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp
-
-# module: system, backend: tizen-tv
-adaptor_system_tizen_tv_src_files=\
-    ${adaptor_system_dir}/tizen-tv/color-controller-impl-tv.cpp \
-    ${adaptor_system_dir}/tizen-tv/system-settings-tv.cpp \
-    ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
-    ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp
+# module: system, backend: tizen-wayland
+adaptor_system_tizen_wayland_src_files=\
+    ${adaptor_system_dir}/tizen-wayland/color-controller-impl-tizen.cpp \
+    ${adaptor_system_dir}/tizen-wayland/system-settings-tizen.cpp \
+    ${adaptor_system_dir}/tizen-wayland/widget-application-impl-tizen.cpp \
+    ${adaptor_system_dir}/tizen-wayland/widget-controller-tizen.cpp
 
 # module: system, backend: tizen-wearable
 adaptor_system_tizen_wearable_src_files=\
-    ${adaptor_system_dir}/tizen-wearable/color-controller-impl-wearable.cpp \
-    ${adaptor_system_dir}/tizen-wearable/system-settings-wearable.cpp \
-    ${adaptor_system_dir}/tizen-wearable/watch-time.cpp \
-    ${adaptor_system_dir}/tizen-wearable/capture.cpp \
-    ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
-    ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp \
-    ${adaptor_system_dir}/tizen/capture-impl-tizen.cpp
+    ${adaptor_system_dir}/tizen-wayland/tizen-wearable/capture.cpp \
+    ${adaptor_system_dir}/tizen-wayland/tizen-wearable/capture-impl-tizen.cpp \
+    ${adaptor_system_dir}/tizen-wayland/tizen-wearable/watch-time.cpp \
+    ${adaptor_system_dir}/tizen-wayland/color-controller-impl-tizen.cpp \
+    ${adaptor_system_dir}/tizen-wayland/system-settings-tizen.cpp \
+    ${adaptor_system_dir}/tizen-wayland/widget-application-impl-tizen.cpp \
+    ${adaptor_system_dir}/tizen-wayland/widget-controller-tizen.cpp
 
 
-# module: system, backend: ubuntu
-adaptor_system_ubuntu_src_files=\
-    ${adaptor_system_dir}/ubuntu/color-controller-impl-ubuntu.cpp \
-    ${adaptor_system_dir}/ubuntu/system-settings-ubuntu.cpp \
-    ${adaptor_system_dir}/ubuntu/widget-application-impl-ubuntu.cpp \
-    ${adaptor_system_dir}/ubuntu/widget-controller-ubuntu.cpp
-
 # module: system, backend: ubuntu-x11
 adaptor_system_ubuntu_x11_src_files=\
-    ${adaptor_system_dir}/ubuntu-x11/system-settings-x.cpp
-
+    ${adaptor_system_dir}/ubuntu-x11/color-controller-impl-x.cpp \
+    ${adaptor_system_dir}/ubuntu-x11/system-settings-x.cpp \
+    ${adaptor_system_dir}/ubuntu-x11/widget-application-impl-x.cpp \
+    ${adaptor_system_dir}/ubuntu-x11/widget-controller-x.cpp
 
diff --git a/dali/internal/system/generic/system-settings.cpp b/dali/internal/system/generic/system-settings.cpp
deleted file mode 100644 (file)
index 046a538..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-int GetLongPressTime( int defaultTime )
-{
-  return defaultTime;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/system/common/callback-manager-ecore.h>
+#include <dali/internal/system/linux/callback-manager-ecore.h>
 
 // EXTERNAL INCLUDES
 // Ecore is littered with C style cast
diff --git a/dali/internal/system/tizen-mobile/color-controller-impl-mobile.cpp b/dali/internal/system/tizen-mobile/color-controller-impl-mobile.cpp
deleted file mode 100644 (file)
index 8b8e98e..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::ColorController ColorController::Get()
-{
-  Dali::ColorController colorController;
-
-  Dali::SingletonService service( SingletonService::Get() );
-  if ( service )
-  {
-    // Check whether the singleton is already created
-    Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ColorController ) );
-    if(handle)
-    {
-      // If so, downcast the handle
-      colorController = Dali::ColorController( dynamic_cast< ColorController* >( handle.GetObjectPtr() ) );
-    }
-    else
-    {
-      colorController = Dali::ColorController( new ColorController( ) );
-      service.Register( typeid( colorController ), colorController );
-    }
-  }
-
-  return colorController;
-
-}
-
-ColorController::ColorController()
-{
-}
-
-ColorController::~ColorController()
-{
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
-{
-  return false;
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
-{
-  return false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/system/tizen-tv/color-controller-impl-tv.cpp b/dali/internal/system/tizen-tv/color-controller-impl-tv.cpp
deleted file mode 100644 (file)
index 1fb8cb1..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::ColorController ColorController::Get()
-{
-  Dali::ColorController colorController;
-  return colorController;
-}
-
-ColorController::ColorController()
-{
-}
-
-ColorController::~ColorController()
-{
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
-{
-  return false;
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
-{
-  return false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/system/tizen-tv/system-settings-tv.cpp b/dali/internal/system/tizen-tv/system-settings-tv.cpp
deleted file mode 100644 (file)
index a518503..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2015 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-int GetLongPressTime( int defaultTime )
-{
-  return defaultTime;
-}
-
-int GetElmAccessActionOver()
-{
-  return 0;
-}
-
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
+#include <dali/internal/system/common/color-controller-impl.h>
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -19,7 +19,7 @@
 #include <system_settings.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
 
 namespace Dali
 {
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/system/tizen/capture-impl.h>
+#include <dali/internal/system/tizen-wayland/tizen-wearable/capture-impl.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -19,7 +19,7 @@
 #include <dali/public-api/capture/capture.h>
 
 // INTERNAL HEADER
-#include <dali/internal/system/tizen/capture-impl.h>
+#include <dali/internal/system/tizen-wayland/tizen-wearable/capture-impl.h>
 
 namespace Dali
 {
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
  */
 
 // CLASS HEADER
-#include <dali/internal/system/tizen/widget-application-impl-tizen.h>
+#include <dali/internal/system/tizen-wayland/widget-application-impl-tizen.h>
 
 // INTERNAL INCLUDE
 #include <dali/public-api/adaptor-framework/widget.h>
 #include <dali/public-api/adaptor-framework/widget-impl.h>
-#include <dali/internal/system/tizen/widget-controller-tizen.h>
+#include <dali/internal/system/tizen-wayland/widget-controller-tizen.h>
 
 #ifdef WIDGET_SUPPOERTED
 #include <bundle.h>
@@ -309,4 +309,3 @@ Dali::Internal::Adaptor::WidgetApplicationPtr Create( int* argc, char **argv[],
 } // namespace Internal
 
 } // namespace Dali
-
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/system/tizen/widget-controller-tizen.h>
+#include <dali/internal/system/tizen-wayland/widget-controller-tizen.h>
 
 // EXTERNAL INCLUDES
 #include <bundle.h>
diff --git a/dali/internal/system/tizen-wearable/color-controller-impl-wearable.cpp b/dali/internal/system/tizen-wearable/color-controller-impl-wearable.cpp
deleted file mode 100644 (file)
index 8b8e98e..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::ColorController ColorController::Get()
-{
-  Dali::ColorController colorController;
-
-  Dali::SingletonService service( SingletonService::Get() );
-  if ( service )
-  {
-    // Check whether the singleton is already created
-    Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ColorController ) );
-    if(handle)
-    {
-      // If so, downcast the handle
-      colorController = Dali::ColorController( dynamic_cast< ColorController* >( handle.GetObjectPtr() ) );
-    }
-    else
-    {
-      colorController = Dali::ColorController( new ColorController( ) );
-      service.Register( typeid( colorController ), colorController );
-    }
-  }
-
-  return colorController;
-
-}
-
-ColorController::ColorController()
-{
-}
-
-ColorController::~ColorController()
-{
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
-{
-  return false;
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
-{
-  return false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
+#include <dali/internal/system/common/color-controller-impl.h>
 
 namespace Dali
 {
index 547c511..2e612e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -22,7 +22,7 @@
 #include <Elementary.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
 
 namespace Dali
 {
@@ -43,6 +43,11 @@ int GetElmAccessActionOver()
 #endif // DALI_PROFILE_UBUNTU
 }
 
+int GetLongPressTime( int defaultTime )
+{
+  return defaultTime;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/system/ubuntu/widget-application-impl-ubuntu.h>
+#include <dali/internal/system/ubuntu-x11/widget-application-impl-x.h>
 #include <dali/integration-api/debug.h>
 
 namespace Dali
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WIDGET_APPLICATION_IMPL_UBUNTU_H
 
 /*
- * Copyright (c) 2017 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.
@@ -20,7 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/application-impl.h>
-#include <dali/internal/system/common//widget-application-impl.h>
+#include <dali/internal/system/common/widget-application-impl.h>
 #include <dali/public-api/adaptor-framework/widget-application.h>
 
 namespace Dali
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/system/ubuntu/widget-controller-ubuntu.h>
+#include <dali/internal/system/ubuntu-x11/widget-controller-x.h>
 
 namespace Dali
 {
diff --git a/dali/internal/system/ubuntu/color-controller-impl-ubuntu.cpp b/dali/internal/system/ubuntu/color-controller-impl-ubuntu.cpp
deleted file mode 100644 (file)
index 467a526..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::ColorController ColorController::Get()
-{
-  return Dali::ColorController( new ColorController() );
-}
-
-ColorController::ColorController()
-{
-}
-
-ColorController::~ColorController()
-{
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
-{
-  return false;
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
-{
-  return false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/system/ubuntu/system-settings-ubuntu.cpp b/dali/internal/system/ubuntu/system-settings-ubuntu.cpp
deleted file mode 100644 (file)
index 046a538..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-int GetLongPressTime( int defaultTime )
-{
-  return defaultTime;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
index ad125fd..3d0f72b 100644 (file)
@@ -288,6 +288,13 @@ FT_FaceRec_* FontClient::GetFreetypeFace( FontId fontId )
   return mPlugin->GetFreetypeFace( fontId );
 }
 
+bool FontClient::AddCustomFontDirectory( const FontPath& path )
+{
+  CreatePlugin();
+
+  return mPlugin->AddCustomFontDirectory( path );
+}
+
 void FontClient::CreatePlugin()
 {
   if( !mPlugin )
index e957187..0d9cf71 100644 (file)
@@ -205,6 +205,11 @@ public:
    */
   FT_FaceRec_* GetFreetypeFace( FontId fontId );
 
+  /**
+   * @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory()
+   */
+  bool AddCustomFontDirectory( const FontPath& path );
+
 private:
 
   /**
index bd4c599..1d157c9 100644 (file)
@@ -1283,6 +1283,12 @@ FT_FaceRec_* FontClient::Plugin::GetFreetypeFace( FontId fontId )
   return fontFace;
 }
 
+bool FontClient::Plugin::AddCustomFontDirectory( const FontPath& path )
+{
+  // NULL as first parameter means the current configuration is used.
+  return FcConfigAppFontAddDir( NULL, reinterpret_cast<const FcChar8 *>( path.c_str() ) );
+}
+
 void FontClient::Plugin::InitSystemFonts()
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "-->FontClient::Plugin::InitSystemFonts\n" );
index da207d5..9bbc70c 100644 (file)
@@ -329,6 +329,11 @@ struct FontClient::Plugin
    */
   FT_FaceRec_* GetFreetypeFace( FontId fontId );
 
+  /**
+   * @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory()
+   */
+  bool AddCustomFontDirectory( const FontPath& path );
+
 private:
 
   /**
index e62f7df..05f371e 100755 (executable)
@@ -95,7 +95,9 @@ void VideoPlayer::Initialize()
   }
 
   mCreateVideoPlayerPtr = reinterpret_cast< CreateVideoPlayerFunction >( dlsym( mHandle, "CreateVideoPlayerPlugin" ) );
-  if( mCreateVideoPlayerPtr == NULL )
+
+  error = dlerror();
+  if( mCreateVideoPlayerPtr == NULL || error != NULL )
   {
     DALI_LOG_ERROR( "Can't load symbol CreateVideoPlayerPlugin(), error: %s\n", error );
     return;
@@ -110,12 +112,13 @@ void VideoPlayer::Initialize()
   }
 
   mDestroyVideoPlayerPtr = reinterpret_cast< DestroyVideoPlayerFunction >( dlsym( mHandle, "DestroyVideoPlayerPlugin" ) );
-  if( mDestroyVideoPlayerPtr == NULL )
+
+  error = dlerror();
+  if( mDestroyVideoPlayerPtr == NULL || error != NULL )
   {
     DALI_LOG_ERROR( "Can't load symbol DestroyVideoPlayerPlugin(), error: %s\n", error );
     return;
   }
-
 }
 
 void VideoPlayer::SetUrl( const std::string& url )
index 7e73ef1..8322e6e 100644 (file)
@@ -23,7 +23,6 @@
 #include <dali/public-api/object/base-object.h>
 #include <dali/internal/graphics/gles20/egl-implementation.h>
 
-#include <memory>
 
 namespace Dali
 {
@@ -67,12 +66,22 @@ public:
   virtual void ConsumeEvents() = 0;
 
   /**
-   * @copydoc Dali::DisplayConnection::InitializeEgl
+   * @copydoc Dali::DisplayConnection::InitializeGraphics
    */
-  virtual bool InitializeEgl(EglInterface& egl) = 0;
+  virtual bool InitializeGraphics() = 0;
 
+  /**
+   * Sets the render surface type
+   * @param[in] type The render surface type
+   */
   virtual void SetSurfaceType( RenderSurface::Type type ) = 0;
 
+  /**
+   * Sets the graphics interface
+   * @param[in] graphics The graphics interface
+   */
+  virtual void SetGraphicsInterface( GraphicsInterface& graphics ) = 0;
+
 public:
 
   /**
index dd5c506..1535056 100644 (file)
 // CLASS HEADER
 #include <dali/internal/window-system/common/display-connection.h>
 #include <dali/internal/window-system/common/display-connection-factory.h>
-// EXTERNAL INCLUDES
 
 // INTERNAL INCLUDES
 #include <dali/internal/window-system/common/display-connection-impl.h>
 #include <dali/internal/window-system/common/display-connection-factory.h>
-#include <dali/integration-api/egl-interface.h>
+
 
 namespace Dali
 {
 
-DisplayConnection* DisplayConnection::New()
+DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics )
 {
   auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
   auto displayConnection = factory->CreateDisplayConnection();
 
   Internal::Adaptor::DisplayConnection* internal( displayConnection.release() );
+  internal->SetGraphicsInterface( graphics );
 
   return new DisplayConnection(internal);
 }
 
-DisplayConnection* DisplayConnection::New( RenderSurface::Type type )
+DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type )
 {
   auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
   auto displayConnection = factory->CreateDisplayConnection();
 
   Internal::Adaptor::DisplayConnection* internal( displayConnection.release() );
 
+  internal->SetGraphicsInterface( graphics );
   internal->SetSurfaceType( type );
 
   return new DisplayConnection(internal);
@@ -69,9 +70,9 @@ void DisplayConnection::ConsumeEvents()
   mImpl->ConsumeEvents();
 }
 
-bool DisplayConnection::InitializeEgl(EglInterface& egl)
+bool DisplayConnection::Initialize()
 {
-  return mImpl->InitializeEgl(egl);
+  return mImpl->InitializeGraphics();
 }
 
 }
index c1e742c..1fc12ca 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/render-surface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
 
-#include <memory>
 
 namespace Dali
 {
-
-class EglInterface;
-
 namespace Internal
 {
 namespace Adaptor
@@ -46,18 +43,20 @@ public:
   /**
    * @brief Create an initialized DisplayConnection.
    *
+   * @param[in] graphics The abstracted graphics interface
    * @return A handle to a newly allocated DisplayConnection resource.
    */
-  static DisplayConnection* New();
+  static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics );
 
   /**
    * @brief Create an initialized DisplayConnection.
    * Native surface will need this instead of DisplayConnection::New()
    *
+   * @param[in] graphics The abstracted graphics interface
    * @param[in] type Render surface type
    * @return A handle to a newly allocated DisplayConnection resource.
    */
-  static DisplayConnection* New( RenderSurface::Type type );
+  static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type );
 
   /**
    * @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
@@ -86,11 +85,9 @@ public:
   void ConsumeEvents();
 
   /**
-   * @brief Initialize EGL display
-   *
-   * @param egl implementation to use for the creation
+   * @brief Initialize the display
    */
-  bool InitializeEgl(EglInterface& egl);
+  bool Initialize();
 
 public:
 
index 4e414ba..8412d53 100644 (file)
@@ -21,6 +21,8 @@
 // EXTERNAL HEADERS
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
+#include <dali/public-api/actors/camera-actor.h>
 #include <dali/public-api/render-tasks/render-task.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/devel-api/adaptor-framework/orientation.h>
@@ -144,13 +146,22 @@ void Window::SetAdaptor(Dali::Adaptor& adaptor)
   DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" );
   mStarted = true;
 
-  // Only create one overlay per window
+  // Create one overlay for the main window only
   Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
   Integration::Core& core = adaptorImpl.GetCore();
   mOverlay = &core.GetSystemOverlay();
 
-  Dali::RenderTaskList taskList = mOverlay->GetOverlayRenderTasks();
-  taskList.CreateTask();
+  // Only create render task list for the overlay once
+  if (!mOverlay->GetOverlayRenderTasks())
+  {
+    Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
+
+    Dali::Actor overlayRootActor = mOverlay->GetDefaultRootActor();
+    Dali::CameraActor overlayCameraActor = mOverlay->GetDefaultCameraActor();
+    Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
+
+    mOverlay->SetOverlayRenderTasks( overlayRenderTaskList );
+  }
 
   mAdaptor = &adaptorImpl;
   mAdaptor->AddObserver( *this );
index e8d8367..04bc79b 100644 (file)
@@ -30,6 +30,8 @@
 #include <dali/internal/window-system/common/window-base.h>
 #include <dali/internal/window-system/common/window-factory.h>
 #include <dali/internal/window-system/common/window-system.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
+
 
 namespace Dali
 {
@@ -79,15 +81,15 @@ WindowRenderSurface::~WindowRenderSurface()
 
 void WindowRenderSurface::Initialize( Any surface )
 {
-  // if width or height are zero, go full screen.
- if ( (mPositionSize.width == 0) || (mPositionSize.height == 0) )
- {
-   // Default window size == screen size
-   mPositionSize.x = 0;
-   mPositionSize.y = 0;
+  // If width or height are zero, go full screen.
 if ( (mPositionSize.width == 0) || (mPositionSize.height == 0) )
 {
+    // Default window size == screen size
+    mPositionSize.x = 0;
+    mPositionSize.y = 0;
 
-   WindowSystem::GetScreenSize( mPositionSize.width, mPositionSize.height );
- }
+    WindowSystem::GetScreenSize( mPositionSize.width, mPositionSize.height );
 }
 
   // Create a window base
   auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
@@ -174,16 +176,31 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi
   mWindowBase->GetDpi( dpiHorizontal, dpiVertical );
 }
 
-void WindowRenderSurface::InitializeEgl( EglInterface& eglIf )
+void WindowRenderSurface::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
 {
-  DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
+  mGraphics = &graphics;
+
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+  EglInterface* mEGL = eglGraphics->Create();
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
+  // Initialize EGL & OpenGL
+  displayConnection.Initialize();
 
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
   eglImpl.ChooseConfig(true, mColorDepth);
+
+  // Create the OpenGL context
+  mEGL->CreateContext();
+
+  // Create the OpenGL surface
+  CreateSurface();
+
+  // Make it current
+  mEGL->MakeContextCurrent();
 }
 
-void WindowRenderSurface::CreateEglSurface( EglInterface& eglIf )
+void WindowRenderSurface::CreateSurface()
 {
   DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
 
@@ -199,29 +216,33 @@ void WindowRenderSurface::CreateEglSurface( EglInterface& eglIf )
     height = mPositionSize.width;
   }
 
-  // create the EGL window
+  // Create the EGL window
   EGLNativeWindowType window = mWindowBase->CreateEglWindow( width, height );
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
   eglImpl.CreateSurfaceWindow( window, mColorDepth );
 
   // Check rotation capability
   mRotationSupported = mWindowBase->IsEglWindowRotationSupported();
 
-  DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: w = %d h = %d angle = %d screen rotation = %d\n", mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle );
+  DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateSurface: w = %d h = %d angle = %d screen rotation = %d\n", mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle );
 }
 
-void WindowRenderSurface::DestroyEglSurface( EglInterface& eglIf )
+void WindowRenderSurface::DestroySurface()
 {
   DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
   eglImpl.DestroySurface();
 
   mWindowBase->DestroyEglWindow();
 }
 
-bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& egl )
+bool WindowRenderSurface::ReplaceGraphicsSurface()
 {
   DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
 
@@ -240,13 +261,15 @@ bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& egl )
     height = mPositionSize.width;
   }
 
-  // create the EGL window
+  // Create the EGL window
   EGLNativeWindowType window = mWindowBase->CreateEglWindow( width, height );
 
   // Set screen rotation
   mScreenRotationFinished = false;
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
   return eglImpl.ReplaceSurfaceWindow( window );
 }
 
@@ -255,14 +278,14 @@ void WindowRenderSurface::MoveResize( Dali::PositionSize positionSize )
   bool needToMove = false;
   bool needToResize = false;
 
-  // check moving
+  // Check moving
   if( (fabs(positionSize.x - mPositionSize.x) > MINIMUM_DIMENSION_CHANGE) ||
       (fabs(positionSize.y - mPositionSize.y) > MINIMUM_DIMENSION_CHANGE) )
   {
     needToMove = true;
   }
 
-  // check resizing
+  // Check resizing
   if( (fabs(positionSize.width - mPositionSize.width) > MINIMUM_DIMENSION_CHANGE) ||
       (fabs(positionSize.height - mPositionSize.height) > MINIMUM_DIMENSION_CHANGE) )
   {
@@ -305,7 +328,7 @@ void WindowRenderSurface::StartRender()
 {
 }
 
-bool WindowRenderSurface::PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface )
+bool WindowRenderSurface::PreRender( bool resizingSurface )
 {
   if( resizingSurface )
   {
@@ -341,28 +364,45 @@ bool WindowRenderSurface::PreRender( EglInterface& egl, Integration::GlAbstracti
     }
   }
 
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+  auto mGLES = eglGraphics->GetGlesInterface();
+  mGLES.PreRender();
+
   return true;
 }
 
-void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, Dali::DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void WindowRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
 {
-  if( resizingSurface )
+  // Inform the gl implementation that rendering has finished before informing the surface
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+  auto mGLES = eglGraphics->GetGlesInterface();
+  mGLES.PostRender();
+
+  if( renderToFbo )
   {
-    if( !mRotationFinished )
+    mGLES.Flush();
+    mGLES.Finish();
+  }
+  else
+  {
+    if( resizingSurface )
     {
-      DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
+      if( !mRotationFinished )
+      {
+        DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
 
-      mRotationTrigger->Trigger();
+        mRotationTrigger->Trigger();
 
-      if( mThreadSynchronization )
-      {
-        // Wait until the event-thread complete the rotation event processing
-        mThreadSynchronization->PostRenderWaitForCompletion();
+        if( mThreadSynchronization )
+        {
+          // Wait until the event-thread complete the rotation event processing
+          mThreadSynchronization->PostRenderWaitForCompletion();
+        }
       }
     }
   }
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
   eglImpl.SwapBuffers();
 
   if( mRenderNotification )
index 9357b41..6f93259 100644 (file)
 // INTERNAL INCLUDES
 #include <dali/integration-api/render-surface.h>
 #include <dali/integration-api/egl-interface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/signals/connection-tracker.h>
 #include <dali/public-api/signals/dali-signal.h>
-#include <memory>
+
 
 namespace Dali
 {
@@ -119,29 +120,28 @@ public: // from Dali::RenderSurface
   virtual PositionSize GetPositionSize() const override;
 
   /**
-   * @copydoc Dali::RenderSurface::GetDpi()
    */
   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::InitializeEgl()
+   * @copydoc Dali::RenderSurface::InitializeGraphics()
    */
-  virtual void InitializeEgl( EglInterface& egl ) override;
+  virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::CreateEglSurface()
+   * @copydoc Dali::RenderSurface::CreateSurface()
    */
-  virtual void CreateEglSurface( EglInterface& egl ) override;
+  virtual void CreateSurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::DestroyEglSurface()
+   * @copydoc Dali::RenderSurface::DestroySurface()
    */
-  virtual void DestroyEglSurface( EglInterface& egl ) override;
+  virtual void DestroySurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+   * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
    */
-  virtual bool ReplaceEGLSurface( EglInterface& egl ) override;
+  virtual bool ReplaceGraphicsSurface() override;
 
   /**
    * @copydoc Dali::RenderSurface::MoveResize()
@@ -161,12 +161,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) override;
+  virtual bool PreRender( bool resizingSurface ) override;
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, Dali::DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) override;
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
 
   /**
    * @copydoc Dali::RenderSurface::StopRender()
@@ -220,6 +220,7 @@ private: // Data
   ThreadSynchronizationInterface* mThreadSynchronization;
   TriggerEventInterface*          mRenderNotification; ///< Render notification trigger
   TriggerEventInterface*          mRotationTrigger;
+  GraphicsInterface*              mGraphics;           ///< Graphics interface
   ColorDepth                      mColorDepth;         ///< Color depth of surface (32 bit or 24 bit)
   OutputSignalType                mOutputTransformedSignal;
   int                             mRotationAngle;
index ca46418..0dae2e9 100755 (executable)
@@ -17,6 +17,7 @@
 
 // CLASS HEADER
 #include <dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
 
 // EXTERNAL_HEADERS
 #include <dali/integration-api/debug.h>
@@ -45,7 +46,8 @@ DisplayConnection* DisplayConnectionEcoreWl::New()
 
 DisplayConnectionEcoreWl::DisplayConnectionEcoreWl()
 : mDisplay( NULL ),
-  mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE )
+  mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE ),
+  mGraphics( nullptr )
 {
 }
 
@@ -66,9 +68,10 @@ void DisplayConnectionEcoreWl::ConsumeEvents()
 {
 }
 
-bool DisplayConnectionEcoreWl::InitializeEgl(EglInterface& egl)
+bool DisplayConnectionEcoreWl::InitializeGraphics()
 {
-  EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+  EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
   if( !eglImpl.InitializeGles( mDisplay ) )
   {
@@ -98,6 +101,11 @@ void DisplayConnectionEcoreWl::SetSurfaceType( RenderSurface::Type type )
   }
 }
 
+void DisplayConnectionEcoreWl::SetGraphicsInterface( GraphicsInterface& graphics )
+{
+  mGraphics = &graphics;
+}
+
 EGLNativeDisplayType DisplayConnectionEcoreWl::GetNativeDisplay()
 {
   return EGLNativeDisplayType();
index 7c63d23..cc31ef0 100644 (file)
@@ -64,15 +64,22 @@ public:
   void ConsumeEvents();
 
   /**
-   * @copydoc Dali::DisplayConnection::InitializeEgl
+   * @copydoc Dali::DisplayConnection::InitializeGraphics
    */
-  bool InitializeEgl(EglInterface& egl);
+  bool InitializeGraphics();
 
   /**
-   * @brief Sets surface type
+   * @brief Sets the surface type
+   * @param[in] type The surface type
    */
   void SetSurfaceType( RenderSurface::Type type );
 
+  /**
+   * @brief Sets the graphics interface
+   * @param[in] graphics The graphics interface
+   */
+  void SetGraphicsInterface( GraphicsInterface& graphics );
+
 public:
 
   /**
@@ -100,7 +107,8 @@ protected:
 
 private:
   EGLNativeDisplayType mDisplay;        ///< Wayland-display for rendering
-  RenderSurface::Type mSurfaceType;
+  RenderSurface::Type mSurfaceType;     ///< The surface type
+  GraphicsInterface* mGraphics;         ///< The graphics interface
 };
 
 } // namespace Adaptor
index 8722ceb..66364cc 100644 (file)
@@ -34,6 +34,7 @@
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/trigger-event.h>
 #include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
 #include <dali/internal/window-system/common/display-connection.h>
 #include <dali/internal/window-system/common/window-system.h>
 #include <dali/integration-api/thread-synchronization-interface.h>
@@ -130,34 +131,54 @@ void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned i
   dpiVertical   = int( yres + 0.5f );
 }
 
-void NativeRenderSurfaceEcoreWl::InitializeEgl( EglInterface& egl )
+void NativeRenderSurfaceEcoreWl::InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection )
 {
   DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
   unsetenv( "EGL_PLATFORM" );
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  mGraphics = &graphics;
 
-  eglImpl.ChooseConfig( true, mColorDepth );
+  auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+
+  EglInterface* mEGL = eglGraphics->Create();
+
+  // Initialize EGL & OpenGL
+  displayConnection.Initialize();
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
+  eglImpl.ChooseConfig(true, mColorDepth);
+
+  // Create the OpenGL context
+  mEGL->CreateContext();
+
+  // Create the OpenGL surface
+  CreateSurface();
+
+  // Make it current
+  mEGL->MakeContextCurrent();
 }
 
-void NativeRenderSurfaceEcoreWl::CreateEglSurface( EglInterface& egl )
+void NativeRenderSurfaceEcoreWl::CreateSurface()
 {
   DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
   eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mColorDepth );
 }
 
-void NativeRenderSurfaceEcoreWl::DestroyEglSurface( EglInterface& egl )
+void NativeRenderSurfaceEcoreWl::DestroySurface()
 {
   DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+
   eglImpl.DestroySurface();
 }
 
-bool NativeRenderSurfaceEcoreWl::ReplaceEGLSurface( EglInterface& egl )
+bool NativeRenderSurfaceEcoreWl::ReplaceGraphicsSurface()
 {
   DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
 
@@ -166,7 +187,8 @@ bool NativeRenderSurfaceEcoreWl::ReplaceEGLSurface( EglInterface& egl )
     return false;
   }
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
   return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ) );
 }
@@ -183,15 +205,17 @@ void NativeRenderSurfaceEcoreWl::StartRender()
 {
 }
 
-bool NativeRenderSurfaceEcoreWl::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
+bool NativeRenderSurfaceEcoreWl::PreRender( bool )
 {
   // nothing to do for pixmaps
   return true;
 }
 
-void NativeRenderSurfaceEcoreWl::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void NativeRenderSurfaceEcoreWl::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
 {
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+
   eglImpl.SwapBuffers();
 
   if( mThreadSynchronization )
@@ -203,7 +227,7 @@ void NativeRenderSurfaceEcoreWl::PostRender( EglInterface& egl, Integration::GlA
   {
     if( tbm_surface_queue_acquire( mTbmQueue, &mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
     {
-      DALI_LOG_ERROR( "Failed to aquire a tbm_surface\n" );
+      DALI_LOG_ERROR( "Failed to acquire a tbm_surface\n" );
       return;
     }
   }
index cfc3d5a..6978b0f 100644 (file)
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-adaptor-common.h>
 #include <dali/integration-api/native-render-surface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
 
 namespace Dali
 {
 
+class DisplayConnection;
+
 /**
  * Ecore Wayland Native implementation of render surface.
  */
@@ -79,24 +82,24 @@ public: // from Dali::RenderSurface
   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::InitializeEgl()
+   * @copydoc Dali::RenderSurface::InitializeGraphics()
    */
-  virtual void InitializeEgl( EglInterface& egl ) override;
+  virtual void InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::CreateEglSurface()
+   * @copydoc Dali::RenderSurface::CreateSurface()
    */
-  virtual void CreateEglSurface( EglInterface& egl ) override;
+  virtual void CreateSurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::DestroyEglSurface()
+   * @copydoc Dali::RenderSurface::DestroySurface()
    */
-  virtual void DestroyEglSurface( EglInterface& egl ) override;
+  virtual void DestroySurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+   * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
    */
-  virtual bool ReplaceEGLSurface( EglInterface& egl ) override;
+  virtual bool ReplaceGraphicsSurface() override;
 
   /**
    * @copydoc Dali::RenderSurface::MoveResize()
@@ -116,12 +119,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) override;
+  virtual bool PreRender( bool resizingSurface ) override;
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) override;
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
 
   /**
    * @copydoc Dali::RenderSurface::StopRender()
@@ -157,17 +160,18 @@ private:
 
 private: // Data
 
-  PositionSize                    mPosition;
-  TriggerEventInterface*          mRenderNotification;
-  ColorDepth                      mColorDepth;
-  tbm_format                      mTbmFormat;
-  bool                            mOwnSurface;
-  bool                            mDrawableCompleted;
-
-  tbm_surface_queue_h             mTbmQueue;
-  tbm_surface_h                   mConsumeSurface;
-  ThreadSynchronizationInterface* mThreadSynchronization;     ///< A pointer to the thread-synchronization
-  ConditionalWait                 mTbmSurfaceCondition;
+  PositionSize                           mPosition;
+  TriggerEventInterface*                 mRenderNotification;
+  Internal::Adaptor::GraphicsInterface*  mGraphics;                  ///< The graphics interface
+  ColorDepth                             mColorDepth;
+  tbm_format                             mTbmFormat;
+  bool                                   mOwnSurface;
+  bool                                   mDrawableCompleted;
+
+  tbm_surface_queue_h                    mTbmQueue;
+  tbm_surface_h                          mConsumeSurface;
+  ThreadSynchronizationInterface*        mThreadSynchronization;     ///< A pointer to the thread-synchronization
+  ConditionalWait                        mTbmSurfaceCondition;
 
 };
 
index b003cd1..9cf7d61 100644 (file)
@@ -24,6 +24,7 @@
 
 // INTERNAL HEADERS
 #include <dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
 
 namespace Dali
 {
@@ -43,7 +44,8 @@ DisplayConnection* DisplayConnectionX11::New()
 }
 
 DisplayConnectionX11::DisplayConnectionX11()
-: mDisplay(NULL)
+: mGraphics( nullptr ),
+  mDisplay( nullptr )
 {
 }
 
@@ -81,9 +83,10 @@ void DisplayConnectionX11::ConsumeEvents()
   while (events > 0);
 }
 
-bool DisplayConnectionX11::InitializeEgl(EglInterface& egl)
+bool DisplayConnectionX11::InitializeGraphics()
 {
-  EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+  EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
   if (!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
   {
@@ -103,6 +106,11 @@ void DisplayConnectionX11::SetSurfaceType( RenderSurface::Type type )
   }
 }
 
+void DisplayConnectionX11::SetGraphicsInterface( GraphicsInterface& graphics )
+{
+  mGraphics = &graphics;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 5b5ba1e..ef2ac82 100644 (file)
@@ -74,12 +74,20 @@ public:
   void ConsumeEvents();
 
   /**
-   * @copydoc Dali::DisplayConnection::InitializeEgl
+   * @copydoc Dali::DisplayConnection::InitializeGraphics
    */
-  bool InitializeEgl(EglInterface& egl);
+  bool InitializeGraphics();
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType
+   */
   void SetSurfaceType( RenderSurface::Type type );
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface
+   */
+  void SetGraphicsInterface( GraphicsInterface& graphics );
+
 public:
 
   /**
@@ -97,6 +105,8 @@ protected:
 
 private:
 
+  GraphicsInterface* mGraphics; ///< The graphics interface
+
 public:
 
   XDisplay*  mDisplay;        ///< X-display for rendering
index d9eabf3..910098a 100644 (file)
@@ -34,6 +34,8 @@
 #include <dali/integration-api/thread-synchronization-interface.h>
 #include <dali/internal/system/common/trigger-event.h>
 #include <dali/internal/window-system/common/display-connection.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
+
 
 namespace Dali
 {
@@ -139,20 +141,22 @@ void PixmapRenderSurfaceEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned in
   dpiVertical   = int( yres + 0.5f );
 }
 
-void PixmapRenderSurfaceEcoreX::InitializeEgl( EglInterface& egl )
+void PixmapRenderSurfaceEcoreX::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
 {
-  DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
-
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  mGraphics = &graphics;
+  mDisplayConnection = &displayConnection;
 
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
   eglImpl.ChooseConfig(false, mColorDepth);
 }
 
-void PixmapRenderSurfaceEcoreX::CreateEglSurface( EglInterface& egl )
+void PixmapRenderSurfaceEcoreX::CreateSurface()
 {
   DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
   for (int i = 0; i < BUFFER_COUNT; ++i)
   {
@@ -163,11 +167,13 @@ void PixmapRenderSurfaceEcoreX::CreateEglSurface( EglInterface& egl )
   }
 }
 
-void PixmapRenderSurfaceEcoreX::DestroyEglSurface( EglInterface& egl )
+void PixmapRenderSurfaceEcoreX::DestroySurface()
 {
   DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
   for (int i = 0; i < BUFFER_COUNT; ++i)
   {
@@ -178,13 +184,15 @@ void PixmapRenderSurfaceEcoreX::DestroyEglSurface( EglInterface& egl )
   }
 }
 
-bool PixmapRenderSurfaceEcoreX::ReplaceEGLSurface( EglInterface& egl )
+bool PixmapRenderSurfaceEcoreX::ReplaceGraphicsSurface()
 {
   DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
 
   bool contextLost = false;
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
   for (int i = 0; i < BUFFER_COUNT; ++i)
   {
@@ -205,15 +213,18 @@ void PixmapRenderSurfaceEcoreX::StartRender()
 {
 }
 
-bool PixmapRenderSurfaceEcoreX::PreRender( EglInterface& egl, Integration::GlAbstraction&, bool )
+bool PixmapRenderSurfaceEcoreX::PreRender( bool )
 {
   // Nothing to do for pixmaps
   return true;
 }
 
-void PixmapRenderSurfaceEcoreX::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, Dali::DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void PixmapRenderSurfaceEcoreX::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
 {
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
   // flush gl instruction queue
+  Integration::GlAbstraction& glAbstraction = eglGraphics->GetGlAbstraction();
   glAbstraction.Flush();
 
   if( mThreadSynchronization )
@@ -225,7 +236,7 @@ void PixmapRenderSurfaceEcoreX::PostRender( EglInterface& egl, Integration::GlAb
     ConditionalWait::ScopedLock lock( mPixmapCondition );
     mConsumeBufferIndex = __sync_fetch_and_xor( &mProduceBufferIndex, 1 ); // Swap buffer indexes.
 
-    Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+    Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
     // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
     XPixmap pixmap = static_cast<XPixmap>( mX11Pixmaps[mProduceBufferIndex] );
@@ -254,7 +265,7 @@ void PixmapRenderSurfaceEcoreX::PostRender( EglInterface& egl, Integration::GlAb
       rect.width = mPosition.width;
       rect.height = mPosition.height;
 
-      XDisplay* display = AnyCast<XDisplay*>(displayConnection->GetDisplay());
+      XDisplay* display = AnyCast<XDisplay*>(mDisplayConnection->GetDisplay());
 
       // make a fixes region as updated area
       region = XFixesCreateRegion( display, &rect, 1 );
index 2cb3927..471092f 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
-#define __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#ifndef DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H
+#define DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
 #include <dali/internal/window-system/common/pixmap-render-surface.h>
 #include <dali/internal/window-system/ubuntu-x11/ecore-x-types.h>
 #include <dali/public-api/dali-adaptor-common.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/threading/conditional-wait.h>
 #include <Ecore_X.h>
 
+
 namespace Dali
 {
 namespace Internal
@@ -81,24 +83,24 @@ public: // from Dali::RenderSurface
   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::InitializeEgl()
+   * @copydoc Dali::RenderSurface::InitializeGraphics()
    */
-  virtual void InitializeEgl( EglInterface& egl ) override;
+  virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::CreateEglSurface()
+   * @copydoc Dali::RenderSurface::CreateSurface()
    */
-  virtual void CreateEglSurface( EglInterface& egl ) override;
+  virtual void CreateSurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::DestroyEglSurface()
+   * @copydoc Dali::RenderSurface::DestroySurface()
    */
-  virtual void DestroyEglSurface( EglInterface& egl ) override;
+  virtual void DestroySurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+   * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
    */
-  virtual bool ReplaceEGLSurface( EglInterface& egl ) override;
+  virtual bool ReplaceGraphicsSurface() override;
 
   /**
    * @copydoc Dali::RenderSurface::MoveResize()
@@ -118,12 +120,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) override;
+  virtual bool PreRender( bool resizingSurface ) override;
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) override;
 
   /**
    * @copydoc Dali::RenderSurface::StopRender()
@@ -174,7 +176,8 @@ private:
 private: // Data
 
   static const int BUFFER_COUNT = 2;
-
+  GraphicsInterface*              mGraphics;               ///< Graphics interface
+  Dali::DisplayConnection*        mDisplayConnection;      ///< Display connection
   PositionSize                    mPosition;               ///< Position
   TriggerEventInterface*          mRenderNotification;     ///< Render notification trigger
   ColorDepth                      mColorDepth;             ///< Color depth of surface (32 bit or 24 bit)
@@ -194,4 +197,4 @@ private: // Data
 
 } // namespace Dali
 
-#endif // __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#endif // DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H
index b24742b..e6d8ccd 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_APPLICATION_H__
-#define __DALI_APPLICATION_H__
+#ifndef DALI_APPLICATION_H
+#define DALI_APPLICATION_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <string>
 #include <dali/public-api/common/view-mode.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/signals/callback.h>
@@ -471,4 +470,4 @@ public: // Not intended for application developers
  */
 } // namespace Dali
 
-#endif // __DALI_APPLICATION_H__
+#endif // DALI_APPLICATION_H
index 9d79f47..c09fae0 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int ADAPTOR_MAJOR_VERSION = 1;
 const unsigned int ADAPTOR_MINOR_VERSION = 3;
-const unsigned int ADAPTOR_MICRO_VERSION = 46;
+const unsigned int ADAPTOR_MICRO_VERSION = 47;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index bdb7a55..a8eb701 100644 (file)
@@ -19,7 +19,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.3.46
+Version:    1.3.47
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT