Merge branch 'devel/master' into tizen
authorDaekwang Ryu <dkdk.ryu@samsung.com>
Tue, 20 Dec 2022 02:04:12 +0000 (11:04 +0900)
committerDaekwang Ryu <dkdk.ryu@samsung.com>
Tue, 20 Dec 2022 02:04:12 +0000 (11:04 +0900)
Change-Id: I58c187eab0eee253b1014b9f996dc91328348f08

55 files changed:
automated-tests/src/dali-adaptor/dali-test-suite-utils/adaptor-environment-variable.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-abstraction.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.h
automated-tests/src/dali-adaptor/utc-Dali-Application.cpp
automated-tests/src/dali-adaptor/utc-Dali-Timer.cpp
automated-tests/src/dali-adaptor/utc-Dali-TtsPlayer.cpp
automated-tests/src/dali-adaptor/utc-Dali-WidgetApplication.cpp
automated-tests/src/dali-graphics/CMakeLists.txt
automated-tests/src/dali-graphics/utc-Dali-GlesImplementation.cpp [new file with mode: 0644]
dali/integration-api/adaptor-framework/scene-holder-impl.cpp
dali/integration-api/adaptor-framework/scene-holder-impl.h
dali/internal/accessibility/bridge/accessibility-common.h
dali/internal/accessibility/bridge/bridge-collection.cpp
dali/internal/accessibility/bridge/bridge-impl.cpp
dali/internal/accessibility/bridge/dbus/dbus.h
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/combined-update-render-controller-debug.h
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/graphics/common/graphics-interface.h
dali/internal/graphics/gles-impl/egl-graphics-controller.cpp
dali/internal/graphics/gles-impl/egl-graphics-controller.h
dali/internal/graphics/gles-impl/gles-context.cpp
dali/internal/graphics/gles-impl/gles-graphics-command-buffer.cpp
dali/internal/graphics/gles-impl/gles-graphics-command-buffer.h
dali/internal/graphics/gles-impl/gles-graphics-reflection.cpp
dali/internal/graphics/gles-impl/gles-graphics-reflection.h
dali/internal/graphics/gles-impl/gles-graphics-types.h
dali/internal/graphics/gles/egl-graphics.cpp
dali/internal/graphics/gles/egl-graphics.h
dali/internal/graphics/gles/egl-implementation.cpp
dali/internal/graphics/gles/gl-proxy-implementation.cpp
dali/internal/imaging/common/loader-png.cpp
dali/internal/imaging/common/pixel-buffer-impl.cpp
dali/internal/imaging/common/pixel-buffer-impl.h
dali/internal/network/common/network-performance-server.cpp
dali/internal/system/android/logging-android.cpp
dali/internal/system/common/environment-options.cpp
dali/internal/system/common/environment-options.h
dali/internal/system/common/environment-variables.h
dali/internal/system/common/object-profiler.cpp
dali/internal/system/common/performance-server.cpp
dali/internal/system/common/system-trace.cpp
dali/internal/system/tizen-wayland/logging-tizen.cpp
dali/internal/system/ubuntu-x11/logging-x.cpp
dali/internal/system/windows/logging-win.cpp
dali/internal/trace/tizen/trace-manager-impl-tizen.cpp
dali/internal/window-system/common/gl-window-impl.cpp
dali/internal/window-system/common/gl-window-impl.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 873b7b3..e4c6078 100644 (file)
@@ -117,13 +117,16 @@ void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, st
   {
     switch(level)
     {
-      case Dali::Integration::Log::DebugInfo:
+      case Dali::Integration::Log::DEBUG:
+        fprintf(stderr, "DEBUG: %s", message.c_str());
+        break;
+      case Dali::Integration::Log::INFO:
         fprintf(stderr, "INFO: %s", message.c_str());
         break;
-      case Dali::Integration::Log::DebugWarning:
+      case Dali::Integration::Log::WARNING:
         fprintf(stderr, "WARN: %s", message.c_str());
         break;
-      case Dali::Integration::Log::DebugError:
+      case Dali::Integration::Log::ERROR:
         fprintf(stderr, "ERROR: %s", message.c_str());
         break;
       default:
index 5e5fde3..7ba7834 100644 (file)
@@ -885,6 +885,9 @@ public:
       case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
         *params = 100;
         break;
+      case GL_ACTIVE_ATTRIBUTES:
+        *params = static_cast<GLint>(mAttribLocs.size());
+        break;
     }
   }
 
index 0c6996e..0ad4763 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.
@@ -120,13 +120,16 @@ void TestGraphicsApplication::LogMessage(Dali::Integration::Log::DebugPriority l
   {
     switch(level)
     {
-      case Dali::Integration::Log::DebugInfo:
+      case Dali::Integration::Log::DEBUG:
+        fprintf(stderr, "DEBUG: %s", message.c_str());
+        break;
+      case Dali::Integration::Log::INFO:
         fprintf(stderr, "INFO: %s", message.c_str());
         break;
-      case Dali::Integration::Log::DebugWarning:
+      case Dali::Integration::Log::WARNING:
         fprintf(stderr, "WARN: %s", message.c_str());
         break;
-      case Dali::Integration::Log::DebugError:
+      case Dali::Integration::Log::ERROR:
         fprintf(stderr, "ERROR: %s", message.c_str());
         break;
       default:
index a1f8a2e..66c9f7a 100644 (file)
@@ -195,6 +195,14 @@ public:
     return 320;
   }
 
+  void FrameStart() override
+  {
+  }
+
+  void LogMemoryPools() override
+  {
+  }
+
   /**
    * Store cached configurations
    */
index d2ec99d..a760954 100644 (file)
@@ -151,6 +151,36 @@ int UtcDaliApplicationNew05(void)
   END_TEST;
 }
 
+int UtcDaliApplicationNew06P(void)
+{
+  int         argc(1);
+  const char* argList[1] = {"program"};
+  char**      argv       = const_cast<char**>(argList);
+
+  Application application = Application::New(&argc, &argv, "stylesheet", Application::WINDOW_MODE::OPAQUE, PositionSize(), true);
+
+  MyTestApp testApp(application);
+
+  DALI_TEST_CHECK(application);
+
+  END_TEST;
+}
+
+int UtcDaliApplicationNew07P(void)
+{
+  int         argc(1);
+  const char* argList[1] = {"program"};
+  char**      argv       = const_cast<char**>(argList);
+
+  Application application = Application::New(&argc, &argv, "stylesheet", Application::WINDOW_MODE::OPAQUE, PositionSize());
+
+  MyTestApp testApp(application);
+
+  DALI_TEST_CHECK(application);
+
+  END_TEST;
+}
+
 int UtcDaliApplicationCopyAndAssignment(void)
 {
   Application application = Application::New();
index 7d467e9..90e3a9e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 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.
@@ -479,3 +479,35 @@ int UtcDaliTimerDownCastN(void)
 
   END_TEST;
 }
+
+int UtcDaliTimerPauseN(void)
+{
+  Timer timer;
+
+  try
+  {
+    timer.Pause();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+  END_TEST;
+}
+
+int UtcDaliTimerResumeN(void)
+{
+  Timer timer;
+
+  try
+  {
+    timer.Resume();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+  END_TEST;
+}
index 4b0305a..e0b3fd3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 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.
@@ -50,6 +50,15 @@ int UtcDaliTtsPlayerCopyConstructorP(void)
   END_TEST;
 }
 
+int UtcDaliTtsPlayerMoveConstructorP(void)
+{
+  Dali::TtsPlayer player;
+  Dali::TtsPlayer copy(std::move(player));
+  DALI_TEST_CHECK(player == copy);
+
+  END_TEST;
+}
+
 int UtcDaliTtsPlayerAssignmentOperatorP(void)
 {
   Dali::TtsPlayer player;
@@ -61,6 +70,17 @@ int UtcDaliTtsPlayerAssignmentOperatorP(void)
   END_TEST;
 }
 
+int UtcDaliTtsPlayerMoveAssignmentOperatorP(void)
+{
+  Dali::TtsPlayer player;
+  Dali::TtsPlayer copy;
+  DALI_TEST_CHECK(!copy);
+  copy = std::move(player);
+  DALI_TEST_CHECK(copy == player);
+
+  END_TEST;
+}
+
 int UtcDaliTtsPlayerDestructorP(void)
 {
   Dali::TtsPlayer* player = new Dali::TtsPlayer();
@@ -171,3 +191,20 @@ int UtcDaliTtsPlayerGetStateN(void)
 
   END_TEST;
 }
+
+int UtcDaliTtsPlayerStateChangedSignalN(void)
+{
+  Dali::TtsPlayer player = Dali::TtsPlayer::Get();
+
+  try
+  {
+    player.StateChangedSignal();
+    DALI_TEST_CHECK(false); // Should not reach here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+
+  END_TEST;
+}
\ No newline at end of file
index 719053d..8bad226 100644 (file)
@@ -78,3 +78,11 @@ int UtcDaliWidgetApplicationConstructorsPositive(void)
 
   END_TEST;
 }
+
+int UtcDaliWidgetApplicationNewP(void)
+{
+  WidgetApplication widget1 = WidgetApplication::New(nullptr, nullptr, std::string());
+  DALI_TEST_CHECK(widget1);
+
+  END_TEST;
+}
index 8a6364e..c41f368 100644 (file)
@@ -5,6 +5,7 @@ SET(RPM_NAME "core-${PKG_NAME}-tests")
 
 SET(CAPI_LIB "dali-graphics")
 SET(TC_SOURCES
+    utc-Dali-GlesImplementation.cpp
     utc-Dali-GraphicsFramebuffer.cpp
     utc-Dali-GraphicsGeometry.cpp
     utc-Dali-GraphicsNativeImage.cpp
@@ -42,6 +43,7 @@ LIST(APPEND TC_SOURCES
 PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
     dali2-core
     dali2-adaptor
+    glesv2
     ecore
     ecore-x
 )
diff --git a/automated-tests/src/dali-graphics/utc-Dali-GlesImplementation.cpp b/automated-tests/src/dali-graphics/utc-Dali-GlesImplementation.cpp
new file mode 100644 (file)
index 0000000..56b4f6d
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * 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.
+ *
+ */
+
+#include <dali-test-suite-utils.h>
+
+#include <dali/internal/graphics/gles/gles2-implementation.h>
+#include <dali/internal/graphics/gles/gles3-implementation.h>
+
+void gles_implementation_startup(void)
+{
+}
+
+void gles_implementation_cleanup(void)
+{
+}
+
+using namespace Dali::Internal::Adaptor;
+
+namespace
+{
+void CallAllMethods(GlesAbstraction& implementation)
+{
+  // These tests are purely for coverage, they don't really test anything!
+  try
+  {
+    implementation.ReadBuffer(0);
+    implementation.DrawRangeElements(0, 0, 0, 0, 0, nullptr);
+    implementation.TexImage3D(0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr);
+    implementation.TexSubImage3D(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr);
+    implementation.CopyTexSubImage3D(0, 0, 0, 0, 0, 0, 0, 0, 0);
+    implementation.CompressedTexImage3D(0, 0, 0, 0, 0, 0, 0, 0, nullptr);
+    implementation.CompressedTexSubImage3D(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr);
+    implementation.GenQueries(0, nullptr);
+    implementation.DeleteQueries(0, nullptr);
+    implementation.IsQuery(0);
+    implementation.BeginQuery(0, 0);
+    implementation.EndQuery(0);
+    implementation.GetQueryiv(0, 0, nullptr);
+    implementation.GetQueryObjectuiv(0, 0, nullptr);
+    implementation.UnmapBuffer(0);
+    implementation.GetBufferPointerv(0, 0, nullptr);
+    implementation.DrawBuffers(0, nullptr);
+    implementation.UniformMatrix2x3fv(0, 0, 0, nullptr);
+    implementation.UniformMatrix3x2fv(0, 0, 0, nullptr);
+    implementation.UniformMatrix2x4fv(0, 0, 0, nullptr);
+    implementation.UniformMatrix4x2fv(0, 0, 0, nullptr);
+    implementation.UniformMatrix3x4fv(0, 0, 0, nullptr);
+    implementation.UniformMatrix4x3fv(0, 0, 0, nullptr);
+    implementation.BlitFramebuffer(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+    implementation.RenderbufferStorageMultisample(0, 0, 0, 0, 0);
+    implementation.FramebufferTexture2DMultisample(0, 0, 0, 0, 0, 0);
+    implementation.FramebufferTextureLayer(0, 0, 0, 0, 0);
+    implementation.MapBufferRange(0, 0, 0, 0);
+    implementation.FlushMappedBufferRange(0, 0, 0);
+    implementation.BindVertexArray(0);
+    implementation.DeleteVertexArrays(0, nullptr);
+    implementation.GenVertexArrays(0, nullptr);
+    implementation.IsVertexArray(0);
+    implementation.GetIntegeri_v(0, 0, nullptr);
+    implementation.BeginTransformFeedback(0);
+    implementation.EndTransformFeedback();
+    implementation.BindBufferRange(0, 0, 0, 0, 0);
+    implementation.BindBufferBase(0, 0, 0);
+    implementation.TransformFeedbackVaryings(0, 0, nullptr, 0);
+    implementation.GetTransformFeedbackVarying(0, 0, 0, nullptr, nullptr, nullptr, nullptr);
+    implementation.VertexAttribIPointer(0, 0, 0, 0, nullptr);
+    implementation.GetVertexAttribIiv(0, 0, nullptr);
+    implementation.GetVertexAttribIuiv(0, 0, nullptr);
+    implementation.VertexAttribI4i(0, 0, 0, 0, 0);
+    implementation.VertexAttribI4ui(0, 0, 0, 0, 0);
+    implementation.VertexAttribI4iv(0, nullptr);
+    implementation.VertexAttribI4uiv(0, nullptr);
+    implementation.GetUniformuiv(0, 0, nullptr);
+    implementation.GetFragDataLocation(0, nullptr);
+    implementation.Uniform1ui(0, 0);
+    implementation.Uniform2ui(0, 0, 0);
+    implementation.Uniform3ui(0, 0, 0, 0);
+    implementation.Uniform4ui(0, 0, 0, 0, 0);
+    implementation.Uniform1uiv(0, 0, nullptr);
+    implementation.Uniform2uiv(0, 0, nullptr);
+    implementation.Uniform3uiv(0, 0, nullptr);
+    implementation.Uniform4uiv(0, 0, nullptr);
+    implementation.ClearBufferiv(0, 0, nullptr);
+    implementation.ClearBufferuiv(0, 0, nullptr);
+    implementation.ClearBufferfv(0, 0, nullptr);
+    implementation.ClearBufferfi(0, 0, 0, 0);
+    implementation.GetStringi(0, 0);
+    implementation.CopyBufferSubData(0, 0, 0, 0, 0);
+    implementation.GetUniformIndices(0, 0, nullptr, nullptr);
+    implementation.GetActiveUniformsiv(0, 0, nullptr, 0, nullptr);
+    implementation.GetUniformBlockIndex(0, nullptr);
+    implementation.GetActiveUniformBlockiv(0, 0, 0, nullptr);
+    implementation.GetActiveUniformBlockName(0, 0, 0, nullptr, nullptr);
+    implementation.UniformBlockBinding(0, 0, 0);
+    implementation.DrawArraysInstanced(0, 0, 0, 0);
+    implementation.DrawElementsInstanced(0, 0, 0, nullptr, 0);
+    implementation.FenceSync(0, 0);
+    implementation.IsSync(0);
+    implementation.DeleteSync(0);
+    implementation.ClientWaitSync(0, 0, 0);
+    implementation.WaitSync(0, 0, 0);
+    implementation.GetInteger64v(0, nullptr);
+    implementation.GetSynciv(0, 0, 0, nullptr, nullptr);
+    implementation.GetInteger64i_v(0, 0, nullptr);
+    implementation.GetBufferParameteri64v(0, 0, nullptr);
+    implementation.GenSamplers(0, nullptr);
+    implementation.DeleteSamplers(0, nullptr);
+    implementation.IsSampler(0);
+    implementation.BindSampler(0, 0);
+    implementation.SamplerParameteri(0, 0, 0);
+    implementation.SamplerParameteriv(0, 0, nullptr);
+    implementation.SamplerParameterf(0, 0, 0);
+    implementation.SamplerParameterfv(0, 0, nullptr);
+    implementation.GetSamplerParameteriv(0, 0, nullptr);
+    implementation.GetSamplerParameterfv(0, 0, nullptr);
+    implementation.VertexAttribDivisor(0, 0);
+    implementation.BindTransformFeedback(0, 0);
+    implementation.DeleteTransformFeedbacks(0, nullptr);
+    implementation.GenTransformFeedbacks(0, nullptr);
+    implementation.IsTransformFeedback(0);
+    implementation.PauseTransformFeedback();
+    implementation.ResumeTransformFeedback();
+    implementation.GetProgramBinary(0, 0, nullptr, nullptr, nullptr);
+    implementation.ProgramBinary(0, 0, nullptr, 0);
+    implementation.ProgramParameteri(0, 0, 0);
+    implementation.InvalidateFramebuffer(0, 0, nullptr);
+    implementation.InvalidateSubFramebuffer(0, 0, nullptr, 0, 0, 0, 0);
+    implementation.TexStorage2D(0, 0, 0, 0, 0);
+    implementation.TexStorage3D(0, 0, 0, 0, 0, 0);
+    implementation.GetInternalformativ(0, 0, 0, 0, nullptr);
+    implementation.BlendBarrier();
+    DALI_TEST_CHECK(true); // Should get here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(false); // Should not get here!
+  }
+}
+
+template<typename Impl>
+void CreateWithBaseClassPtr()
+{
+  // This derived destructor of the class is called which is purely for increasing function coverage
+  GlesAbstraction* abstraction = new Impl;
+  try
+  {
+    abstraction->ReadBuffer(0);
+    DALI_TEST_CHECK(true);
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(false);
+  }
+  delete abstraction;
+}
+
+} // unnamed namespace
+
+int UtcDaliGles2ImplementationConstruction(void)
+{
+  CreateWithBaseClassPtr<Gles2Implementation>();
+  END_TEST;
+}
+
+int UtcDaliGles3ImplementationConstruction(void)
+{
+  CreateWithBaseClassPtr<Gles3Implementation>();
+  END_TEST;
+}
+
+int UtcDaliGles2ImplementationMethods(void)
+{
+  Gles2Implementation implementation;
+  CallAllMethods(implementation);
+  END_TEST;
+}
+
+int UtcDaliGles3ImplementationMethods(void)
+{
+  Gles3Implementation implementation;
+  CallAllMethods(implementation);
+  END_TEST;
+}
\ No newline at end of file
index aa033eb..182c546 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.
@@ -212,10 +212,10 @@ void SceneHolder::SetAdaptor(Dali::Adaptor& adaptor)
 
   // Create the scene
   PositionSize surfacePositionSize = mSurface->GetPositionSize();
-  int          windowOrientation         = mSurface->GetSurfaceOrientation();
-  int          screenOrientation         = mSurface->GetScreenOrientation();
+  int          windowOrientation   = mSurface->GetSurfaceOrientation();
+  int          screenOrientation   = mSurface->GetScreenOrientation();
 
-  mScene                           = Dali::Integration::Scene::New(Size(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height)), windowOrientation, screenOrientation);
+  mScene = Dali::Integration::Scene::New(Size(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height)), windowOrientation, screenOrientation);
 
   Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
   mAdaptor                                = &adaptorImpl;
@@ -276,7 +276,8 @@ void SceneHolder::FeedTouchPoint(Dali::Integration::Point& point, int timeStamp)
     timeStamp = TimeService::GetMilliSeconds();
   }
 
-  RecalculateTouchPosition(point);
+  Vector2 convertedPosition = RecalculatePosition(point.GetScreenPosition());
+  point.SetScreenPosition(convertedPosition);
 
   Integration::TouchEvent                            touchEvent;
   Integration::HoverEvent                            hoverEvent;
@@ -311,6 +312,9 @@ void SceneHolder::FeedWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
   // Keep the handle alive until the core events are processed.
   Dali::BaseHandle sceneHolder(this);
 
+  Vector2 convertedPosition = RecalculatePosition(wheelEvent.point);
+  wheelEvent.point          = convertedPosition;
+
   mScene.QueueEvent(wheelEvent);
   mAdaptor->ProcessCoreEvents();
 }
index 8868d52..9911817 100644 (file)
@@ -335,10 +335,14 @@ private: // The following methods can be overridden if required
   virtual void OnResume(){};
 
   /**
-   * Recalculate the touch position if required
-   * @param[in,out] point The touch point
+   * Recalculate the position if required
+   * @param[in] position The screen position
+   * @return converted position by oriention
    */
-  virtual void RecalculateTouchPosition(Integration::Point& point){};
+  virtual Vector2 RecalculatePosition(const Vector2& position)
+  {
+    return position;
+  };
 
 private:
   /**
index 29231c8..6f01428 100644 (file)
@@ -82,7 +82,6 @@ enum class SortOrder : uint32_t
 
 namespace DBus
 {
-
 /**
  * @brief The CurrentBridgePtr class is to save the current Accessibility Bridge.
  */
@@ -117,7 +116,6 @@ public:
   }
 }; // CurrentBridgePtr
 
-
 // Templates for setting and getting Accessible values
 namespace detail
 {
@@ -258,7 +256,7 @@ struct _Logger
 
   ~_Logger()
   {
-    Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, "%s:%d: %s", mFile, mLine, mTmp.str().c_str());
+    Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, "%s:%d: %s", mFile, mLine, mTmp.str().c_str());
   }
 
   template<typename T>
@@ -287,12 +285,12 @@ struct _LoggerScope
   : mFile(file),
     mLine(line)
   {
-    Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, "%s:%d: +", mFile, mLine);
+    Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, "%s:%d: +", mFile, mLine);
   }
 
   ~_LoggerScope()
   {
-    Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, "%s:%d: -", mFile, mLine);
+    Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, "%s:%d: -", mFile, mLine);
   }
 };
 
index 497863b..d6caa90 100644 (file)
@@ -466,6 +466,11 @@ void BridgeCollection::VisitNodes(Accessible* obj, std::vector<Accessible*>& res
   if(comparer(obj))
   {
     result.emplace_back(obj);
+    // the code below will never return for maxCount equal 0
+    if(result.size() == maxCount)
+    {
+      return;
+    }
   }
 
   for(auto i = 0u; i < obj->GetChildCount(); ++i)
index e274ad8..b4df08e 100644 (file)
@@ -786,14 +786,14 @@ public:
   {
     auto client = CreateSocketClient(socket);
 
-    client.method<void(std::string)>("Embedded").call(ATSPI_PREFIX_PATH + plug.GetPath());
+    client.method<void(std::string)>("Embedded").asyncCall([](DBus::ValueOrError<void>) {}, ATSPI_PREFIX_PATH + plug.GetPath());
   }
 
   void UnembedSocket(const Address& plug, const Address& socket) override
   {
     auto client = CreateSocketClient(socket);
 
-    client.method<void(Address)>("Unembed").call(plug);
+    client.method<void(Address)>("Unembed").asyncCall([](DBus::ValueOrError<void>) {}, plug);
   }
 
   void SetSocketOffset(ProxyAccessible* socket, std::int32_t x, std::int32_t y) override
index c23cd53..9babbfc 100644 (file)
@@ -485,7 +485,7 @@ enum class ErrorType
 struct Error
 {
   std::string message;
-  ErrorType errorType{ErrorType::DEFAULT};
+  ErrorType   errorType{ErrorType::DEFAULT};
 
   Error() = default;
   Error(std::string msg, ErrorType errorType = ErrorType::DEFAULT)
@@ -710,34 +710,71 @@ using char_array = std::array<char, N>;
 constexpr char* xcopy_n(const char* src, size_t n, char* dst)
 {
   for(std::size_t i = 0; i < n; ++i)
+  {
     dst[i] = src[i];
+  }
 
   return dst + n;
 }
 
-template<std::size_t N>
-constexpr std::size_t xlen(const char (&)[N])
+template<std::size_t L, std::size_t R>
+constexpr char_array<L + R - 1> concat_internal(const char_array<L> lhs, const char_array<R> rhs)
 {
-  return N - 1;
-}
+  char_array<L + R - 1> arr{};
+  char*                 ptr = arr.data();
 
-template<std::size_t N>
-constexpr std::size_t xlen(const char_array<N>&)
-{
-  return N - 1;
-}
+  if constexpr(!arr.empty())
+  {
+    ptr  = xcopy_n(std::data(lhs), L - 1, ptr);
+    ptr  = xcopy_n(std::data(rhs), R - 1, ptr);
+    *ptr = 0;
+  }
 
-template<typename... Args>
-constexpr auto concat(const Args&... args)
+  return arr;
+}
+template<std::size_t L>
+constexpr char_array<L> convert_internal(const char (&str)[L])
 {
-  char_array<(1U + ... + xlen(args))> arr{};
-  char*                               ptr = arr.data();
+  char_array<L> arr{};
+  char*         ptr = arr.data();
 
   if constexpr(!arr.empty())
-    ((ptr = xcopy_n(std::data(args), xlen(args), ptr)), ...);
+  {
+    ptr = xcopy_n(std::data(str), L, ptr);
+  }
 
   return arr;
 }
+template<std::size_t L, std::size_t R>
+constexpr char_array<L + R - 1> concat(const char_array<L> lhs, const char_array<R> rhs)
+{
+  return concat_internal(lhs, rhs);
+}
+template<std::size_t L, std::size_t R>
+constexpr char_array<L + R - 1> concat(const char (&lhs)[L], const char_array<R> rhs)
+{
+  return concat_internal(convert_internal(lhs), rhs);
+}
+template<std::size_t L, std::size_t R>
+constexpr char_array<L + R - 1> concat(const char_array<L> lhs, const char (&rhs)[R])
+{
+  return concat_internal(lhs, convert_internal(rhs));
+}
+template<std::size_t L, std::size_t R>
+constexpr char_array<L + R - 1> concat(const char (&lhs)[L], const char (&rhs)[R])
+{
+  return concat_internal(convert_internal(lhs), convert_internal(rhs));
+}
+template<std::size_t L>
+constexpr char_array<L> concat(const char (&str)[L])
+{
+  return convert_internal(str);
+}
+template<std::size_t L>
+constexpr char_array<L> concat(const char_array<L> str)
+{
+  return str;
+}
 
 template<std::size_t... Digits>
 struct to_chars
@@ -1022,7 +1059,7 @@ template<>
 struct signature<float> : signature_helper<signature<float>>
 {
   static constexpr auto name_v = concat("float");
-  static constexpr auto sig_v  = concat("d");
+  static constexpr auto sig_v  = concat("f");
 
   /**
        * @brief Marshals value v as marshalled type into message
@@ -1238,7 +1275,7 @@ struct signature_tuple_helper : signature_helper<signature_tuple_helper<INDEX, S
 {
   using current_type = typename signature_tuple_element_type_helper<INDEX, ARGS...>::type;
 
-  static constexpr auto name_v = concat(signature<current_type>::name_v, ", ", signature_tuple_helper<INDEX + 1, SIZE, ARGS...>::name_v);
+  static constexpr auto name_v = concat(signature<current_type>::name_v, concat(", ", signature_tuple_helper<INDEX + 1, SIZE, ARGS...>::name_v));
   static constexpr auto sig_v  = concat(signature<current_type>::sig_v, signature_tuple_helper<INDEX + 1, SIZE, ARGS...>::sig_v);
 
   /**
@@ -1297,8 +1334,8 @@ struct signature_tuple_helper<SIZE, SIZE, ARGS...> : signature_helper<signature_
 template<typename... ARGS>
 struct signature<std::tuple<ARGS...>> : signature_helper<signature<std::tuple<ARGS...>>>
 {
-  static constexpr auto name_v = concat("tuple<", signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::name_v, ">");
-  static constexpr auto sig_v  = concat("(", signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::sig_v, ")");
+  static constexpr auto name_v = concat("tuple<", concat(signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::name_v, ">"));
+  static constexpr auto sig_v  = concat("(", concat(signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::sig_v, ")"));
 
   /**
        * @brief Marshals value v as marshalled type into message
@@ -1334,7 +1371,7 @@ struct signature<std::tuple<ARGS...>> : signature_helper<signature<std::tuple<AR
 template<typename... ARGS>
 struct signature<ValueOrError<ARGS...>> : signature_helper<signature<ValueOrError<ARGS...>>>
 {
-  static constexpr auto name_v = concat("ValueOrError<", signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::name_v, ">");
+  static constexpr auto name_v = concat("ValueOrError<", concat(signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::name_v, ">"));
   static constexpr auto sig_v  = signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::sig_v;
 
   /**
@@ -1410,8 +1447,8 @@ struct signature<ValueOrError<>> : signature_helper<signature<ValueOrError<>>>
 template<typename A, typename B>
 struct signature<std::pair<A, B>> : signature_helper<signature<std::pair<A, B>>>
 {
-  static constexpr auto name_v = concat("pair<", signature_tuple_helper<0, 2, A, B>::name_v, ">");
-  static constexpr auto sig_v  = concat("(", signature_tuple_helper<0, 2, A, B>::sig_v, ")");
+  static constexpr auto name_v = concat("pair<", concat(signature_tuple_helper<0, 2, A, B>::name_v, ">"));
+  static constexpr auto sig_v  = concat("(", concat(signature_tuple_helper<0, 2, A, B>::sig_v, ")"));
 
   /**
        * @brief Marshals value v as marshalled type into message
@@ -1453,7 +1490,7 @@ struct signature<std::pair<A, B>> : signature_helper<signature<std::pair<A, B>>>
 template<typename A>
 struct signature<std::vector<A>> : signature_helper<signature<std::vector<A>>>
 {
-  static constexpr auto name_v = concat("vector<", signature<A>::name_v, ">");
+  static constexpr auto name_v = concat("vector<", concat(signature<A>::name_v, ">"));
   static constexpr auto sig_v  = concat("a", signature<A>::sig_v);
 
   /**
@@ -1493,7 +1530,7 @@ struct signature<std::vector<A>> : signature_helper<signature<std::vector<A>>>
 template<typename A, size_t N>
 struct signature<std::array<A, N>> : signature_helper<signature<std::array<A, N>>>
 {
-  static constexpr auto name_v = concat("array<", signature<A>::name_v, ", ", to_string<N>::value, ">");
+  static constexpr auto name_v = concat("array<", concat(signature<A>::name_v, concat(", ", concat(to_string<N>::value, ">"))));
   static constexpr auto sig_v  = concat("a", signature<A>::sig_v);
 
   /**
@@ -1534,7 +1571,7 @@ struct signature<std::array<A, N>> : signature_helper<signature<std::array<A, N>
 template<typename A>
 struct signature<EldbusVariant<A>> : signature_helper<signature<EldbusVariant<A>>>
 {
-  static constexpr auto name_v = concat("variant<", signature<A>::name_v, ">");
+  static constexpr auto name_v = concat("variant<", concat(signature<A>::name_v, ">"));
   static constexpr auto sig_v  = concat("v");
 
   /**
@@ -1579,8 +1616,8 @@ struct signature<EldbusVariant<A>> : signature_helper<signature<EldbusVariant<A>
 template<typename A, typename B>
 struct signature<std::unordered_map<A, B>> : signature_helper<signature<std::unordered_map<A, B>>>
 {
-  static constexpr auto name_v = concat("unordered_map<", signature<A>::name_v, ", ", signature<B>::name_v, ">");
-  static constexpr auto sig_v  = concat("a{", signature_tuple_helper<0, 2, A, B>::sig_v, "}");
+  static constexpr auto name_v = concat("unordered_map<", concat(signature<A>::name_v, concat(", ", concat(signature<B>::name_v, ">"))));
+  static constexpr auto sig_v  = concat("a{", concat(signature_tuple_helper<0, 2, A, B>::sig_v, "}"));
 
   /**
        * @brief Marshals value v as marshalled type into message
@@ -1625,8 +1662,8 @@ struct signature<std::unordered_map<A, B>> : signature_helper<signature<std::uno
 template<typename A, typename B>
 struct signature<std::map<A, B>> : signature_helper<signature<std::map<A, B>>>
 {
-  static constexpr auto name_v = concat("map<", signature<A>::name_v, ", ", signature<B>::name_v, ">");
-  static constexpr auto sig_v  = concat("a{", signature_tuple_helper<0, 2, A, B>::sig_v, "}");
+  static constexpr auto name_v = concat("map<", concat(signature<A>::name_v, concat(", ", concat(signature<B>::name_v, ">"))));
+  static constexpr auto sig_v  = concat("a{", concat(signature_tuple_helper<0, 2, A, B>::sig_v, "}"));
 
   /**
        * @brief Marshals value v as marshalled type into message
@@ -1663,7 +1700,7 @@ struct signature<std::map<A, B>> : signature_helper<signature<std::map<A, B>>>
 template<typename A>
 struct signature<const A&> : signature_helper<signature<const A&>>
 {
-  static constexpr auto name_v = concat("const ", signature<A>::name_v, "&");
+  static constexpr auto name_v = concat("const ", concat(signature<A>::name_v, "&"));
   static constexpr auto sig_v  = signature<A>::sig_v;
 
   /**
index a9fbcfe..b7de74f 100644 (file)
@@ -189,6 +189,14 @@ void Adaptor::Initialize(GraphicsFactory& graphicsFactory)
     mObjectProfiler = new ObjectProfiler(mCore->GetObjectRegistry(), timeInterval);
   }
 
+  const uint32_t poolTimeInterval = mEnvironmentOptions->GetMemoryPoolInterval();
+  if(0u < poolTimeInterval)
+  {
+    mMemoryPoolTimer = Dali::Timer::New(poolTimeInterval * 1000);
+    mMemoryPoolTimer.TickSignal().Connect(mMemoryPoolTimerSlotDelegate, &Adaptor::MemoryPoolTimeout);
+    mMemoryPoolTimer.Start();
+  }
+
   mNotificationTrigger = TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &Adaptor::ProcessCoreEvents), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
 
   mDisplayConnection = Dali::DisplayConnection::New(*mGraphics, defaultWindow->GetSurface()->GetSurfaceType());
@@ -1231,6 +1239,7 @@ Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor,
   mKernelTracer(),
   mSystemTracer(),
   mObjectProfiler(nullptr),
+  mMemoryPoolTimerSlotDelegate(this),
   mSocketFactory(),
   mMutex(),
   mThreadMode(threadMode),
@@ -1278,6 +1287,12 @@ void Adaptor::RemoveIdleEnterer(CallbackBase* callback)
   mCallbackManager->RemoveIdleEntererCallback(callback);
 }
 
+bool Adaptor::MemoryPoolTimeout()
+{
+  mCore->LogMemoryPools();
+  return true; // Keep logging forever
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 69a6b3f..d24b830 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_IMPL_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.
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/threading/mutex.h>
 #include <dali/integration-api/render-controller.h>
+#include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/math/uint-16-pair.h>
@@ -620,6 +621,11 @@ private:
    */
   void RemoveIdleEnterer(CallbackBase* callback);
 
+  /**
+   * Trigger to log the memory pools from Core and Adaptor
+   */
+  bool MemoryPoolTimeout();
+
 private:
   /**
    * Constructor
@@ -679,12 +685,14 @@ private:                                          // Data
   KernelTrace                 mKernelTracer;                          ///< Kernel tracer
   SystemTrace                 mSystemTracer;                          ///< System tracer
   ObjectProfiler*             mObjectProfiler;                        ///< Tracks object lifetime for profiling
-  SocketFactory               mSocketFactory;                         ///< Socket factory
-  Mutex                       mMutex;                                 ///< Mutex
-  ThreadMode                  mThreadMode;                            ///< The thread mode
-  const bool                  mEnvironmentOptionsOwned : 1;           ///< Whether we own the EnvironmentOptions (and thus, need to delete it)
-  bool                        mUseRemoteSurface : 1;                  ///< whether the remoteSurface is used or not
-  Dali::LayoutDirection::Type mRootLayoutDirection;                   ///< LayoutDirection of window
+  Dali::Timer                 mMemoryPoolTimer;                       ///< Logs memory pool capacity
+  SlotDelegate<Adaptor>       mMemoryPoolTimerSlotDelegate;
+  SocketFactory               mSocketFactory;               ///< Socket factory
+  Mutex                       mMutex;                       ///< Mutex
+  ThreadMode                  mThreadMode;                  ///< The thread mode
+  const bool                  mEnvironmentOptionsOwned : 1; ///< Whether we own the EnvironmentOptions (and thus, need to delete it)
+  bool                        mUseRemoteSurface : 1;        ///< whether the remoteSurface is used or not
+  Dali::LayoutDirection::Type mRootLayoutDirection;         ///< LayoutDirection of window
 
   std::unique_ptr<Integration::AddOnManager> mAddOnManager; ///< Pointer to the addon manager
 
index 8a2a150..0a0cfe4 100644 (file)
@@ -75,13 +75,13 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_THR
 #define DEBUG_LEVEL_EVENT 0
 
 #define LOG_THREAD_SYNC(level, color, format, ...) \
-  Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, "%s" format "%s\n", color, ##__VA_ARGS__, COLOR_CLEAR)
+  Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, "%s" format "%s\n", color, ##__VA_ARGS__, COLOR_CLEAR)
 
 #define LOG_THREAD_SYNC_TRACE(color) \
-  Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, "%s%s%s\n", color, __FUNCTION__, COLOR_CLEAR)
+  Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, "%s%s%s\n", color, __FUNCTION__, COLOR_CLEAR)
 
 #define LOG_THREAD_SYNC_TRACE_FMT(color, format, ...) \
-  Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, "%s%s: " format "%s\n", color, __FUNCTION__, ##__VA_ARGS__, COLOR_CLEAR)
+  Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, "%s%s: " format "%s\n", color, __FUNCTION__, ##__VA_ARGS__, COLOR_CLEAR)
 
 #else
 
index 49d02f3..a3d81ac 100644 (file)
@@ -31,7 +31,6 @@
 #include <dali/internal/adaptor/common/combined-update-render-controller-debug.h>
 #include <dali/internal/graphics/common/graphics-interface.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
-#include <dali/internal/graphics/gles/egl-implementation.h>
 #include <dali/internal/system/common/environment-options.h>
 #include <dali/internal/system/common/time-service.h>
 #include <dali/internal/window-system/common/window-impl.h>
@@ -528,6 +527,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
   // Update time
   uint64_t lastFrameTime;
   TimeService::GetNanoseconds(lastFrameTime);
+  uint64_t lastMemPoolLogTime = lastFrameTime;
 
   LOG_UPDATE_RENDER("THREAD INITIALISED");
 
@@ -536,6 +536,8 @@ void CombinedUpdateRenderController::UpdateRenderThread()
   uint64_t timeToSleepUntil   = 0;
   int      extraFramesDropped = 0;
 
+  const uint64_t memPoolInterval = mEnvironmentOptions.GetMemoryPoolInterval() * NANOSECONDS_PER_SECOND;
+
   const unsigned int renderToFboInterval = mEnvironmentOptions.GetRenderToFboInterval();
   const bool         renderToFboEnabled  = 0u != renderToFboInterval;
   unsigned int       frameCount          = 0u;
@@ -647,6 +649,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     // RENDER
     //////////////////////////////
 
+    graphics.FrameStart();
     mAdaptorInterfaces.GetDisplayConnectionInterface().ConsumeEvents();
 
     if(mPreRenderCallback != NULL)
@@ -746,6 +749,13 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     TRACE_UPDATE_RENDER_END("DALI_RENDER");
     AddPerformanceMarker(PerformanceInterface::RENDER_END);
 
+    // if the memory pool interval is set and has elapsed, log the graphics memory pools
+    if(0 < memPoolInterval && memPoolInterval < lastFrameTime - lastMemPoolLogTime)
+    {
+      lastMemPoolLogTime = lastFrameTime;
+      graphics.LogMemoryPools();
+    }
+
     mForceClear = false;
 
     // Trigger event thread to request Update/Render thread to sleep if update not required
index 08cc77d..53fa462 100644 (file)
@@ -181,6 +181,16 @@ public:
    */
   virtual void CacheConfigurations(ConfigurationManager& configurationManager) = 0;
 
+  /**
+   * Initialize data for logging frame info
+   */
+  virtual void FrameStart() = 0;
+
+  /**
+   * Log total capacity of memory pools during this frame
+   */
+  virtual void LogMemoryPools() = 0;
+
 protected:
   Integration::DepthBufferAvailable   mDepthBufferRequired;   ///< Whether the depth buffer is required
   Integration::StencilBufferAvailable mStencilBufferRequired; ///< Whether the stencil buffer is required
index be7a0c3..b093c7f 100644 (file)
@@ -127,7 +127,7 @@ EglGraphicsController::~EglGraphicsController()
 
 void EglGraphicsController::InitializeGLES(Integration::GlAbstraction& glAbstraction)
 {
-  DALI_LOG_RELEASE_INFO("Initializing New Graphics Controller #1\n");
+  DALI_LOG_RELEASE_INFO("Initializing Graphics Controller Phase 1\n");
   mGlAbstraction  = &glAbstraction;
   mContext        = std::make_unique<GLES::Context>(*this);
   mCurrentContext = mContext.get();
@@ -137,7 +137,7 @@ void EglGraphicsController::Initialize(Integration::GraphicsSyncAbstraction&
                                        Integration::GlContextHelperAbstraction& glContextHelperAbstraction,
                                        Internal::Adaptor::GraphicsInterface&    graphicsInterface)
 {
-  DALI_LOG_RELEASE_INFO("Initializing New Graphics Controller #2\n");
+  DALI_LOG_RELEASE_INFO("Initializing Graphics Controller Phase 2\n");
   auto* syncImplPtr = static_cast<Internal::Adaptor::EglSyncImplementation*>(&syncImplementation);
 
   mEglSyncImplementation      = syncImplPtr;
@@ -145,12 +145,19 @@ void EglGraphicsController::Initialize(Integration::GraphicsSyncAbstraction&
   mGraphics                   = &graphicsInterface;
 }
 
+void EglGraphicsController::FrameStart()
+{
+  mCapacity = 0; // Reset the command buffer capacity at the start of the frame.
+}
+
 void EglGraphicsController::SubmitCommandBuffers(const SubmitInfo& submitInfo)
 {
   for(auto& cmdbuf : submitInfo.cmdBuffer)
   {
     // Push command buffers
-    mCommandQueue.push(static_cast<GLES::CommandBuffer*>(cmdbuf));
+    auto* commandBuffer = static_cast<GLES::CommandBuffer*>(cmdbuf);
+    mCapacity += commandBuffer->GetCapacity();
+    mCommandQueue.push(commandBuffer);
   }
 
   // If flush bit set, flush all pending tasks
@@ -312,7 +319,7 @@ TextureProperties EglGraphicsController::GetTextureProperties(const Texture& tex
   properties.compressed   = glesTexture->IsCompressed();
   properties.extent2D     = createInfo.size;
   properties.nativeHandle = glesTexture->GetGLTexture();
-  //TODO: Skip format1, emulated, packed, directWriteAccessEnabled of TextureProperties for now
+  // TODO: Skip format1, emulated, packed, directWriteAccessEnabled of TextureProperties for now
 
   return properties;
 }
@@ -331,7 +338,8 @@ void EglGraphicsController::CreateSurfaceContext(Dali::RenderSurfaceInterface* s
 void EglGraphicsController::DeleteSurfaceContext(Dali::RenderSurfaceInterface* surface)
 {
   mSurfaceContexts.erase(std::remove_if(
-                           mSurfaceContexts.begin(), mSurfaceContexts.end(), [surface](SurfaceContextPair& iter) { return surface == iter.first; }),
+                           mSurfaceContexts.begin(), mSurfaceContexts.end(), [surface](SurfaceContextPair& iter)
+                           { return surface == iter.first; }),
                          mSurfaceContexts.end());
 }
 
@@ -339,7 +347,6 @@ void EglGraphicsController::ActivateResourceContext()
 {
   mCurrentContext = mContext.get();
   mCurrentContext->GlContextCreated();
-
   if(!mSharedContext)
   {
     auto eglGraphics = dynamic_cast<Dali::Internal::Adaptor::EglGraphics*>(mGraphics);
@@ -354,9 +361,8 @@ void EglGraphicsController::ActivateSurfaceContext(Dali::RenderSurfaceInterface*
 {
   if(surface && mGraphics->IsResourceContextSupported())
   {
-    auto iter = std::find_if(mSurfaceContexts.begin(), mSurfaceContexts.end(), [surface](SurfaceContextPair& iter) {
-      return (iter.first == surface);
-    });
+    auto iter = std::find_if(mSurfaceContexts.begin(), mSurfaceContexts.end(), [surface](SurfaceContextPair& iter)
+                             { return (iter.first == surface); });
 
     if(iter != mSurfaceContexts.end())
     {
index b89fa31..1db48a2 100644 (file)
@@ -94,6 +94,13 @@ public:
   Internal::Adaptor::EglSyncImplementation& GetEglSyncImplementation();
 
   /**
+   * Mark the start of the frame.
+   *
+   * Note, this is used for logging & debugging, so is not part of the main Graphics API.
+   */
+  void FrameStart();
+
+  /**
    * @copydoc Dali::Graphics::SubmitCommandBuffers()
    */
   void SubmitCommandBuffers(const SubmitInfo& submitInfo) override;
@@ -775,6 +782,11 @@ public:
     return mSyncPool;
   }
 
+  std::size_t GetCapacity() const
+  {
+    return mCapacity;
+  }
+
 private:
   Integration::GlAbstraction*              mGlAbstraction{nullptr};
   Integration::GlContextHelperAbstraction* mGlContextHelperAbstraction{nullptr};
@@ -823,10 +835,11 @@ private:
 
   GLES::TextureDependencyChecker mTextureDependencyChecker; // Checks if FBO textures need syncing
   GLES::SyncPool                 mSyncPool;
+  std::size_t                    mCapacity; ///< Memory Usage (of command buffers)
 };
 
 } // namespace Graphics
 
 } // namespace Dali
 
-#endif //DALI_EGL_GRAPHICS_CONTROLLER_H
+#endif // DALI_EGL_GRAPHICS_CONTROLLER_H
index 1d981bc..b75b08b 100644 (file)
@@ -64,6 +64,13 @@ struct Context::Impl
         mProgramVAOCurrentState = iter->second;
         gl.BindVertexArray(iter->second);
       }
+
+      // We should re-check enable attribute usage because geometry might be changed.
+      // @todo : We can remove this loop if we enable vertex attrib by shader's information.
+      for(const auto& attr : vertexInputState.attributes)
+      {
+        gl.EnableVertexAttribArray(attr.location);
+      }
       return;
     }
 
@@ -71,6 +78,9 @@ struct Context::Impl
     gl.GenVertexArrays(1, &vao);
     gl.BindVertexArray(vao);
     mProgramVAOMap[program] = vao;
+
+    // @todo : Enable vertex attrib only by shader's information, not with Geometry.
+    // Currently, vertexInputState.attributes depend on Geometry's VertexBuffer.
     for(const auto& attr : vertexInputState.attributes)
     {
       gl.EnableVertexAttribArray(attr.location);
index d619842..0e72a8c 100644 (file)
@@ -65,7 +65,7 @@ class CommandPool
     inline void resize(int newSize)
     {
       ptr      = reinterpret_cast<T*>(realloc(ptr, newSize * sizeof(T)));
-      capacity = newSize;
+      capacity = newSize * sizeof(T);
       dataSize = newSize;
     }
 
@@ -224,6 +224,11 @@ public:
     size = commandPool.size;
     return commandPool.data.ptr;
   }
+
+  std::size_t GetTotalCapacity() const
+  {
+    return commandPool.data.capacity + memoryPool.data.capacity;
+  }
 };
 
 CommandBuffer::CommandBuffer(const Graphics::CommandBufferCreateInfo& createInfo, EglGraphicsController& controller)
@@ -266,7 +271,7 @@ void CommandBuffer::BindUniformBuffers(const std::vector<Graphics::UniformBuffer
   static thread_local UniformBufferBindingDescriptor sTempBindings[MAX_UNIFORM_BUFFER_BINDINGS];
 
   // reset temp bindings
-  memset(sTempBindings, 0, sizeof(UniformBufferBindingDescriptor) * MAX_UNIFORM_BUFFER_BINDINGS);
+  std::fill_n(sTempBindings, MAX_UNIFORM_BUFFER_BINDINGS, UniformBufferBindingDescriptor());
 
   auto maxBinding = 0u;
 
@@ -558,4 +563,14 @@ void CommandBuffer::DiscardResource()
   GetController().DiscardResource(this);
 }
 
+std::size_t CommandBuffer::GetCapacity()
+{
+  std::size_t total{0u};
+  if(mCommandPool)
+  {
+    total = mCommandPool->GetTotalCapacity();
+  }
+  return total;
+}
+
 } // namespace Dali::Graphics::GLES
index 07c5561..c2ae566 100644 (file)
@@ -438,6 +438,9 @@ public:
    */
   void DiscardResource() override;
 
+  // Get the total memory usage of this command buffer
+  std::size_t GetCapacity();
+
 private:
   std::unique_ptr<CommandPool> mCommandPool; ///< Pool of commands and transient memory
 };
index 05776c2..ee7299a 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.
 
 namespace
 {
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gGraphicsReflectionLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_GRAPHICS_REFLECTION");
+#endif
+
 struct StringSize
 {
   const char* const mString;
@@ -171,7 +175,7 @@ void ParseShaderSamplers(std::string shaderSource, std::vector<Dali::Graphics::U
 
             if(!found)
             {
-              DALI_LOG_ERROR("Sampler uniform %s declared but not used in the shader\n", token);
+              DALI_LOG_INFO(gGraphicsReflectionLogFilter, Debug::General, "Sampler uniform %s declared but not used in the shader\n", token);
             }
             break;
           }
@@ -214,12 +218,16 @@ void Reflection::BuildVertexAttributeReflection()
     return;
   }
 
+  DALI_LOG_INFO(gGraphicsReflectionLogFilter, Debug::General, "Build vertex attribute reflection for glProgram : %u\n", glProgram);
+
   gl->GetProgramiv(glProgram, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxLength);
   gl->GetProgramiv(glProgram, GL_ACTIVE_ATTRIBUTES, &nAttribs);
 
   mVertexInputAttributes.clear();
   mVertexInputAttributes.resize(nAttribs);
 
+  int maximumLocation = nAttribs - 1;
+
   name = new GLchar[maxLength];
   for(int i = 0; i < nAttribs; i++)
   {
@@ -228,13 +236,21 @@ void Reflection::BuildVertexAttributeReflection()
 
     if(location >= 0)
     {
+      if(maximumLocation < location)
+      {
+        maximumLocation = location;
+        // Increate continer size s.t. we can use maximumLocation as index.
+        mVertexInputAttributes.resize(maximumLocation + 1u);
+      }
+
       AttributeInfo attributeInfo;
-      attributeInfo.location = location;
-      attributeInfo.name     = name;
-      attributeInfo.format   = GetVertexAttributeTypeFormat(type);
-      mVertexInputAttributes.insert(mVertexInputAttributes.begin() + location, attributeInfo);
+      attributeInfo.location           = location;
+      attributeInfo.name               = name;
+      attributeInfo.format             = GetVertexAttributeTypeFormat(type);
+      mVertexInputAttributes[location] = std::move(attributeInfo);
     }
   }
+
   delete[] name;
 }
 
@@ -254,6 +270,8 @@ void Reflection::BuildUniformReflection()
     return;
   }
 
+  DALI_LOG_INFO(gGraphicsReflectionLogFilter, Debug::General, "Build uniform reflection for glProgram : %u\n", glProgram);
+
   gl->GetProgramiv(glProgram, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxLen);
   gl->GetProgramiv(glProgram, GL_ACTIVE_UNIFORMS, &numUniforms);
 
@@ -365,6 +383,8 @@ void Reflection::BuildUniformBlockReflection()
     return;
   }
 
+  DALI_LOG_INFO(gGraphicsReflectionLogFilter, Debug::General, "Build uniform block reflection for glProgram : %u\n", glProgram);
+
   gl->GetProgramiv(glProgram, GL_ACTIVE_UNIFORM_BLOCKS, &numUniformBlocks);
 
   mUniformBlocks.clear();
@@ -420,6 +440,7 @@ void Reflection::BuildUniformBlockReflection()
 
 uint32_t Reflection::GetVertexAttributeLocation(const std::string& name) const
 {
+  DALI_LOG_INFO(gGraphicsReflectionLogFilter, Debug::Verbose, "name : %s\n", name.c_str());
   for(auto&& attr : mVertexInputAttributes)
   {
     if(attr.name == name)
@@ -432,6 +453,7 @@ uint32_t Reflection::GetVertexAttributeLocation(const std::string& name) const
 
 Dali::Graphics::VertexInputAttributeFormat Reflection::GetVertexAttributeFormat(uint32_t location) const
 {
+  DALI_LOG_INFO(gGraphicsReflectionLogFilter, Debug::Verbose, "location : %u\n", location);
   if(location >= mVertexInputAttributes.size())
   {
     return Dali::Graphics::VertexInputAttributeFormat::UNDEFINED;
@@ -442,6 +464,7 @@ Dali::Graphics::VertexInputAttributeFormat Reflection::GetVertexAttributeFormat(
 
 std::string Reflection::GetVertexAttributeName(uint32_t location) const
 {
+  DALI_LOG_INFO(gGraphicsReflectionLogFilter, Debug::Verbose, "location : %u\n", location);
   if(location >= mVertexInputAttributes.size())
   {
     return std::string();
index 06cfba1..d1bca95 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_GLES_REFLECTION_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.
@@ -254,7 +254,7 @@ private:
 
   struct AttributeInfo
   {
-    uint32_t                                   location{};
+    uint32_t                                   location{ERROR_ATTRIBUTE_NOT_FOUND};
     std::string                                name{};
     Dali::Graphics::VertexInputAttributeFormat format{};
   };
index 836439d..73454e6 100644 (file)
@@ -1148,7 +1148,7 @@ struct UniformBufferBindingDescriptor
   const GLES::Buffer* buffer{nullptr};
   uint32_t            binding{0u};
   uint32_t            offset{0u};
-  bool                emulated; ///<true if UBO is emulated for old gfx API
+  bool                emulated{false}; ///<true if UBO is emulated for old gfx API
 };
 
 /**
index 15e17f1..0786141 100644 (file)
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
+#include <dali/integration-api/debug.h>
 #include <dali/internal/system/common/configuration-manager.h>
 #include <dali/internal/system/common/environment-options.h>
 #include <dali/internal/window-system/common/display-utils.h> // For Utils::MakeUnique
@@ -251,6 +252,20 @@ void EglGraphics::CacheConfigurations(ConfigurationManager& configurationManager
   mGLES->SetShadingLanguageVersion(configurationManager.GetShadingLanguageVersion());
 }
 
+void EglGraphics::FrameStart()
+{
+  mGraphicsController.FrameStart();
+}
+
+void EglGraphics::LogMemoryPools()
+{
+  std::size_t graphicsCapacity = mGraphicsController.GetCapacity();
+  DALI_LOG_RELEASE_INFO(
+    "EglGraphics:\n"
+    "  GraphicsController Capacity: %lu\n",
+    graphicsCapacity);
+}
+
 } // namespace Adaptor
 } // namespace Internal
 } // namespace Dali
index 48dd0b7..b431611 100644 (file)
@@ -211,9 +211,19 @@ public:
 
   void CacheConfigurations(ConfigurationManager& configurationManager) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::GraphicsInterface::FrameStart()
+   */
+  void FrameStart() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::GraphicsInterface::LogMemoryPools()
+   */
+  void LogMemoryPools() override;
+
 private:
   // Eliminate copy and assigned operations
-  EglGraphics(const EglGraphics& rhs) = delete;
+  EglGraphics(const EglGraphics& rhs)            = delete;
   EglGraphics& operator=(const EglGraphics& rhs) = delete;
 
   /**
index 7747066..632cc40 100644 (file)
@@ -182,7 +182,7 @@ bool EglImplementation::InitializeGles(EGLNativeDisplayType display, bool isOwnS
   mGlesInitialized = true;
 
   // We want to display this information all the time, so use the LogMessage directly
-  Integration::Log::LogMessage(Integration::Log::DebugInfo,
+  Integration::Log::LogMessage(Integration::Log::INFO,
                                "EGL Information\n"
                                "            PartialUpdate  %d\n"
                                "            Vendor:        %s\n"
@@ -597,7 +597,7 @@ bool EglImplementation::ChooseConfig(bool isWindowType, ColorDepth depth)
     DALI_ASSERT_ALWAYS(false && "eglChooseConfig failed!");
     return false;
   }
-  Integration::Log::LogMessage(Integration::Log::DebugInfo, "Using OpenGL es %d.%d.\n", mGlesVersion / 10, mGlesVersion % 10);
+  Integration::Log::LogMessage(Integration::Log::INFO, "Using OpenGL es %d.%d.\n", mGlesVersion / 10, mGlesVersion % 10);
 
   mContextAttribs.Clear();
   if(mIsKhrCreateContextSupported)
index a9c31e7..33da896 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.
@@ -415,7 +415,7 @@ void GlProxyImplementation::AccumulateSamples()
 
 void GlProxyImplementation::LogResults()
 {
-  Debug::LogMessage(Debug::DebugInfo, "OpenGL ES statistics sampled over %d frames) operations per frame:\n", mTotalFrameCount);
+  Debug::LogMessage(Debug::INFO, "OpenGL ES statistics sampled over %d frames) operations per frame:\n", mTotalFrameCount);
   LogCalls(mActiveTextureSampler);
   LogCalls(mClearSampler);
   LogCalls(mBindBufferSampler);
@@ -423,7 +423,7 @@ void GlProxyImplementation::LogResults()
   LogCalls(mDrawSampler);
   LogCalls(mUniformSampler);
   LogCalls(mUseProgramSampler);
-  Debug::LogMessage(Debug::DebugInfo, "OpenGL ES Object Count:\n");
+  Debug::LogMessage(Debug::INFO, "OpenGL ES Object Count:\n");
   LogObjectCounter(mBufferCount);
   LogObjectCounter(mTextureCount);
   LogObjectCounter(mProgramCount);
@@ -431,12 +431,12 @@ void GlProxyImplementation::LogResults()
 
 void GlProxyImplementation::LogCalls(const Sampler& sampler)
 {
-  Debug::LogMessage(Debug::DebugInfo, "  %s : Mean %5.2f  (Min:%5.2f, Max:%5.2f, StdDev:%5.2f, Actual:%d)\n", sampler.GetDescription(), sampler.GetMeanValue(), sampler.GetMin(), sampler.GetMax(), sampler.GetStandardDeviation(), sampler.GetCount());
+  Debug::LogMessage(Debug::INFO, "  %s : Mean %5.2f  (Min:%5.2f, Max:%5.2f, StdDev:%5.2f, Actual:%d)\n", sampler.GetDescription(), sampler.GetMeanValue(), sampler.GetMin(), sampler.GetMax(), sampler.GetStandardDeviation(), sampler.GetCount());
 }
 
 void GlProxyImplementation::LogObjectCounter(const ObjectCounter& sampler)
 {
-  Debug::LogMessage(Debug::DebugInfo, "  %s : %u  (Peak:%u)\n", sampler.GetDescription(), sampler.GetCount(), sampler.GetPeak());
+  Debug::LogMessage(Debug::INFO, "  %s : %u  (Peak:%u)\n", sampler.GetDescription(), sampler.GetCount(), sampler.GetPeak());
 }
 
 void GlProxyImplementation::ResetSamplers()
index c9a5866..f482372 100644 (file)
@@ -390,7 +390,7 @@ extern "C" void WriteData(png_structp png_ptr, png_bytep data, png_size_t length
 extern "C" void FlushData(png_structp png_ptr)
 {
 #ifdef DEBUG_ENABLED
-  Debug::LogMessageWithFunctionLine(Debug::DebugInfo, "PNG Flush");
+  Debug::LogMessageWithFunctionLine(Debug::INFO, "PNG Flush");
 #endif // DEBUG_ENABLED
 }
 } // namespace
index f4a1743..ffdb355 100644 (file)
@@ -23,6 +23,7 @@
 #include <cstring>
 
 // INTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
 #include <dali/internal/imaging/common/alpha-mask.h>
 #include <dali/internal/imaging/common/gaussian-blur.h>
 #include <dali/internal/imaging/common/image-operations.h>
@@ -36,6 +37,11 @@ namespace Adaptor
 {
 namespace
 {
+
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gPixelBufferFilter = Debug::Filter::New(Debug::NoLogging, false, "DALI_LOG_PIXEL_BUFFER_SIZE");
+#endif
+
 const float TWO_PI = 2.f * Math::PI; ///< 360 degrees in radians
 // based on W3C Recommendations (https://www.w3.org/TR/AERT/#color-contrast)
 constexpr uint32_t BRIGHTNESS_CONSTANT_R = 299;
@@ -43,6 +49,10 @@ constexpr uint32_t BRIGHTNESS_CONSTANT_G = 587;
 constexpr uint32_t BRIGHTNESS_CONSTANT_B = 114;
 } // namespace
 
+#if defined(DEBUG_ENABLED)
+uint32_t PixelBuffer::gPixelBufferAllocationTotal{0};
+#endif
+
 PixelBuffer::PixelBuffer(uint8_t*            buffer,
                          uint32_t            bufferSize,
                          uint32_t            width,
@@ -74,7 +84,12 @@ PixelBufferPtr PixelBuffer::New(uint32_t            width,
   if(bufferSize > 0)
   {
     buffer = static_cast<uint8_t*>(malloc(bufferSize));
+#if defined(DEBUG_ENABLED)
+    gPixelBufferAllocationTotal += bufferSize;
+#endif
   }
+  DALI_LOG_INFO(gPixelBufferFilter, Debug::Concise, "Allocated PixelBuffer of size %u\n", bufferSize);
+
   return new PixelBuffer(buffer, bufferSize, width, height, width, pixelFormat);
 }
 
@@ -90,6 +105,9 @@ PixelBufferPtr PixelBuffer::New(uint8_t*            buffer,
 
 Dali::PixelData PixelBuffer::Convert(PixelBuffer& pixelBuffer)
 {
+#if defined(DEBUG_ENABLED)
+  gPixelBufferAllocationTotal -= pixelBuffer.mBufferSize;
+#endif
   Dali::PixelData pixelData = Dali::PixelData::New(pixelBuffer.mBuffer,
                                                    pixelBuffer.mBufferSize,
                                                    pixelBuffer.mWidth,
@@ -219,6 +237,9 @@ void PixelBuffer::ReleaseBuffer()
 {
   if(mBuffer)
   {
+#if defined(DEBUG_ENABLED)
+    gPixelBufferAllocationTotal -= mBufferSize;
+#endif
     free(mBuffer);
   }
 }
@@ -228,6 +249,9 @@ void PixelBuffer::AllocateFixedSize(uint32_t size)
   ReleaseBuffer();
   mBuffer     = reinterpret_cast<unsigned char*>(malloc(size));
   mBufferSize = size;
+#if defined(DEBUG_ENABLED)
+  gPixelBufferAllocationTotal += size;
+#endif
 }
 
 bool PixelBuffer::Rotate(Degree angle)
index 0866dd4..45ff5dd 100644 (file)
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/integration-api/debug.h>
 #include <dali/public-api/images/image-operations.h> // For ImageDimensions
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/object/base-object.h>
@@ -106,6 +107,18 @@ protected:
 
 public:
   /**
+   * Get the total allocated size of current pixel buffers
+   */
+  static uint32_t GetTotalAllocatedSize()
+  {
+#if defined(DEBUG_ENABLED)
+    return gPixelBufferAllocationTotal;
+#else
+    return 0;
+#endif
+  }
+
+  /**
    * Get the width of the buffer in pixels.
    * @return The width of the buffer in pixels
    */
@@ -297,6 +310,10 @@ private:
   uint32_t                       mStride;        ///< Buffer stride in bytes, 0 means the buffer is tightly packed
   Pixel::Format                  mPixelFormat;   ///< Pixel format
   bool                           mPreMultiplied; ///< PreMultiplied
+
+#if defined(DEBUG_ENABLED)
+  static uint32_t gPixelBufferAllocationTotal;
+#endif
 };
 
 } // namespace Adaptor
index d81e456..44e5460 100644 (file)
@@ -104,7 +104,7 @@ void NetworkPerformanceServer::Start()
     int error = pthread_create(&mServerThread, NULL, ConnectionListenerFunc, this);
     DALI_ASSERT_ALWAYS(!error && "pthread create failed");
 
-    Dali::Integration::Log::LogMessage(Integration::Log::DebugInfo, "~~~ NetworkPerformanceServer started on port %d ~~~ \n", SERVER_PORT + basePort);
+    Dali::Integration::Log::LogMessage(Integration::Log::INFO, "~~~ NetworkPerformanceServer started on port %d ~~~ \n", SERVER_PORT + basePort);
   }
 }
 void NetworkPerformanceServer::Stop()
index 634d0b9..2ceb29f 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.
@@ -31,14 +31,17 @@ void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& messag
 
   switch(level)
   {
-    case Dali::Integration::Log::DebugInfo:
+    case Dali::Integration::Log::DEBUG:
+      __android_log_print(ANDROID_LOG_DEBUG, DALI_TAG, "%s", message.c_str());
+      break;
+    case Dali::Integration::Log::INFO:
       __android_log_print(ANDROID_LOG_INFO, DALI_TAG, "%s", message.c_str());
       break;
-    case Dali::Integration::Log::DebugWarning:
+    case Dali::Integration::Log::WARNING:
       __android_log_print(ANDROID_LOG_WARN, DALI_TAG, "%s", message.c_str());
       break;
-    case Dali::Integration::Log::DebugError:
-      __android_log_print(ANDROID_LOG_DEBUG, DALI_TAG, "%s", message.c_str());
+    case Dali::Integration::Log::ERROR:
+      __android_log_print(ANDROID_LOG_ERROR, DALI_TAG, "%s", message.c_str());
       break;
     default:
       __android_log_print(ANDROID_LOG_DEBUG, DALI_TAG, "%s", message.c_str());
index 6de61e0..d1b0829 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.
@@ -206,6 +206,7 @@ EnvironmentOptions::EnvironmentOptions()
   mFpsFrequency(0),
   mUpdateStatusFrequency(0),
   mObjectProfilerInterval(0),
+  mMemoryPoolInterval(0),
   mPerformanceStatsLevel(0),
   mPerformanceStatsFrequency(DEFAULT_STATISTICS_LOG_FREQUENCY),
   mPerformanceTimeStampOutput(0),
@@ -300,7 +301,10 @@ unsigned int EnvironmentOptions::GetObjectProfilerInterval() const
 {
   return mObjectProfilerInterval;
 }
-
+unsigned int EnvironmentOptions::GetMemoryPoolInterval() const
+{
+  return mMemoryPoolInterval;
+}
 unsigned int EnvironmentOptions::GetPerformanceStatsLoggingOptions() const
 {
   return mPerformanceStatsLevel;
@@ -522,6 +526,7 @@ void EnvironmentOptions::ParseEnvironmentOptions()
   mFpsFrequency               = GetEnvironmentVariable(DALI_ENV_FPS_TRACKING, 0);
   mUpdateStatusFrequency      = GetEnvironmentVariable(DALI_ENV_UPDATE_STATUS_INTERVAL, 0);
   mObjectProfilerInterval     = GetEnvironmentVariable(DALI_ENV_OBJECT_PROFILER_INTERVAL, 0);
+  mMemoryPoolInterval         = GetEnvironmentVariable(DALI_ENV_MEMORY_POOL_INTERVAL, 0);
   mPerformanceStatsLevel      = GetEnvironmentVariable(DALI_ENV_LOG_PERFORMANCE_STATS, 0);
   mPerformanceStatsFrequency  = GetEnvironmentVariable(DALI_ENV_LOG_PERFORMANCE_STATS_FREQUENCY, 0);
   mPerformanceTimeStampOutput = GetEnvironmentVariable(DALI_ENV_PERFORMANCE_TIMESTAMP_OUTPUT, 0);
index 4ba290c..13299e6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_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.
@@ -100,6 +100,11 @@ public:
   unsigned int GetObjectProfilerInterval() const;
 
   /**
+   * @return memory pool status interval (0==off)
+   */
+  unsigned int GetMemoryPoolInterval() const;
+
+  /**
    * @return performance statistics log level ( 0 == off )
    */
   unsigned int GetPerformanceStatsLoggingOptions() const;
@@ -354,6 +359,7 @@ private: // Data
   unsigned int mFpsFrequency;               ///< how often fps is logged out in seconds
   unsigned int mUpdateStatusFrequency;      ///< how often update status is logged out in frames
   unsigned int mObjectProfilerInterval;     ///< how often object counts are logged out in seconds
+  uint32_t     mMemoryPoolInterval;         ///< how often memory pool capacities are logged out in seconds
   unsigned int mPerformanceStatsLevel;      ///< performance statistics logging bitmask
   unsigned int mPerformanceStatsFrequency;  ///< performance statistics logging frequency (seconds)
   unsigned int mPerformanceTimeStampOutput; ///< performance time stamp output ( bitmask)
index c262bd7..59329f0 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_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.
@@ -53,6 +53,7 @@ namespace Adaptor
 #define DALI_ENV_UPDATE_STATUS_INTERVAL "DALI_UPDATE_STATUS_INTERVAL"
 
 #define DALI_ENV_OBJECT_PROFILER_INTERVAL "DALI_OBJECT_PROFILER_INTERVAL"
+#define DALI_ENV_MEMORY_POOL_INTERVAL "DALI_MEMORY_POOL_INTERVAL"
 
 // Pan-Gesture configuration:
 // Prediction Modes 1 & 2:
index 4be76bd..576d8f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 20217 Samsung Electronics Co., Ltd.
+ * Copyright (c) 20227 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 <dali/integration-api/debug.h>
 #include <dali/integration-api/profiling.h>
+#include <dali/internal/imaging/common/pixel-buffer-impl.h>
+#include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/type-registry.h>
+
 #include <stdlib.h>
 
 using std::string;
@@ -60,18 +63,23 @@ void ObjectProfiler::DisplayInstanceCounts()
     std::size_t memorySize = GetMemorySize(element.first, element.second);
     if(memorySize > 0)
     {
-      LogMessage(Debug::DebugInfo, "%-30s: % 4d  Memory MemorySize: ~% 6.1f kB\n", element.first.c_str(), element.second, memorySize / 1024.0f);
+      LogMessage(Debug::INFO, "%-30s: % 4d  Memory MemorySize: ~% 6.1f kB\n", element.first.c_str(), element.second, memorySize / 1024.0f);
     }
     else
     {
-      LogMessage(Debug::DebugInfo, "%-30s: % 4d\n", element.first.c_str(), element.second);
+      LogMessage(Debug::INFO, "%-30s: % 4d\n", element.first.c_str(), element.second);
     }
   }
-  LogMessage(Debug::DebugInfo, "\n");
+  LogMessage(Debug::INFO, "\n");
 }
 
 bool ObjectProfiler::OnTimeout()
 {
+  uint32_t pixelDataSize   = Dali::PixelData::GetTotalAllocatedSize();
+  uint32_t pixelBufferSize = Dali::Internal::Adaptor::PixelBuffer::GetTotalAllocatedSize();
+  LogMessage(Debug::INFO, "Total PixelData: %9.1fkb\n", ((float)pixelDataSize) / 1024.0f);
+  LogMessage(Debug::INFO, "Total PixelBuffer: %9.1fkb\n", ((float)pixelBufferSize) / 1024.0f);
+
   DisplayInstanceCounts();
   return true;
 }
index 4f85519..ec01f5c 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.
@@ -116,10 +116,10 @@ PerformanceInterface::ContextId PerformanceServer::AddContext(const char* name)
   return mStatContextManager.AddContext(name, PerformanceMarker::CUSTOM_EVENTS);
 }
 
-PerformanceInterface::ContextId PerformanceServer::GetContextId( const char* name )
+PerformanceInterface::ContextId PerformanceServer::GetContextId(const char* name)
 {
   // for adding custom contexts
-  return mStatContextManager.GetContextId( name );
+  return mStatContextManager.GetContextId(name);
 }
 
 void PerformanceServer::RemoveContext(ContextId contextId)
@@ -191,7 +191,7 @@ void PerformanceServer::AddMarker(MarkerType markerType)
 
 void PerformanceServer::LogContextStatistics(const char* const text)
 {
-  Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, text);
+  Integration::Log::LogMessage(Dali::Integration::Log::INFO, text);
 }
 
 void PerformanceServer::LogMarker(const PerformanceMarker& marker, const char* const description)
@@ -225,7 +225,7 @@ void PerformanceServer::LogMarker(const PerformanceMarker& marker, const char* c
   // log to Dali log ( this is thread safe )
   if(mPerformanceOutputBitmask & OUTPUT_DALI_LOG)
   {
-    Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo,
+    Integration::Log::LogMessage(Dali::Integration::Log::INFO,
                                  "%.6f (seconds), %s\n",
                                  float(marker.GetTimeStamp().microseconds) * MICROSECONDS_TO_SECOND,
                                  description);
index 9431467..b19c2a0 100644 (file)
@@ -36,15 +36,15 @@ const int TTRACE_TAG_GRAPHICS = 1;
 
 void traceAsyncBegin(int tag, int cookie, const char* name, ...)
 {
-  Debug::LogMessage(Debug::DebugInfo, "AsyncBegin: %s : cookie %d\n", name, cookie);
+  Debug::LogMessage(Debug::INFO, "AsyncBegin: %s : cookie %d\n", name, cookie);
 }
 void traceAsyncEnd(int tag, int cookie, const char* name, ...)
 {
-  Debug::LogMessage(Debug::DebugInfo, "AsyncEnd: %s : cookie %d\n", name, cookie);
+  Debug::LogMessage(Debug::INFO, "AsyncEnd: %s : cookie %d\n", name, cookie);
 }
 void traceMark(int tag, const char* name, ...)
 {
-  Debug::LogMessage(Debug::DebugInfo, "Marker: %s \n", name);
+  Debug::LogMessage(Debug::INFO, "Marker: %s \n", name);
 }
 } // namespace
 #endif
index 4decbb4..5428f1a 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.
@@ -34,13 +34,16 @@ void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& messag
 
   switch(level)
   {
-    case Dali::Integration::Log::DebugInfo:
+    case Dali::Integration::Log::DEBUG:
+      print_log(DLOG_DEBUG, DALI_TAG, "%s", message.c_str());
+      break;
+    case Dali::Integration::Log::INFO:
       print_log(DLOG_INFO, DALI_TAG, "%s", message.c_str());
       break;
-    case Dali::Integration::Log::DebugWarning:
+    case Dali::Integration::Log::WARNING:
       print_log(DLOG_WARN, DALI_TAG, "%s", message.c_str());
       break;
-    case Dali::Integration::Log::DebugError:
+    case Dali::Integration::Log::ERROR:
       print_log(DLOG_ERROR, DALI_TAG, "%s", message.c_str());
       break;
     default:
index 8a41c87..dc317a5 100644 (file)
@@ -32,13 +32,16 @@ void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& messag
   const char* format = NULL;
   switch(level)
   {
-    case Dali::Integration::Log::DebugInfo:
+    case Dali::Integration::Log::DEBUG:
+      format = "\e[1;32mDEBUG:\e[21m %s: %s\e[0m";
+      break;
+    case Dali::Integration::Log::INFO:
       format = "\e[1;32mINFO:\e[21m %s: %s\e[0m";
       break;
-    case Dali::Integration::Log::DebugWarning:
+    case Dali::Integration::Log::WARNING:
       format = "\e[1;33mWARN:\e[21m %s: %s\e[0m";
       break;
-    case Dali::Integration::Log::DebugError:
+    case Dali::Integration::Log::ERROR:
       format = "\e[1;91mERROR:\e[21m %s: %s\e[0m";
       break;
     default:
index 570d67f..2784c61 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.
@@ -32,13 +32,16 @@ void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& messag
   const char* format = NULL;
   switch(level)
   {
-    case Dali::Integration::Log::DebugInfo:
+    case Dali::Integration::Log::DEBUG:
+      format = "\e[1;34mDEBUG:\e[21m %s: %s\e[0m";
+      break;
+    case Dali::Integration::Log::INFO:
       format = "\e[1;34mINFO:\e[21m %s: %s\e[0m";
       break;
-    case Dali::Integration::Log::DebugWarning:
+    case Dali::Integration::Log::WARNING:
       format = "\e[1;33mWARN:\e[21m %s: %s\e[0m";
       break;
-    case Dali::Integration::Log::DebugError:
+    case Dali::Integration::Log::ERROR:
       format = "\e[1;91mERROR:\e[21m %s: %s\e[0m";
       break;
     default:
index 4a99c5a..956653f 100644 (file)
@@ -61,7 +61,7 @@ void TraceManagerTizen::LogContext(bool start, const char* tag)
 
     if(gTraceManagerEnablePrintLog)
     {
-      DALI_LOG_RELEASE_INFO("BEGIN: %s\n", tag);
+      DALI_LOG_DEBUG_INFO("BEGIN: %s\n", tag);
     }
   }
   else
@@ -70,7 +70,7 @@ void TraceManagerTizen::LogContext(bool start, const char* tag)
 
     if(gTraceManagerEnablePrintLog)
     {
-      DALI_LOG_RELEASE_INFO("END: %s\n", tag);
+      DALI_LOG_DEBUG_INFO("END: %s\n", tag);
     }
   }
 }
index db58107..1a33ca2 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.
@@ -494,7 +494,9 @@ void GlWindow::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
     return;
   }
 
-  RecalculateTouchPosition(point);
+  Vector2 convertedPosition = RecalculatePosition(point.GetScreenPosition());
+  point.SetScreenPosition(convertedPosition);
+
   Dali::TouchEvent touchEvent = Dali::Integration::NewTouchEvent(timeStamp, point);
   Dali::GlWindow   handle(this);
   mTouchedSignal.Emit(touchEvent);
@@ -540,9 +542,8 @@ void GlWindow::OnRotation(const RotationEvent& rotation)
   }
 }
 
-void GlWindow::RecalculateTouchPosition(Integration::Point& point)
+Vector2 GlWindow::RecalculatePosition(const Vector2& position)
 {
-  Vector2 position = point.GetScreenPosition();
   Vector2 convertedPosition;
 
   switch(mTotalRotationAngle)
@@ -571,8 +572,7 @@ void GlWindow::RecalculateTouchPosition(Integration::Point& point)
       break;
     }
   }
-
-  point.SetScreenPosition(convertedPosition);
+  return convertedPosition;
 }
 
 void GlWindow::SetAvailableAnlges(const std::vector<int>& angles)
index 98f8c93..7df776c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_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.
@@ -293,9 +293,9 @@ private:
   void SetEventHandler();
 
   /**
-   * @brief calculate touch position for rotation.
+   * @brief calculate screen position for rotation.
    */
-  void RecalculateTouchPosition(Integration::Point& point);
+  Vector2 RecalculatePosition(const Vector2& position);
 
   /**
    * @brief Sets window and class name.
index 673f0bd..0cf5be8 100644 (file)
@@ -837,8 +837,8 @@ bool Window::UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali::Vector<bool
 
 void Window::OnIconifyChanged(bool iconified)
 {
-  const bool isActuallyChanged = (iconified != mIconified);
-  auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge();
+  const bool   isActuallyChanged = (iconified != mIconified);
+  auto         bridge            = Dali::Accessibility::Bridge::GetCurrentBridge();
   Dali::Window handle(this);
 
   if(iconified)
@@ -891,7 +891,7 @@ void Window::OnMaximizeChanged(bool maximized)
 
   if(isActuallyChanged)
   {
-    auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge();
+    auto         bridge = Dali::Accessibility::Bridge::GetCurrentBridge();
     Dali::Window handle(this);
 
     if(maximized)
@@ -1116,9 +1116,8 @@ void Window::OnAccessibilityDisabled()
   bridge->RemoveTopLevelWindow(accessible);
 }
 
-void Window::RecalculateTouchPosition(Integration::Point& point)
+Vector2 Window::RecalculatePosition(const Vector2& position)
 {
-  Vector2 position = point.GetScreenPosition();
   Vector2 convertedPosition;
 
   switch(mRotationAngle)
@@ -1147,8 +1146,7 @@ void Window::RecalculateTouchPosition(Integration::Point& point)
       break;
     }
   }
-
-  point.SetScreenPosition(convertedPosition);
+  return convertedPosition;
 }
 
 Dali::Window Window::Get(Dali::Actor actor)
index f9d7fc7..35db02a 100644 (file)
@@ -644,9 +644,9 @@ private: // Dali::Internal::Adaptor::SceneHolder
   void OnResume() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculateTouchPosition
+   * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculatePosition
    */
-  void RecalculateTouchPosition(Integration::Point& point) override;
+  Vector2 RecalculatePosition(const Vector2& position) override;
 
 private: // Dali::Internal::Adaptor::EventHandler::Observer
   /**
index 1fcdf45..bfcbf7c 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const unsigned int ADAPTOR_MAJOR_VERSION = 2;
 const unsigned int ADAPTOR_MINOR_VERSION = 2;
-const unsigned int ADAPTOR_MICRO_VERSION = 5;
+const unsigned int ADAPTOR_MICRO_VERSION = 6;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index d00b6c7..b3e6fc8 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    2.2.5
+Version:    2.2.6
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT