Merge branch 'devel/master' into tizen
authorSunghyun kim <scholb.kim@samsung.com>
Tue, 13 Nov 2018 06:16:43 +0000 (15:16 +0900)
committerSunghyun kim <scholb.kim@samsung.com>
Tue, 13 Nov 2018 06:16:48 +0000 (15:16 +0900)
Change-Id: I07fffe55da50f85e6fb754460813f61eb7bb8f52

48 files changed:
build/tizen/adaptor/Makefile.am
dali/devel-api/adaptor-framework/environment-variable.cpp
dali/devel-api/adaptor-framework/environment-variable.h
dali/internal/adaptor/common/adaptor-builder-impl.cpp
dali/internal/adaptor/common/adaptor-builder-impl.h
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-internal-services.h
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/graphics/file.list
dali/internal/graphics/gles/egl-debug.cpp [moved from dali/internal/graphics/gles20/egl-debug.cpp with 98% similarity]
dali/internal/graphics/gles/egl-debug.h [moved from dali/internal/graphics/gles20/egl-debug.h with 100% similarity]
dali/internal/graphics/gles/egl-factory-interface.h [moved from dali/internal/graphics/gles20/egl-factory-interface.h with 100% similarity]
dali/internal/graphics/gles/egl-graphics-factory.cpp [moved from dali/internal/graphics/gles20/egl-graphics-factory.cpp with 90% similarity]
dali/internal/graphics/gles/egl-graphics-factory.h [moved from dali/internal/graphics/gles20/egl-graphics-factory.h with 100% similarity]
dali/internal/graphics/gles/egl-graphics.cpp [moved from dali/internal/graphics/gles20/egl-graphics.cpp with 98% similarity]
dali/internal/graphics/gles/egl-graphics.h [moved from dali/internal/graphics/gles20/egl-graphics.h with 93% similarity]
dali/internal/graphics/gles/egl-implementation.cpp [moved from dali/internal/graphics/gles20/egl-implementation.cpp with 98% similarity]
dali/internal/graphics/gles/egl-implementation.h [moved from dali/internal/graphics/gles20/egl-implementation.h with 100% similarity]
dali/internal/graphics/gles/egl-sync-implementation.cpp [moved from dali/internal/graphics/gles20/egl-sync-implementation.cpp with 97% similarity]
dali/internal/graphics/gles/egl-sync-implementation.h [moved from dali/internal/graphics/gles20/egl-sync-implementation.h with 100% similarity]
dali/internal/graphics/gles/gl-extensions.cpp [moved from dali/internal/graphics/gles20/gl-extensions.cpp with 98% similarity]
dali/internal/graphics/gles/gl-extensions.h [moved from dali/internal/graphics/gles20/gl-extensions.h with 99% similarity]
dali/internal/graphics/gles/gl-implementation.h [moved from dali/internal/graphics/gles20/gl-implementation.h with 99% similarity]
dali/internal/graphics/gles/gl-proxy-implementation.cpp [moved from dali/internal/graphics/gles20/gl-proxy-implementation.cpp with 99% similarity]
dali/internal/graphics/gles/gl-proxy-implementation.h [moved from dali/internal/graphics/gles20/gl-proxy-implementation.h with 99% similarity]
dali/internal/graphics/tizen/egl-image-extensions-tizen.cpp
dali/internal/graphics/ubuntu/egl-image-extensions-ubuntu.cpp
dali/internal/imaging/common/native-bitmap-buffer-impl.cpp
dali/internal/imaging/file.list
dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-factory-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp [new file with mode: 0644]
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h [new file with mode: 0755]
dali/internal/system/common/environment-variables.h
dali/internal/web-engine/common/web-engine-impl.cpp
dali/internal/web-engine/common/web-engine-impl.h
dali/internal/window-system/common/display-connection-impl.h
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-render-surface.cpp
dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp
dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp
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/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index c62cdc6..3ce8237 100644 (file)
@@ -42,7 +42,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(devel_api_src_files) \
                   $(adaptor_devel_api_text_abstraction_src_files) \
                   $(adaptor_graphics_common_src_files) \
-                  $(adaptor_graphics_gles20_src_files) \
+                  $(adaptor_graphics_gles_src_files) \
                   $(adaptor_graphics_ubuntu_src_files) \
                   $(adaptor_haptics_common_src_files) \
                   $(adaptor_imaging_common_src_files) \
@@ -96,7 +96,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(devel_api_src_files) \
                   $(adaptor_devel_api_text_abstraction_src_files) \
                   $(adaptor_graphics_common_src_files) \
-                  $(adaptor_graphics_gles20_src_files) \
+                  $(adaptor_graphics_gles_src_files) \
                   $(adaptor_graphics_tizen_src_files) \
                   $(adaptor_haptics_common_src_files) \
                   $(adaptor_imaging_common_src_files) \
@@ -158,7 +158,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(devel_api_src_files) \
                   $(adaptor_devel_api_text_abstraction_src_files) \
                   $(adaptor_graphics_common_src_files) \
-                  $(adaptor_graphics_gles20_src_files) \
+                  $(adaptor_graphics_gles_src_files) \
                   $(adaptor_graphics_tizen_src_files) \
                   $(adaptor_haptics_common_src_files) \
                   $(adaptor_haptics_tizen_src_files) \
@@ -221,7 +221,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(devel_api_src_files) \
                   $(adaptor_devel_api_text_abstraction_src_files) \
                   $(adaptor_graphics_common_src_files) \
-                  $(adaptor_graphics_gles20_src_files) \
+                  $(adaptor_graphics_gles_src_files) \
                   $(adaptor_graphics_tizen_src_files) \
                   $(adaptor_haptics_common_src_files) \
                   $(adaptor_imaging_common_src_files) \
@@ -282,7 +282,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(devel_api_src_files) \
                   $(adaptor_devel_api_text_abstraction_src_files) \
                   $(adaptor_graphics_common_src_files) \
-                  $(adaptor_graphics_gles20_src_files) \
+                  $(adaptor_graphics_gles_src_files) \
                   $(adaptor_graphics_tizen_src_files) \
                   $(adaptor_haptics_common_src_files) \
                   $(adaptor_imaging_common_src_files) \
@@ -346,7 +346,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \
                   $(devel_api_src_files) \
                   $(adaptor_devel_api_text_abstraction_src_files) \
                   $(adaptor_graphics_common_src_files) \
-                  $(adaptor_graphics_gles20_src_files) \
+                  $(adaptor_graphics_gles_src_files) \
                   $(adaptor_graphics_tizen_src_files) \
                   $(adaptor_haptics_common_src_files) \
                   $(adaptor_imaging_common_src_files) \
index 9eb6582..1bcf1b6 100644 (file)
@@ -31,6 +31,11 @@ const char * GetEnvironmentVariable( const char * variable )
   return std::getenv( variable );
 }
 
+bool SetEnvironmentVariable( const char * variable, const char * value )
+{
+  return setenv( variable, value, 1 ) == 0;
+}
+
 } // namespace EnvironmentVariable
 
 } // namespace Dali
index b258d31..3ebe394 100644 (file)
@@ -34,6 +34,15 @@ namespace EnvironmentVariable
  */
 DALI_ADAPTOR_API const char * GetEnvironmentVariable( const char * variable );
 
+/**
+ * @brief Create or overwrite (when it does not exist) an environment variable.
+ *
+ * @param[in] variable Null-terminated character string identifying the name of the environmental variable.
+ * @param[in] value Null-terminated character string to set as a value.
+ * @return True on success, false on error.
+ */
+DALI_ADAPTOR_API bool SetEnvironmentVariable( const char * variable, const char * value );
+
 } // namespace EnvironmentVariable
 
 } // namespace Dali
index 8ea291e..37332b1 100644 (file)
@@ -20,7 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-adaptor-common.h>
-#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+#include <dali/internal/graphics/gles/egl-graphics-factory.h>
 #include <dali/internal/window-system/common/display-utils.h>
 
 
index b382b4b..ab09a34 100644 (file)
@@ -21,7 +21,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/environment-options.h>
-#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+#include <dali/internal/graphics/gles/egl-graphics-factory.h>
 
 
 namespace Dali
index 33dce23..ee1b447 100755 (executable)
@@ -37,8 +37,8 @@
 #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/internal/graphics/gles/egl-graphics-factory.h>
+#include <dali/internal/graphics/gles/egl-graphics.h> // Temporary until Core is abstracted
 
 #include <dali/devel-api/text-abstraction/font-client.h>
 
@@ -47,9 +47,9 @@
 #include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
 #include <dali/internal/input/common/gesture-manager.h>
 #include <dali/internal/window-system/common/event-handler.h>
-#include <dali/internal/graphics/gles20/gl-proxy-implementation.h>
-#include <dali/internal/graphics/gles20/gl-implementation.h>
-#include <dali/internal/graphics/gles20/egl-sync-implementation.h>
+#include <dali/internal/graphics/gles/gl-proxy-implementation.h>
+#include <dali/internal/graphics/gles/gl-implementation.h>
+#include <dali/internal/graphics/gles/egl-sync-implementation.h>
 #include <dali/internal/graphics/common/egl-image-extensions.h>
 #include <dali/internal/clipboard/common/clipboard-impl.h>
 #include <dali/internal/graphics/common/vsync-monitor.h>
index 0cc2d32..4823a6b 100644 (file)
@@ -27,7 +27,7 @@
 #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/graphics/gles/egl-factory-interface.h>
 #include <dali/internal/network/common/socket-factory-interface.h>
 #include <dali/internal/system/common/performance-interface.h>
 #include <dali/internal/graphics/common/vsync-monitor-interface.h>
index a73104a..e9fa33f 100644 (file)
@@ -515,13 +515,15 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     }
 
     // Check resize
-    bool surfaceResized = ShouldSurfaceBeResized();
-    if( DALI_UNLIKELY( surfaceResized ) )
+    bool surfaceResized = false;
+    bool shouldSurfaceBeResized = ShouldSurfaceBeResized();
+    if( DALI_UNLIKELY( shouldSurfaceBeResized ) )
     {
       if( updateStatus.SurfaceRectChanged() )
       {
         LOG_UPDATE_RENDER_TRACE_FMT( "Resizing Surface" );
         SurfaceResized();
+        surfaceResized = true;
       }
     }
 
@@ -547,7 +549,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
     if( currentSurface )
     {
-      currentSurface->PreRender( mSurfaceResized );
+      currentSurface->PreRender( surfaceResized );
     }
 
     Integration::RenderStatus renderStatus;
@@ -562,7 +564,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     {
       if( currentSurface )
       {
-        currentSurface->PostRender( isRenderingToFbo, ( mNewSurface != NULL ), mSurfaceResized );
+        currentSurface->PostRender( isRenderingToFbo, ( mNewSurface != NULL ), surfaceResized );
       }
     }
 
index 1949b28..016a3d8 100644 (file)
@@ -1,14 +1,14 @@
 
 
-# module: graphics, backend: gles20
-adaptor_graphics_gles20_src_files=\
-    ${adaptor_graphics_dir}/gles20/egl-debug.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/egl-graphics-factory.cpp \
-    ${adaptor_graphics_dir}/gles20/egl-graphics.cpp
+# module: graphics, backend: gles
+adaptor_graphics_gles_src_files=\
+    ${adaptor_graphics_dir}/gles/egl-debug.cpp \
+    ${adaptor_graphics_dir}/gles/egl-implementation.cpp \
+    ${adaptor_graphics_dir}/gles/egl-sync-implementation.cpp \
+    ${adaptor_graphics_dir}/gles/gl-extensions.cpp \
+    ${adaptor_graphics_dir}/gles/gl-proxy-implementation.cpp \
+    ${adaptor_graphics_dir}/gles/egl-graphics-factory.cpp \
+    ${adaptor_graphics_dir}/gles/egl-graphics.cpp
 
 # module: graphics, backend: tizen
 adaptor_graphics_tizen_src_files=\
similarity index 98%
rename from dali/internal/graphics/gles20/egl-debug.cpp
rename to dali/internal/graphics/gles/egl-debug.cpp
index bf0f95a..1f5bbfa 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/graphics/gles20/egl-debug.h>
+#include <dali/internal/graphics/gles/egl-debug.h>
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
@@ -17,8 +17,8 @@
 
 
 // CLASS HEADER
-#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
-#include <dali/internal/graphics/gles20/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-graphics-factory.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 
 // INTERNAL INCLUDES
 
@@ -17,7 +17,7 @@
 
 
 // CLASS HEADER
-#include <dali/internal/graphics/gles20/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/window-system/common/display-utils.h> // For Utils::MakeUnique
similarity index 93%
rename from dali/internal/graphics/gles20/egl-graphics.h
rename to dali/internal/graphics/gles/egl-graphics.h
index 603b584..36a4c3c 100644 (file)
 
 // 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/internal/graphics/gles/gl-proxy-implementation.h>
+#include <dali/internal/graphics/gles/gl-implementation.h>
 #include <dali/integration-api/egl-interface.h>
 
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 #include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-sync-implementation.h>
+#include <dali/internal/graphics/gles/egl-sync-implementation.h>
 
 
 namespace Dali
@@ -17,7 +17,7 @@
 
 
 // CLASS HEADER
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
@@ -26,8 +26,8 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-adaptor-common.h>
-#include <dali/internal/graphics/gles20/gl-implementation.h>
-#include <dali/internal/graphics/gles20/egl-debug.h>
+#include <dali/internal/graphics/gles/gl-implementation.h>
+#include <dali/internal/graphics/gles/egl-debug.h>
 
 // EGL constants use C style casts
 #pragma GCC diagnostic push
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/graphics/gles20/egl-sync-implementation.h>
+#include <dali/internal/graphics/gles/egl-sync-implementation.h>
 
 // EXTERNAL INCLUDES
 
@@ -31,7 +31,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 
 #ifdef _ARCH_ARM_
 
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/graphics/gles20/gl-extensions.h>
+#include <dali/internal/graphics/gles/gl-extensions.h>
 
 // EXTERNAL INCLUDES
 #include <EGL/egl.h>
similarity index 99%
rename from dali/internal/graphics/gles20/gl-extensions.h
rename to dali/internal/graphics/gles/gl-extensions.h
index 569a266..2b2f6cc 100644 (file)
@@ -22,7 +22,6 @@
 
 #if DALI_GLES_VERSION >= 30
 #include <GLES3/gl3.h>
-#include <GLES3/gl3ext.h>
 #else
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
@@ -35,7 +35,7 @@
 #include <dali/integration-api/gl-abstraction.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/graphics/gles20/gl-extensions.h>
+#include <dali/internal/graphics/gles/gl-extensions.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali/internal/graphics/gles20/gl-proxy-implementation.h>
+#include <dali/internal/graphics/gles/gl-proxy-implementation.h>
 
 // EXTERNAL INCLUDES
 #include <math.h>
@@ -19,7 +19,7 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/internal/graphics/gles20/gl-implementation.h>
+#include <dali/internal/graphics/gles/gl-implementation.h>
 
 namespace Dali
 {
index 781c32f..a0d4d79 100644 (file)
@@ -22,7 +22,6 @@
 // EXTERNAL INCLUDES
 #if DALI_GLES_VERSION >= 30
 #include <GLES3/gl3.h>
-#include <GLES3/gl3ext.h>
 
 #else
 #include <GLES2/gl2.h>
@@ -35,7 +34,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 
 // TBM surface support
 #ifndef EGL_NATIVE_SURFACE_TIZEN
index 800d34b..526b3dd 100644 (file)
@@ -22,7 +22,6 @@
 // EXTERNAL INCLUDES
 #if DALI_GLES_VERSION >= 30
 #include <GLES3/gl3.h>
-#include <GLES3/gl3ext.h>
 
 #else
 #include <GLES2/gl2.h>
@@ -35,7 +34,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 
 
 namespace
index 7bd4570..1741803 100644 (file)
@@ -23,8 +23,8 @@
 #include <dali/integration-api/bitmap.h>
 
 // INTERNAL HEADERS
-#include <dali/internal/graphics/gles20/gl-implementation.h>
-#include <dali/internal/graphics/gles20/egl-graphics.h>
+#include <dali/internal/graphics/gles/gl-implementation.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 
 namespace Dali
 {
index 6aa7fb2..83f82f7 100755 (executable)
@@ -30,4 +30,6 @@ adaptor_imaging_tizen_src_files=\
 # module: imaging, backend: ubuntu-x11
 adaptor_imaging_ubuntu_x11_src_files=\
     ${adaptor_imaging_dir}/ubuntu-x11/native-image-source-factory-x.cpp \
-    ${adaptor_imaging_dir}/ubuntu-x11/native-image-source-impl-x.cpp
+    ${adaptor_imaging_dir}/ubuntu-x11/native-image-source-impl-x.cpp \
+    ${adaptor_imaging_dir}/ubuntu-x11/native-image-source-queue-impl-x.cpp
+
index e4bcc00..401a33a 100644 (file)
@@ -26,7 +26,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/integration-api/render-surface.h>
 
index 8223c81..b72f743 100644 (file)
@@ -25,7 +25,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 
 namespace Dali
index b072c67..76969b9 100644 (file)
@@ -20,7 +20,7 @@
 
 // INTERNAL HEADERS
 #include <dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h>
-#include <dali/internal/imaging/common/native-image-source-queue-impl.h>
+#include <dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h>
 
 namespace Dali
 {
@@ -38,7 +38,7 @@ std::unique_ptr< NativeImageSource > NativeImageSourceFactoryX::CreateNativeImag
 std::unique_ptr< NativeImageSourceQueue > NativeImageSourceFactoryX::CreateNativeImageSourceQueue( unsigned int width, unsigned int height,
                                                                                                    Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
 {
-  return std::unique_ptr< NativeImageSourceQueue >( nullptr );
+  return std::unique_ptr< NativeImageSourceQueue >( NativeImageSourceQueueX::New( width, height, depth, nativeImageSourceQueue ) );
 }
 
 // this should be created from somewhere
index be32323..f3bd587 100644 (file)
@@ -26,7 +26,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 #include <dali/integration-api/render-surface.h>
diff --git a/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp b/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp
new file mode 100644 (file)
index 0000000..1ed1421
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * 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/imaging/ubuntu-x11/native-image-source-queue-impl-x.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+#include <dali/integration-api/gl-defines.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/egl-image-extensions.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace
+{
+#define TBM_SURFACE_QUEUE_SIZE  3
+
+const char* FRAGMENT_PREFIX = "\n";
+const char* SAMPLER_TYPE = "sampler2D";
+
+}
+
+NativeImageSourceQueueX* NativeImageSourceQueueX::New( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
+{
+  NativeImageSourceQueueX* image = new NativeImageSourceQueueX( width, height, depth, nativeImageSourceQueue );
+  return image;
+}
+
+NativeImageSourceQueueX::NativeImageSourceQueueX( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
+: mWidth( width ),
+  mHeight( height )
+{
+  DALI_LOG_ERROR( "NativeImageSourceQueueX::NativeImageSourceQueueX: Not supported\n" );
+}
+
+NativeImageSourceQueueX::~NativeImageSourceQueueX()
+{
+}
+
+Any NativeImageSourceQueueX::GetNativeImageSourceQueue() const
+{
+  return Any();
+}
+
+void NativeImageSourceQueueX::SetSource( Any source )
+{
+}
+
+bool NativeImageSourceQueueX::GlExtensionCreate()
+{
+  return true;
+}
+
+void NativeImageSourceQueueX::GlExtensionDestroy()
+{
+}
+
+unsigned int NativeImageSourceQueueX::TargetTexture()
+{
+  return 0;
+}
+
+void NativeImageSourceQueueX::PrepareTexture()
+{
+}
+
+const char* NativeImageSourceQueueX::GetCustomFragmentPreFix()
+{
+  return FRAGMENT_PREFIX;
+}
+
+const char* NativeImageSourceQueueX::GetCustomSamplerTypename()
+{
+  return SAMPLER_TYPE;
+}
+
+int NativeImageSourceQueueX::GetEglImageTextureTarget()
+{
+  return 0;
+}
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
diff --git a/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h b/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h
new file mode 100755 (executable)
index 0000000..c53b51d
--- /dev/null
@@ -0,0 +1,163 @@
+#ifndef DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_X_H
+#define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_X_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
+#include <dali/devel-api/images/native-image-interface-extension.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/imaging/common/native-image-source-queue-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class EglGraphics;
+class EglImageExtensions;
+
+/**
+ * Dali internal NativeImageSourceQueue.
+ */
+class NativeImageSourceQueueX: public Internal::Adaptor::NativeImageSourceQueue, public NativeImageInterface::Extension
+{
+public:
+
+  /**
+   * Create a new NativeImageSourceQueueX internally.
+   * Depending on hardware the width and height may have to be a power of two.
+   * @param[in] width The width of the image.
+   * @param[in] height The height of the image.
+   * @param[in] depth color depth of the image.
+   * @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
+   * @return A smart-pointer to a newly allocated image.
+   */
+  static NativeImageSourceQueueX* New(unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
+
+  /**
+   * @copydoc Dali::NativeImageSourceQueue::GetNativeImageSourceQueue()
+   */
+  Any GetNativeImageSourceQueue() const override;
+
+  /**
+   * @copydoc Dali::NativeImageSourceQueue::SetSource( Any source )
+   */
+  void SetSource( Any source ) override;
+
+  /**
+   * destructor
+   */
+  ~NativeImageSourceQueueX() override;
+
+  /**
+   * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+   */
+  bool GlExtensionCreate() override;
+
+  /**
+   * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+   */
+  void GlExtensionDestroy() override;
+
+  /**
+   * @copydoc Dali::NativeImageInterface::TargetTexture()
+   */
+  unsigned int TargetTexture() override;
+
+  /**
+   * @copydoc Dali::NativeImageInterface::PrepareTexture()
+   */
+  void PrepareTexture() override;
+
+  /**
+   * @copydoc Dali::NativeImageInterface::GetWidth()
+   */
+  unsigned int GetWidth() const override
+  {
+    return mWidth;
+  }
+
+  /**
+   * @copydoc Dali::NativeImageInterface::GetHeight()
+   */
+  unsigned int GetHeight() const override
+  {
+    return mHeight;
+  }
+
+  /**
+   * @copydoc Dali::NativeImageInterface::RequiresBlending()
+   */
+  bool RequiresBlending() const override
+  {
+    return true;
+  }
+
+  /**
+   * @copydoc Dali::NativeImageInterface::GetExtension()
+   */
+  NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
+  {
+    return this;
+  }
+
+  /**
+   * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
+   */
+  const char* GetCustomFragmentPreFix() override;
+
+  /**
+   * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
+   */
+  const char* GetCustomSamplerTypename() override;
+
+  /**
+   * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
+   */
+  int GetEglImageTextureTarget() override;
+
+private:
+
+  /**
+   * Private constructor; @see NativeImageSourceQueue::New()
+   * @param[in] width The width of the image.
+   * @param[in] height The height of the image.
+   * @param[in] colour depth of the image.
+   * @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
+   */
+  NativeImageSourceQueueX( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
+
+private:
+
+  unsigned int    mWidth;                ///< image width
+  unsigned int    mHeight;               ///< image height
+
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_X_H
index 2833f6b..cddaaa3 100644 (file)
@@ -112,6 +112,8 @@ namespace Adaptor
 
 #define DALI_ENV_DISABLE_STENCIL_BUFFER "DALI_DISABLE_STENCIL_BUFFER"
 
+#define DALI_ENV_WEB_ENGINE_NAME "DALI_WEB_ENGINE_NAME"
+
 } // namespace Adaptor
 
 } // namespace Internal
index 988462d..b727a48 100644 (file)
 // EXTERNAL INCLUDES
 #include <dlfcn.h>
 #include <dali/integration-api/debug.h>
-#include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/public-api/object/type-registry.h>
+#include <sstream>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
+#include <dali/internal/system/common/environment-variables.h>
+#include <dali/public-api/adaptor-framework/native-image-source.h>
 
 namespace Dali
 {
@@ -36,7 +41,20 @@ namespace Adaptor
 namespace // unnamed namespace
 {
 
-const char* WEB_ENGINE_PLUGIN_SO( "libdali-web-engine-plugin.so" );
+constexpr char const * const kPluginFullNamePrefix = "libdali-web-engine-";
+constexpr char const * const kPluginFullNamePostfix = "-plugin.so";
+constexpr char const * const kPluginFullNameDefault = "libdali-web-engine-plugin.so";
+
+// Note: Dali WebView policy does not allow to use multiple web engines in an application.
+// So once pluginName is set to non-empty string, it will not change.
+std::string pluginName;
+
+std::string MakePluginName( const char* environmentName )
+{
+  std::stringstream fullName;
+  fullName << kPluginFullNamePrefix << environmentName << kPluginFullNamePostfix;
+  return std::move( fullName.str() );
+}
 
 Dali::BaseHandle Create()
 {
@@ -84,16 +102,40 @@ WebEngine::~WebEngine()
   }
 }
 
+bool WebEngine::InitializePluginHandle()
+{
+  if ( pluginName.length() == 0 )
+  {
+    // pluginName is not initialized yet.
+    const char* name = EnvironmentVariable::GetEnvironmentVariable( DALI_ENV_WEB_ENGINE_NAME );
+    if ( name )
+    {
+      pluginName = MakePluginName( name );
+      mHandle = dlopen( pluginName.c_str(), RTLD_LAZY );
+      if ( mHandle )
+      {
+        return true;
+      }
+    }
+    pluginName = std::string( kPluginFullNameDefault );
+  }
+
+  mHandle = dlopen( pluginName.c_str(), RTLD_LAZY );
+  if ( !mHandle )
+  {
+    DALI_LOG_ERROR( "Can't load %s : %s\n", pluginName.c_str(), dlerror() );
+    return false;
+  }
+
+  return true;
+}
+
 bool WebEngine::Initialize()
 {
   char* error = NULL;
 
-  mHandle = dlopen( WEB_ENGINE_PLUGIN_SO, RTLD_LAZY );
-
-  error = dlerror();
-  if( mHandle == NULL || error != NULL )
+  if ( !InitializePluginHandle() )
   {
-    DALI_LOG_ERROR( "WebEngine::Initialize(), dlopen error: %s\n", error );
     return false;
   }
 
index 3cb1eb6..90616ad 100644 (file)
@@ -187,9 +187,16 @@ private:
    */
   bool Initialize();
 
+  /**
+   * @brief Initializes library handle by loading web engine plugin.
+   *
+   * @return Whether the initialization succeed or not.
+   */
+  bool InitializePluginHandle();
+
 private:
 
-  Dali::WebEnginePlugin* mPlugin; ///< WebEngine plugin handle
+  Dali::WebEnginePlugin* mPlugin; ///< WebEnginePlugin instance
   void* mHandle; ///< Handle for the loaded library
 
   typedef Dali::WebEnginePlugin* (*CreateWebEngineFunction)();
index 8322e6e..b5fe5b3 100644 (file)
@@ -21,7 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/internal/window-system/common/display-connection.h>
 #include <dali/public-api/object/base-object.h>
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 
 
 namespace Dali
index ec4f805..91a958c 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/internal/window-system/common/indicator-interface.h>
 #include <dali/internal/window-system/common/damage-observer.h>
 #include <dali/internal/window-system/common/rotation-observer.h>
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/events/key-event-integ.h>
index 04bc79b..d97ffd2 100644 (file)
 // INTERNAL INCLUDES
 #include <dali/integration-api/trigger-event-factory-interface.h>
 #include <dali/integration-api/thread-synchronization-interface.h>
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #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>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 
 
 namespace Dali
index 0dae2e9..195eda2 100755 (executable)
@@ -17,7 +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>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 
 // EXTERNAL_HEADERS
 #include <dali/integration-api/debug.h>
index 66364cc..a39f707 100644 (file)
@@ -33,8 +33,8 @@
 
 // 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/graphics/gles/egl-implementation.h>
+#include <dali/internal/graphics/gles/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>
index 9cf7d61..e605892 100644 (file)
@@ -24,7 +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>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 
 namespace Dali
 {
index 910098a..bd31ff8 100644 (file)
@@ -34,7 +34,7 @@
 #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>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 
 
 namespace Dali
index 471092f..48868cc 100644 (file)
@@ -20,7 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/egl-interface.h>
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 #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>
index 17c45ad..106b98f 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 = 48;
+const unsigned int ADAPTOR_MICRO_VERSION = 49;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 96f7a99..440b19c 100644 (file)
@@ -19,7 +19,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.3.48
+Version:    1.3.49
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT