Merge branch 'devel/master' into tizen
authorWonsik Jung <sidein@samsung.com>
Mon, 22 Apr 2019 05:44:30 +0000 (14:44 +0900)
committerWonsik Jung <sidein@samsung.com>
Mon, 22 Apr 2019 05:45:57 +0000 (14:45 +0900)
21 files changed:
.travis.yml
README.md
automated-tests/coverage.sh
automated-tests/execute.sh
automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.cpp
automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h
build/tizen-cmake/.gitignore [new file with mode: 0644]
build/tizen-cmake/CMakeLists.txt
build/tizen-cmake/dali-core.pc.in
build/tizen/configure.ac
dali/devel-api/CMakeLists.txt
dali/integration-api/CMakeLists.txt
dali/integration-api/gl-abstraction.h
dali/internal/CMakeLists.txt
dali/internal/render/common/render-manager.cpp
dali/internal/render/gl-resources/context.h
dali/internal/render/renderers/render-texture.cpp
dali/public-api/dali-core-version.cpp
doc/CMakeLists.txt [new file with mode: 0644]
doc/file.list
packaging/dali.spec

index 9fcfc79..04f43d6 100644 (file)
@@ -29,7 +29,7 @@ script:
   - autoreconf --install
   - export CXXFLAGS="--coverage "
   - export LD_LIBRARY_PATH=/usr/local/lib
-  - ./configure --enable-profile=UBUNTU --enable-gles=20 --enable-debug
+  - ./configure --enable-profile=UBUNTU --enable-debug
   - make -j7
   - sudo make install
   - popd
index 98db879..b374d3a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -69,21 +69,6 @@ Then run the following commands:
          $ ./configure --prefix=$DESKTOP_PREFIX
          $ make install -j8
 
-### Build target options
-
-OpenGL ES context:
-
-When building, the OpenGL ES version of the target should be specified.
-
-Valid version options are 20, 30, 31
-
-With configure:
-Add: *--enable-gles=X*
-
-With gbs:
-Add to the gbs build line: *--define "%target_gles_version X"*
-
-
 ### Building and executing test cases
 
 See the README.md in dali-core/automated-tests.
index a4cad67..96c3740 100755 (executable)
@@ -5,7 +5,18 @@ if [ $1 == -n ] ; then
   opt_genhtml=false
 fi
 
-( cd ../build/tizen ; make cov_data )
+BUILD_DIR_NAME=tizen
+function MakeCovData()
+{
+    (  cd ../build/$BUILD_DIR_NAME ; make cov_data )
+}
+
+MakeCovData
+if [[ $? -ne 0 ]]
+then
+    BUILD_DIR_NAME=tizen-cmake
+    MakeCovData
+fi
 
 # From lcov version 1.10 onwards, branch coverage is off by default and earlier versions do not support the rc option
 LCOV_OPTS=`if [ \`printf "\\\`lcov --version | cut -d' ' -f4\\\`\n1.10\n" | sort -V | head -n 1\` = 1.10 ] ; then echo "--rc lcov_branch_coverage=1" ; fi`
@@ -30,7 +41,7 @@ done
 (
     if [ $opt_genhtml == true ] ; then
         cd .. ;
-        genhtml $LCOV_OPTS -o build/tizen/doc/coverage `find . -name dali.info`
-        echo "Coverage output: ../build/tizen/doc/coverage/index.html"
+        genhtml $LCOV_OPTS -o build/$BUILD_DIR_NAME/doc/coverage `find . -name dali.info`
+        echo "Coverage output: ../build/$BUILD_DIR_NAME/doc/coverage/index.html"
     fi
 )
index 902ba11..7703340 100755 (executable)
@@ -77,9 +77,8 @@ fi
 rm -f tct*core-tests.xml
 
 # Clean up old coverage data
-if [ -d ../build/tizen ] ; then
-    rm -f ../build/tizen/dali/.libs/*.gcda
-fi
+[ -d ../build/tizen ] && rm -f ../build/tizen/dali/.libs/*.gcda
+[ -d ../build/tizen-cmake ] && find ../build/tizen-cmake/ -name \*.gcda -exec rm {} \;
 
 find build \( -name "*.gcda" \) -exec rm '{}' \;
 
index 02439bc..8372e03 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -104,6 +104,16 @@ void TestGlAbstraction::PostRender()
 {
 }
 
+bool TestGlAbstraction::IsSurfacelessContextSupported() const
+{
+  return true;
+}
+
+bool TestGlAbstraction::TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const
+{
+  return ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
+}
+
 } // Namespace dali
 
 bool BlendEnabled(const Dali::TraceCallStack& callStack)
index c68573b..6572dbc 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_GL_ABSTRACTION_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -59,6 +59,10 @@ public:
   void PreRender();
   void PostRender();
 
+  bool IsSurfacelessContextSupported() const;
+
+  bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const;
+
   /* OpenGL ES 2.0 */
 
   inline void ActiveTexture( GLenum textureUnit )
diff --git a/build/tizen-cmake/.gitignore b/build/tizen-cmake/.gitignore
new file mode 100644 (file)
index 0000000..5df5866
--- /dev/null
@@ -0,0 +1 @@
+/doc
index baf23b0..988cf61 100644 (file)
@@ -21,16 +21,21 @@ OPTION(ENABLE_DEBUG          "Enable Debug" OFF)
 OPTION(ENABLE_BACKTRACE      "Enable Backtrace" OFF)
 OPTION(ENABLE_LOCK_BACKTRACE "Enable" OFF)
 OPTION(ENABLE_COVERAGE       "Coverage" OFF)
-SET(GLES_VERSION 20 CACHE INTEGER "Gles Version")
 
 # Set up compiler definitions
 
+IF(CMAKE_BUILD_TYPE MATCHES Debug)
+  MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Debug )
+  SET(ENABLE_DEBUG ON)
+ELSE()
+  MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Release )
+ENDIF()
+
 ADD_DEFINITIONS(-DPLATFORM_TIZEN -DDALI_COMPILATION)
-ADD_DEFINITIONS(-DDALI_GLES_VERSION=${GLES_VERSION})
 ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS)
 
 IF("${ARCH}" STREQUAL "arm")
-    ADD_DEFINITIONS("-DTARGET")
+  ADD_DEFINITIONS("-DTARGET")
 ENDIF("${ARCH}" STREQUAL "arm")
 
 IF( NOT ${ENABLE_EXPORTALL} AND NOT ${ENABLE_DEBUG} )
@@ -56,33 +61,34 @@ SET( EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
 # from root/build/tizen, get back to root
 SET(ROOT_SRC_DIR ${CMAKE_SOURCE_DIR}/../..)
 
-# Requires the following variables to be setup
-# @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIBDIR@ @DEV_INCLUDE_PATH@
-SET(INCLUDE_DIR $ENV{includedir})
-SET(DEV_INCLUDE_PATH ${INCLUDE_DIR})
-SET(LIB_DIR $ENV{libdir})
-CONFIGURE_FILE( dali-core.pc.in dali-core.pc )
-
-MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
-if(CMAKE_BUILD_TYPE MATCHES Debug)
-    MESSAGE("Setting variable: DEBUG_ENABLED")
-    SET(DEBUG_ENABLED "1")
+# Set up the include dir
+SET( INCLUDE_DIR $ENV{includedir} )
+IF( NOT INCLUDE_DIR )
+  SET( INCLUDE_DIR ${PREFIX}/include )
 ENDIF()
 
+# Set up the lib dir
+SET( LIB_DIR $ENV{libdir} )
+IF( NOT LIB_DIR )
+  SET( LIB_DIR ${PREFIX}/lib )
+ENDIF()
+
+# Configure the pkg-config file
+# Requires the following variables to be setup:
+# @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIB_DIR@ @DEV_INCLUDE_PATH@
+SET( DEV_INCLUDE_PATH ${INCLUDE_DIR} )
+SET( CORE_PKG_CFG_FILE dali-core.pc )
+CONFIGURE_FILE( ${CORE_PKG_CFG_FILE}.in ${CORE_PKG_CFG_FILE} @ONLY )
+
 # Set up compiler flags and warnings
 #ADD_COMPILE_OPTIONS( -std=c++11 -ggdb )
 ADD_COMPILE_OPTIONS( -std=c++11 -gdwarf-4 )
 ADD_COMPILE_OPTIONS( -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast )
 ADD_COMPILE_OPTIONS( -Werror -Wall -Wextra -Wno-unused-parameter -Wfloat-equal )
 
-IF( ENABLE_DEBUG )
-  ADD_COMPILE_OPTIONS( -O0 )
-ELSE( ENABLE_DEBUG )
-  ADD_COMPILE_OPTIONS( -Os )
-ENDIF( ENABLE_DEBUG )
-
-IF( ENABLE_COVERAGE OR CXXFLAGS MATCHES --coverage)
+IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
   ADD_COMPILE_OPTIONS( --coverage )
+  SET(ENABLE_COVERAGE ON)
   SET(COVERAGE --coverage)
 ENDIF()
 
@@ -91,6 +97,7 @@ INCLUDE_DIRECTORIES(
 )
 
 SET(SOURCE_DIR "${ROOT_SRC_DIR}/dali")
+SET(PACKAGE_DOXY_SRC_DIR "${ROOT_SRC_DIR}/doc")
 
 SET(SOURCES "")
 
@@ -100,6 +107,7 @@ ADD_SUBDIRECTORY( ${SOURCE_DIR}/internal dali/internal )
 ADD_SUBDIRECTORY( ${SOURCE_DIR}/integration-api dali/integration-api )
 ADD_SUBDIRECTORY( ${SOURCE_DIR}/public-api dali/public-api )
 ADD_SUBDIRECTORY( ${SOURCE_DIR}/devel-api dali/devel-api )
+ADD_SUBDIRECTORY( ${PACKAGE_DOXY_SRC_DIR} doc )
 
 ADD_LIBRARY( ${name} SHARED ${SOURCES} )
 
@@ -116,7 +124,10 @@ SET_TARGET_PROPERTIES( ${name}
 )
 
 # Install the library so file and symlinks
-INSTALL( TARGETS ${name} DESTINATION ${PREFIX}/lib )
+INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} )
+
+# Install the pkg-config file
+INSTALL( FILES ${CMAKE_BINARY_DIR}/${CORE_PKG_CFG_FILE} DESTINATION ${LIB_DIR}/pkgconfig )
 
 # macro for installing headers by replacing prefix. (TODO, investigate
 # if there is a CMAKE way of doing this automatically)
@@ -125,7 +136,7 @@ MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST STRIP_PREFIX REPLACE_PREFIX)
   FOREACH(HEADER ${${HEADER_LIST}})
     STRING(REGEX MATCH "(.*)[/]" DIR ${HEADER})
     STRING(REPLACE ${SPREFIX} ${REPLACE_PREFIX} NEWDIR ${DIR})
-    INSTALL(FILES ${HEADER} DESTINATION ${PREFIX}/include/${NEWDIR})
+    INSTALL(FILES ${HEADER} DESTINATION ${INCLUDE_DIR}/${NEWDIR})
   ENDFOREACH(HEADER)
 ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
 
@@ -133,6 +144,7 @@ ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
 INSTALL_HEADERS_WITH_DIRECTORY(PUBLIC_API_HEADERS ${SOURCE_DIR} "dali")
 INSTALL_HEADERS_WITH_DIRECTORY(DEVEL_API_HEADERS ${SOURCE_DIR} "dali")
 INSTALL_HEADERS_WITH_DIRECTORY(INTEGRATION_API_HEADERS ${SOURCE_DIR} "dali")
+INSTALL_HEADERS_WITH_DIRECTORY(PACKAGE_DOXY_HEADERS ${PACKAGE_DOXY_SRC_DIR} "dali/doc" )
 
 IF(UNIX)
   # Define custom rules for coverage
@@ -191,7 +203,11 @@ ENDIF(UNIX)
 
 MESSAGE( STATUS "Configuration:\n" )
 MESSAGE( STATUS "Prefix:                " ${PREFIX} )
+MESSAGE( STATUS "Lib Dir:               " ${LIB_DIR} )
+MESSAGE( STATUS "Include Dir:           " ${INCLUDE_DIR} )
 MESSAGE( STATUS "Debug build:           " ${ENABLE_DEBUG} )
 MESSAGE( STATUS "Backtrace:             " ${ENABLE_BACKTRACE} )
 MESSAGE( STATUS "Scoped Lock backtrace: " ${ENABLE_LOCK_BACKTRACE} )
 MESSAGE( STATUS "Coverage:              " ${ENABLE_COVERAGE} )
+MESSAGE( STATUS "CXXFLAGS:              " ${CMAKE_CXX_FLAGS} )
+MESSAGE( STATUS "LDFLAGS:               " ${CMAKE_SHARED_LINKER_FLAGS_INIT}${CMAKE_SHARED_LINKER_FLAGS} )
index b6ff02d..7bbcbfc 100644 (file)
@@ -1,7 +1,7 @@
 prefix=@PREFIX@
 exec_prefix=@EXEC_PREFIX@
 apiversion=@DALI_VERSION@
-libdir=@LIBDIR@
+libdir=@LIB_DIR@
 includedir=@DEV_INCLUDE_PATH@
 
 Name: DALi 3D Engine
index 75b5615..4082251 100644 (file)
@@ -57,12 +57,6 @@ AC_ARG_ENABLE([lock_backtrace],
               [enable_lock_backtrace=$enableval],
               [enable_lock_backtrace=no])
 
-AC_ARG_ENABLE([gles],
-              [AC_HELP_STRING([--enable-gles],
-                              [Specify the OpenGL ES version for backwards compatibility])],
-              [enable_gles=$enableval],
-              [enable_gles=30])
-
 AC_ARG_ENABLE([cxx03_abi],
               [AC_HELP_STRING([--enable-cxx03-abi],
                               [Specify abi for the build])],
@@ -82,8 +76,6 @@ if test "x$enable_cxx03_abi" = "xyes"; then
   DALI_CFLAGS="$DALI_CFLAGS -D_GLIBCXX_USE_CXX11_ABI=0"
 fi
 
-DALI_CFLAGS="$DALI_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
-
 if test "x$enable_debug" = "xyes"; then
   DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
 fi
@@ -152,7 +144,6 @@ Configuration
   Data Dir (Read Only):             $dataReadOnlyDir
   Backtrace:                        $enable_backtrace
   ScopedLock Backtrace:             $enable_lock_backtrace
-  OpenGL ES version:                $enable_gles
   C++03 ABI:                        $enable_cxx03_abi
   Rename so file:                   $enable_rename_so
 "
index 5572eeb..0aca8ad 100644 (file)
@@ -8,6 +8,7 @@ SET( SOURCES ${SOURCES}
   ${CMAKE_CURRENT_SOURCE_DIR}/common/hash.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/common/stage-devel.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/events/hit-test-algorithm.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-data-devel.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/images/distance-field.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/images/texture-set-image.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/images/nine-patch-image.cpp
@@ -33,6 +34,7 @@ SET( DEVEL_API_HEADERS
   ${CMAKE_CURRENT_SOURCE_DIR}/animation/path-constrainer.h
   ${CMAKE_CURRENT_SOURCE_DIR}/animation/animation-devel.h
 
+  ${CMAKE_CURRENT_SOURCE_DIR}/common/bitwise-enum.h
   ${CMAKE_CURRENT_SOURCE_DIR}/common/circular-queue.h
   ${CMAKE_CURRENT_SOURCE_DIR}/common/hash.h
   ${CMAKE_CURRENT_SOURCE_DIR}/common/map-wrapper.h
@@ -42,6 +44,7 @@ SET( DEVEL_API_HEADERS
   ${CMAKE_CURRENT_SOURCE_DIR}/common/stage-devel.h
 
   ${CMAKE_CURRENT_SOURCE_DIR}/events/hit-test-algorithm.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-data-devel.h
 
   ${CMAKE_CURRENT_SOURCE_DIR}/images/distance-field.h
   ${CMAKE_CURRENT_SOURCE_DIR}/images/native-image-interface-extension.h
index a856c3b..7b8e613 100644 (file)
@@ -4,6 +4,7 @@ SET(SOURCES ${SOURCES}
   ${CMAKE_CURRENT_SOURCE_DIR}/bitmap.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/core.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/debug.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/trace.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/profiling.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/input-options.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/lockless-buffer.cpp
@@ -29,6 +30,7 @@ SET(INTEGRATION_API_HEADERS
   ${CMAKE_CURRENT_SOURCE_DIR}/core-enumerations.h
   ${CMAKE_CURRENT_SOURCE_DIR}/context-notifier.h
   ${CMAKE_CURRENT_SOURCE_DIR}/debug.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/trace.h
   ${CMAKE_CURRENT_SOURCE_DIR}/profiling.h
   ${CMAKE_CURRENT_SOURCE_DIR}/input-options.h
   ${CMAKE_CURRENT_SOURCE_DIR}/bitmap.h
@@ -40,10 +42,11 @@ SET(INTEGRATION_API_HEADERS
   ${CMAKE_CURRENT_SOURCE_DIR}/gesture-manager.h
   ${CMAKE_CURRENT_SOURCE_DIR}/render-controller.h
   ${CMAKE_CURRENT_SOURCE_DIR}/platform-abstraction.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/processor-interface.h
   ${CMAKE_CURRENT_SOURCE_DIR}/lockless-buffer.h
   ${CMAKE_CURRENT_SOURCE_DIR}/render-task-list-integ.h
   ${CMAKE_CURRENT_SOURCE_DIR}/scene.h
-
+  ${CMAKE_CURRENT_SOURCE_DIR}/render-surface.h
   ${CMAKE_CURRENT_SOURCE_DIR}/events/event.h
   ${CMAKE_CURRENT_SOURCE_DIR}/events/gesture-event.h
   ${CMAKE_CURRENT_SOURCE_DIR}/events/gesture-requests.h
index a5d81f3..98df443 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTEGRATION_GL_ABSTRACTION_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -116,6 +116,21 @@ public:
   virtual void PostRender() = 0;
 
   /**
+   * Returns current gles can support surfaceless context
+   * @Return true current gles support surfaceless context
+   */
+  virtual bool IsSurfacelessContextSupported() const = 0;
+
+  /**
+   * Determine whether to convert pixel format or not.
+   * @param[in] imageGlFormat GLformat of input image.
+   * @param[in] textureGlFormat GLformat of Texture.
+   * @param[in] isSubImage Boolian value for the whether the image is subimage or not
+   * @return Whether the texture will be convert or not.
+   */
+  virtual bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const = 0;
+
+  /**
    * The number of texture units an implementation supports is implementation dependent, but must be at least 8.
    */
   static const unsigned int MIN_TEXTURE_UNIT_LIMIT = 8;
index 47d1722..17ce42a 100644 (file)
@@ -127,12 +127,15 @@ SET(SOURCES ${SOURCES}
   ${CMAKE_CURRENT_SOURCE_DIR}/update/gestures/pan-gesture-profiling.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/gestures/scene-graph-pan-gesture.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/queue/update-message-queue.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/frame-callback-processor.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/render-instruction-processor.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/render-task-processor.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/scene-graph-frame-callback.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/transform-manager.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/update-algorithms.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/update-manager.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/update-manager-debug.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/update-proxy-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/render-tasks/scene-graph-camera.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/nodes/node.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/nodes/node-messages.cpp
index a69d02f..d0bdd0d 100644 (file)
@@ -561,16 +561,17 @@ void RenderManager::DoRender( RenderInstruction& instruction )
   {
     surfaceFrameBuffer = static_cast<Render::SurfaceFrameBuffer*>( instruction.mFrameBuffer );
 
-#if DALI_GLES_VERSION >= 30
-    Context* surfaceContext = surfaceFrameBuffer->GetContext();
-    if ( mImpl->currentContext != surfaceContext )
+    if ( mImpl->currentContext->IsSurfacelessContextSupported() )
     {
-      // Switch the correct context if rendering to a surface
-      mImpl->currentContext = surfaceContext;
-      // Clear the current cached program when the context is switched
-      mImpl->programController.ClearCurrentProgram();
+      Context* surfaceContext = surfaceFrameBuffer->GetContext();
+      if ( mImpl->currentContext != surfaceContext )
+      {
+        // Switch the correct context if rendering to a surface
+        mImpl->currentContext = surfaceContext;
+        // Clear the current cached program when the context is switched
+        mImpl->programController.ClearCurrentProgram();
+      }
     }
-#endif
 
     surfaceRect = Rect<int32_t>( 0, 0, static_cast<int32_t>( surfaceFrameBuffer->GetWidth() ), static_cast<int32_t>( surfaceFrameBuffer->GetHeight() ) );
     backgroundColor = surfaceFrameBuffer->GetBackgroundColor();
@@ -586,16 +587,23 @@ void RenderManager::DoRender( RenderInstruction& instruction )
   {
     instruction.mFrameBuffer->Bind( *mImpl->currentContext );
   }
+  else
+  {
+    mImpl->currentContext->BindFramebuffer( GL_FRAMEBUFFER, 0u );
+  }
 
-  mImpl->currentContext->Viewport( surfaceRect.x,
-                            surfaceRect.y,
-                            surfaceRect.width,
-                            surfaceRect.height );
-
-  mImpl->currentContext->ClearColor( backgroundColor.r,
-                              backgroundColor.g,
-                              backgroundColor.b,
-                              backgroundColor.a );
+  if ( surfaceFrameBuffer )
+  {
+    mImpl->currentContext->Viewport( surfaceRect.x,
+                              surfaceRect.y,
+                              surfaceRect.width,
+                              surfaceRect.height );
+
+    mImpl->currentContext->ClearColor( backgroundColor.r,
+                                backgroundColor.g,
+                                backgroundColor.b,
+                                backgroundColor.a );
+  }
 
   // Clear the entire color, depth and stencil buffers for the default framebuffer, if required.
   // It is important to clear all 3 buffers when they are being used, for performance on deferred renderers
index 81561ba..a9ad4a2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_CONTEXT_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -130,6 +130,22 @@ public:
    ****************************************************************************************/
 
   /**
+   * Wrapper for IsSurfacelessContextSupported of Dali::Integration::GlAbstraction
+   */
+  bool IsSurfacelessContextSupported() const
+  {
+    return mGlAbstraction.IsSurfacelessContextSupported();
+  }
+
+  /**
+   * Wrapper for TextureRequiresConverting of Dali::Integration::GlAbstraction
+   */
+  bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const
+  {
+    return mGlAbstraction.TextureRequiresConverting( imageGlFormat, textureGlFormat, isSubImage );
+  }
+
+  /**
    * Wrapper for OpenGL ES 2.0 glActiveTexture()
    */
   void ActiveTexture( TextureUnit textureUnit )
@@ -1635,7 +1651,11 @@ public:
   {
     // check if its same as already set
     Rect<int> newViewport( x, y, width, height );
-    if( mViewPort != newViewport )
+
+    // Temporarily disable the viewport caching, as the implementation of GLES driver in Tizen platform
+    // share a global viewport between multiple contexts, therefore glViewport has to be called every
+    // time after glBindFramebuffer regardless of the same vewport size in the same context.
+//    if( mViewPort != newViewport )
     {
       // set new one
       LOG_GL("Viewport %d %d %d %d\n", x, y, width, height);
index 99fca0d..d26f00d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -767,7 +767,7 @@ void Texture::Upload( Context& context, PixelDataPtr pixelData, const Internal::
   uint8_t* buffer( pixelData->GetBuffer() );
 
   //This buffer is only used if manually converting from RGB to RGBA
-  uint8_t* tempBuffer(0);
+  std::vector< uint8_t > tempBuffer;
 
   //Retrieves the pixel data element type, the gl format and gl internal format of the data contained in the PixelData object.
   GLenum glFormat;
@@ -784,16 +784,10 @@ void Texture::Upload( Context& context, PixelDataPtr pixelData, const Internal::
                             ( params.width  != ( mWidth  / ( 1 << params.mipmap ) ) ) ||
                             ( params.height != ( mHeight / ( 1 << params.mipmap ) ) ) );
 
-  bool convert = ( ( glFormat == GL_RGB ) && ( mGlFormat == GL_RGBA ) );
-#if DALI_GLES_VERSION >= 30
-  // Don't convert manually from RGB to RGBA if GLES >= 3.0 and a sub-image is uploaded.
-  convert = convert && !isSubImage;
-#endif
-
-  if( convert )
+  if( context.TextureRequiresConverting( glFormat, mGlFormat, isSubImage ) )
   {
     uint32_t dataSize = static_cast< uint32_t >( params.width ) * params.height;
-    tempBuffer = new uint8_t[dataSize*4u];
+    tempBuffer.reserve( dataSize * 4u );
     for( uint32_t i = 0u; i < dataSize; ++i )
     {
       tempBuffer[i*4u]   = buffer[i*3u];
@@ -802,7 +796,7 @@ void Texture::Upload( Context& context, PixelDataPtr pixelData, const Internal::
       tempBuffer[i*4u+3] = 0xFF;
     }
 
-    buffer = tempBuffer;
+    buffer = &tempBuffer[0];
     glFormat = mGlFormat; // Set the glFormat to GL_RGBA
   }
 
@@ -845,10 +839,6 @@ void Texture::Upload( Context& context, PixelDataPtr pixelData, const Internal::
                                        glFormat, static_cast<GLsizei>( pixelData->GetBufferSize() ), buffer );
     }
   }
-
-
-  //Destroy temp buffer used for conversion RGB->RGBA
-  delete[] tempBuffer;
 }
 
 bool Texture::Bind( Context& context, uint32_t textureUnit, Render::Sampler* sampler )
@@ -914,14 +904,10 @@ void Texture::ApplySampler( Context& context, Render::Sampler* sampler )
       }
     }
 
-#if DALI_GLES_VERSION >= 30
-    //In GLES 3.0 we do not need to upload all of the mipmap levels, but GL_TEXTURE_MAX_LEVEL must be set
     if(mMaxMipMapLevel)
     {
       context.TexParameteri( mTarget, GL_TEXTURE_MAX_LEVEL, mMaxMipMapLevel );
     }
-#endif
-
   }
 }
 
index 583eb46..76e8cb2 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const uint32_t CORE_MAJOR_VERSION = 1;
 const uint32_t CORE_MINOR_VERSION = 4;
-const uint32_t CORE_MICRO_VERSION = 14;
+const uint32_t CORE_MICRO_VERSION = 16;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a3c79d5
--- /dev/null
@@ -0,0 +1,6 @@
+#
+# Add package doxy headers here
+#
+SET(PACKAGE_DOXY_HEADERS
+  ${CMAKE_CURRENT_SOURCE_DIR}/dali-core-doc.h
+  PARENT_SCOPE )
index b0fc9e5..e633229 100644 (file)
@@ -1,2 +1,5 @@
+#
+# Add package doxy headers here
+#
 package_doxy_files = \
   $(package_doxy_dir)/dali-core-doc.h
index ffa4e93..244a9d5 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali
 Summary:    DALi 3D Engine
-Version:    1.4.14
+Version:    1.4.16
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
@@ -124,9 +124,6 @@ DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
 export DALI_DATA_RW_DIR
 export DALI_DATA_RO_DIR
 
-# Default to GLES 2.0 if not specified.
-%{!?target_gles_version: %define target_gles_version 20}
-
 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS;
 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS;
 LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
@@ -145,7 +142,6 @@ LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
       --localstatedir=%{_localstatedir} \
       --sharedstatedir=%{_sharedstatedir} \
       --mandir=%{_mandir} \
-      --enable-gles=%{target_gles_version} \
 %if 0%{?enable_debug}
       --enable-debug \
 %endif
@@ -184,7 +180,6 @@ make clean
       --sharedstatedir=%{_sharedstatedir} \
       --mandir=%{_mandir} \
       --enable-cxx03-abi=yes  \
-      --enable-gles=%{target_gles_version} \
 %if 0%{?enable_debug}
       --enable-debug \
 %endif