Removing old temporary graphics APIs 56/305356/2
authorDavid Steele <david.steele@samsung.com>
Wed, 31 Jan 2024 18:56:41 +0000 (18:56 +0000)
committerDavid Steele <david.steele@samsung.com>
Thu, 1 Feb 2024 15:42:33 +0000 (15:42 +0000)
Change-Id: I41c5af839ab5b0807194ebe2ecedbbaa27ba033c

12 files changed:
automated-tests/src/dali/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali/dali-test-suite-utils/test-application.h
automated-tests/src/dali/dali-test-suite-utils/test-gl-context-helper-abstraction.h [deleted file]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.h
dali/graphics-api/graphics-controller.h
dali/integration-api/file.list
dali/integration-api/gl-abstraction.h
dali/integration-api/gl-context-helper-abstraction.h [deleted file]
dali/integration-api/graphics-config.h [new file with mode: 0644]
dali/internal/common/core-impl.cpp
dali/internal/common/core-impl.h
dali/internal/event/common/thread-local-storage.cpp

index 47487e2..496fc3b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -163,11 +163,6 @@ TestGlAbstraction& TestApplication::GetGlAbstraction()
   return static_cast<TestGlAbstraction&>(mGraphicsController.GetGlAbstraction());
 }
 
-TestGlContextHelperAbstraction& TestApplication::GetGlContextHelperAbstraction()
-{
-  return static_cast<TestGlContextHelperAbstraction&>(mGraphicsController.GetGlContextHelperAbstraction());
-}
-
 TestGraphicsSyncImplementation& TestApplication::GetGraphicsSyncImpl()
 {
   return static_cast<TestGraphicsSyncImplementation&>(mGraphicsController.GetGraphicsSyncImpl());
index 5e86b3c..555822d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_APPLICATION_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -67,7 +67,6 @@ public:
   TestGraphicsController&  GetGraphicsController();
 
   TestGlAbstraction&              GetGlAbstraction();
-  TestGlContextHelperAbstraction& GetGlContextHelperAbstraction();
   TestGraphicsSyncImplementation& GetGraphicsSyncImpl();
 
   void        ProcessEvent(const Integration::Event& event);
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-gl-context-helper-abstraction.h b/automated-tests/src/dali/dali-test-suite-utils/test-gl-context-helper-abstraction.h
deleted file mode 100644 (file)
index 1a5a54c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef TEST_GL_CONTEXT_HELPER_ABSTRACTION_H
-#define TEST_GL_CONTEXT_HELPER_ABSTRACTION_H
-
-/*
- * Copyright (c) 2020 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/integration-api/gl-context-helper-abstraction.h>
-
-namespace Dali
-{
-/**
- * Class to emulate the GL context helper
- */
-class DALI_CORE_API TestGlContextHelperAbstraction : public Integration::GlContextHelperAbstraction
-{
-public:
-  /**
-   * Constructor
-   */
-  TestGlContextHelperAbstraction(){};
-
-  /**
-   * Destructor
-   */
-  ~TestGlContextHelperAbstraction() override{};
-
-  /**
-   * @brief Switch to the surfaceless GL context
-   */
-  void MakeSurfacelessContextCurrent() override{};
-
-  /**
-   * @brief Clear the GL context
-   */
-  void MakeContextNull() override{};
-
-  /**
-   * @brief Wait until all GL rendering calls for the current GL context are executed
-   */
-  void WaitClient() override{};
-
-private:
-  TestGlContextHelperAbstraction(const TestGlContextHelperAbstraction&);            ///< Undefined
-  TestGlContextHelperAbstraction& operator=(const TestGlContextHelperAbstraction&); ///< Undefined
-};
-
-} // namespace Dali
-
-#endif // TEST_GL_CONTEXT_HELPER_ABSTRACTION_H
index e14499b..6066f67 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_GRAPHICS_CONTROLLER_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
 #include <dali/graphics-api/graphics-controller.h>
 #include <unordered_map>
 #include "test-gl-abstraction.h"
-#include "test-gl-context-helper-abstraction.h"
 #include "test-graphics-command-buffer.h"
 #include "test-graphics-program.h"
 #include "test-graphics-reflection.h"
@@ -104,14 +103,14 @@ public:
     mGl.Initialize();
   }
 
-  Integration::GlAbstraction& GetGlAbstraction() override
+  Integration::GlAbstraction& GetGlAbstraction()
   {
     return mGl;
   }
 
-  Integration::GlContextHelperAbstraction& GetGlContextHelperAbstraction() override
+  Integration::GraphicsConfig& GetGraphicsConfig()
   {
-    return mGlContextHelperAbstraction;
+    return mGl;
   }
 
   TestGraphicsSyncImplementation& GetGraphicsSyncImpl()
@@ -465,7 +464,6 @@ public:
 
   TestGlAbstraction              mGl;
   TestGraphicsSyncImplementation mGraphicsSyncImpl;
-  TestGlContextHelperAbstraction mGlContextHelperAbstraction;
 
   bool            isDiscardQueueEmptyResult{true};
   bool            isDrawOnResumeRequiredResult{true};
index 1395671..99edd0e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_CONTROLLER_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/integration-api/graphics-config.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <memory>
 
@@ -43,7 +44,6 @@ namespace Dali
 namespace Integration
 {
 class GlAbstraction;
-class GlContextHelperAbstraction;
 } // namespace Integration
 
 namespace Graphics
@@ -70,9 +70,10 @@ class Texture;
 class Controller
 {
 public:
-  // Temporary until graphics api is complete
-  virtual Integration::GlAbstraction&              GetGlAbstraction()              = 0;
-  virtual Integration::GlContextHelperAbstraction& GetGlContextHelperAbstraction() = 0;
+  /**
+   * Get graphics configuration for info about the graphics subsystem.
+   */
+  virtual Integration::GraphicsConfig& GetGraphicsConfig() = 0;
 
   /**
    * @brief Destroys controller
index 1059719..be358ac 100644 (file)
@@ -37,8 +37,8 @@ SET( platform_abstraction_header_files
    ${platform_abstraction_src_dir}/core-enumerations.h
    ${platform_abstraction_src_dir}/debug.h
    ${platform_abstraction_src_dir}/gl-abstraction.h
-   ${platform_abstraction_src_dir}/gl-context-helper-abstraction.h
    ${platform_abstraction_src_dir}/gl-defines.h
+   ${platform_abstraction_src_dir}/graphics-config.h
    ${platform_abstraction_src_dir}/graphics-sync-abstraction.h
    ${platform_abstraction_src_dir}/input-options.h
    ${platform_abstraction_src_dir}/lockless-buffer.h
index 7a5a598..f085354 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_GL_ABSTRACTION_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -47,6 +47,8 @@
 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 */
 
+#include <dali/integration-api/graphics-config.h>
+
 /* OpenGL ES 3.0 */
 struct __GLsync;
 
@@ -91,7 +93,7 @@ namespace Integration
  * A concrete implementation must be created for each platform, and provided when creating the
  * Dali::Integration::Core object.
  */
-class GlAbstraction
+class GlAbstraction : public GraphicsConfig
 {
 protected:
   // Protected construction & deletion
diff --git a/dali/integration-api/gl-context-helper-abstraction.h b/dali/integration-api/gl-context-helper-abstraction.h
deleted file mode 100644 (file)
index 4e2e4e7..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef DALI_INTEGRATION_GL_CONTEXT_HELPER_ABSTRACTION_H
-#define DALI_INTEGRATION_GL_CONTEXT_HELPER_ABSTRACTION_H
-
-/*
- * Copyright (c) 2020 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/common/dali-common.h>
-
-namespace Dali
-{
-namespace Integration
-{
-/**
- * This abstraction defines the interface for accessing GL context.
- */
-class GlContextHelperAbstraction
-{
-protected:
-  /**
-   * Virtual protected destructor, no deletion through this interface
-   */
-  virtual ~GlContextHelperAbstraction() = default;
-
-public:
-  /**
-   * @brief Switch to the surfaceless GL context
-   */
-  virtual void MakeSurfacelessContextCurrent() = 0;
-
-  /**
-   * @brief Clear the GL context
-   */
-  virtual void MakeContextNull() = 0;
-
-  /**
-   * @brief Wait until all GL rendering calls for the current GL context are executed
-   */
-  virtual void WaitClient() = 0;
-};
-
-} // namespace Integration
-} // namespace Dali
-
-#endif // DALI_INTEGRATION_GL_CONTEXT_HELPER_ABSTRACTION_H
diff --git a/dali/integration-api/graphics-config.h b/dali/integration-api/graphics-config.h
new file mode 100644 (file)
index 0000000..e0b3ddb
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef DALI_INTEGRATION_GRAPHICS_CONFIG_H
+#define DALI_INTEGRATION_GRAPHICS_CONFIG_H
+
+/*
+ * Copyright (c) 2024 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/rendering/renderer-devel.h>
+
+namespace Dali::Integration
+{
+/**
+ * GraphicsConfig is an abstract interface, used to access OpenGRAPHICS services.
+ * A concrete implementation must be created for each platform, and provided when creating the
+ * Dali::Integration::Core object.
+ */
+class GraphicsConfig
+{
+protected:
+  // Protected construction & deletion
+  GraphicsConfig()          = default; ///< Protected constructor so an instance of this class cannot be created.
+  virtual ~GraphicsConfig() = default; ///< Virtual protected destructor, no deletion through this interface.
+
+public:
+  // Not copyable but movable
+  GraphicsConfig(const GraphicsConfig&) = delete;            ///< Deleted copy constructor.
+  GraphicsConfig(GraphicsConfig&&)      = default;           ///< Default move constructor.
+  GraphicsConfig& operator=(const GraphicsConfig&) = delete; ///< Deleted copy assignment operator.
+  GraphicsConfig& operator=(GraphicsConfig&&) = default;     ///< Default move assignment operator.
+
+  /**
+   * Returns current graphicses can support the blend equation
+   * @Return true current graphicses support the blend equation
+   */
+  virtual bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation) = 0;
+
+  /**
+   * Returns shader prefix of shading language version.
+   * @Return shader prefix of shading language version.
+   */
+  virtual std::string GetShaderVersionPrefix() = 0;
+
+  /**
+   * Returns vertex shader prefix including shading language version.
+   * @Return vertex shader prefix including shading language version.
+   */
+  virtual std::string GetVertexShaderPrefix() = 0;
+
+  /**
+   * Returns fragment shader prefix including shading language version and extension information.
+   * @Return fragment shader prefix including shading language version and extension information.
+   */
+  virtual std::string GetFragmentShaderPrefix() = 0;
+};
+
+} // namespace Dali::Integration
+
+#endif
index 3d61851..936ba76 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -23,7 +23,6 @@
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/events/event.h>
-#include <dali/integration-api/gl-context-helper-abstraction.h>
 #include <dali/integration-api/platform-abstraction.h>
 #include <dali/integration-api/processor-interface.h>
 #include <dali/integration-api/render-controller.h>
@@ -72,7 +71,6 @@ namespace Internal
 {
 using Integration::Event;
 using Integration::GlAbstraction;
-using Integration::GlContextHelperAbstraction;
 using Integration::PlatformAbstraction;
 using Integration::RenderController;
 using Integration::RenderStatus;
@@ -640,9 +638,9 @@ AnimationPlaylist& Core::GetAnimationPlaylist() const
   return *(mAnimationPlaylist);
 }
 
-Integration::GlAbstraction& Core::GetGlAbstraction() const
+Integration::GraphicsConfig& Core::GetGraphicsConfig() const
 {
-  return mGraphicsController.GetGlAbstraction();
+  return mGraphicsController.GetGraphicsConfig();
 }
 
 void Core::AddScene(Scene* scene)
index 754869c..61fe6f1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_CORE_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -318,11 +318,10 @@ private:
   AnimationPlaylist& GetAnimationPlaylist() const;
 
   /**
-   * @brief Returns GlAbstraction.
-   * @note Use only for the capability. Do not use this for bypass context
-   * @return GlAbstraction
+   * @brief Returns GraphicsConfig
+   * @return A reference to the GraphicsConfig struct.
    */
-  Integration::GlAbstraction& GetGlAbstraction() const;
+  Integration::GraphicsConfig& GetGraphicsConfig() const;
 
 private:
   /**
index 077355d..8cac030 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -162,22 +162,22 @@ AnimationPlaylist& ThreadLocalStorage::GetAnimationPlaylist()
 
 bool ThreadLocalStorage::IsBlendEquationSupported(DevelBlendEquation::Type blendEquation)
 {
-  return mCore->GetGlAbstraction().IsBlendEquationSupported(blendEquation);
+  return mCore->GetGraphicsConfig().IsBlendEquationSupported(blendEquation);
 }
 
 std::string ThreadLocalStorage::GetShaderVersionPrefix()
 {
-  return mCore->GetGlAbstraction().GetShaderVersionPrefix();
+  return mCore->GetGraphicsConfig().GetShaderVersionPrefix();
 }
 
 std::string ThreadLocalStorage::GetVertexShaderPrefix()
 {
-  return mCore->GetGlAbstraction().GetVertexShaderPrefix();
+  return mCore->GetGraphicsConfig().GetVertexShaderPrefix();
 }
 
 std::string ThreadLocalStorage::GetFragmentShaderPrefix()
 {
-  return mCore->GetGlAbstraction().GetFragmentShaderPrefix();
+  return mCore->GetGraphicsConfig().GetFragmentShaderPrefix();
 }
 
 void ThreadLocalStorage::AddScene(Scene* scene)