[Tizen] GraphicsBackend clean up backport 30/306230/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 1 Feb 2024 11:51:11 +0000 (11:51 +0000)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 19 Feb 2024 05:18:48 +0000 (14:18 +0900)
This is a combination of 6 commits.

Cleaned up some of the circular dependency between GLES::Context & GLES::GraphicsController

Updates to remove old temporary graphics APIs

Removal of EglContextHelper

SVACE fix in gles-graphics-texture.cpp

SVACE fix in gles-graphics-program.cpp

Fix SVACE errors in various files

Change-Id: Icdf7f138077dac5f6fd527e8c65be9d1c5dd43ac

22 files changed:
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-context-helper-abstraction.h [deleted file]
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-controller.h
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/graphics/file.list
dali/internal/graphics/gles-impl/egl-graphics-controller.cpp
dali/internal/graphics/gles-impl/egl-graphics-controller.h
dali/internal/graphics/gles-impl/gles-context.cpp
dali/internal/graphics/gles-impl/gles-context.h
dali/internal/graphics/gles-impl/gles-graphics-pipeline.cpp
dali/internal/graphics/gles-impl/gles-graphics-program.cpp
dali/internal/graphics/gles-impl/gles-graphics-texture.cpp
dali/internal/graphics/gles-impl/gles2-graphics-memory.cpp
dali/internal/graphics/gles-impl/gles3-graphics-memory.cpp
dali/internal/graphics/gles/egl-context-helper-implementation.cpp [deleted file]
dali/internal/graphics/gles/egl-context-helper-implementation.h [deleted file]
dali/internal/graphics/gles/egl-graphics.cpp
dali/internal/graphics/gles/egl-graphics.h

index 47487e23a6aa73c325c3c1c162f7beb915634251..496fc3b014379652b1b303248d2f9f6ea5bfd612 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 5e86b3c13b2ce7fd550958d5520d41c53e1cb454..555822d6a22a850e3f8559cfb37008193e6575a1 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-adaptor/dali-test-suite-utils/test-gl-context-helper-abstraction.h b/automated-tests/src/dali-adaptor/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 f4de9af00175f3a1009f880875ecf59cc7b11a95..8e618d5a224cf539a3d61d13c5c2c4cd85c6e517 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.
@@ -62,7 +62,8 @@ void TestGraphicsApplication::CreateCore()
 
   mGraphics.Initialize();
   mGraphicsController.InitializeGLES(mGlAbstraction);
-  mGraphicsController.Initialize(mGraphicsSyncImplementation, mGlContextHelperAbstraction, mGraphics);
+  mGraphicsController.Initialize(mGraphicsSyncImplementation, mGraphics);
+  mGraphicsController.ActivateResourceContext();
 
   mCore = Dali::Integration::Core::New(mRenderController,
                                        mPlatformAbstraction,
@@ -165,11 +166,6 @@ TestGlAbstraction& TestGraphicsApplication::GetGlAbstraction()
   return static_cast<TestGlAbstraction&>(mGraphicsController.GetGlAbstraction());
 }
 
-TestGlContextHelperAbstraction& TestGraphicsApplication::GetGlContextHelperAbstraction()
-{
-  return static_cast<TestGlContextHelperAbstraction&>(mGraphicsController.GetGlContextHelperAbstraction());
-}
-
 void TestGraphicsApplication::ProcessEvent(const Integration::Event& event)
 {
   mCore->QueueEvent(event);
@@ -277,7 +273,7 @@ void TestGraphicsApplication::ResetContext()
 {
   mCore->ContextDestroyed();
   mGraphicsController.InitializeGLES(mGlAbstraction);
-  mGraphicsController.Initialize(mGraphicsSyncImplementation, mGlContextHelperAbstraction, mGraphics);
+  mGraphicsController.Initialize(mGraphicsSyncImplementation, mGraphics);
   mCore->ContextCreated();
 }
 
index aef657afc37423702da868232828badab63cbdc2..22d59f9418bdd6ff777f722fc17e46c653ce1211 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_GRAPHICS_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.
@@ -29,7 +29,6 @@
 #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>
@@ -252,8 +251,7 @@ public:
   TestRenderController&    GetRenderController();
   Graphics::Controller&    GetGraphicsController();
 
-  TestGlAbstraction&              GetGlAbstraction();
-  TestGlContextHelperAbstraction& GetGlContextHelperAbstraction();
+  TestGlAbstraction& GetGlAbstraction();
 
   void        ProcessEvent(const Integration::Event& event);
   void        SendNotification();
@@ -285,7 +283,6 @@ protected:
   TestRenderController                        mRenderController;
   Graphics::EglGraphicsController             mGraphicsController; // Use real controller in Adaptor
   TestGlAbstraction                           mGlAbstraction;
-  TestGlContextHelperAbstraction              mGlContextHelperAbstraction;
   TestGraphicsSyncImplementation              mGraphicsSyncImplementation;
   TestGraphicsImpl                            mGraphics;
   Graphics::UniquePtr<Graphics::RenderTarget> mRenderTarget{nullptr};
index e14499bf12006dd92613d00199b354994f225f02..6066f6795dade949d6a8744271f67e9532a14deb 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 a3592ebdfd5c72214c7bd1534f5bfbd1b6b372f3..33c1788b0b30af2fa9d404f469c9c71e7deac165 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.
@@ -50,7 +50,7 @@
 #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>
 
index 58d4f7a90a53ca2b9a4a76ec4218bd7272a7801a..10f6c7aa40d1efe670e28e9b02f244db6a82eafd 100644 (file)
@@ -610,8 +610,8 @@ void CombinedUpdateRenderController::UpdateRenderThread()
         auto numberOfPrecompiledShader = precompiledShader->shaderCount;
         for(int i = 0; i < numberOfPrecompiledShader; ++i)
         {
-          auto vertexShader   = graphics.GetController().GetGlAbstraction().GetVertexShaderPrefix() + std::string(precompiledShader->vertexPrefix[i].data()) + std::string(precompiledShader->vertexShader.data());
-          auto fragmentShader = graphics.GetController().GetGlAbstraction().GetFragmentShaderPrefix() + std::string(precompiledShader->fragmentPrefix[i].data()) + std::string(precompiledShader->fragmentShader.data());
+          auto vertexShader   = graphics.GetController().GetGraphicsConfig().GetVertexShaderPrefix() + std::string(precompiledShader->vertexPrefix[i].data()) + std::string(precompiledShader->vertexShader.data());
+          auto fragmentShader = graphics.GetController().GetGraphicsConfig().GetFragmentShaderPrefix() + std::string(precompiledShader->fragmentPrefix[i].data()) + std::string(precompiledShader->fragmentShader.data());
           PreCompileShader(std::move(vertexShader), std::move(fragmentShader), static_cast<uint32_t>(i) < precompiledShader->shaderName.size() ? std::string(precompiledShader->shaderName[i]) : "");
         }
         DALI_LOG_RELEASE_INFO("ShaderPreCompiler[ENABLE], shader count :%d \n", numberOfPrecompiledShader);
index 3bd12d3399c616b0ac10320f14e7e5936ec83bcc..8041345a7445837fdbc304cf306bcfcdfc217205 100644 (file)
@@ -4,7 +4,6 @@ SET( adaptor_graphics_gles_src_files
     ${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
index 40eeb0c8580cdc823a207ece7029f864e6883a96..76fe230552cd4c0ead0c0d8628291f794ac9a137 100644 (file)
@@ -153,20 +153,18 @@ void EglGraphicsController::InitializeGLES(Integration::GlAbstraction& glAbstrac
 {
   DALI_LOG_RELEASE_INFO("Initializing Graphics Controller Phase 1\n");
   mGlAbstraction  = &glAbstraction;
-  mContext        = std::make_unique<GLES::Context>(*this);
+  mContext        = std::make_unique<GLES::Context>(*this, mGlAbstraction);
   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()
@@ -244,10 +242,10 @@ Integration::GlAbstraction& EglGraphicsController::GetGlAbstraction()
   return *mGlAbstraction;
 }
 
-Integration::GlContextHelperAbstraction& EglGraphicsController::GetGlContextHelperAbstraction()
+Integration::GraphicsConfig& EglGraphicsController::GetGraphicsConfig()
 {
-  DALI_ASSERT_DEBUG(mGlContextHelperAbstraction && "Graphics controller not initialized");
-  return *mGlContextHelperAbstraction;
+  DALI_ASSERT_DEBUG(mGlAbstraction && "Graphics controller not initialized");
+  return *mGlAbstraction;
 }
 
 Internal::Adaptor::EglSyncImplementation& EglGraphicsController::GetEglSyncImplementation()
@@ -379,7 +377,7 @@ const Graphics::Reflection& EglGraphicsController::GetProgramReflection(const Gr
 
 void EglGraphicsController::CreateSurfaceContext(Dali::RenderSurfaceInterface* surface)
 {
-  std::unique_ptr<GLES::Context> context = std::make_unique<GLES::Context>(*this);
+  std::unique_ptr<GLES::Context> context = std::make_unique<GLES::Context>(*this, mGlAbstraction);
   mSurfaceContexts.push_back(std::move(std::make_pair(surface, std::move(context))));
 }
 
index 2b8c6b5e0185da6838a3097073b9bba8ac600c05..cddc538b8fd5adf641fc9efa38e07f945151a72f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_EGL_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.
@@ -88,12 +88,19 @@ public:
    *
    * 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
+   */
+  Integration::GlAbstraction& GetGlAbstraction();
+
+  /**
+   * Used to access extra info about the graphics subsystem.
+   */
+  Integration::GraphicsConfig& GetGraphicsConfig();
 
-  Integration::GlAbstraction&               GetGlAbstraction() override;
-  Integration::GlContextHelperAbstraction&  GetGlContextHelperAbstraction() override;
   Internal::Adaptor::EglSyncImplementation& GetEglSyncImplementation();
 
   /**
index e92b8bd58c58a4b7d93d578d9b69d23daa5aa65a..b7e2b5edbc5b21a907433bc87338958257c4c6d1 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.
@@ -40,8 +40,9 @@ namespace Dali::Graphics::GLES
 {
 struct Context::Impl
 {
-  explicit Impl(EglGraphicsController& controller)
-  : mController(controller)
+  explicit Impl(EglGraphicsController& controller, Integration::GlAbstraction* gl)
+  : mController(controller),
+    mGL(gl)
   {
   }
 
@@ -71,11 +72,15 @@ struct Context::Impl
       hash += salt;
     }
 
-    auto& gl = *mController.GetGL();
+    auto* gl = GetGL();
+    if(!gl) // early out if no gl
+    {
+      return;
+    }
 
     if(DALI_UNLIKELY(!mDiscardedVAOList.empty()))
     {
-      gl.DeleteVertexArrays(static_cast<Dali::GLsizei>(mDiscardedVAOList.size()), mDiscardedVAOList.data());
+      gl->DeleteVertexArrays(static_cast<Dali::GLsizei>(mDiscardedVAOList.size()), mDiscardedVAOList.data());
       mDiscardedVAOList.clear();
     }
 
@@ -88,7 +93,7 @@ struct Context::Impl
         if(mProgramVAOCurrentState != attributeIter->second)
         {
           mProgramVAOCurrentState = attributeIter->second;
-          gl.BindVertexArray(attributeIter->second);
+          gl->BindVertexArray(attributeIter->second);
 
           // Binding VAO seems to reset the index buffer binding so the cache must be reset
           mGlStateCache.mBoundElementArrayBufferId = 0;
@@ -98,8 +103,8 @@ struct Context::Impl
     }
 
     uint32_t vao;
-    gl.GenVertexArrays(1, &vao);
-    gl.BindVertexArray(vao);
+    gl->GenVertexArrays(1, &vao);
+    gl->BindVertexArray(vao);
 
     // Binding VAO seems to reset the index buffer binding so the cache must be reset
     mGlStateCache.mBoundElementArrayBufferId = 0;
@@ -107,7 +112,7 @@ struct Context::Impl
     mProgramVAOMap[program][hash] = vao;
     for(const auto& attr : vertexInputState.attributes)
     {
-      gl.EnableVertexAttribArray(attr.location);
+      gl->EnableVertexAttribArray(attr.location);
     }
 
     mProgramVAOCurrentState = vao;
@@ -118,46 +123,48 @@ struct Context::Impl
    */
   void InitializeGlState()
   {
-    auto& gl = *mController.GetGL();
-
-    mGlStateCache.mClearColorSet        = false;
-    mGlStateCache.mColorMask            = true;
-    mGlStateCache.mStencilMask          = 0xFF;
-    mGlStateCache.mBlendEnabled         = false;
-    mGlStateCache.mDepthBufferEnabled   = false;
-    mGlStateCache.mDepthMaskEnabled     = false;
-    mGlStateCache.mScissorTestEnabled   = false;
-    mGlStateCache.mStencilBufferEnabled = false;
+    auto* gl = GetGL();
+    if(gl)
+    {
+      mGlStateCache.mClearColorSet        = false;
+      mGlStateCache.mColorMask            = true;
+      mGlStateCache.mStencilMask          = 0xFF;
+      mGlStateCache.mBlendEnabled         = false;
+      mGlStateCache.mDepthBufferEnabled   = false;
+      mGlStateCache.mDepthMaskEnabled     = false;
+      mGlStateCache.mScissorTestEnabled   = false;
+      mGlStateCache.mStencilBufferEnabled = false;
 
-    gl.Disable(GL_DITHER);
+      gl->Disable(GL_DITHER);
 
-    mGlStateCache.mBoundArrayBufferId        = 0;
-    mGlStateCache.mBoundElementArrayBufferId = 0;
-    mGlStateCache.mActiveTextureUnit         = 0;
+      mGlStateCache.mBoundArrayBufferId        = 0;
+      mGlStateCache.mBoundElementArrayBufferId = 0;
+      mGlStateCache.mActiveTextureUnit         = 0;
 
-    mGlStateCache.mBlendFuncSeparateSrcRGB   = BlendFactor::ONE;
-    mGlStateCache.mBlendFuncSeparateDstRGB   = BlendFactor::ZERO;
-    mGlStateCache.mBlendFuncSeparateSrcAlpha = BlendFactor::ONE;
-    mGlStateCache.mBlendFuncSeparateDstAlpha = BlendFactor::ZERO;
+      mGlStateCache.mBlendFuncSeparateSrcRGB   = BlendFactor::ONE;
+      mGlStateCache.mBlendFuncSeparateDstRGB   = BlendFactor::ZERO;
+      mGlStateCache.mBlendFuncSeparateSrcAlpha = BlendFactor::ONE;
+      mGlStateCache.mBlendFuncSeparateDstAlpha = BlendFactor::ZERO;
 
-    // initial state is GL_FUNC_ADD for both RGB and Alpha blend modes
-    mGlStateCache.mBlendEquationSeparateModeRGB   = BlendOp::ADD;
-    mGlStateCache.mBlendEquationSeparateModeAlpha = BlendOp::ADD;
+      // initial state is GL_FUNC_ADD for both RGB and Alpha blend modes
+      mGlStateCache.mBlendEquationSeparateModeRGB   = BlendOp::ADD;
+      mGlStateCache.mBlendEquationSeparateModeAlpha = BlendOp::ADD;
 
-    mGlStateCache.mCullFaceMode = CullMode::NONE; //By default cullface is disabled, front face is set to CCW and cull face is set to back
+      mGlStateCache.mCullFaceMode = CullMode::NONE; // By default cullface is disabled, front face is set to CCW and cull face is set to back
 
-    //Initialze vertex attribute cache
-    memset(&mGlStateCache.mVertexAttributeCachedState, 0, sizeof(mGlStateCache.mVertexAttributeCachedState));
-    memset(&mGlStateCache.mVertexAttributeCurrentState, 0, sizeof(mGlStateCache.mVertexAttributeCurrentState));
+      // Initialze vertex attribute cache
+      memset(&mGlStateCache.mVertexAttributeCachedState, 0, sizeof(mGlStateCache.mVertexAttributeCachedState));
+      memset(&mGlStateCache.mVertexAttributeCurrentState, 0, sizeof(mGlStateCache.mVertexAttributeCurrentState));
 
-    //Initialize bound 2d texture cache
-    memset(&mGlStateCache.mBoundTextureId, 0, sizeof(mGlStateCache.mBoundTextureId));
+      // Initialize bound 2d texture cache
+      memset(&mGlStateCache.mBoundTextureId, 0, sizeof(mGlStateCache.mBoundTextureId));
 
-    mGlStateCache.mFrameBufferStateCache.Reset();
+      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);
+      GLint maxTextures;
+      gl->GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextures);
+      DALI_LOG_RELEASE_INFO("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: %d\n", maxTextures);
+    }
   }
 
   /**
@@ -165,23 +172,25 @@ struct Context::Impl
    */
   void FlushVertexAttributeLocations()
   {
-    auto& gl = *mController.GetGL();
-
-    for(unsigned int i = 0; i < MAX_ATTRIBUTE_CACHE_SIZE; ++i)
+    auto* gl = GetGL();
+    if(gl)
     {
-      // see if the cached state is different to the actual state
-      if(mGlStateCache.mVertexAttributeCurrentState[i] != mGlStateCache.mVertexAttributeCachedState[i])
+      for(unsigned int i = 0; i < MAX_ATTRIBUTE_CACHE_SIZE; ++i)
       {
-        // it's different so make the change to the driver and update the cached state
-        mGlStateCache.mVertexAttributeCurrentState[i] = mGlStateCache.mVertexAttributeCachedState[i];
-
-        if(mGlStateCache.mVertexAttributeCurrentState[i])
-        {
-          gl.EnableVertexAttribArray(i);
-        }
-        else
+        // see if the cached state is different to the actual state
+        if(mGlStateCache.mVertexAttributeCurrentState[i] != mGlStateCache.mVertexAttributeCachedState[i])
         {
-          gl.DisableVertexAttribArray(i);
+          // it's different so make the change to the driver and update the cached state
+          mGlStateCache.mVertexAttributeCurrentState[i] = mGlStateCache.mVertexAttributeCachedState[i];
+
+          if(mGlStateCache.mVertexAttributeCurrentState[i])
+          {
+            gl->EnableVertexAttribArray(i);
+          }
+          else
+          {
+            gl->DisableVertexAttribArray(i);
+          }
         }
       }
     }
@@ -195,29 +204,41 @@ struct Context::Impl
    */
   void SetVertexAttributeLocation(unsigned int location, bool state)
   {
-    auto& gl = *mController.GetGL();
-
-    if(location >= MAX_ATTRIBUTE_CACHE_SIZE)
+    auto* gl = GetGL();
+    if(gl)
     {
-      // not cached, make the gl call through context
-      if(state)
+      if(location >= MAX_ATTRIBUTE_CACHE_SIZE)
       {
-        gl.EnableVertexAttribArray(location);
+        // not cached, make the gl call through context
+        if(state)
+        {
+          gl->EnableVertexAttribArray(location);
+        }
+        else
+        {
+          gl->DisableVertexAttribArray(location);
+        }
       }
       else
       {
-        gl.DisableVertexAttribArray(location);
+        // set the cached state, it will be set at the next draw call
+        // if it's different from the current driver state
+        mGlStateCache.mVertexAttributeCachedState[location] = state;
       }
     }
-    else
-    {
-      // set the cached state, it will be set at the next draw call
-      // if it's different from the current driver state
-      mGlStateCache.mVertexAttributeCachedState[location] = state;
-    }
   }
 
-  EglGraphicsController& mController;
+  /**
+   * Get the pointer to the GL implementation
+   * @return The GL implementation, nullptr if the context has not been created or shutting down
+   */
+  [[nodiscard]] inline Integration::GlAbstraction* GetGL() const
+  {
+    return mGlContextCreated ? mGL : nullptr;
+  }
+
+  EglGraphicsController&      mController;
+  Integration::GlAbstraction* mGL{nullptr};
 
   const GLES::PipelineImpl* mCurrentPipeline{nullptr}; ///< Currently bound pipeline
   const GLES::PipelineImpl* mNewPipeline{nullptr};     ///< New pipeline to be set on flush
@@ -259,9 +280,9 @@ struct Context::Impl
   EGLContext mCacheEGLGraphicsContext{0u}; ///< cached window context
 };
 
-Context::Context(EglGraphicsController& controller)
+Context::Context(EglGraphicsController& controller, Integration::GlAbstraction* glAbstraction)
 {
-  mImpl = std::make_unique<Impl>(controller);
+  mImpl = std::make_unique<Impl>(controller, glAbstraction);
 }
 
 Context::~Context()
@@ -276,7 +297,11 @@ Context::~Context()
 
 void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::TextureDependencyChecker& dependencyChecker)
 {
-  auto& gl = *mImpl->mController.GetGL();
+  auto* gl = mImpl->GetGL();
+  if(!gl) // Early out if no gl
+  {
+    return;
+  }
 
   static const bool hasGLES3(mImpl->mController.GetGLESVersion() >= GLESVersion::GLES_30);
 
@@ -362,8 +387,8 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
     {
       // @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);
+      gl->Uniform1i(samplers[currentSampler].location + currentElement,
+                    samplers[currentSampler].offset + currentElement);
       ++currentElement;
       if(currentElement >= samplers[currentSampler].elementCount)
       {
@@ -404,21 +429,21 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
          attr.format == VertexInputFormat::FVECTOR3 ||
          attr.format == VertexInputFormat::FVECTOR4)
       {
-        gl.VertexAttribPointer(attr.location, // Not cached...
-                               GLVertexFormat(attr.format).size,
-                               GLVertexFormat(attr.format).format,
-                               GL_FALSE,
-                               bufferBinding.stride,
-                               reinterpret_cast<void*>(attr.offset));
-      }
-      else
-      {
-        gl.VertexAttribIPointer(attr.location,
+        gl->VertexAttribPointer(attr.location, // Not cached...
                                 GLVertexFormat(attr.format).size,
                                 GLVertexFormat(attr.format).format,
+                                GL_FALSE,
                                 bufferBinding.stride,
                                 reinterpret_cast<void*>(attr.offset));
       }
+      else
+      {
+        gl->VertexAttribIPointer(attr.location,
+                                 GLVertexFormat(attr.format).size,
+                                 GLVertexFormat(attr.format).format,
+                                 bufferBinding.stride,
+                                 reinterpret_cast<void*>(attr.offset));
+      }
 
       if(hasGLES3)
       {
@@ -426,13 +451,13 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
         {
           case Graphics::VertexInputRate::PER_VERTEX:
           {
-            gl.VertexAttribDivisor(attr.location, 0);
+            gl->VertexAttribDivisor(attr.location, 0);
             break;
           }
           case Graphics::VertexInputRate::PER_INSTANCE:
           {
             //@todo Get actual instance rate...
-            gl.VertexAttribDivisor(attr.location, 1);
+            gl->VertexAttribDivisor(attr.location, 1);
             break;
           }
         }
@@ -459,16 +484,16 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
 
       if(drawCall.draw.instanceCount == 0)
       {
-        gl.DrawArrays(GLESTopology(ia->topology),
-                      drawCall.draw.firstVertex,
-                      drawCall.draw.vertexCount);
+        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);
+        gl->DrawArraysInstanced(GLESTopology(ia->topology),
+                                drawCall.draw.firstVertex,
+                                drawCall.draw.vertexCount,
+                                drawCall.draw.instanceCount);
       }
       break;
     }
@@ -490,18 +515,18 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
       auto indexBufferFormat = GLIndexFormat(binding.format).format;
       if(drawCall.drawIndexed.instanceCount == 0)
       {
-        gl.DrawElements(GLESTopology(ia->topology),
-                        drawCall.drawIndexed.indexCount,
-                        indexBufferFormat,
-                        reinterpret_cast<void*>(binding.offset));
+        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);
+        gl->DrawElementsInstanced(GLESTopology(ia->topology),
+                                  drawCall.drawIndexed.indexCount,
+                                  indexBufferFormat,
+                                  reinterpret_cast<void*>(binding.offset),
+                                  drawCall.drawIndexed.instanceCount);
       }
       break;
     }
@@ -607,14 +632,18 @@ void Context::ResolveBlendState()
     return;
   }
 
-  auto& gl = *mImpl->mController.GetGL();
+  auto* gl = mImpl->GetGL();
+  if(!gl) // Early out if no gl
+  {
+    return;
+  }
 
   if(!currentBlendState || currentBlendState->blendEnable != newBlendState->blendEnable)
   {
     if(newBlendState->blendEnable != mImpl->mGlStateCache.mBlendEnabled)
     {
       mImpl->mGlStateCache.mBlendEnabled = newBlendState->blendEnable;
-      newBlendState->blendEnable ? gl.Enable(GL_BLEND) : gl.Disable(GL_BLEND);
+      newBlendState->blendEnable ? gl->Enable(GL_BLEND) : gl->Disable(GL_BLEND);
     }
   }
 
@@ -646,11 +675,11 @@ void Context::ResolveBlendState()
 
       if(newSrcRGB == newSrcAlpha && newDstRGB == newDstAlpha)
       {
-        gl.BlendFunc(GLBlendFunc(newSrcRGB), GLBlendFunc(newDstRGB));
+        gl->BlendFunc(GLBlendFunc(newSrcRGB), GLBlendFunc(newDstRGB));
       }
       else
       {
-        gl.BlendFuncSeparate(GLBlendFunc(newSrcRGB), GLBlendFunc(newDstRGB), GLBlendFunc(newSrcAlpha), GLBlendFunc(newDstAlpha));
+        gl->BlendFuncSeparate(GLBlendFunc(newSrcRGB), GLBlendFunc(newDstRGB), GLBlendFunc(newSrcAlpha), GLBlendFunc(newDstAlpha));
       }
     }
   }
@@ -667,15 +696,15 @@ void Context::ResolveBlendState()
 
       if(newBlendState->colorBlendOp == newBlendState->alphaBlendOp)
       {
-        gl.BlendEquation(GLBlendOp(newBlendState->colorBlendOp));
+        gl->BlendEquation(GLBlendOp(newBlendState->colorBlendOp));
         if(newBlendState->colorBlendOp >= Graphics::ADVANCED_BLEND_OPTIONS_START)
         {
-          gl.BlendBarrier();
+          gl->BlendBarrier();
         }
       }
       else
       {
-        gl.BlendEquationSeparate(GLBlendOp(newBlendState->colorBlendOp), GLBlendOp(newBlendState->alphaBlendOp));
+        gl->BlendEquationSeparate(GLBlendOp(newBlendState->colorBlendOp), GLBlendOp(newBlendState->alphaBlendOp));
       }
     }
   }
@@ -692,7 +721,11 @@ void Context::ResolveRasterizationState()
     return;
   }
 
-  auto& gl = *mImpl->mController.GetGL();
+  auto* gl = mImpl->GetGL();
+  if(!gl) // Early out if no gl
+  {
+    return;
+  }
 
   if(!currentRasterizationState ||
      currentRasterizationState->cullMode != newRasterizationState->cullMode)
@@ -702,12 +735,12 @@ void Context::ResolveRasterizationState()
       mImpl->mGlStateCache.mCullFaceMode = newRasterizationState->cullMode;
       if(newRasterizationState->cullMode == CullMode::NONE)
       {
-        gl.Disable(GL_CULL_FACE);
+        gl->Disable(GL_CULL_FACE);
       }
       else
       {
-        gl.Enable(GL_CULL_FACE);
-        gl.CullFace(GLCullMode(newRasterizationState->cullMode));
+        gl->Enable(GL_CULL_FACE);
+        gl->CullFace(GLCullMode(newRasterizationState->cullMode));
       }
     }
   }
@@ -730,11 +763,13 @@ void Context::ResolveUniformBuffers()
 
 void Context::ResolveGpuUniformBuffers()
 {
-  auto& gl = *mImpl->mController.GetGL();
-  auto  i  = 0u;
-  for(auto& binding : mImpl->mCurrentUBOBindings)
+  if(auto* gl = mImpl->GetGL())
   {
-    gl.BindBufferRange(GL_UNIFORM_BUFFER, i++, binding.buffer->GetGLBuffer(), GLintptr(binding.offset), GLintptr(binding.dataSize));
+    auto i = 0u;
+    for(auto& binding : mImpl->mCurrentUBOBindings)
+    {
+      gl->BindBufferRange(GL_UNIFORM_BUFFER, i++, binding.buffer->GetGLBuffer(), GLintptr(binding.offset), GLintptr(binding.dataSize));
+    }
   }
 }
 
@@ -767,7 +802,11 @@ void Context::BeginRenderPass(const BeginRenderPassDescriptor& renderPassBegin)
 
   const auto& targetInfo = renderTarget.GetCreateInfo();
 
-  auto& gl = *mImpl->mController.GetGL();
+  auto* gl = mImpl->GetGL();
+  if(!gl) // Early out if no gl
+  {
+    return;
+  }
 
   if(targetInfo.surface)
   {
@@ -807,10 +846,10 @@ void Context::BeginRenderPass(const BeginRenderPassDescriptor& renderPassBegin)
        !Dali::Equals(mImpl->mGlStateCache.mClearColor.a, clearValues[0].color.a) ||
        !mImpl->mGlStateCache.mClearColorSet)
     {
-      gl.ClearColor(clearValues[0].color.r,
-                    clearValues[0].color.g,
-                    clearValues[0].color.b,
-                    clearValues[0].color.a);
+      gl->ClearColor(clearValues[0].color.r,
+                     clearValues[0].color.g,
+                     clearValues[0].color.b,
+                     clearValues[0].color.a);
 
       mImpl->mGlStateCache.mClearColorSet = true;
       mImpl->mGlStateCache.mClearColor    = Vector4(clearValues[0].color.r,
@@ -829,7 +868,7 @@ void Context::BeginRenderPass(const BeginRenderPassDescriptor& renderPassBegin)
       if(!mImpl->mGlStateCache.mDepthMaskEnabled)
       {
         mImpl->mGlStateCache.mDepthMaskEnabled = true;
-        gl.DepthMask(true);
+        gl->DepthMask(true);
       }
       mask |= GL_DEPTH_BUFFER_BIT;
     }
@@ -838,14 +877,14 @@ void Context::BeginRenderPass(const BeginRenderPassDescriptor& renderPassBegin)
       if(mImpl->mGlStateCache.mStencilMask != 0xFF)
       {
         mImpl->mGlStateCache.mStencilMask = 0xFF;
-        gl.StencilMask(0xFF);
+        gl->StencilMask(0xFF);
       }
       mask |= GL_STENCIL_BUFFER_BIT;
     }
   }
 
   SetScissorTestEnabled(true);
-  gl.Scissor(renderPassBegin.renderArea.x, renderPassBegin.renderArea.y, renderPassBegin.renderArea.width, renderPassBegin.renderArea.height);
+  gl->Scissor(renderPassBegin.renderArea.x, renderPassBegin.renderArea.y, renderPassBegin.renderArea.width, renderPassBegin.renderArea.height);
   ClearBuffer(mask, true);
   SetScissorTestEnabled(false);
 
@@ -858,10 +897,10 @@ void Context::EndRenderPass(GLES::TextureDependencyChecker& dependencyChecker)
   if(mImpl->mCurrentRenderTarget)
   {
     GLES::Framebuffer* framebuffer = mImpl->mCurrentRenderTarget->GetFramebuffer();
-    if(framebuffer)
+    auto*              gl          = mImpl->GetGL();
+    if(framebuffer && gl)
     {
-      auto& gl = *mImpl->mController.GetGL();
-      gl.Flush();
+      gl->Flush();
 
       /* @todo Full dependency checking would need to store textures in Begin, and create
        * fence objects here; but we're going to draw all fbos on shared context in serial,
@@ -887,12 +926,11 @@ void Context::ClearState()
 
 void Context::ColorMask(bool enabled)
 {
-  if(enabled != mImpl->mGlStateCache.mColorMask)
+  auto* gl = mImpl->GetGL();
+  if(gl && enabled != mImpl->mGlStateCache.mColorMask)
   {
     mImpl->mGlStateCache.mColorMask = enabled;
-
-    auto& gl = *mImpl->mController.GetGL();
-    gl.ColorMask(enabled, enabled, enabled, enabled);
+    gl->ColorMask(enabled, enabled, enabled, enabled);
   }
 }
 
@@ -908,66 +946,67 @@ void Context::ClearDepthBuffer()
 
 void Context::ClearBuffer(uint32_t mask, bool forceClear)
 {
-  mask = mImpl->mGlStateCache.mFrameBufferStateCache.GetClearMask(mask, forceClear, mImpl->mGlStateCache.mScissorTestEnabled);
-  if(mask > 0)
+  mask     = mImpl->mGlStateCache.mFrameBufferStateCache.GetClearMask(mask, forceClear, mImpl->mGlStateCache.mScissorTestEnabled);
+  auto* gl = mImpl->GetGL();
+  if(mask > 0 && gl)
   {
-    auto& gl = *mImpl->mController.GetGL();
-    gl.Clear(mask);
+    gl->Clear(mask);
   }
 }
 
 void Context::InvalidateDepthStencilBuffers()
 {
-  auto& gl = *mImpl->mController.GetGL();
-
-  GLenum attachments[] = {GL_DEPTH, GL_STENCIL};
-  gl.InvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
+  if(auto* gl = mImpl->GetGL())
+  {
+    GLenum attachments[] = {GL_DEPTH, GL_STENCIL};
+    gl->InvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
+  }
 }
 
 void Context::SetScissorTestEnabled(bool scissorEnabled)
 {
-  if(mImpl->mGlStateCache.mScissorTestEnabled != scissorEnabled)
+  auto* gl = mImpl->GetGL();
+  if(gl && mImpl->mGlStateCache.mScissorTestEnabled != scissorEnabled)
   {
     mImpl->mGlStateCache.mScissorTestEnabled = scissorEnabled;
 
-    auto& gl = *mImpl->mController.GetGL();
     if(scissorEnabled)
     {
-      gl.Enable(GL_SCISSOR_TEST);
+      gl->Enable(GL_SCISSOR_TEST);
     }
     else
     {
-      gl.Disable(GL_SCISSOR_TEST);
+      gl->Disable(GL_SCISSOR_TEST);
     }
   }
 }
 
 void Context::SetStencilTestEnable(bool stencilEnable)
 {
-  if(stencilEnable != mImpl->mGlStateCache.mStencilBufferEnabled)
+  auto* gl = mImpl->GetGL();
+  if(gl && stencilEnable != mImpl->mGlStateCache.mStencilBufferEnabled)
   {
     mImpl->mGlStateCache.mStencilBufferEnabled = stencilEnable;
 
-    auto& gl = *mImpl->mController.GetGL();
     if(stencilEnable)
     {
-      gl.Enable(GL_STENCIL_TEST);
+      gl->Enable(GL_STENCIL_TEST);
     }
     else
     {
-      gl.Disable(GL_STENCIL_TEST);
+      gl->Disable(GL_STENCIL_TEST);
     }
   }
 }
 
 void Context::StencilMask(uint32_t writeMask)
 {
-  if(writeMask != mImpl->mGlStateCache.mStencilMask)
+  auto* gl = mImpl->GetGL();
+  if(gl && writeMask != mImpl->mGlStateCache.mStencilMask)
   {
     mImpl->mGlStateCache.mStencilMask = writeMask;
 
-    auto& gl = *mImpl->mController.GetGL();
-    gl.StencilMask(writeMask);
+    gl->StencilMask(writeMask);
   }
 }
 
@@ -975,16 +1014,17 @@ void Context::StencilFunc(Graphics::CompareOp compareOp,
                           uint32_t            reference,
                           uint32_t            compareMask)
 {
-  if(compareOp != mImpl->mGlStateCache.mStencilFunc ||
-     reference != mImpl->mGlStateCache.mStencilFuncRef ||
-     compareMask != mImpl->mGlStateCache.mStencilFuncMask)
+  auto* gl = mImpl->GetGL();
+  if(gl &&
+     (compareOp != mImpl->mGlStateCache.mStencilFunc ||
+      reference != mImpl->mGlStateCache.mStencilFuncRef ||
+      compareMask != mImpl->mGlStateCache.mStencilFuncMask))
   {
     mImpl->mGlStateCache.mStencilFunc     = compareOp;
     mImpl->mGlStateCache.mStencilFuncRef  = reference;
     mImpl->mGlStateCache.mStencilFuncMask = compareMask;
 
-    auto& gl = *mImpl->mController.GetGL();
-    gl.StencilFunc(GLCompareOp(compareOp).op, reference, compareMask);
+    gl->StencilFunc(GLCompareOp(compareOp).op, reference, compareMask);
   }
 }
 
@@ -992,149 +1032,163 @@ void Context::StencilOp(Graphics::StencilOp failOp,
                         Graphics::StencilOp depthFailOp,
                         Graphics::StencilOp passOp)
 {
-  if(failOp != mImpl->mGlStateCache.mStencilOpFail ||
-     depthFailOp != mImpl->mGlStateCache.mStencilOpDepthFail ||
-     passOp != mImpl->mGlStateCache.mStencilOpDepthPass)
+  auto* gl = mImpl->GetGL();
+  if(gl &&
+     (failOp != mImpl->mGlStateCache.mStencilOpFail ||
+      depthFailOp != mImpl->mGlStateCache.mStencilOpDepthFail ||
+      passOp != mImpl->mGlStateCache.mStencilOpDepthPass))
   {
     mImpl->mGlStateCache.mStencilOpFail      = failOp;
     mImpl->mGlStateCache.mStencilOpDepthFail = depthFailOp;
     mImpl->mGlStateCache.mStencilOpDepthPass = passOp;
 
-    auto& gl = *mImpl->mController.GetGL();
-    gl.StencilOp(GLStencilOp(failOp).op, GLStencilOp(depthFailOp).op, GLStencilOp(passOp).op);
+    gl->StencilOp(GLStencilOp(failOp).op, GLStencilOp(depthFailOp).op, GLStencilOp(passOp).op);
   }
 }
 
 void Context::SetDepthCompareOp(Graphics::CompareOp compareOp)
 {
-  if(compareOp != mImpl->mGlStateCache.mDepthFunction)
+  auto* gl = mImpl->GetGL();
+  if(gl && compareOp != mImpl->mGlStateCache.mDepthFunction)
   {
     mImpl->mGlStateCache.mDepthFunction = compareOp;
-    auto& gl                            = *mImpl->mController.GetGL();
-    gl.DepthFunc(GLCompareOp(compareOp).op);
+
+    gl->DepthFunc(GLCompareOp(compareOp).op);
   }
 }
 
 void Context::SetDepthTestEnable(bool depthTestEnable)
 {
-  if(depthTestEnable != mImpl->mGlStateCache.mDepthBufferEnabled)
+  auto* gl = mImpl->GetGL();
+  if(gl && depthTestEnable != mImpl->mGlStateCache.mDepthBufferEnabled)
   {
     mImpl->mGlStateCache.mDepthBufferEnabled = depthTestEnable;
 
-    auto& gl = *mImpl->mController.GetGL();
     if(depthTestEnable)
     {
-      gl.Enable(GL_DEPTH_TEST);
+      gl->Enable(GL_DEPTH_TEST);
     }
     else
     {
-      gl.Disable(GL_DEPTH_TEST);
+      gl->Disable(GL_DEPTH_TEST);
     }
   }
 }
 
 void Context::SetDepthWriteEnable(bool depthWriteEnable)
 {
-  if(depthWriteEnable != mImpl->mGlStateCache.mDepthMaskEnabled)
+  auto* gl = mImpl->GetGL();
+  if(gl && depthWriteEnable != mImpl->mGlStateCache.mDepthMaskEnabled)
   {
     mImpl->mGlStateCache.mDepthMaskEnabled = depthWriteEnable;
 
-    auto& gl = *mImpl->mController.GetGL();
-    gl.DepthMask(depthWriteEnable);
+    gl->DepthMask(depthWriteEnable);
   }
 }
 
 void Context::ActiveTexture(uint32_t textureBindingIndex)
 {
-  if(mImpl->mGlStateCache.mActiveTextureUnit != textureBindingIndex)
+  auto* gl = mImpl->GetGL();
+  if(gl && mImpl->mGlStateCache.mActiveTextureUnit != textureBindingIndex)
   {
     mImpl->mGlStateCache.mActiveTextureUnit = textureBindingIndex;
 
-    auto& gl = *mImpl->mController.GetGL();
-    gl.ActiveTexture(GL_TEXTURE0 + textureBindingIndex);
+    gl->ActiveTexture(GL_TEXTURE0 + textureBindingIndex);
   }
 }
 
 void Context::BindTexture(GLenum target, BoundTextureType textureTypeId, uint32_t textureId)
 {
   uint32_t typeId = static_cast<uint32_t>(textureTypeId);
-  if(mImpl->mGlStateCache.mBoundTextureId[mImpl->mGlStateCache.mActiveTextureUnit][typeId] != textureId)
+  auto*    gl     = mImpl->GetGL();
+  if(gl && mImpl->mGlStateCache.mBoundTextureId[mImpl->mGlStateCache.mActiveTextureUnit][typeId] != textureId)
   {
     mImpl->mGlStateCache.mBoundTextureId[mImpl->mGlStateCache.mActiveTextureUnit][typeId] = textureId;
 
-    auto& gl = *mImpl->mController.GetGL();
-    gl.BindTexture(target, textureId);
+    gl->BindTexture(target, textureId);
   }
 }
 
 void Context::GenerateMipmap(GLenum target)
 {
-  auto& gl = *mImpl->mController.GetGL();
-  gl.GenerateMipmap(target);
+  if(auto* gl = mImpl->GetGL())
+  {
+    gl->GenerateMipmap(target);
+  }
 }
 
 bool Context::BindBuffer(GLenum target, uint32_t bufferId)
 {
-  switch(target)
+  if(auto* gl = mImpl->GetGL())
   {
-    case GL_ARRAY_BUFFER:
+    switch(target)
     {
-      if(mImpl->mGlStateCache.mBoundArrayBufferId == bufferId)
+      case GL_ARRAY_BUFFER:
       {
-        return false;
+        if(mImpl->mGlStateCache.mBoundArrayBufferId == bufferId)
+        {
+          return false;
+        }
+        mImpl->mGlStateCache.mBoundArrayBufferId = bufferId;
+        break;
       }
-      mImpl->mGlStateCache.mBoundArrayBufferId = bufferId;
-      break;
-    }
-    case GL_ELEMENT_ARRAY_BUFFER:
-    {
-      if(mImpl->mGlStateCache.mBoundElementArrayBufferId == bufferId)
+      case GL_ELEMENT_ARRAY_BUFFER:
       {
-        return false;
+        if(mImpl->mGlStateCache.mBoundElementArrayBufferId == bufferId)
+        {
+          return false;
+        }
+        mImpl->mGlStateCache.mBoundElementArrayBufferId = bufferId;
+        break;
       }
-      mImpl->mGlStateCache.mBoundElementArrayBufferId = bufferId;
-      break;
     }
-  }
 
-  // Cache miss. Bind buffer.
-  auto& gl = *mImpl->mController.GetGL();
-  gl.BindBuffer(target, bufferId);
-  return true;
+    // Cache miss. Bind buffer.
+    gl->BindBuffer(target, bufferId);
+    return true;
+  }
+  return false;
 }
 
 void Context::DrawBuffers(uint32_t count, const GLenum* buffers)
 {
-  mImpl->mGlStateCache.mFrameBufferStateCache.DrawOperation(mImpl->mGlStateCache.mColorMask,
-                                                            mImpl->mGlStateCache.DepthBufferWriteEnabled(),
-                                                            mImpl->mGlStateCache.StencilBufferWriteEnabled());
+  if(auto* gl = mImpl->GetGL())
+  {
+    mImpl->mGlStateCache.mFrameBufferStateCache.DrawOperation(mImpl->mGlStateCache.mColorMask,
+                                                              mImpl->mGlStateCache.DepthBufferWriteEnabled(),
+                                                              mImpl->mGlStateCache.StencilBufferWriteEnabled());
 
-  auto& gl = *mImpl->mController.GetGL();
-  gl.DrawBuffers(count, buffers);
+    gl->DrawBuffers(count, buffers);
+  }
 }
 
 void Context::BindFrameBuffer(GLenum target, uint32_t bufferId)
 {
-  mImpl->mGlStateCache.mFrameBufferStateCache.SetCurrentFrameBuffer(bufferId);
+  if(auto* gl = mImpl->GetGL())
+  {
+    mImpl->mGlStateCache.mFrameBufferStateCache.SetCurrentFrameBuffer(bufferId);
 
-  auto& gl = *mImpl->mController.GetGL();
-  gl.BindFramebuffer(target, bufferId);
+    gl->BindFramebuffer(target, bufferId);
+  }
 }
 
 void Context::GenFramebuffers(uint32_t count, uint32_t* framebuffers)
 {
-  auto& gl = *mImpl->mController.GetGL();
-  gl.GenFramebuffers(count, framebuffers);
-
-  mImpl->mGlStateCache.mFrameBufferStateCache.FrameBuffersCreated(count, framebuffers);
+  if(auto* gl = mImpl->GetGL())
+  {
+    gl->GenFramebuffers(count, framebuffers);
+    mImpl->mGlStateCache.mFrameBufferStateCache.FrameBuffersCreated(count, framebuffers);
+  }
 }
 
 void Context::DeleteFramebuffers(uint32_t count, uint32_t* framebuffers)
 {
-  mImpl->mGlStateCache.mFrameBufferStateCache.FrameBuffersDeleted(count, framebuffers);
+  if(auto* gl = mImpl->GetGL())
+  {
+    mImpl->mGlStateCache.mFrameBufferStateCache.FrameBuffersDeleted(count, framebuffers);
 
-  auto& gl = *mImpl->mController.GetGL();
-  gl.DeleteFramebuffers(count, framebuffers);
+    gl->DeleteFramebuffers(count, framebuffers);
+  }
 }
 
 GLStateCache& Context::GetGLStateCache()
@@ -1167,7 +1221,7 @@ void Context::InvalidateCachedPipeline(GLES::Pipeline* pipeline)
   }
 
   // Remove cached VAO map
-  auto* gl = mImpl->mController.GetGL();
+  auto* gl = mImpl->GetGL();
   if(gl)
   {
     const auto* program = pipeline->GetCreateInfo().programState->program;
index fb6f7ff814782194397aedabd38412716ce55850..f4cde6db05b9d748abb9fec5e9f09788fc066e53 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_GLES_CONTEXT_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.
@@ -39,7 +39,7 @@ class TextureDependencyChecker;
 class Context
 {
 public:
-  explicit Context(EglGraphicsController& controller);
+  explicit Context(EglGraphicsController& controller, Integration::GlAbstraction* glAbstraction);
 
   ~Context();
 
index 5454c84df97046f1c779303f60fb396b57ff325e..a927fadc81123c830f7c3842fcbf9018a070d41e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -91,8 +91,10 @@ auto& PipelineImpl::GetController() const
 
 void PipelineImpl::Bind(const uint32_t glProgram) const
 {
-  auto& gl = *GetController().GetGL();
-  gl.UseProgram(glProgram);
+  if(auto gl = GetController().GetGL())
+  {
+    gl->UseProgram(glProgram);
+  }
 }
 
 void PipelineImpl::Retain()
index a5d6b3d3a26a214f0ca34535dc1f00a80783d918..dcd09669fc94300a407f6ec7d36635bbfd3b1d12 100644 (file)
@@ -268,7 +268,11 @@ void ProgramImpl::UpdateStandaloneUniformBlock(const char* ptr)
 
   const auto& extraInfos = reflection.GetStandaloneUniformExtraInfo();
 
-  auto& gl = *GetController().GetGL();
+  auto* gl = GetController().GetGL();
+  if(!gl)
+  {
+    return; // Early out if no GL found
+  }
 
   // Set uniforms
   int  index    = 0;
@@ -283,17 +287,17 @@ void ProgramImpl::UpdateStandaloneUniformBlock(const char* ptr)
       {
         case UniformSetter::Type::FLOAT:
         {
-          (gl.*(setter.uniformfProc))(info.location, info.arraySize, reinterpret_cast<const float*>(&ptr[offset]));
+          (gl->*(setter.uniformfProc))(info.location, info.arraySize, reinterpret_cast<const float*>(&ptr[offset]));
           break;
         }
         case UniformSetter::Type::INT:
         {
-          (gl.*(setter.uniformiProc))(info.location, info.arraySize, reinterpret_cast<const int*>(&ptr[offset]));
+          (gl->*(setter.uniformiProc))(info.location, info.arraySize, reinterpret_cast<const int*>(&ptr[offset]));
           break;
         }
         case UniformSetter::Type::MATRIX:
         {
-          (gl.*(setter.uniformMatrixProc))(info.location, info.arraySize, GL_FALSE, reinterpret_cast<const float*>(&ptr[offset]));
+          (gl->*(setter.uniformMatrixProc))(info.location, info.arraySize, GL_FALSE, reinterpret_cast<const float*>(&ptr[offset]));
           break;
         }
         case UniformSetter::Type::UNDEFINED:
index 2151d5bc3921e75df4643f6bf87b1b956ee8d6b0..cd4b66d0c8226f7658e0342093e2d8aba325281b 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.
@@ -424,9 +424,9 @@ bool Texture::TryConvertPixelData(const void* pData, Graphics::Format srcFormat,
 
 void Texture::SetSamplerParameter(uint32_t param, uint32_t& cacheValue, uint32_t value) const
 {
-  if(cacheValue != value)
+  auto gl = mController.GetGL();
+  if(gl && cacheValue != value)
   {
-    auto gl = mController.GetGL();
     gl->TexParameteri(mGlTarget, param, value);
     cacheValue = value;
   }
index 038410ae0ae818b9b9ee66a2b932634f01afa02d..92b4ef01ffdab6e8162508234d82ebb698472126 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 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.
@@ -74,28 +74,29 @@ void* Memory2::LockRegion(uint32_t offset, uint32_t size)
 
 void Memory2::Unlock(bool flush)
 {
-  auto gl = mController.GetGL();
-
-  // for buffer...
-  if(mMapObjectType == MapObjectType::BUFFER && mMappedPointer)
+  if(auto gl = mController.GetGL())
   {
-    auto buffer = static_cast<GLES::Buffer*>(mMapBufferInfo.buffer);
-    if(!buffer->IsCPUAllocated())
+    // for buffer...
+    if(mMapObjectType == MapObjectType::BUFFER && mMappedPointer)
     {
-      buffer->Bind(BufferUsage::VERTEX_BUFFER);
-      gl->BufferSubData(GL_ARRAY_BUFFER, GLintptr(mMapBufferInfo.offset), GLsizeiptr(mMapBufferInfo.size), mMappedPointer);
+      auto buffer = static_cast<GLES::Buffer*>(mMapBufferInfo.buffer);
+      if(!buffer->IsCPUAllocated())
+      {
+        buffer->Bind(BufferUsage::VERTEX_BUFFER);
+        gl->BufferSubData(GL_ARRAY_BUFFER, GLintptr(mMapBufferInfo.offset), GLsizeiptr(mMapBufferInfo.size), mMappedPointer);
+      }
     }
-  }
 
-  if(mIsAllocatedLocally)
-  {
-    free(mMappedPointer);
-    mMappedPointer = nullptr;
-  }
+    if(mIsAllocatedLocally)
+    {
+      free(mMappedPointer);
+      mMappedPointer = nullptr;
+    }
 
-  if(flush)
-  {
-    Flush();
+    if(flush)
+    {
+      Flush();
+    }
   }
 }
 
index 9dd9f5104f0afcf58c81784f2053972e2eaa0622..18e78616a7f19669b3ff21f32746ecc7d4295ba2 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.
@@ -49,50 +49,51 @@ Memory3::~Memory3()
 
 void* Memory3::LockRegion(uint32_t offset, uint32_t size)
 {
-  auto gl = mController.GetGL();
-
-  if(mMapObjectType == MapObjectType::BUFFER)
+  if(auto gl = mController.GetGL())
   {
-    auto buffer = static_cast<GLES::Buffer*>(mMapBufferInfo.buffer);
-
-    if(buffer->IsCPUAllocated())
-    {
-      using Ptr      = char*;
-      mMappedPointer = Ptr(buffer->GetCPUAllocatedAddress()) + offset;
-    }
-    else
+    if(mMapObjectType == MapObjectType::BUFFER)
     {
-      gl->BindBuffer(GL_COPY_WRITE_BUFFER, buffer->GetGLBuffer());
-      void* ptr      = nullptr;
-      ptr            = gl->MapBufferRange(GL_COPY_WRITE_BUFFER, GLintptr(mMapBufferInfo.offset), GLsizeiptr(mMapBufferInfo.size), GL_MAP_WRITE_BIT);
-      mMappedPointer = ptr;
+      auto buffer = static_cast<GLES::Buffer*>(mMapBufferInfo.buffer);
+
+      if(buffer->IsCPUAllocated())
+      {
+        using Ptr      = char*;
+        mMappedPointer = Ptr(buffer->GetCPUAllocatedAddress()) + offset;
+      }
+      else
+      {
+        gl->BindBuffer(GL_COPY_WRITE_BUFFER, buffer->GetGLBuffer());
+        void* ptr      = nullptr;
+        ptr            = gl->MapBufferRange(GL_COPY_WRITE_BUFFER, GLintptr(mMapBufferInfo.offset), GLsizeiptr(mMapBufferInfo.size), GL_MAP_WRITE_BIT);
+        mMappedPointer = ptr;
+      }
+      return mMappedPointer;
     }
-    return mMappedPointer;
   }
-
   return nullptr;
 }
 
 void Memory3::Unlock(bool flush)
 {
-  auto gl = mController.GetGL();
-
-  if(mMapObjectType == MapObjectType::BUFFER && mMappedPointer)
+  if(auto gl = mController.GetGL())
   {
-    auto buffer = static_cast<GLES::Buffer*>(mMapBufferInfo.buffer);
-    if(!buffer->IsCPUAllocated())
+    if(mMapObjectType == MapObjectType::BUFFER && mMappedPointer)
     {
-      gl->BindBuffer(GL_COPY_WRITE_BUFFER, buffer->GetGLBuffer());
-      gl->UnmapBuffer(GL_COPY_WRITE_BUFFER);
+      auto buffer = static_cast<GLES::Buffer*>(mMapBufferInfo.buffer);
+      if(!buffer->IsCPUAllocated())
+      {
+        gl->BindBuffer(GL_COPY_WRITE_BUFFER, buffer->GetGLBuffer());
+        gl->UnmapBuffer(GL_COPY_WRITE_BUFFER);
+      }
     }
-  }
 
-  if(flush)
-  {
-    Flush();
-  }
+    if(flush)
+    {
+      Flush();
+    }
 
-  mMappedPointer = nullptr;
+    mMappedPointer = nullptr;
+  }
 }
 
 void Memory3::Flush()
diff --git a/dali/internal/graphics/gles/egl-context-helper-implementation.cpp b/dali/internal/graphics/gles/egl-context-helper-implementation.cpp
deleted file mode 100644 (file)
index 6a4a46c..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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
diff --git a/dali/internal/graphics/gles/egl-context-helper-implementation.h b/dali/internal/graphics/gles/egl-context-helper-implementation.h
deleted file mode 100644 (file)
index 961b4c8..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#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
index 48929853bca1c0a2f4d96e1d20b00f85005f01e5..0d46a0c8b8510815adf9c597cc4628c306357a97 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.
@@ -107,7 +107,7 @@ void EglGraphics::Initialize()
   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)
@@ -123,12 +123,10 @@ void EglGraphics::Initialize(bool depth, bool stencil, bool partialRendering, in
 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)
@@ -226,12 +224,6 @@ EglSyncImplementation& EglGraphics::GetSyncImplementation()
   return *mEglSync;
 }
 
-EglContextHelperImplementation& EglGraphics::GetContextHelperImplementation()
-{
-  DALI_ASSERT_DEBUG(mEglContextHelper && "EglContextHelperImplementation not created");
-  return *mEglContextHelper;
-}
-
 EglImageExtensions* EglGraphics::GetImageExtensions()
 {
   DALI_ASSERT_DEBUG(mEglImageExtensions && "EglImageExtensions not created");
index 396943262dcd70a07702d31fb101485beb6751c7..753629fee1f7abd773248319a1cdac91002a73bd 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -23,7 +23,6 @@
 #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>
@@ -126,12 +125,6 @@ public:
    */
   EglSyncImplementation& GetSyncImplementation();
 
-  /**
-   * Gets the implementation of GlContextHelperAbstraction for EGL.
-   * @return The implementation of GlContextHelperAbstraction for EGL.
-   */
-  EglContextHelperImplementation& GetContextHelperImplementation();
-
   /**
    * @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetDepthBufferRequired()
    */
@@ -231,12 +224,11 @@ private:
   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
 };