/*
- * 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.
return static_cast<TestGlAbstraction&>(mGraphicsController.GetGlAbstraction());
}
-TestGlContextHelperAbstraction& TestApplication::GetGlContextHelperAbstraction()
-{
- return static_cast<TestGlContextHelperAbstraction&>(mGraphicsController.GetGlContextHelperAbstraction());
-}
-
TestGraphicsSyncImplementation& TestApplication::GetGraphicsSyncImpl()
{
return static_cast<TestGraphicsSyncImplementation&>(mGraphicsController.GetGraphicsSyncImpl());
#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.
TestGraphicsController& GetGraphicsController();
TestGlAbstraction& GetGlAbstraction();
- TestGlContextHelperAbstraction& GetGlContextHelperAbstraction();
TestGraphicsSyncImplementation& GetGraphicsSyncImpl();
void ProcessEvent(const Integration::Event& event);
+++ /dev/null
-#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
#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.
#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"
mGl.Initialize();
}
- Integration::GlAbstraction& GetGlAbstraction() override
+ Integration::GlAbstraction& GetGlAbstraction()
{
return mGl;
}
- Integration::GlContextHelperAbstraction& GetGlContextHelperAbstraction() override
+ Integration::GraphicsConfig& GetGraphicsConfig()
{
- return mGlContextHelperAbstraction;
+ return mGl;
}
TestGraphicsSyncImplementation& GetGraphicsSyncImpl()
TestGlAbstraction mGl;
TestGraphicsSyncImplementation mGraphicsSyncImpl;
- TestGlContextHelperAbstraction mGlContextHelperAbstraction;
bool isDiscardQueueEmptyResult{true};
bool isDrawOnResumeRequiredResult{true};
#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.
*/
// EXTERNAL INCLUDES
+#include <dali/integration-api/graphics-config.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <memory>
namespace Integration
{
class GlAbstraction;
-class GlContextHelperAbstraction;
} // namespace Integration
namespace Graphics
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
${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
#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.
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
+#include <dali/integration-api/graphics-config.h>
+
/* OpenGL ES 3.0 */
struct __GLsync;
* 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
+++ /dev/null
-#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
--- /dev/null
+#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
/*
- * 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.
#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>
{
using Integration::Event;
using Integration::GlAbstraction;
-using Integration::GlContextHelperAbstraction;
using Integration::PlatformAbstraction;
using Integration::RenderController;
using Integration::RenderStatus;
return *(mAnimationPlaylist);
}
-Integration::GlAbstraction& Core::GetGlAbstraction() const
+Integration::GraphicsConfig& Core::GetGraphicsConfig() const
{
- return mGraphicsController.GetGlAbstraction();
+ return mGraphicsController.GetGraphicsConfig();
}
void Core::AddScene(Scene* scene)
#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.
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:
/**
/*
- * 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.
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)