Merge branch 'devel/master' into tizen accepted/tizen/unified/20230428.155059
authorjoogab.yun <joogab.yun@samsung.com>
Wed, 26 Apr 2023 05:38:23 +0000 (14:38 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Wed, 26 Apr 2023 05:38:23 +0000 (14:38 +0900)
Change-Id: Ie74f46d93fa14e5d4b686638ff8763654822c687

29 files changed:
automated-tests/src/dali-adaptor/CMakeLists.txt
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.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-controller.cpp
automated-tests/src/dali-adaptor/utc-Dali-Application.cpp
automated-tests/src/dali-adaptor/utc-Dali-WindowData.cpp [new file with mode: 0644]
dali/dali.h
dali/devel-api/adaptor-framework/graphics-capabilities.cpp [new file with mode: 0644]
dali/devel-api/adaptor-framework/graphics-capabilities.h [new file with mode: 0644]
dali/devel-api/file.list
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/graphics/common/graphics-interface.h
dali/internal/graphics/gles-impl/gles-context.cpp
dali/internal/graphics/gles-impl/gles-graphics-reflection.cpp
dali/internal/graphics/gles-impl/gles-graphics-shader.cpp
dali/internal/graphics/gles/egl-graphics.h
dali/internal/graphics/gles/gl-implementation.h
dali/internal/system/common/configuration-manager.cpp
dali/internal/system/common/configuration-manager.h
dali/internal/system/common/environment-variables.h
dali/internal/text/text-abstraction/font-client-impl.cpp
dali/internal/text/text-abstraction/font-client-impl.h
dali/public-api/adaptor-framework/application.cpp
dali/public-api/adaptor-framework/application.h
dali/public-api/adaptor-framework/window-data.cpp [new file with mode: 0644]
dali/public-api/adaptor-framework/window-data.h [new file with mode: 0644]
dali/public-api/dali-adaptor-version.cpp
dali/public-api/file.list
packaging/dali-adaptor.spec

index f4c425e..ecbe6f8 100644 (file)
@@ -8,6 +8,7 @@ SET(TC_SOURCES
     utc-Dali-Application.cpp
     utc-Dali-EncodedImageBuffer.cpp
     utc-Dali-Capture.cpp
+    utc-Dali-WindowData.cpp
     utc-Dali-FileLoader.cpp
     utc-Dali-GifLoading.cpp
     utc-Dali-Gl-Window.cpp
index 7ba7834..834ae6f 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_GL_ABSTRACTION_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -1893,10 +1893,26 @@ public:
 
   inline void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount) override
   {
+    std::stringstream out;
+    out << mode << ", " << first << ", " << count << ", " << instanceCount;
+    TraceCallStack::NamedParams namedParams;
+    namedParams["mode"] << std::hex << mode;
+    namedParams["first"] << first;
+    namedParams["count"] << count;
+    namedParams["instanceCount"] << instanceCount;
+    mDrawTrace.PushCall("DrawArraysInstanced", out.str(), namedParams);
   }
 
   inline void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount) override
   {
+    std::stringstream out;
+    out << mode << ", " << count << ", " << type << ", " << instanceCount;
+    TraceCallStack::NamedParams namedParams;
+    namedParams["mode"] << std::hex << mode;
+    namedParams["count"] << count;
+    namedParams["type"] << std::hex << type;
+    namedParams["indexCount"] << instanceCount;
+    mDrawTrace.PushCall("DrawElementsInstanced", out.str(), namedParams);
   }
 
   inline GLsync FenceSync(GLenum condition, GLbitfield flags) override
@@ -1981,6 +1997,12 @@ public:
 
   inline void VertexAttribDivisor(GLuint index, GLuint divisor) override
   {
+    std::stringstream out;
+    out << index << ", " << divisor;
+    TraceCallStack::NamedParams namedParams;
+    namedParams["index"] << index;
+    namedParams["divisor"] << divisor;
+    mBufferTrace.PushCall("VertexAttribDivisor", out.str(), namedParams);
   }
 
   inline void BindTransformFeedback(GLenum target, GLuint id) override
index 66c9f7a..fbeecdf 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_GRAPHICS_APPLICATION_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -179,6 +179,11 @@ public:
     return 32768u;
   }
 
+  uint32_t GetMaxCombinedTextureUnits() override
+  {
+    return 96;
+  }
+
   /**
    * @return the maximum texture samples when we use multisampled texture
    */
index 319ec67..3cc464c 100644 (file)
@@ -712,9 +712,19 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com
       {
         if(currentPipeline)
         {
-          mGl.DrawArrays(GetTopology(currentPipeline->inputAssemblyState.topology),
-                         0,
-                         cmd.data.draw.draw.vertexCount);
+          if(cmd.data.draw.draw.instanceCount == 0)
+          {
+            mGl.DrawArrays(GetTopology(currentPipeline->inputAssemblyState.topology),
+                           0,
+                           cmd.data.draw.draw.vertexCount);
+          }
+          else
+          {
+            mGl.DrawArraysInstanced(GetTopology(currentPipeline->inputAssemblyState.topology),
+                                    0,
+                                    cmd.data.draw.draw.vertexCount,
+                                    cmd.data.draw.draw.instanceCount);
+          }
         }
         break;
       }
@@ -722,10 +732,21 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com
       {
         if(currentPipeline)
         {
-          mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology),
-                           static_cast<GLsizei>(cmd.data.draw.drawIndexed.indexCount),
-                           GL_UNSIGNED_SHORT,
-                           reinterpret_cast<void*>(cmd.data.draw.drawIndexed.firstIndex));
+          if(cmd.data.draw.draw.instanceCount == 0)
+          {
+            mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology),
+                             static_cast<GLsizei>(cmd.data.draw.drawIndexed.indexCount),
+                             GL_UNSIGNED_SHORT,
+                             reinterpret_cast<void*>(cmd.data.draw.drawIndexed.firstIndex));
+          }
+          else
+          {
+            mGl.DrawElementsInstanced(GetTopology(currentPipeline->inputAssemblyState.topology),
+                                      static_cast<GLsizei>(cmd.data.draw.drawIndexed.indexCount),
+                                      GL_UNSIGNED_SHORT,
+                                      reinterpret_cast<void*>(cmd.data.draw.drawIndexed.firstIndex),
+                                      cmd.data.draw.drawIndexed.instanceCount);
+          }
         }
         break;
       }
@@ -983,12 +1004,22 @@ void TestGraphicsController::BindPipeline(TestGraphicsPipeline* pipeline)
     uint32_t attributeOffset = attribute.offset;
     GLsizei  stride          = vi.bufferBindings[attribute.binding].stride;
 
+    auto rate = vi.bufferBindings[attribute.binding].inputRate;
+
     mGl.VertexAttribPointer(attribute.location,
                             GetNumComponents(attribute.format),
                             GetGlType(attribute.format),
                             GL_FALSE, // Not normalized
                             stride,
                             reinterpret_cast<void*>(attributeOffset));
+    if(rate == Graphics::VertexInputRate::PER_VERTEX)
+    {
+      mGl.VertexAttribDivisor(attribute.location, 0);
+    }
+    else if(rate == Graphics::VertexInputRate::PER_INSTANCE)
+    {
+      mGl.VertexAttribDivisor(attribute.location, 1);
+    }
   }
 
   // Cull face setup
index a760954..7261b37 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -181,6 +181,22 @@ int UtcDaliApplicationNew07P(void)
   END_TEST;
 }
 
+int UtcDaliApplicationNew08P(void)
+{
+  int         argc(1);
+  const char* argList[1] = {"program"};
+  char**      argv       = const_cast<char**>(argList);
+  WindowData  windowData;
+
+  Application application = Application::New(&argc, &argv, "stylesheet", false, windowData);
+
+  MyTestApp testApp(application);
+
+  DALI_TEST_CHECK(application);
+
+  END_TEST;
+}
+
 int UtcDaliApplicationCopyAndAssignment(void)
 {
   Application application = Application::New();
diff --git a/automated-tests/src/dali-adaptor/utc-Dali-WindowData.cpp b/automated-tests/src/dali-adaptor/utc-Dali-WindowData.cpp
new file mode 100644 (file)
index 0000000..abe4286
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2023 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/public-api/adaptor-framework/window-data.h>
+
+using namespace Dali;
+
+int UtcDaliWindowData01(void)
+{
+  // Test default values
+  WindowData windowData;
+
+  DALI_TEST_CHECK(windowData.GetWindowType() == WindowType::NORMAL);
+  DALI_TEST_CHECK(windowData.GetTransparency() == true);
+  DALI_TEST_CHECK(windowData.GetPositionSize().x == 0);
+  DALI_TEST_CHECK(windowData.GetPositionSize().y == 0);
+  DALI_TEST_CHECK(windowData.GetPositionSize().width == 0);
+  DALI_TEST_CHECK(windowData.GetPositionSize().height == 0);
+
+  END_TEST;
+}
+
+int UtcDaliWindowData02(void)
+{
+  // Test SetTransparency and GetTransparency
+  WindowData windowData;
+  windowData.SetTransparency(false);
+
+  DALI_TEST_CHECK(windowData.GetTransparency() == false);
+
+  END_TEST;
+}
+
+int UtcDaliWindowData03(void)
+{
+  // Test SetWindowType and GetWindowType
+  WindowData windowData;
+  windowData.SetWindowType(WindowType::UTILITY);
+
+  DALI_TEST_CHECK(windowData.GetWindowType() == WindowType::UTILITY);
+
+  END_TEST;
+}
+
+int UtcDaliWindowData04(void)
+{
+  // Test SetPositionSize and GetPositionSize
+  WindowData      windowData;
+  Dali::Rect<int> rect(100, 200, 300, 400);
+  windowData.SetPositionSize(rect);
+
+  DALI_TEST_CHECK(windowData.GetPositionSize().x == 100);
+  DALI_TEST_CHECK(windowData.GetPositionSize().y == 200);
+  DALI_TEST_CHECK(windowData.GetPositionSize().width == 300);
+  DALI_TEST_CHECK(windowData.GetPositionSize().height == 400);
+
+  END_TEST;
+}
index ff3b7df..db4687d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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,6 +32,7 @@
 #include <dali/public-api/adaptor-framework/widget-application.h>
 #include <dali/public-api/adaptor-framework/widget-impl.h>
 #include <dali/public-api/adaptor-framework/widget.h>
+#include <dali/public-api/adaptor-framework/window-data.h>
 #include <dali/public-api/dali-adaptor-version.h>
 
-#endif //DALI_H
+#endif // DALI_H
diff --git a/dali/devel-api/adaptor-framework/graphics-capabilities.cpp b/dali/devel-api/adaptor-framework/graphics-capabilities.cpp
new file mode 100644 (file)
index 0000000..7f79a0f
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2023 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/devel-api/adaptor-framework/graphics-capabilities.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/system/common/configuration-manager.h>
+
+namespace Dali::GraphicsCapabilities
+{
+uint32_t GetMaxCombinedTextureUnits()
+{
+  Dali::Adaptor&                                       adaptor              = Adaptor::Get();
+  Internal::Adaptor::Adaptor&                          adaptorImpl          = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
+  const Dali::Internal::Adaptor::ConfigurationManager* configurationManager = adaptorImpl.GetConfigurationManager();
+  if(configurationManager)
+  {
+    return const_cast<Dali::Internal::Adaptor::ConfigurationManager*>(configurationManager)->GetMaxCombinedTextureUnits();
+  }
+  return 8; // Gles2 max.
+}
+
+} // namespace Dali::GraphicsCapabilities
diff --git a/dali/devel-api/adaptor-framework/graphics-capabilities.h b/dali/devel-api/adaptor-framework/graphics-capabilities.h
new file mode 100644 (file)
index 0000000..a989829
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef DALI_DEVEL_API_ADAPTOR_GRAPHICS_CAPABILITIES_H
+#define DALI_DEVEL_API_ADAPTOR_GRAPHICS_CAPABILITIES_H
+
+/*
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+
+// EXTERNAL INCLUDES
+#include <cstdint>
+
+namespace Dali::GraphicsCapabilities
+{
+/**
+ * @brief Get the total number of combined texture units that can be used by
+ * all the shaders in a given program.
+ *
+ * @return the maximum number of texture units
+ */
+DALI_ADAPTOR_API uint32_t GetMaxCombinedTextureUnits();
+
+} // namespace Dali::GraphicsCapabilities
+
+#endif //DALI_DEVEL_API_ADAPTOR_GRAPHICS_CAPABILITIES_H
index 9199da3..8cf5583 100755 (executable)
@@ -27,6 +27,7 @@ SET( devel_api_src_files
   ${adaptor_devel_api_dir}/adaptor-framework/feedback-player.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/file-loader.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/file-stream.cpp
+  ${adaptor_devel_api_dir}/adaptor-framework/graphics-capabilities.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/image-loading.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/input-method-context.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/input-method-options.cpp
@@ -77,6 +78,7 @@ SET( devel_api_adaptor_framework_header_files
   ${adaptor_devel_api_dir}/adaptor-framework/feedback-player.h
   ${adaptor_devel_api_dir}/adaptor-framework/file-loader.h
   ${adaptor_devel_api_dir}/adaptor-framework/file-stream.h
+  ${adaptor_devel_api_dir}/adaptor-framework/graphics-capabilities.h
   ${adaptor_devel_api_dir}/adaptor-framework/image-loader-input.h
   ${adaptor_devel_api_dir}/adaptor-framework/image-loader-plugin.h
   ${adaptor_devel_api_dir}/adaptor-framework/image-loading.h
index 07f5df4..814fa5a 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_IMPL_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -514,6 +514,15 @@ public: //AdaptorInternalServices
    */
   void GetWindowContainerInterface(WindowContainer& windows) override;
 
+  /**
+   * @brief Get the configuration manager
+   * @return The configuration manager, or null if it hasn't been created yet
+   */
+  const ConfigurationManager* GetConfigurationManager() const
+  {
+    return mConfigurationManager.get();
+  }
+
 public: // Signals
   /**
    * @copydoc Dali::Adaptor::SignalResized
index 53fa462..af632ac 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -167,6 +167,11 @@ public:
   virtual uint32_t GetMaxTextureSize() = 0;
 
   /**
+   * @return the maximum number of combined texture units
+   */
+  virtual uint32_t GetMaxCombinedTextureUnits() = 0;
+
+  /**
    * @return the maximum texture samples when we use multisampled texture
    */
   virtual uint8_t GetMaxTextureSamples() = 0;
index c6f0728..8a3602a 100644 (file)
@@ -139,6 +139,10 @@ struct Context::Impl
     memset(&mGlStateCache.mBoundTextureId, 0, sizeof(mGlStateCache.mBoundTextureId));
 
     mGlStateCache.mFrameBufferStateCache.Reset();
+
+    GLint maxTextures;
+    gl.GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextures);
+    DALI_LOG_RELEASE_INFO("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: %d\n", maxTextures);
   }
 
   /**
@@ -305,6 +309,12 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
   // Map binding# to sampler location
   const auto& reflection = !newProgram ? currentProgram->GetReflection() : newProgram->GetReflection();
   const auto& samplers   = reflection.GetSamplers();
+
+  uint32_t currentSampler = 0;
+  uint32_t currentElement = 0;
+
+  // @warning Assume that binding.binding is strictly linear in the same order as mCurrentTextureBindings
+  // elements. This avoids having to sort the bindings.
   for(const auto& binding : mImpl->mCurrentTextureBindings)
   {
     auto texture = const_cast<GLES::Texture*>(static_cast<const GLES::Texture*>(binding.texture));
@@ -312,24 +322,28 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
     // Texture may not have been initialized yet...(tbm_surface timing issue?)
     if(!texture->GetGLTexture())
     {
-      // Attempt to reinitialize
-      // @todo need to put this somewhere else where it isn't const.
-      // Maybe post it back on end of initialize queue if initialization fails?
       texture->InitializeResource();
     }
 
     // Warning, this may cause glWaitSync to occur on the GPU.
     dependencyChecker.CheckNeedsSync(this, texture);
-
     texture->Bind(binding);
-
-    texture->Prepare(); // @todo also non-const.
-
-    if(binding.binding < samplers.size()) // binding maps to texture unit. (texture bindings should also be in binding order)
+    texture->Prepare();
+
+    // @warning Assume that location of array elements is sequential.
+    // @warning GL does not guarantee this, but in practice, it is.
+    gl.Uniform1i(samplers[currentSampler].location + currentElement,
+                 samplers[currentSampler].offset + currentElement);
+    ++currentElement;
+    if(currentElement >= samplers[currentSampler].elementCount)
     {
-      // Offset is set to the lexical offset within the frag shader, map it to the texture unit
-      // @todo Explicitly set the texture unit through the graphics interface
-      gl.Uniform1i(samplers[binding.binding].location, samplers[binding.binding].offset);
+      ++currentSampler;
+      currentElement = 0;
+    }
+    if(currentSampler >= samplers.size())
+    {
+      // Don't bind more textures than there are active samplers.
+      break;
     }
   }
 
@@ -365,6 +379,21 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
                            GL_FALSE,
                            bufferBinding.stride,
                            reinterpret_cast<void*>(attr.offset));
+
+    switch(bufferBinding.inputRate)
+    {
+      case Graphics::VertexInputRate::PER_VERTEX:
+      {
+        gl.VertexAttribDivisor(attr.location, 0);
+        break;
+      }
+      case Graphics::VertexInputRate::PER_INSTANCE:
+      {
+        //@todo Get actual instance rate...
+        gl.VertexAttribDivisor(attr.location, 1);
+        break;
+      }
+    }
   }
 
   // Resolve topology
@@ -386,9 +415,19 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
         mImpl->FlushVertexAttributeLocations();
       }
 
-      gl.DrawArrays(GLESTopology(ia->topology),
-                    drawCall.draw.firstVertex,
-                    drawCall.draw.vertexCount);
+      if(drawCall.draw.instanceCount == 0)
+      {
+        gl.DrawArrays(GLESTopology(ia->topology),
+                      drawCall.draw.firstVertex,
+                      drawCall.draw.vertexCount);
+      }
+      else
+      {
+        gl.DrawArraysInstanced(GLESTopology(ia->topology),
+                               drawCall.draw.firstVertex,
+                               drawCall.draw.vertexCount,
+                               drawCall.draw.instanceCount);
+      }
       break;
     }
     case DrawCallDescriptor::Type::DRAW_INDEXED:
@@ -407,10 +446,21 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
       }
 
       auto indexBufferFormat = GLIndexFormat(binding.format).format;
-      gl.DrawElements(GLESTopology(ia->topology),
-                      drawCall.drawIndexed.indexCount,
-                      indexBufferFormat,
-                      reinterpret_cast<void*>(binding.offset));
+      if(drawCall.drawIndexed.instanceCount == 0)
+      {
+        gl.DrawElements(GLESTopology(ia->topology),
+                        drawCall.drawIndexed.indexCount,
+                        indexBufferFormat,
+                        reinterpret_cast<void*>(binding.offset));
+      }
+      else
+      {
+        gl.DrawElementsInstanced(GLESTopology(ia->topology),
+                                 drawCall.drawIndexed.indexCount,
+                                 indexBufferFormat,
+                                 reinterpret_cast<void*>(binding.offset),
+                                 drawCall.drawIndexed.instanceCount);
+      }
       break;
     }
     case DrawCallDescriptor::Type::DRAW_INDEXED_INDIRECT:
index ee7299a..04247c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -60,7 +60,8 @@ bool operator==(const StringSize& lhs, const char* rhs)
   return strncmp(lhs.mString, rhs, lhs.mLength) == 0;
 }
 
-const char* const    DELIMITERS = " \t\n";
+const char* const    DELIMITERS           = " \t\n";
+const char* const    DELIMITERS_INC_INDEX = " \t\n[]";
 constexpr StringSize UNIFORM{"uniform"};
 constexpr StringSize SAMPLER_PREFIX{"sampler"};
 constexpr StringSize SAMPLER_TYPES[]   = {"2D", "Cube", "ExternalOES"};
@@ -148,27 +149,50 @@ void ParseShaderSamplers(std::string shaderSource, std::vector<Dali::Graphics::U
 
     while(uniform)
     {
+      // From "uniform" to ";", not ignoring comments.
       char* outerToken = strtok_r(uniform + UNIFORM.mLength, ";", &uniform);
 
       char* nextPtr = nullptr;
       char* token   = strtok_r(outerToken, DELIMITERS, &nextPtr);
       while(token)
       {
+        // Ignore any token up to "sampler"
         if(SAMPLER_PREFIX == token)
         {
           token += SAMPLER_PREFIX.mLength;
           if(std::find(SAMPLER_TYPES, END_SAMPLER_TYPES, token) != END_SAMPLER_TYPES)
           {
             bool found(false);
-            token = strtok_r(nullptr, DELIMITERS, &nextPtr);
+            // We now are at next token after "samplerxxx" in outerToken token "stream"
+
+            // Does it use array notation?
+            int  arraySize = 0; // 0 = No array
+            auto iter      = std::string(token).find("[", 0);
+            if(iter != std::string::npos)
+            {
+              // Get Array size from source. (Warning, may be higher than GetActiveUniform suggests)
+              iter++;
+              arraySize = int(strtol(token + iter, nullptr, 0));
+            }
+
+            token = strtok_r(nullptr, DELIMITERS_INC_INDEX, &nextPtr); // " ", "\t", "\n", "[", "]"
 
             for(uint32_t i = 0; i < static_cast<uint32_t>(uniformOpaques.size()); ++i)
             {
               if(samplerPositions[i] == -1 &&
                  strncmp(token, uniformOpaques[i].name.c_str(), uniformOpaques[i].name.size()) == 0)
               {
-                samplerPositions[i] = uniformOpaques[i].offset = samplerPosition++;
-                found                                          = true;
+                // We have found a matching name.
+                samplerPositions[i] = uniformOpaques[i].offset = samplerPosition;
+                if(arraySize == 0)
+                {
+                  ++samplerPosition;
+                }
+                else
+                {
+                  samplerPosition += arraySize;
+                }
+                found = true;
                 break;
               }
             }
@@ -289,6 +313,7 @@ void Reflection::BuildUniformReflection()
     GLenum type;
     int    written;
     gl->GetActiveUniform(glProgram, i, maxLen, &written, &elementCount, &type, name);
+
     int location = gl->GetUniformLocation(glProgram, name);
 
     Dali::Graphics::UniformInfo uniformInfo;
@@ -296,16 +321,21 @@ void Reflection::BuildUniformReflection()
     uniformInfo.name = name;
     if(elementCount > 1)
     {
+      // If we have an active uniform that refers to an array, only the first element
+      // is present in this list, and is referenced as "uniform[0]", but the element
+      // count is non-zero to indicate how many uniforms there are in the array.
+
+      // Strip off the array, but store the element count
       auto iter = std::string(uniformInfo.name).find("[", 0);
       if(iter != std::string::npos)
       {
-        uniformInfo.name = std::string(name).substr(0, iter);
+        uniformInfo.name         = std::string(name).substr(0, iter);
+        uniformInfo.elementCount = elementCount;
       }
     }
-
     uniformInfo.uniformClass = IsSampler(type) ? Dali::Graphics::UniformClass::COMBINED_IMAGE_SAMPLER : Dali::Graphics::UniformClass::UNIFORM;
-    uniformInfo.location     = location; //IsSampler(type) ? 0 : location;
-    uniformInfo.binding      = 0;        // IsSampler(type) ? location : 0;
+    uniformInfo.location     = location; // GL doesn't guarantee that consecutive array elements have sequential locations. But, we only store location of first element.
+    uniformInfo.binding      = 0;
     uniformInfo.bufferIndex  = 0;
     uniformInfo.offset       = 0;
 
index 60f9a34..e8eb2c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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,8 +116,8 @@ bool Shader::Compile() const
         char    output[4096];
         GLsizei size{0u};
         gl->GetShaderInfoLog(shader, 4096, &size, output);
-        DALI_LOG_RELEASE_INFO("Code: %s\n", reinterpret_cast<const char*>(GetCreateInfo().sourceData));
-        DALI_LOG_RELEASE_INFO("Log: %s\n", output);
+        DALI_LOG_RENDER_INFO("Code: %s\n", reinterpret_cast<const char*>(GetCreateInfo().sourceData));
+        DALI_LOG_RENDER_INFO("Log: %s\n", output);
         gl->DeleteShader(shader);
         return false;
       }
index 5d04448..3969432 100644 (file)
@@ -188,6 +188,11 @@ public:
     return mGLES->GetMaxTextureSize();
   }
 
+  uint32_t GetMaxCombinedTextureUnits() override
+  {
+    return mGLES->GetMaxCombinedTextureUnits();
+  }
+
   uint8_t GetMaxTextureSamples() override
   {
     return mGLES->GetMaxTextureSamples();
index 191a294..5dac669 100644 (file)
@@ -82,6 +82,7 @@ public:
   : mGlExtensionSupportedCacheList(),
     mContextCreatedWaitCondition(),
     mMaxTextureSize(0),
+    mMaxCombinedTextureUnits(0),
     mMaxTextureSamples(0),
     mVertexShaderPrefix(""),
     mGlesVersion(INITIAL_GLES_VERSION),
@@ -110,6 +111,7 @@ public:
   void ContextCreated()
   {
     glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
+    glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &mMaxCombinedTextureUnits);
 
     // Since gles 2.0 didn't return well for GL_MAJOR_VERSION and GL_MINOR_VERSION,
     // Only change gles version for the device that support above gles 3.0.
@@ -365,6 +367,16 @@ public:
     return mMaxTextureSize;
   }
 
+  int GetMaxCombinedTextureUnits()
+  {
+    ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
+    if(!mIsContextCreated)
+    {
+      mContextCreatedWaitCondition.Wait(lock);
+    }
+    return mMaxCombinedTextureUnits;
+  }
+
   int GetMaxTextureSamples()
   {
     ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
@@ -1703,6 +1715,7 @@ private:
 
   ConditionalWait mContextCreatedWaitCondition;
   GLint           mMaxTextureSize;
+  GLint           mMaxCombinedTextureUnits;
   GLint           mMaxTextureSamples;
   std::string     mShaderVersionPrefix;
   std::string     mVertexShaderPrefix;
index ff77416..9f42c21 100644 (file)
@@ -50,6 +50,7 @@ ConfigurationManager::ConfigurationManager(std::string systemCachePath, Graphics
   mGraphics(graphics),
   mThreadController(threadController),
   mMaxTextureSize(0u),
+  mMaxCombinedTextureUnits(0u),
   mShaderLanguageVersion(0u),
   mIsMultipleWindowSupported(true),
   mIsAdvancedBlendEquationSupported(true),
@@ -58,7 +59,8 @@ ConfigurationManager::ConfigurationManager(std::string systemCachePath, Graphics
   mIsMultipleWindowSupportedCached(false),
   mIsAdvancedBlendEquationSupportedCached(false),
   mIsMultisampledRenderToTextureSupportedCached(false),
-  mShaderLanguageVersionCached(false)
+  mShaderLanguageVersionCached(false),
+  mMaxCombinedTextureUnitsCached(false)
 {
 }
 
@@ -92,6 +94,12 @@ void ConfigurationManager::RetrieveKeysFromConfigFile(const std::string& configF
         mMaxTextureSize       = std::atoi(value.c_str());
         mMaxTextureSizeCached = true;
       }
+      if(!mMaxCombinedTextureUnitsCached && name == DALI_ENV_MAX_COMBINED_TEXTURE_UNITS)
+      {
+        std::getline(subStream, value);
+        mMaxCombinedTextureUnits       = std::atoi(value.c_str());
+        mMaxCombinedTextureUnitsCached = true;
+      }
       else if(!mIsAdvancedBlendEquationSupportedCached && name == DALI_BLEND_EQUATION_ADVANCED_SUPPORT)
       {
         std::getline(subStream, value);
@@ -154,6 +162,41 @@ uint32_t ConfigurationManager::GetMaxTextureSize()
   return mMaxTextureSize;
 }
 
+uint32_t ConfigurationManager::GetMaxCombinedTextureUnits()
+{
+  if(!mMaxCombinedTextureUnitsCached)
+  {
+    RetrieveKeysFromConfigFile(mSystemCacheFilePath);
+
+    if(!mMaxCombinedTextureUnitsCached)
+    {
+      if(!mGraphics->IsInitialized())
+      {
+        // Wait until Graphics Subsystem is initialised, but this will happen once.
+        // This method blocks until the render thread has initialised the graphics.
+        mThreadController->WaitForGraphicsInitialization();
+      }
+
+      mMaxCombinedTextureUnits       = mGraphics->GetMaxCombinedTextureUnits();
+      mMaxCombinedTextureUnitsCached = true;
+      DALI_LOG_RENDER_INFO("MaxCombinedTextureUnits = %d\n", mMaxCombinedTextureUnits);
+
+      Dali::FileStream configFile(mSystemCacheFilePath, Dali::FileStream::READ | Dali::FileStream::APPEND | Dali::FileStream::TEXT);
+      std::fstream&    stream = dynamic_cast<std::fstream&>(configFile.GetStream());
+      if(stream.is_open())
+      {
+        stream << DALI_ENV_MAX_COMBINED_TEXTURE_UNITS << " " << mMaxCombinedTextureUnits << std::endl;
+      }
+      else
+      {
+        DALI_LOG_ERROR("Fail to open file : %s\n", mSystemCacheFilePath.c_str());
+      }
+    }
+  }
+
+  return mMaxCombinedTextureUnits;
+}
+
 uint32_t ConfigurationManager::GetShadingLanguageVersion()
 {
   if(!mShaderLanguageVersionCached)
index 7fc767e..930a38b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ENVIRONMENT_CONFIGURATION_MANAGER_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -63,6 +63,12 @@ public:
   uint32_t GetMaxTextureSize();
 
   /**
+   * @brief Get the maximum number of combined texture units (across all shaders in program)
+   * @return the number of combined texture units
+   */
+  uint32_t GetMaxCombinedTextureUnits();
+
+  /**
    * @brief Get the shader language version that the system supports
    * @return the shader language version.
    */
@@ -102,6 +108,7 @@ private:                                                                // Data
   GraphicsInterface* mGraphics;                                         ///< Graphics interface
   ThreadController*  mThreadController;                                 ///< The thread controller
   unsigned int       mMaxTextureSize;                                   ///< The largest texture that the GL can handle
+  unsigned int       mMaxCombinedTextureUnits;                          ///< The maximum number of combined texture units
   unsigned int       mShaderLanguageVersion;                            ///< The shader language version that the system supports.
   bool               mIsMultipleWindowSupported : 1;                    ///< Whether multiple window is supported by the GLES
   bool               mIsAdvancedBlendEquationSupported : 1;             ///< Whether blend equation advanced (extension) is supported by the GLES
@@ -111,6 +118,7 @@ private:                                                                // Data
   bool               mIsAdvancedBlendEquationSupportedCached : 1;       ///< Whether we have checked the support of blend equation advanced (extension)
   bool               mIsMultisampledRenderToTextureSupportedCached : 1; ///< Whether we have checked the support of multisampled render to texture (extension)
   bool               mShaderLanguageVersionCached : 1;                  ///< Whether we have checked the shader language version
+  bool               mMaxCombinedTextureUnitsCached : 1;                ///< Whether we have checked the maximum number of combined texture units
 };
 
 } // namespace Adaptor
index 59329f0..5ec4398 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -123,6 +123,8 @@ namespace Adaptor
 
 #define DALI_ENV_MAX_TEXTURE_SIZE "DALI_MAX_TEXTURE_SIZE"
 
+#define DALI_ENV_MAX_COMBINED_TEXTURE_UNITS "DALI_MAX_COMBINED_TEXTURE_UNITS"
+
 #define DALI_RENDER_TO_FBO "DALI_RENDER_TO_FBO"
 
 #define DALI_ENV_DISABLE_DEPTH_BUFFER "DALI_DISABLE_DEPTH_BUFFER"
index 5e2b258..ea171dc 100644 (file)
@@ -53,8 +53,7 @@ namespace TextAbstraction
 {
 namespace Internal
 {
-Dali::TextAbstraction::FontClient FontClient::gPreInitializedFontClient(NULL);
-Dali::TextAbstraction::FontClient FontClient::gPreCachedFontClient(NULL);
+Dali::TextAbstraction::FontClient FontClient::gPreCreatedFontClient(NULL);
 std::thread                       gPreCacheThread;
 /* TODO: This is to prevent duplicate calls of font pre-cache.
  * We may support this later, but currently we can't guarantee the behaviour
@@ -96,16 +95,10 @@ Dali::TextAbstraction::FontClient FontClient::Get()
         FONT_LOG_MESSAGE(Dali::Integration::Log::INFO, "FontClient PreCache thread join\n");
       }
 
-      if(gPreInitializedFontClient)
+      if(gPreCreatedFontClient)
       {
-        fontClientHandle = gPreInitializedFontClient;
-        gPreInitializedFontClient.Reset(); // No longer needed
-      }
-      else if(gPreCachedFontClient)
-      {
-        // TODO: Currently font pre-caching is not available in the candidate process.
-        fontClientHandle = gPreCachedFontClient;
-        gPreCachedFontClient.Reset(); // No longer needed
+        fontClientHandle = gPreCreatedFontClient;
+        gPreCreatedFontClient.Reset(); // No longer needed
       }
       else
       {
@@ -136,24 +129,34 @@ Dali::TextAbstraction::FontClient FontClient::Get()
 
 Dali::TextAbstraction::FontClient FontClient::PreInitialize()
 {
-  gPreInitializedFontClient = Dali::TextAbstraction::FontClient(new FontClient);
+  // Pre-cached font client already exists or pre-cache thread already running.
+  // Font client pre-cache includes caching of the default font description.
+  if((gPreCreatedFontClient && !gFontPreCacheAvailable) ||
+     (gPreCacheThread.joinable()))
+  {
+    return gPreCreatedFontClient;
+  }
+
+  gPreCreatedFontClient = Dali::TextAbstraction::FontClient(new FontClient);
 
   // Make DefaultFontDescription cached
   Dali::TextAbstraction::FontDescription defaultFontDescription;
-  gPreInitializedFontClient.GetDefaultPlatformFontDescription(defaultFontDescription);
+  gPreCreatedFontClient.GetDefaultPlatformFontDescription(defaultFontDescription);
 
-  return gPreInitializedFontClient;
+  return gPreCreatedFontClient;
 }
 
 void FontClient::PreCacheRun(const FontFamilyList& fallbackFamilyList, const FontFamilyList& extraFamilyList, const FontFamily& localeFamily)
 {
-  if(!gPreCachedFontClient)
+  if(gFontPreCacheAvailable)
   {
-    FONT_LOG_MESSAGE(Dali::Integration::Log::INFO, "BEGIN: DALI_TEXT_PRECACHE_RUN\n");
-    Dali::TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient(new FontClient);
-    GetImplementation(fontClient).FontPreCache(fallbackFamilyList, extraFamilyList, localeFamily);
-    gPreCachedFontClient   = fontClient;
     gFontPreCacheAvailable = false;
+    FONT_LOG_MESSAGE(Dali::Integration::Log::INFO, "BEGIN: DALI_TEXT_PRECACHE_RUN\n");
+    if(!gPreCreatedFontClient)
+    {
+      gPreCreatedFontClient = Dali::TextAbstraction::FontClient(new FontClient);
+    }
+    GetImplementation(gPreCreatedFontClient).FontPreCache(fallbackFamilyList, extraFamilyList, localeFamily);
     FONT_LOG_MESSAGE(Dali::Integration::Log::INFO, "END: DALI_TEXT_PRECACHE_RUN\n");
   }
   else
index 46ae88c..01c09a8 100644 (file)
@@ -334,8 +334,7 @@ private:
   unsigned int mDpiHorizontal;
   unsigned int mDpiVertical;
 
-  static Dali::TextAbstraction::FontClient gPreInitializedFontClient;
-  static Dali::TextAbstraction::FontClient gPreCachedFontClient;
+  static Dali::TextAbstraction::FontClient gPreCreatedFontClient;
 
 }; // class FontClient
 
index 8ed1f90..36db754 100644 (file)
@@ -123,6 +123,34 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
   return Application(internal.Get());
 }
 
+Application Application::New(int* argc, char** argv[], const std::string& stylesheet, bool useUiThread, WindowData& windowData)
+{
+  Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
+  if(internal)
+  {
+    // pre-initialized application
+    internal->SetCommandLineOptions(argc, argv);
+    internal->SetStyleSheet(stylesheet);
+
+    // Set defaut Window type
+    internal->SetDefaultWindowType(windowData.GetWindowType());
+    internal->GetWindow().SetTransparency(windowData.GetTransparency());
+
+    // Store only the value before adaptor is created
+    internal->StoreWindowPositionSize(windowData.GetPositionSize());
+  }
+  else
+  {
+    // clang-format off
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet,
+                  windowData.GetTransparency() ? WINDOW_MODE::TRANSPARENT : WINDOW_MODE::OPAQUE,
+                  windowData.GetPositionSize(), Internal::Adaptor::Framework::NORMAL,
+                  windowData.GetWindowType(), useUiThread);
+    // clang-format on
+  }
+  return Application(internal.Get());
+}
+
 Application::~Application()
 {
 }
index 1971c4d..c8ca3be 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_APPLICATION_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -24,6 +24,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/device-status.h>
+#include <dali/public-api/adaptor-framework/window-data.h>
 #include <dali/public-api/adaptor-framework/window.h>
 
 namespace Dali
@@ -224,6 +225,24 @@ public:
   static Application New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize, bool useUiThread);
 
   /**
+   * @brief This is the constructor for applications.
+   *
+   * @SINCE_2_2.23
+   * @PRIVLEVEL_PUBLIC
+   * @PRIVILEGE_DISPLAY
+   * @param[in,out]  argc         A pointer to the number of arguments
+   * @param[in,out]  argv         A pointer to the argument list
+   * @param[in]      stylesheet   The path to user defined theme file
+   * @param[in]      useUiThread  True if the application would create a UI thread
+   * @param[in]      windowData   The window data for the application
+   * @return A handle to the Application
+   * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.<BR>
+   * UI thread is an additional thread that DALi creates for UI events.
+   * The UI thread isn't blocked from the system events(AppControl, LanguageChanged, RegionChanged, LowMemory, LowBattery task signals).
+   */
+  static Application New(int* argc, char** argv[], const std::string& stylesheet, bool useUiThread, WindowData& windowData);
+
+  /**
    * @brief Constructs an empty handle.
    * @SINCE_1_0.0
    */
diff --git a/dali/public-api/adaptor-framework/window-data.cpp b/dali/public-api/adaptor-framework/window-data.cpp
new file mode 100644 (file)
index 0000000..6d329bb
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/public-api/adaptor-framework/window-data.h>
+
+namespace Dali
+{
+struct WindowData::Impl
+{
+  Impl()
+  : mPositionSize(0, 0, 0, 0),
+    mIsTransparent(true),
+    mWindowType(WindowType::NORMAL)
+  {
+  }
+
+  Dali::Rect<int> mPositionSize;  ///< The position and size of the Window
+  bool            mIsTransparent; ///< The transparency of the Window
+  WindowType      mWindowType;    ///< The window type of the Window
+};
+
+WindowData::WindowData()
+: mImpl(std::make_unique<Impl>())
+{
+}
+
+WindowData::~WindowData() = default;
+
+void WindowData::SetPositionSize(Dali::Rect<int>& positionSize)
+{
+  mImpl->mPositionSize = positionSize;
+}
+
+Dali::Rect<int> WindowData::GetPositionSize() const
+{
+  return mImpl->mPositionSize;
+}
+
+void WindowData::SetTransparency(bool transparent)
+{
+  mImpl->mIsTransparent = transparent;
+}
+
+bool WindowData::GetTransparency() const
+{
+  return mImpl->mIsTransparent;
+}
+
+void WindowData::SetWindowType(WindowType type)
+{
+  mImpl->mWindowType = type;
+}
+
+WindowType WindowData::GetWindowType() const
+{
+  return mImpl->mWindowType;
+}
+
+} // namespace Dali
diff --git a/dali/public-api/adaptor-framework/window-data.h b/dali/public-api/adaptor-framework/window-data.h
new file mode 100644 (file)
index 0000000..b7bf089
--- /dev/null
@@ -0,0 +1,109 @@
+#ifndef DALI_WINDOW_DATA_H
+#define DALI_WINDOW_DATA_H
+
+/*
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
+#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/public-api/math/rect.h>
+#include <memory>
+
+namespace Dali
+{
+/**
+ * The WindowData class is used as a parameter for the constructors of the Application class.
+ * The data from the WindowData object is used to customize the default window created by the Application class.
+ *
+ * The default values are below:
+ * PositionSize : x:0, y:0, w:0, h:0 (full-screen window)
+ * Transparency : true (Window is created with 32-bit color depth)
+ * WindowType : NORMAL
+ *
+ * If you want to customize the window, you can modify the values of the WindowData object as needed.
+ * @SINCE_2_2.23
+ */
+class DALI_ADAPTOR_API WindowData
+{
+public:
+  /**
+   * @brief Creates a WindowData object.
+   */
+  WindowData();
+
+  /**
+   * @brief Destructor.
+   */
+  ~WindowData();
+
+  /**
+   * @brief Sets the position and size
+   *
+   * @SINCE_2_2.23
+   * @param[in] positionSize Position and Size
+   */
+  void SetPositionSize(Dali::Rect<int>& positionSize);
+
+  /**
+   * @brief Gets the PositionSize
+   *
+   * @SINCE_2_2.23
+   * @return The position and size
+   */
+  Dali::Rect<int> GetPositionSize() const;
+
+  /**
+   * @brief Sets the transparency
+   *
+   * @SINCE_2_2.23
+   * @param[in] transparent transparency
+   */
+  void SetTransparency(bool transparent);
+
+  /**
+   * @brief Gets the transparency
+   *
+   * @SINCE_2_2.23
+   * @return whether transparency
+   */
+  bool GetTransparency() const;
+
+  /**
+   * @brief Sets the window type
+   *
+   * @SINCE_2_2.23
+   * @param[in] type the window type
+   */
+  void SetWindowType(WindowType type);
+
+  /**
+   * @brief Gets the window type
+   *
+   * @SINCE_2_2.23
+   * @return the window type
+   */
+  WindowType GetWindowType() const;
+
+private:
+  struct Impl;
+  std::unique_ptr<Impl> mImpl;
+};
+
+} // namespace Dali
+
+#endif // DALI_WINDOW_DATA_H
index 04817cc..5868c9e 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 = 22;
+const unsigned int ADAPTOR_MICRO_VERSION = 23;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index f13b5ff..4fbbab1 100644 (file)
@@ -12,6 +12,7 @@ SET( adaptor_public_api_src_files
   ${adaptor_public_api_dir}/adaptor-framework/widget-application.cpp
   ${adaptor_public_api_dir}/adaptor-framework/widget-impl.cpp
   ${adaptor_public_api_dir}/adaptor-framework/async-task-manager.cpp
+  ${adaptor_public_api_dir}/adaptor-framework/window-data.cpp
   ${adaptor_public_api_dir}/capture/capture.cpp
   ${adaptor_public_api_dir}/dali-adaptor-version.cpp
 )
@@ -41,6 +42,7 @@ SET( public_api_adaptor_framework_header_files
   ${adaptor_public_api_dir}/adaptor-framework/window-enumerations.h
   ${adaptor_public_api_dir}/adaptor-framework/round-robin-container-view.h
   ${adaptor_public_api_dir}/adaptor-framework/async-task-manager.h
+  ${adaptor_public_api_dir}/adaptor-framework/window-data.h
 )
 
 SET( public_dali_capture_header_files
index 42170a8..1da2c10 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    2.2.22
+Version:    2.2.23
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT