Merge branch 'devel/master' into tizen accepted/tizen/unified/20220330.003611 submit/tizen/20220329.054434
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 29 Mar 2022 01:26:00 +0000 (10:26 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 29 Mar 2022 01:26:00 +0000 (10:26 +0900)
16 files changed:
build/tizen/CMakeLists.txt
dali/devel-api/adaptor-framework/accessibility-bridge.h
dali/devel-api/adaptor-framework/atspi-accessibility.cpp
dali/devel-api/adaptor-framework/atspi-accessibility.h
dali/internal/accessibility/bridge/bridge-impl.cpp
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/combined-update-render-controller-debug.h
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/adaptor/tizen-wayland/framework-tizen.cpp
dali/internal/graphics/gles/egl-implementation.cpp
dali/internal/imaging/common/gif-loading.cpp
dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp
dali/internal/trace/android/trace-manager-impl-android.cpp
dali/internal/trace/generic/trace-manager-impl-generic.cpp
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 7d2da30..70cea5c 100644 (file)
@@ -18,6 +18,7 @@ ENDIF()
 OPTION(ENABLE_PKG_CONFIGURE  "Use pkgconfig" ON)
 OPTION(ENABLE_LINK_TEST      "Enable the link test" ON)
 OPTION(ENABLE_ATSPI          "Enable AT-SPI accessibility" ON)
+OPTION(ENABLE_TRACE          "Enable Trace" OFF)
 
 # Include additional macros
 INCLUDE( common.cmake )
@@ -109,6 +110,10 @@ IF( NOT DALI_ELDBUS_AVAILABLE )
   SET( ENABLE_ATSPI OFF )
 ENDIF()
 
+IF( ENABLE_TRACE )
+  ADD_DEFINITIONS("-DTRACE_ENABLED")
+ENDIF()
+
 # Set up compiler flags and warnings
 IF( UNIX )
   ADD_COMPILE_OPTIONS( -Wall ${DALI_CFLAGS} )# -Wextra -Wno-unused-parameter )# -Wfloat-equal )
@@ -420,6 +425,7 @@ MESSAGE( STATUS "Using Tizen APP FW libraries:     ${ENABLE_APPFW}")
 MESSAGE( STATUS "Use pkg configure:                ${ENABLE_PKG_CONFIGURE}" )
 MESSAGE( STATUS "Enable link test:                 ${ENABLE_LINK_TEST}" )
 MESSAGE( STATUS "Enable AT-SPI:                    ${ENABLE_ATSPI}" )
+MESSAGE( STATUS "Enable Trace:                     ${ENABLE_TRACE}" )
 MESSAGE( STATUS "Tizen Platform Config supported   ${TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG}")
 MESSAGE( STATUS "Compile flags:                    ${CMAKE_CXX_FLAGS}")
 MESSAGE( STATUS "Compile flags:                    ${CMAKE_C_FLAGS}")
index a35fe31..21296d3 100644 (file)
@@ -401,6 +401,16 @@ struct DALI_ADAPTOR_API Bridge
     return mDisabledSignal;
   }
 
+  static Signal<void()>& ScreenReaderEnabledSignal()
+  {
+    return mScreenReaderEnabledSignal;
+  }
+
+  static Signal<void()>& ScreenReaderDisabledSignal()
+  {
+    return mScreenReaderDisabledSignal;
+  }
+
 protected:
   struct Data
   {
@@ -423,6 +433,8 @@ protected:
 
   inline static Signal<void()> mEnabledSignal;
   inline static Signal<void()> mDisabledSignal;
+  inline static Signal<void()> mScreenReaderEnabledSignal;
+  inline static Signal<void()> mScreenReaderDisabledSignal;
 
   /**
    * @brief Registers accessible object to be known in bridge object.
index 53a230d..1adebe7 100644 (file)
@@ -118,3 +118,8 @@ bool Dali::AtspiAccessibility::IsEnabled()
 {
   return Dali::Accessibility::IsUp();
 }
+
+bool Dali::AtspiAccessibility::IsScreenReaderEnabled()
+{
+  return Dali::Accessibility::Bridge::GetCurrentBridge()->GetScreenReaderEnabled();
+}
\ No newline at end of file
index 16f1e37..3ee0674 100644 (file)
@@ -87,6 +87,13 @@ DALI_ADAPTOR_API int GetStatus();
  */
 DALI_ADAPTOR_API bool IsEnabled();
 
+/**
+ * @brief Returns whether the state of Screen Reader is enabled or not.
+ *
+ * @return True if Screen Reader is enabled, false otherwise.
+ */
+DALI_ADAPTOR_API bool IsScreenReaderEnabled();
+
 } //namespace AtspiAccessibility
 } //namespace Dali
 
index a5bde9c..817b445 100644 (file)
@@ -585,10 +585,23 @@ public:
     });
   }
 
+  void EmitScreenReaderEnabledSignal()
+  {
+    if (mIsScreenReaderEnabled)
+    {
+      mScreenReaderEnabledSignal.Emit();
+    }
+    else
+    {
+      mScreenReaderDisabledSignal.Emit();
+    }
+  }
+
   void ListenScreenReaderEnabledProperty()
   {
     mAccessibilityStatusClient.addPropertyChangedEvent<bool>("ScreenReaderEnabled", [this](bool res) {
       mIsScreenReaderEnabled = res;
+      EmitScreenReaderEnabledSignal();
       SwitchBridge();
     });
   }
index d93886e..97a23e0 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/trace.h>
 #include <dali/public-api/object/object-registry.h>
 
 // INTERNAL INCLUDES
@@ -56,6 +57,8 @@ namespace Internal
 {
 namespace Adaptor
 {
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_APPLICATION, true);
+
 ApplicationPtr Application::gPreInitializedApplication(NULL);
 
 ApplicationPtr Application::New(
@@ -266,7 +269,9 @@ void Application::OnInit()
   }
 
   // Run the adaptor
+  DALI_TRACE_BEGIN(gTraceFilter, "DALI_APP_ADAPTOR_START");
   mAdaptor->Start();
+  DALI_TRACE_END(gTraceFilter, "DALI_APP_ADAPTOR_START");
   Accessibility::Accessible::SetObjectRegistry(mAdaptor->GetObjectRegistry());
 
   if(!mStylesheet.empty())
@@ -285,7 +290,10 @@ void Application::OnInit()
   LanguageChangedSignal().Connect(&GetImplementation(lifecycleController), &LifecycleController::OnLanguageChanged);
 
   Dali::Application application(this);
+
+  DALI_TRACE_BEGIN(gTraceFilter, "DALI_APP_EMIT_INIT_SIGNAL");
   mInitSignal.Emit(application);
+  DALI_TRACE_END(gTraceFilter, "DALI_APP_EMIT_INIT_SIGNAL");
 
   mAdaptor->NotifySceneCreated();
 }
index 2ebebb6..8a2a150 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_DEBUG_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/trace.h>
 
 namespace Dali
 {
@@ -132,6 +133,10 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_THR
 #define LOG_EVENT_TRACE_FMT(format, ...)
 #endif
 
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_COMBINED, false);
+#define TRACE_UPDATE_RENDER_BEGIN(tag) DALI_TRACE_BEGIN(gTraceFilter, tag)
+#define TRACE_UPDATE_RENDER_END(tag) DALI_TRACE_END(gTraceFilter, tag)
+
 } // unnamed namespace
 
 } // namespace Adaptor
index 356cec0..cd81f5c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -616,12 +616,14 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     Integration::UpdateStatus updateStatus;
 
     AddPerformanceMarker(PerformanceInterface::UPDATE_START);
+    TRACE_UPDATE_RENDER_BEGIN("DALI_UPDATE");
     mCore.Update(frameDelta,
                  currentTime,
                  nextFrameTime,
                  updateStatus,
                  renderToFboEnabled,
                  isRenderingToFbo);
+    TRACE_UPDATE_RENDER_END("DALI_UPDATE");
     AddPerformanceMarker(PerformanceInterface::UPDATE_END);
 
     unsigned int keepUpdatingStatus = updateStatus.KeepUpdating();
@@ -665,6 +667,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     Integration::RenderStatus renderStatus;
 
     AddPerformanceMarker(PerformanceInterface::RENDER_START);
+    TRACE_UPDATE_RENDER_BEGIN("DALI_RENDER");
 
     // Upload shared resources
     mCore.PreRender(renderStatus, mForceClear, mUploadWithoutRendering);
@@ -739,6 +742,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       SurfaceDeleted();
     }
 
+    TRACE_UPDATE_RENDER_END("DALI_RENDER");
     AddPerformanceMarker(PerformanceInterface::RENDER_END);
 
     mForceClear = false;
index 25a1b58..b4efe3d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -46,6 +46,7 @@
 #endif
 
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/trace.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/callback-manager.h>
@@ -61,6 +62,7 @@ namespace
 #if defined(DEBUG_ENABLED)
 Integration::Log::Filter* gDBusLogging = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_DBUS");
 #endif
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_FRAMEWORK, true);
 
 bool IsWidgetFeatureEnabled()
 {
@@ -834,7 +836,9 @@ void Framework::Run()
   mRunning = true;
   int ret;
 
+  DALI_TRACE_BEGIN(gTraceFilter, "DALI_APPMAIN");
   ret = mImpl->AppMain();
+  DALI_TRACE_END(gTraceFilter, "DALI_APPMAIN");
   if(ret != APP_ERROR_NONE)
   {
     DALI_LOG_ERROR("Framework::Run(), ui_app_main() is failed. err = %d\n", ret);
index b850f77..d63989f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/trace.h>
 #include <dali/public-api/common/dali-vector.h>
 #include <sstream>
 
@@ -42,6 +43,7 @@ const std::string EGL_KHR_CREATE_CONTEXT                  = "EGL_KHR_create_cont
 const std::string EGL_KHR_PARTIAL_UPDATE                  = "EGL_KHR_partial_update";
 const std::string EGL_KHR_SWAP_BUFFERS_WITH_DAMAGE        = "EGL_KHR_swap_buffers_with_damage";
 
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_EGL, true);
 } // namespace
 
 namespace Dali
@@ -385,6 +387,7 @@ void EglImplementation::SwapBuffers(EGLSurface& eglSurface)
     if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
     {
       DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffers started. eglSurface(%p)\n", eglSurface);
+      DALI_TRACE_BEGIN(gTraceFilter, "DALI_EGL_SWAP_BUFFERS");
     }
 #endif //DALI_PROFILE_UBUNTU
 
@@ -394,6 +397,7 @@ void EglImplementation::SwapBuffers(EGLSurface& eglSurface)
 #ifndef DALI_PROFILE_UBUNTU
     if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
     {
+      DALI_TRACE_END(gTraceFilter, "DALI_EGL_SWAP_BUFFERS");
       DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffers finished.\n");
       mSwapBufferCountAfterResume++;
     }
@@ -453,6 +457,7 @@ void EglImplementation::SwapBuffers(EGLSurface& eglSurface, const std::vector<Re
     if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
     {
       DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffersWithDamageKHR started. eglSurface(%p)\n", eglSurface);
+      DALI_TRACE_BEGIN(gTraceFilter, "DALI_EGL_SWAP_BUFFERS_KHR");
     }
 #endif //DALI_PROFILE_UBUNTU
 
@@ -465,6 +470,7 @@ void EglImplementation::SwapBuffers(EGLSurface& eglSurface, const std::vector<Re
 #ifndef DALI_PROFILE_UBUNTU
     if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
     {
+      DALI_TRACE_END(gTraceFilter, "DALI_EGL_SWAP_BUFFERS_KHR");
       DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffersWithDamageKHR finished.\n");
       mSwapBufferCountAfterResume++;
     }
index a142447..cfb055e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -61,6 +61,8 @@ Debug::Filter* gGifLoadingLogFilter = Debug::Filter::New(Debug::NoLogging, false
 const int        IMG_MAX_SIZE                = 65000;
 constexpr size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE = 50 * 1024 * 1024;
 
+constexpr int LOCAL_CACHED_COLOR_GENERATE_THRESHOLD = 16; ///< Generate color map optimize only if colorCount * threshold < width * height, So we don't loop if image is small
+
 #if GIFLIB_MAJOR < 5
 const int DISPOSE_BACKGROUND = 2; /* Set area too background color */
 const int DISPOSE_PREVIOUS   = 3; /* Restore to previous content */
@@ -131,6 +133,16 @@ struct GifAnimationData
   bool                    animated;
 };
 
+struct GifCachedColorData
+{
+  GifCachedColorData() = default;
+
+  // precalculated colormap table
+  std::vector<std::uint32_t> globalCachedColor{};
+  std::vector<std::uint32_t> localCachedColor{};
+  ColorMapObject*            localCachedColorMap{nullptr}; // Weak-pointer of ColorMapObject. should be nullptr if image changed
+};
+
 // Forward declaration
 struct GifAccessor;
 
@@ -187,6 +199,7 @@ struct LoaderInfo
 
   FileData                     fileData;
   GifAnimationData             animated;
+  GifCachedColorData           cachedColor;
   std::unique_ptr<GifAccessor> gifAccessor{nullptr};
   int                          imageNumber{0};
   FileInfo                     fileInfo;
@@ -617,7 +630,7 @@ FrameInfo* NewFrame(GifAnimationData& animated, int transparent, int dispose, in
  * @brief Decode a gif image into rows then expand to 32bit into the destination
  * data pointer.
  */
-bool DecodeImage(GifFileType* gif, uint32_t* data, int rowpix, int xin, int yin, int transparent, int x, int y, int w, int h, bool fill)
+bool DecodeImage(GifFileType* gif, GifCachedColorData& gifCachedColor, uint32_t* data, int rowpix, int xin, int yin, int transparent, int x, int y, int w, int h, bool fill)
 {
   int             intoffset[] = {0, 4, 2, 1};
   int             intjump[]   = {8, 8, 4, 2};
@@ -627,6 +640,9 @@ bool DecodeImage(GifFileType* gif, uint32_t* data, int rowpix, int xin, int yin,
   ColorMapObject* colorMap;
   uint32_t*       p;
 
+  // cached color data.
+  const std::uint32_t* cachedColorPtr = nullptr;
+
   // what we need is image size.
   SavedImage* sp;
   sp = &gif->SavedImages[gif->ImageCount - 1];
@@ -685,65 +701,149 @@ bool DecodeImage(GifFileType* gif, uint32_t* data, int rowpix, int xin, int yin,
   if(gif->Image.ColorMap)
   {
     colorMap = gif->Image.ColorMap;
+    // use local cached color map without re-calculate cache.
+    if(gifCachedColor.localCachedColorMap == colorMap)
+    {
+      cachedColorPtr = gifCachedColor.localCachedColor.data();
+    }
+    // else if w * h is big enough, generate local cached color.
+    else if(colorMap->ColorCount * LOCAL_CACHED_COLOR_GENERATE_THRESHOLD < w * h)
+    {
+      gifCachedColor.localCachedColor.resize(colorMap->ColorCount);
+      for(i = 0; i < colorMap->ColorCount; ++i)
+      {
+        gifCachedColor.localCachedColor[i] = PixelLookup(colorMap, i);
+      }
+      gifCachedColor.localCachedColorMap = colorMap;
+
+      cachedColorPtr = gifCachedColor.localCachedColor.data();
+    }
   }
   else
   {
-    colorMap = gif->SColorMap;
+    colorMap       = gif->SColorMap;
+    cachedColorPtr = gifCachedColor.globalCachedColor.data();
   }
 
+  // HARD-CODING optimize
   // if we need to deal with transparent pixels at all...
   if(transparent >= 0)
   {
     // if we are told to FILL (overwrite with transparency kept)
     if(fill)
     {
-      for(yy = 0; yy < h; yy++)
+      // if we use cachedColor, use it
+      if(cachedColorPtr)
       {
-        p = data + ((y + yy) * rowpix) + x;
-        for(xx = 0; xx < w; xx++)
+        for(yy = 0; yy < h; yy++)
         {
-          pix = rows[yin + yy][xin + xx];
-          if(pix != transparent)
+          p = data + ((y + yy) * rowpix) + x;
+          for(xx = 0; xx < w; xx++)
           {
-            *p = PixelLookup(colorMap, pix);
+            pix = rows[yin + yy][xin + xx];
+            if(pix != transparent)
+            {
+              *p = cachedColorPtr[pix];
+            }
+            else
+            {
+              *p = 0;
+            }
+            p++;
           }
-          else
+        }
+      }
+      // we don't have cachedColor. use PixelLookup function.
+      else
+      {
+        for(yy = 0; yy < h; yy++)
+        {
+          p = data + ((y + yy) * rowpix) + x;
+          for(xx = 0; xx < w; xx++)
           {
-            *p = 0;
+            pix = rows[yin + yy][xin + xx];
+            if(pix != transparent)
+            {
+              *p = PixelLookup(colorMap, pix);
+            }
+            else
+            {
+              *p = 0;
+            }
+            p++;
           }
-          p++;
         }
       }
     }
     // paste on top with transparent pixels untouched
     else
     {
-      for(yy = 0; yy < h; yy++)
+      // if we use cachedColor, use it
+      if(cachedColorPtr)
       {
-        p = data + ((y + yy) * rowpix) + x;
-        for(xx = 0; xx < w; xx++)
+        for(yy = 0; yy < h; yy++)
         {
-          pix = rows[yin + yy][xin + xx];
-          if(pix != transparent)
+          p = data + ((y + yy) * rowpix) + x;
+          for(xx = 0; xx < w; xx++)
           {
-            *p = PixelLookup(colorMap, pix);
+            pix = rows[yin + yy][xin + xx];
+            if(pix != transparent)
+            {
+              *p = cachedColorPtr[pix];
+            }
+            p++;
+          }
+        }
+      }
+      // we don't have cachedColor. use PixelLookup function.
+      else
+      {
+        for(yy = 0; yy < h; yy++)
+        {
+          p = data + ((y + yy) * rowpix) + x;
+          for(xx = 0; xx < w; xx++)
+          {
+            pix = rows[yin + yy][xin + xx];
+            if(pix != transparent)
+            {
+              *p = PixelLookup(colorMap, pix);
+            }
+            p++;
           }
-          p++;
         }
       }
     }
   }
   else
   {
-    // walk pixels without worring about transparency at all
-    for(yy = 0; yy < h; yy++)
+    // if we use cachedColor, use it
+    if(cachedColorPtr)
+    {
+      // walk pixels without worring about transparency at all
+      for(yy = 0; yy < h; yy++)
+      {
+        p = data + ((y + yy) * rowpix) + x;
+        for(xx = 0; xx < w; xx++)
+        {
+          pix = rows[yin + yy][xin + xx];
+          *p  = cachedColorPtr[pix];
+          p++;
+        }
+      }
+    }
+    // we don't have cachedColor. use PixelLookup function.
+    else
     {
-      p = data + ((y + yy) * rowpix) + x;
-      for(xx = 0; xx < w; xx++)
+      // walk pixels without worring about transparency at all
+      for(yy = 0; yy < h; yy++)
       {
-        pix = rows[yin + yy][xin + xx];
-        *p  = PixelLookup(colorMap, pix);
-        p++;
+        p = data + ((y + yy) * rowpix) + x;
+        for(xx = 0; xx < w; xx++)
+        {
+          pix = rows[yin + yy][xin + xx];
+          *p  = PixelLookup(colorMap, pix);
+          p++;
+        }
       }
     }
   }
@@ -769,9 +869,10 @@ bool ReadHeader(LoaderInfo&      loaderInfo,
                 ImageProperties& prop, //output struct
                 int*             error)
 {
-  GifAnimationData&     animated = loaderInfo.animated;
-  LoaderInfo::FileData& fileData = loaderInfo.fileData;
-  bool                  success  = false;
+  GifAnimationData&     animated    = loaderInfo.animated;
+  GifCachedColorData&   cachedColor = loaderInfo.cachedColor;
+  LoaderInfo::FileData& fileData    = loaderInfo.fileData;
+  bool                  success     = false;
   LoaderInfo::FileInfo  fileInfo;
   GifRecordType         rec;
 
@@ -957,6 +1058,18 @@ bool ReadHeader(LoaderInfo&      loaderInfo,
 
           animated.currentFrame = 1;
 
+          // cache global color map
+          ColorMapObject* colorMap = gifAccessor.gif->SColorMap;
+          if(colorMap)
+          {
+            cachedColor.globalCachedColor.resize(colorMap->ColorCount);
+            for(int i = 0; i < colorMap->ColorCount; ++i)
+            {
+              cachedColor.globalCachedColor[i] = PixelLookup(colorMap, i);
+            }
+          }
+          cachedColor.localCachedColorMap = nullptr;
+
           // no errors in header scan etc. so set err and return value
           *error = 0;
         }
@@ -1147,7 +1260,7 @@ bool ReadNextFrame(LoaderInfo& loaderInfo, ImageProperties& prop, //  use for w
           // now draw this frame on top
           frameInfo = &(thisFrame->info);
           ClipCoordinates(prop.w, prop.h, &xin, &yin, frameInfo->x, frameInfo->y, frameInfo->w, frameInfo->h, &x, &y, &w, &h);
-          if(!DecodeImage(loaderInfo.gifAccessor->gif, thisFrame->data, prop.w, xin, yin, frameInfo->transparent, x, y, w, h, first))
+          if(!DecodeImage(loaderInfo.gifAccessor->gif, loaderInfo.cachedColor, thisFrame->data, prop.w, xin, yin, frameInfo->transparent, x, y, w, h, first))
           {
             DALI_LOG_ERROR("LOAD_ERROR_CORRUPT_FILE\n");
             return false;
@@ -1173,7 +1286,7 @@ bool ReadNextFrame(LoaderInfo& loaderInfo, ImageProperties& prop, //  use for w
             FillFrame(reinterpret_cast<uint32_t*>(pixels), prop.w, loaderInfo.gifAccessor->gif, frameInfo, 0, 0, prop.w, prop.h);
 
             // and decode the gif with overwriting
-            if(!DecodeImage(loaderInfo.gifAccessor->gif, reinterpret_cast<uint32_t*>(pixels), prop.w, xin, yin, frameInfo->transparent, x, y, w, h, true))
+            if(!DecodeImage(loaderInfo.gifAccessor->gif, loaderInfo.cachedColor, reinterpret_cast<uint32_t*>(pixels), prop.w, xin, yin, frameInfo->transparent, x, y, w, h, true))
             {
               DALI_LOG_ERROR("LOAD_ERROR_CORRUPT_FILE\n");
               return false;
index 92c7e6c..2faa238 100644 (file)
@@ -41,6 +41,7 @@ namespace
  * In this API, widget framework create a new keyEvent, find the proper widget and send this event.
  * Finally widget framework receive feedback from widget.
  */
+#ifdef OVER_TIZEN_VERSION_7
 bool OnKeyEventCallback(const char *id, screen_connector_event_type_e eventType, int keyCode, const char *keyName, long long cls, long long subcls, const char* identifier, long long timestamp, void *userData)
 {
   Dali::Internal::Adaptor::WidgetApplicationTizen* application = static_cast<Dali::Internal::Adaptor::WidgetApplicationTizen*>(userData);
@@ -72,6 +73,7 @@ bool OnKeyEventCallback(const char *id, screen_connector_event_type_e eventType,
 
   return consumed;
 }
+#endif
 
 int OnInstanceInit(widget_base_instance_h instanceHandle, bundle* content, int w, int h, void* classData)
 {
@@ -138,7 +140,9 @@ int OnInstanceInit(widget_base_instance_h instanceHandle, bundle* content, int w
   Internal::Adaptor::GetImplementation(widgetInstance).OnCreate(encodedContentString, window);
 
   // connect keyEvent for widget
+#ifdef OVER_TIZEN_VERSION_7
   application->ConnectKeyEvent(window);
+#endif
 
   return 0;
 }
@@ -376,7 +380,9 @@ void WidgetApplicationTizen::ConnectKeyEvent(Dali::Window window)
 {
   if(!mConnectedKeyEvent)
   {
+#ifdef OVER_TIZEN_VERSION_7
     screen_connector_provider_set_key_event_cb(OnKeyEventCallback, this);
+#endif
     mConnectedKeyEvent = true;
   }
   window.KeyEventSignal().Connect(this, &WidgetApplicationTizen::OnWindowKeyEvent);
index ddad644..665a37c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -42,15 +42,18 @@ Dali::Integration::Trace::LogContextFunction TraceManagerAndroid::GetLogContextF
 
 void TraceManagerAndroid::LogContext(bool start, const char* tag)
 {
-  if(start)
+  if(traceManagerAndroid && traceManagerAndroid->mPerformanceInterface)
   {
-    unsigned short contextId = traceManagerAndroid->mPerformanceInterface->AddContext(tag);
-    traceManagerAndroid->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId);
-  }
-  else
-  {
-    unsigned short contextId = traceManagerAndroid->mPerformanceInterface->AddContext(tag);
-    traceManagerAndroid->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId);
+    if(start)
+    {
+      unsigned short contextId = traceManagerAndroid->mPerformanceInterface->AddContext(tag);
+      traceManagerAndroid->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId);
+    }
+    else
+    {
+      unsigned short contextId = traceManagerAndroid->mPerformanceInterface->AddContext(tag);
+      traceManagerAndroid->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId);
+    }
   }
 }
 
index 92ada6e..bf9c696 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -42,15 +42,18 @@ Dali::Integration::Trace::LogContextFunction TraceManagerGeneric::GetLogContextF
 
 void TraceManagerGeneric::LogContext(bool start, const char* tag)
 {
-  if(start)
+  if(traceManagerGeneric && traceManagerGeneric->mPerformanceInterface)
   {
-    unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag);
-    traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId);
-  }
-  else
-  {
-    unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag);
-    traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId);
+    if(start)
+    {
+      unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag);
+      traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId);
+    }
+    else
+    {
+      unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag);
+      traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId);
+    }
   }
 }
 
index b4d7fc9..d352b4b 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const unsigned int ADAPTOR_MAJOR_VERSION = 2;
 const unsigned int ADAPTOR_MINOR_VERSION = 1;
-const unsigned int ADAPTOR_MICRO_VERSION = 14;
+const unsigned int ADAPTOR_MICRO_VERSION = 15;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 611686d..ae72b3e 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    2.1.14
+Version:    2.1.15
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
@@ -270,7 +270,7 @@ CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
 
 CFLAGS+=" -DWAYLAND"
 CXXFLAGS+=" -DWAYLAND"
-cmake_flags=" -DENABLE_WAYLAND=ON -DENABLE_ATSPI=ON"
+cmake_flags=" -DENABLE_WAYLAND=ON -DENABLE_ATSPI=ON -DENABLE_TRACE=ON"
 
 # Use this conditional when Tizen version is 5.x or greater
 %if 0%{?tizen_version_major} >= 5
@@ -291,10 +291,6 @@ CXXFLAGS+=" -DOVER_TIZEN_VERSION_7"
 cmake_flags+=" -DCMAKE_BUILD_TYPE=Debug"
 %endif
 
-%if 0%{?enable_trace}
-cmake_flags+=" -DENABLE_TRACE=ON"
-%endif
-
 %if 0%{?enable_logging}
 cmake_flags+=" -DENABLE_NETWORK_LOGGING=ON"
 %endif