#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
mGraphics.Initialize();
mGraphicsController.InitializeGLES(mGlAbstraction);
- mGraphicsController.Initialize(mGraphicsSyncImplementation, mGlContextHelperAbstraction, mGraphics);
+ mGraphicsController.Initialize(mGraphicsSyncImplementation, mGraphics);
mGraphicsController.ActivateResourceContext();
mCore = Dali::Integration::Core::New(mRenderController,
{
mCore->ContextDestroyed();
mGraphicsController.InitializeGLES(mGlAbstraction);
- mGraphicsController.Initialize(mGraphicsSyncImplementation, mGlContextHelperAbstraction, mGraphics);
+ mGraphicsController.Initialize(mGraphicsSyncImplementation, mGraphics);
mCore->ContextCreated();
}
#include <dali/public-api/common/dali-common.h>
#include <test-gl-abstraction.h>
-#include <test-gl-context-helper-abstraction.h>
#include <test-graphics-sync-impl.h>
#include <test-platform-abstraction.h>
#include <test-render-controller.h>
TestRenderController mRenderController;
Graphics::EglGraphicsController mGraphicsController; // Use real controller in Adaptor
TestGlAbstraction mGlAbstraction;
- TestGlContextHelperAbstraction mGlContextHelperAbstraction;
TestGraphicsSyncImplementation mGraphicsSyncImplementation;
TestGraphicsImpl mGraphics;
Graphics::UniquePtr<Graphics::RenderTarget> mRenderTarget{nullptr};
#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"
TestGlAbstraction mGl;
TestGraphicsSyncImplementation mGraphicsSyncImpl;
- TestGlContextHelperAbstraction mGlContextHelperAbstraction;
bool isDiscardQueueEmptyResult{true};
bool isDrawOnResumeRequiredResult{true};
/*
- * 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/public-api/dali-adaptor-common.h>
#include <dali/internal/graphics/gles/egl-graphics-factory.h>
-#include <dali/internal/graphics/gles/egl-graphics.h> // Temporary until Core is abstracted
+#include <dali/internal/graphics/gles/egl-graphics.h>
#include <dali/devel-api/text-abstraction/font-client.h>
${adaptor_graphics_dir}/gles/egl-debug.cpp
${adaptor_graphics_dir}/gles/egl-implementation.cpp
${adaptor_graphics_dir}/gles/egl-sync-implementation.cpp
- ${adaptor_graphics_dir}/gles/egl-context-helper-implementation.cpp
${adaptor_graphics_dir}/gles/gl-extensions.cpp
${adaptor_graphics_dir}/gles/gl-extensions-support.cpp
${adaptor_graphics_dir}/gles/gl-implementation.cpp
mCurrentContext = mContext.get();
}
-void EglGraphicsController::Initialize(Integration::GraphicsSyncAbstraction& syncImplementation,
- Integration::GlContextHelperAbstraction& glContextHelperAbstraction,
- Internal::Adaptor::GraphicsInterface& graphicsInterface)
+void EglGraphicsController::Initialize(Integration::GraphicsSyncAbstraction& syncImplementation,
+ Internal::Adaptor::GraphicsInterface& graphicsInterface)
{
DALI_LOG_RELEASE_INFO("Initializing Graphics Controller Phase 2\n");
auto* syncImplPtr = static_cast<Internal::Adaptor::EglSyncImplementation*>(&syncImplementation);
- mEglSyncImplementation = syncImplPtr;
- mGlContextHelperAbstraction = &glContextHelperAbstraction;
- mGraphics = &graphicsInterface;
+ mEglSyncImplementation = syncImplPtr;
+ mGraphics = &graphicsInterface;
}
void EglGraphicsController::FrameStart()
*
* Note, this is now executed in the render thread, after core initialization
*/
- void Initialize(Integration::GraphicsSyncAbstraction& syncImplementation,
- Integration::GlContextHelperAbstraction& glContextHelperAbstraction,
- Internal::Adaptor::GraphicsInterface& graphicsInterface);
+ void Initialize(Integration::GraphicsSyncAbstraction& syncImplementation,
+ Internal::Adaptor::GraphicsInterface& graphicsInterface);
/**
* Used to access GL implementation
+++ /dev/null
-/*
- * Copyright (c) 2021 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/internal/graphics/gles/egl-context-helper-implementation.h>
-
-// EXTERNAL INCLUDES
-
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/graphics/gles/egl-implementation.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-EglContextHelperImplementation::EglContextHelperImplementation()
-: mEglImplementation(NULL)
-{
-}
-
-void EglContextHelperImplementation::Initialize(EglImplementation* eglImpl)
-{
- mEglImplementation = eglImpl;
-}
-
-void EglContextHelperImplementation::MakeSurfacelessContextCurrent()
-{
- if(mEglImplementation && mEglImplementation->IsSurfacelessContextSupported())
- {
- mEglImplementation->MakeContextCurrent(EGL_NO_SURFACE, mEglImplementation->GetContext());
- }
-}
-
-void EglContextHelperImplementation::MakeContextNull()
-{
- if(mEglImplementation)
- {
- mEglImplementation->MakeContextNull();
- }
-}
-
-void EglContextHelperImplementation::WaitClient()
-{
- if(mEglImplementation)
- {
- mEglImplementation->WaitClient();
- }
-}
-
-} // namespace Adaptor
-} // namespace Internal
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_ADAPTOR_EGL_CONTEXT_HELPER_IMPLEMENTATION_H
-#define DALI_INTERNAL_ADAPTOR_EGL_CONTEXT_HELPER_IMPLEMENTATION_H
-
-/*
- * Copyright (c) 2021 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/internal/graphics/common/egl-include.h>
-// EXTERNAL INCLUDES
-#include <dali/integration-api/gl-context-helper-abstraction.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
-
-namespace Dali
-{
-namespace Integration
-{
-class RenderSurface;
-}
-
-namespace Internal
-{
-namespace Adaptor
-{
-class EglImplementation;
-
-/**
- * EglContextHelperImplementation is a concrete implementation for GlContextHelperAbstraction.
- * It provides helper functions to access EGL context APIs
- */
-class EglContextHelperImplementation : public Integration::GlContextHelperAbstraction
-{
-public:
- /**
- * Constructor
- */
- EglContextHelperImplementation();
-
- /**
- * Destructor
- */
- virtual ~EglContextHelperImplementation() = default;
-
- /**
- * Initialize with the Egl implementation.
- * @param[in] impl The EGL implementation (to access the EGL context)
- */
- void Initialize(EglImplementation* impl);
-
- /**
- * @copydoc Dali::Integration::GlContextHelperAbstraction::MakeSurfacelessContextCurrent()
- */
- void MakeSurfacelessContextCurrent() override;
-
- /**
- * @copydoc Dali::Integration::GlContextHelperAbstraction::MakeContextNull()
- */
- void MakeContextNull() override;
-
- /**
- * @copydoc Dali::Integration::GlContextHelperAbstraction::WaitClient()
- */
- void WaitClient() override;
-
-private:
- EglImplementation* mEglImplementation; ///< Egl implementation (to access the EGL context)
-};
-
-} // namespace Adaptor
-} // namespace Internal
-} // namespace Dali
-
-#endif // DALI_INTERNAL_ADAPTOR_EGL_CONTEXT_HELPER_IMPLEMENTATION_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.
EglInitialize();
// Sync and context helper require EGL to be initialized first (can't execute in the constructor)
- mGraphicsController.Initialize(*mEglSync.get(), *mEglContextHelper.get(), *this);
+ mGraphicsController.Initialize(*mEglSync.get(), *this);
}
void EglGraphics::Initialize(bool depth, bool stencil, bool partialRendering, int msaa)
void EglGraphics::EglInitialize()
{
mEglSync = Utils::MakeUnique<EglSyncImplementation>();
- mEglContextHelper = Utils::MakeUnique<EglContextHelperImplementation>();
mEglImplementation = Utils::MakeUnique<EglImplementation>(mMultiSamplingLevel, mDepthBufferRequired, mStencilBufferRequired, mPartialUpdateRequired);
mEglImageExtensions = Utils::MakeUnique<EglImageExtensions>(mEglImplementation.get());
- mEglSync->Initialize(mEglImplementation.get()); // The sync impl needs the EglDisplay
- mEglContextHelper->Initialize(mEglImplementation.get()); // The context helper impl needs the EglContext
+ mEglSync->Initialize(mEglImplementation.get()); // The sync impl needs the EglDisplay
}
void EglGraphics::ConfigureSurface(Dali::RenderSurfaceInterface* surface)
return *mEglSync;
}
-EglContextHelperImplementation& EglGraphics::GetContextHelperImplementation()
-{
- DALI_ASSERT_DEBUG(mEglContextHelper && "EglContextHelperImplementation not created");
- return *mEglContextHelper;
-}
-
EglImageExtensions* EglGraphics::GetImageExtensions()
{
DALI_ASSERT_DEBUG(mEglImageExtensions && "EglImageExtensions not created");
#define DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_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/internal/graphics/common/egl-image-extensions.h>
#include <dali/internal/graphics/common/graphics-interface.h>
#include <dali/internal/graphics/gles-impl/egl-graphics-controller.h>
-#include <dali/internal/graphics/gles/egl-context-helper-implementation.h>
#include <dali/internal/graphics/gles/egl-implementation.h>
#include <dali/internal/graphics/gles/egl-sync-implementation.h>
#include <dali/internal/graphics/gles/gl-implementation.h>
EglSyncImplementation& GetSyncImplementation();
/**
- * Gets the implementation of GlContextHelperAbstraction for EGL.
- * @return The implementation of GlContextHelperAbstraction for EGL.
- */
- EglContextHelperImplementation& GetContextHelperImplementation();
-
- /**
* @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetDepthBufferRequired()
*/
Integration::DepthBufferAvailable& GetDepthBufferRequired();
void EglInitialize();
private:
- Graphics::EglGraphicsController mGraphicsController; ///< Graphics Controller for Dali Core
- std::unique_ptr<GlImplementation> mGLES; ///< GL implementation
- std::unique_ptr<EglImplementation> mEglImplementation; ///< EGL implementation
- std::unique_ptr<EglImageExtensions> mEglImageExtensions; ///< EGL image extension
- std::unique_ptr<EglSyncImplementation> mEglSync; ///< GlSyncAbstraction implementation for EGL
- std::unique_ptr<EglContextHelperImplementation> mEglContextHelper; ///< GlContextHelperAbstraction implementation for EGL
+ Graphics::EglGraphicsController mGraphicsController; ///< Graphics Controller for Dali Core
+ std::unique_ptr<GlImplementation> mGLES; ///< GL implementation
+ std::unique_ptr<EglImplementation> mEglImplementation; ///< EGL implementation
+ std::unique_ptr<EglImageExtensions> mEglImageExtensions; ///< EGL image extension
+ std::unique_ptr<EglSyncImplementation> mEglSync; ///< GlSyncAbstraction implementation for EGL
int mMultiSamplingLevel; ///< The multiple sampling level
};