summaryrefslogtreecommitdiff
path: root/dali
diff options
context:
space:
mode:
authorDavid Steele <david.steele@samsung.com>2024-03-14 19:26:27 +0000
committerDavid Steele <david.steele@samsung.com>2024-07-08 11:07:25 +0100
commit50677dc25f3148bad28c3458229d8c562d774098 (patch)
treeee4682b97fb6afc9f5808106fe06b3306bacdd04 /dali
parentd686a850fc3f9f50f39fd68bd164349d7c48afbd (diff)
downloaddali-adaptor-50677dc25f3148bad28c3458229d8c562d774098.tar.gz
dali-adaptor-50677dc25f3148bad28c3458229d8c562d774098.tar.bz2
dali-adaptor-50677dc25f3148bad28c3458229d8c562d774098.zip
Refactored DisplayConnection to remove graphics dependency
Changed graphics initialization to depend on DisplayConnection instead; as it needs a Display in order to initialize. Change-Id: I9c025dd446f9f394ae49ab52fcb5029b91f9cf98 Signed-off-by: David Steele <david.steele@samsung.com>
Diffstat (limited to 'dali')
-rw-r--r--dali/internal/adaptor/common/adaptor-impl.cpp2
-rw-r--r--dali/internal/adaptor/common/combined-update-render-controller.cpp8
-rw-r--r--dali/internal/graphics/common/graphics-interface.h14
-rw-r--r--dali/internal/graphics/gles/egl-graphics.cpp12
-rw-r--r--dali/internal/graphics/gles/egl-graphics.h9
-rw-r--r--dali/internal/window-system/android/display-connection-impl-android.cpp47
-rw-r--r--dali/internal/window-system/android/display-connection-impl-android.h38
-rw-r--r--dali/internal/window-system/common/display-connection-impl.h29
-rw-r--r--dali/internal/window-system/common/display-connection.cpp16
-rw-r--r--dali/internal/window-system/common/display-connection.h27
-rw-r--r--dali/internal/window-system/common/gl-window-impl.cpp12
-rw-r--r--dali/internal/window-system/macos/display-connection-impl-mac.cpp47
-rw-r--r--dali/internal/window-system/macos/display-connection-impl-mac.h30
-rw-r--r--dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp25
-rw-r--r--dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h34
-rw-r--r--dali/internal/window-system/tizen-wayland/native-image-surface-impl-ecore-wl.cpp7
-rw-r--r--dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp33
-rw-r--r--dali/internal/window-system/ubuntu-x11/display-connection-impl-x.h32
-rw-r--r--dali/internal/window-system/windows/display-connection-impl-win.cpp45
-rw-r--r--dali/internal/window-system/windows/display-connection-impl-win.h28
-rw-r--r--dali/internal/window-system/x11/display-connection-impl-x.cpp45
-rw-r--r--dali/internal/window-system/x11/display-connection-impl-x.h41
22 files changed, 131 insertions, 450 deletions
diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp
index 36bcec2df..c0001cacd 100644
--- a/dali/internal/adaptor/common/adaptor-impl.cpp
+++ b/dali/internal/adaptor/common/adaptor-impl.cpp
@@ -216,7 +216,7 @@ void Adaptor::Initialize(GraphicsFactory& graphicsFactory)
mNotificationTrigger = TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &Adaptor::ProcessCoreEvents), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
- mDisplayConnection = Dali::DisplayConnection::New(*mGraphics, defaultWindow->GetSurface()->GetSurfaceType());
+ mDisplayConnection = Dali::DisplayConnection::New(defaultWindow->GetSurface()->GetSurfaceType());
mThreadController = new ThreadController(*this, *mEnvironmentOptions, mThreadMode);
diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp
index b3d865772..32e5b8ef1 100644
--- a/dali/internal/adaptor/common/combined-update-render-controller.cpp
+++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp
@@ -536,11 +536,9 @@ void CombinedUpdateRenderController::UpdateRenderThread()
LOG_UPDATE_RENDER("THREAD CREATED");
// Initialize graphics
- GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface();
- graphics.Initialize();
-
Dali::DisplayConnection& displayConnection = mAdaptorInterfaces.GetDisplayConnectionInterface();
- displayConnection.Initialize(); //@todo Move InitializeGraphics code into graphics implementation
+ GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface();
+ graphics.Initialize(displayConnection);
// Setup graphics controller into upload manager.
GetImplementation(mTextureUploadManager).InitalizeGraphicsController(graphics.GetController());
@@ -661,7 +659,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
// we need to delete the surface and renderable (pixmap / window)
// Then create a new pixmap/window and new surface
// If the new surface has a different display connection, then the context will be lost
- mAdaptorInterfaces.GetDisplayConnectionInterface().Initialize();
+ graphics.InitializeGraphicsAPI(displayConnection);
graphics.ActivateSurfaceContext(newSurface);
// TODO: ReplaceGraphicsSurface doesn't work, InitializeGraphics()
// already creates new surface window, the surface and the context.
diff --git a/dali/internal/graphics/common/graphics-interface.h b/dali/internal/graphics/common/graphics-interface.h
index af632ac73..d30e17d74 100644
--- a/dali/internal/graphics/common/graphics-interface.h
+++ b/dali/internal/graphics/common/graphics-interface.h
@@ -2,7 +2,7 @@
#define DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_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.
@@ -22,6 +22,7 @@
#include <dali/graphics-api/graphics-controller.h>
#include <dali/integration-api/core-enumerations.h>
#include <dali/internal/system/common/environment-options.h>
+#include "dali/internal/window-system/common/display-connection.h"
namespace Dali
{
@@ -61,17 +62,24 @@ public:
/**
* Initialize the graphics subsystem, configured from environment
*/
- virtual void Initialize() = 0;
+ virtual void Initialize(const Dali::DisplayConnection& displayConnection) = 0;
/**
* Initialize the graphics subsystem, providing explicit parameters.
*
+ * @param[in] displayConnection The connection to the display
* @param[in] depth True if depth buffer is required
* @param[in] stencil True if stencil buffer is required
* @param[in] partialRendering True if partial rendering is required
* @param[in] msaa level of anti-aliasing required (-1 = off)
*/
- virtual void Initialize(bool depth, bool stencil, bool partialRendering, int msaa) = 0;
+ virtual void Initialize(const Dali::DisplayConnection& displayConnection, bool depth, bool stencil, bool partialRendering, int msaa) = 0;
+
+ /**
+ * Initialize the graphics API subsystem
+ * @param displayConnection
+ */
+ virtual void InitializeGraphicsAPI(const Dali::DisplayConnection& displayConnection) = 0;
/**
* Configure the graphics surface
diff --git a/dali/internal/graphics/gles/egl-graphics.cpp b/dali/internal/graphics/gles/egl-graphics.cpp
index 4f7465213..f34f4120a 100644
--- a/dali/internal/graphics/gles/egl-graphics.cpp
+++ b/dali/internal/graphics/gles/egl-graphics.cpp
@@ -102,15 +102,16 @@ void EglGraphics::SetFirstFrameAfterResume()
}
}
-void EglGraphics::Initialize()
+void EglGraphics::Initialize(const Dali::DisplayConnection& displayConnection)
{
EglInitialize();
// Sync and context helper require EGL to be initialized first (can't execute in the constructor)
mGraphicsController.Initialize(*mEglSync.get(), *this);
+ InitializeGraphicsAPI(displayConnection);
}
-void EglGraphics::Initialize(bool depth, bool stencil, bool partialRendering, int msaa)
+void EglGraphics::Initialize(const Dali::DisplayConnection& displayConnection, bool depth, bool stencil, bool partialRendering, int msaa)
{
mDepthBufferRequired = static_cast<Integration::DepthBufferAvailable>(depth);
mStencilBufferRequired = static_cast<Integration::StencilBufferAvailable>(stencil);
@@ -118,6 +119,13 @@ void EglGraphics::Initialize(bool depth, bool stencil, bool partialRendering, in
mMultiSamplingLevel = msaa;
EglInitialize();
+ InitializeGraphicsAPI(displayConnection);
+}
+
+void EglGraphics::InitializeGraphicsAPI(const Dali::DisplayConnection& displayConnection)
+{
+ // Bad name - it does call "eglInitialize"!!!! @todo Rename me!
+ mEglImplementation->InitializeGles(displayConnection.GetDisplay().Get<EGLNativeDisplayType>());
}
void EglGraphics::EglInitialize()
diff --git a/dali/internal/graphics/gles/egl-graphics.h b/dali/internal/graphics/gles/egl-graphics.h
index e1a73b1b5..c2270978f 100644
--- a/dali/internal/graphics/gles/egl-graphics.h
+++ b/dali/internal/graphics/gles/egl-graphics.h
@@ -53,12 +53,14 @@ public:
/**
* @copydoc Dali::Internal::Adaptor::GraphicsInterface::Initialize()
*/
- void Initialize() override;
+ void Initialize(const Dali::DisplayConnection& displayConnection) override;
/**
* @copydoc Dali::Internal::Adaptor::GraphicsInterface::Initialize(bool,bool,bool,int)
*/
- void Initialize(bool depth, bool stencil, bool partialRendering, int msaa);
+ void Initialize(const Dali::DisplayConnection& displayConnection, bool depth, bool stencil, bool partialRendering, int msaa) override;
+
+ void InitializeGraphicsAPI(const Dali::DisplayConnection& displayConnection);
/**
* @copydoc Dali::Internal::Adaptor::GraphicsInterface::ConfigureSurface()
@@ -208,11 +210,12 @@ public:
*/
void LogMemoryPools() override;
-private:
+public:
// Eliminate copy and assigned operations
EglGraphics(const EglGraphics& rhs) = delete;
EglGraphics& operator=(const EglGraphics& rhs) = delete;
+private:
/**
* Initialize graphics subsystems
*/
diff --git a/dali/internal/window-system/android/display-connection-impl-android.cpp b/dali/internal/window-system/android/display-connection-impl-android.cpp
index 8b2893803..b077e3dd4 100644
--- a/dali/internal/window-system/android/display-connection-impl-android.cpp
+++ b/dali/internal/window-system/android/display-connection-impl-android.cpp
@@ -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.
@@ -17,16 +17,13 @@
// CLASS HEADER
#include <dali/internal/graphics/gles/egl-graphics.h>
+
+// INTERNAL HEADERS
#include <dali/internal/window-system/android/display-connection-impl-android.h>
-// EXTERNAL_HEADERS
-#include <dali/integration-api/debug.h>
+// EXTERNAL HEADERS
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
+namespace Dali::Internal::Adaptor
{
DisplayConnection* DisplayConnectionAndroid::New()
{
@@ -36,9 +33,7 @@ DisplayConnection* DisplayConnectionAndroid::New()
}
DisplayConnectionAndroid::DisplayConnectionAndroid()
-: mDisplay(NULL),
- mSurfaceType(RenderSurfaceInterface::WINDOW_RENDER_SURFACE),
- mGraphics(nullptr)
+: mDisplay(nullptr)
{
}
@@ -46,40 +41,16 @@ DisplayConnectionAndroid::~DisplayConnectionAndroid() = default;
Any DisplayConnectionAndroid::GetDisplay()
{
- return Any(mDisplay);
+ return {mDisplay};
}
void DisplayConnectionAndroid::ConsumeEvents()
{
}
-bool DisplayConnectionAndroid::InitializeGraphics()
-{
- auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
- EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
- if(!eglImpl.InitializeGles(mDisplay))
- {
- DALI_LOG_ERROR("Failed to initialize GLES.\n");
- return false;
- }
-
- return true;
-}
-
void DisplayConnectionAndroid::SetSurfaceType(Dali::RenderSurfaceInterface::Type type)
{
- mSurfaceType = type;
- mDisplay = EGL_DEFAULT_DISPLAY;
-}
-
-void DisplayConnectionAndroid::SetGraphicsInterface(GraphicsInterface& graphics)
-{
- mGraphics = &graphics;
+ mDisplay = EGL_DEFAULT_DISPLAY;
}
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+} // namespace Dali::Internal::Adaptor
diff --git a/dali/internal/window-system/android/display-connection-impl-android.h b/dali/internal/window-system/android/display-connection-impl-android.h
index ff178a47d..62eacbbfa 100644
--- a/dali/internal/window-system/android/display-connection-impl-android.h
+++ b/dali/internal/window-system/android/display-connection-impl-android.h
@@ -2,7 +2,7 @@
#define DALI_INTERNAL_WINDOWSYSTEM_DISPLAY_CONNECTION_IMPL_ANDROID_H
/*
- * 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.
@@ -25,9 +25,7 @@ namespace Dali
{
class DisplayConnection;
-namespace Internal
-{
-namespace Adaptor
+namespace Internal::Adaptor
{
/**
* DisplayConnection implementation
@@ -51,52 +49,36 @@ public:
/**
* @copydoc Dali::DisplayConnection::GetDisplay
*/
- Any GetDisplay();
+ Any GetDisplay() override;
/**
* @copydoc Dali::DisplayConnection::ConsumeEvents
*/
- void ConsumeEvents();
-
- /**
- * @copydoc Dali::DisplayConnection::InitializeGraphics
- */
- bool InitializeGraphics();
+ void ConsumeEvents() override;
/**
* @brief Sets the surface type
* @param[in] type The surface type
*/
- void SetSurfaceType(Dali::RenderSurfaceInterface::Type type);
-
- /**
- * @brief Sets the graphics interface
- * @param[in] graphics The graphics interface
- */
- void SetGraphicsInterface(GraphicsInterface& graphics);
+ void SetSurfaceType(Dali::RenderSurfaceInterface::Type type) override;
public:
/**
* Destructor
*/
- virtual ~DisplayConnectionAndroid();
+ ~DisplayConnectionAndroid() override;
-protected:
// Undefined
- DisplayConnectionAndroid(const DisplayConnectionAndroid&);
+ DisplayConnectionAndroid(const DisplayConnectionAndroid&) = delete;
// Undefined
- DisplayConnectionAndroid& operator=(const DisplayConnectionAndroid& rhs);
+ DisplayConnectionAndroid& operator=(const DisplayConnectionAndroid& rhs) = delete;
private:
- EGLNativeDisplayType mDisplay; ///< EGL display for rendering
- Dali::RenderSurfaceInterface::Type mSurfaceType; ///< The surface type
- GraphicsInterface* mGraphics; ///< The graphics interface
+ EGLNativeDisplayType mDisplay; ///< EGL display for rendering
};
-} // namespace Adaptor
-
-} // namespace Internal
+} // namespace Internal::Adaptor
} // namespace Dali
diff --git a/dali/internal/window-system/common/display-connection-impl.h b/dali/internal/window-system/common/display-connection-impl.h
index 1dbbe3ce9..afd0cfc17 100644
--- a/dali/internal/window-system/common/display-connection-impl.h
+++ b/dali/internal/window-system/common/display-connection-impl.h
@@ -2,7 +2,7 @@
#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_DISPLAY_CONNECTION_IMPL_H
/*
- * 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.
@@ -27,9 +27,7 @@ namespace Dali
{
class DisplayConnection;
-namespace Internal
-{
-namespace Adaptor
+namespace Internal::Adaptor
{
/**
* DisplayConnection implementation
@@ -42,13 +40,6 @@ public:
*/
DisplayConnection() = default;
- /**
- * @brief Create an initialized DisplayConnection.
- *
- * @return A handle to a newly allocated DisplayConnection resource.
- */
- static DisplayConnection* New();
-
public:
/**
* @copydoc Dali::DisplayConnection::GetDisplay
@@ -61,29 +52,17 @@ public:
virtual void ConsumeEvents() = 0;
/**
- * @copydoc Dali::DisplayConnection::InitializeGraphics
- */
- virtual bool InitializeGraphics() = 0;
-
- /**
* Sets the render surface type
* @param[in] type The render surface type
*/
virtual void SetSurfaceType(Dali::RenderSurfaceInterface::Type type) = 0;
- /**
- * Sets the graphics interface
- * @param[in] graphics The graphics interface
- */
- virtual void SetGraphicsInterface(GraphicsInterface& graphics) = 0;
-
public:
/**
* Destructor
*/
~DisplayConnection() override = default;
-protected:
// Undefined
DisplayConnection(const DisplayConnection&) = delete;
@@ -91,9 +70,7 @@ protected:
DisplayConnection& operator=(const DisplayConnection& rhs) = delete;
};
-} // namespace Adaptor
-
-} // namespace Internal
+} // namespace Internal::Adaptor
} // namespace Dali
diff --git a/dali/internal/window-system/common/display-connection.cpp b/dali/internal/window-system/common/display-connection.cpp
index 2c3a1a41b..95cb1aea6 100644
--- a/dali/internal/window-system/common/display-connection.cpp
+++ b/dali/internal/window-system/common/display-connection.cpp
@@ -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.
@@ -20,30 +20,27 @@
#include <dali/internal/window-system/common/display-connection.h>
// INTERNAL INCLUDES
-#include <dali/internal/window-system/common/display-connection-factory.h>
#include <dali/internal/window-system/common/display-connection-impl.h>
namespace Dali
{
-DisplayConnection* DisplayConnection::New(Dali::Internal::Adaptor::GraphicsInterface& graphics)
+DisplayConnection* DisplayConnection::New()
{
auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
auto displayConnection = factory->CreateDisplayConnection();
Internal::Adaptor::DisplayConnection* internal(displayConnection.release());
- internal->SetGraphicsInterface(graphics);
return new DisplayConnection(internal);
}
-DisplayConnection* DisplayConnection::New(Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::RenderSurfaceInterface::Type type)
+DisplayConnection* DisplayConnection::New(Dali::RenderSurfaceInterface::Type type)
{
auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
auto displayConnection = factory->CreateDisplayConnection();
Internal::Adaptor::DisplayConnection* internal(displayConnection.release());
- internal->SetGraphicsInterface(graphics);
internal->SetSurfaceType(type);
return new DisplayConnection(internal);
@@ -58,7 +55,7 @@ DisplayConnection::DisplayConnection(Internal::Adaptor::DisplayConnection* impl)
mImpl.reset(impl);
}
-Any DisplayConnection::GetDisplay()
+Any DisplayConnection::GetDisplay() const
{
return mImpl->GetDisplay();
}
@@ -68,9 +65,4 @@ void DisplayConnection::ConsumeEvents()
mImpl->ConsumeEvents();
}
-bool DisplayConnection::Initialize()
-{
- return mImpl->InitializeGraphics();
-}
-
} // namespace Dali
diff --git a/dali/internal/window-system/common/display-connection.h b/dali/internal/window-system/common/display-connection.h
index 1fb90089e..52afbc82c 100644
--- a/dali/internal/window-system/common/display-connection.h
+++ b/dali/internal/window-system/common/display-connection.h
@@ -1,8 +1,8 @@
-#ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_DISPLAY_CONNECTION_H
-#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_DISPLAY_CONNECTION_H
+#ifndef DALI_INTERNAL_WINDOW_SYSTEM_COMMON_DISPLAY_CONNECTION_H
+#define DALI_INTERNAL_WINDOW_SYSTEM_COMMON_DISPLAY_CONNECTION_H
/*
- * 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.
@@ -23,17 +23,13 @@
// INTERNAL INCLUDES
#include <dali/integration-api/adaptor-framework/render-surface-interface.h>
-#include <dali/internal/graphics/common/graphics-interface.h>
namespace Dali
{
-namespace Internal
-{
-namespace Adaptor
+namespace Internal::Adaptor
{
class DisplayConnection;
}
-} // namespace Internal
class DisplayConnection
{
@@ -41,20 +37,18 @@ public:
/**
* @brief Create an initialized DisplayConnection.
*
- * @param[in] graphics The abstracted graphics interface
* @return A handle to a newly allocated DisplayConnection resource.
*/
- static DisplayConnection* New(Dali::Internal::Adaptor::GraphicsInterface& graphics);
+ static DisplayConnection* New();
/**
* @brief Create an initialized DisplayConnection.
* Native surface will need this instead of DisplayConnection::New()
*
- * @param[in] graphics The abstracted graphics interface
* @param[in] type Render surface type
* @return A handle to a newly allocated DisplayConnection resource.
*/
- static DisplayConnection* New(Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::RenderSurfaceInterface::Type type);
+ static DisplayConnection* New(Dali::RenderSurfaceInterface::Type type);
/**
* @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
@@ -75,18 +69,13 @@ public:
*
* @return display
*/
- Any GetDisplay();
+ Any GetDisplay() const;
/**
* @brief Consumes any possible events on the queue so that there is no leaking between frames
*/
void ConsumeEvents();
- /**
- * @brief Initialize the display
- */
- bool Initialize();
-
public:
/**
* @brief This constructor is used by DisplayConnection New() methods.
@@ -101,4 +90,4 @@ private:
} // namespace Dali
-#endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_DISPLAY_CONNECTION_H
+#endif // DALI_INTERNAL_WINDOW_SYSTEM_COMMON_DISPLAY_CONNECTION_H
diff --git a/dali/internal/window-system/common/gl-window-impl.cpp b/dali/internal/window-system/common/gl-window-impl.cpp
index 3f5ce843f..0fd6da0d2 100644
--- a/dali/internal/window-system/common/gl-window-impl.cpp
+++ b/dali/internal/window-system/common/gl-window-impl.cpp
@@ -793,15 +793,13 @@ void GlWindow::InitializeGraphics()
{
// Init Graphics
std::unique_ptr<GraphicsFactory> graphicsFactoryPtr = Utils::MakeUnique<GraphicsFactory>(mEnvironmentOptions);
- auto graphicsFactory = *graphicsFactoryPtr.get();
+ auto graphicsFactory = *graphicsFactoryPtr;
- mGraphics = std::unique_ptr<GraphicsInterface>(&graphicsFactory.Create());
- GraphicsInterface* graphics = mGraphics.get();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(graphics);
- eglGraphics->Initialize(mDepth, mStencil, false, mMSAA);
+ mGraphics = std::unique_ptr<GraphicsInterface>(&graphicsFactory.Create());
+ GraphicsInterface* graphics = mGraphics.get();
- mDisplayConnection = std::unique_ptr<Dali::DisplayConnection>(Dali::DisplayConnection::New(*graphics, Dali::RenderSurfaceInterface::Type::WINDOW_RENDER_SURFACE));
- mDisplayConnection->Initialize();
+ mDisplayConnection = std::unique_ptr<Dali::DisplayConnection>(Dali::DisplayConnection::New(Dali::RenderSurfaceInterface::Type::WINDOW_RENDER_SURFACE));
+ graphics->Initialize(*mDisplayConnection, mDepth, mStencil, false, mMSAA);
// Create Render Thread
mGlWindowRenderThread = std::unique_ptr<Dali::Internal::Adaptor::GlWindowRenderThread>(new GlWindowRenderThread(mPositionSize, mColorDepth));
diff --git a/dali/internal/window-system/macos/display-connection-impl-mac.cpp b/dali/internal/window-system/macos/display-connection-impl-mac.cpp
index f514b70e8..1056abb24 100644
--- a/dali/internal/window-system/macos/display-connection-impl-mac.cpp
+++ b/dali/internal/window-system/macos/display-connection-impl-mac.cpp
@@ -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.
@@ -16,14 +16,10 @@
*/
// CLASS HEADER
-#include <EGL/egl.h>
#include <dali/internal/window-system/macos/display-connection-impl-mac.h>
// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-
// INTERNAL INCLUDES
-#include <dali/internal/graphics/gles/egl-graphics.h>
namespace Dali::Internal::Adaptor
{
@@ -32,14 +28,9 @@ DisplayConnection* DisplayConnectionCocoa::New()
return new DisplayConnectionCocoa();
}
-DisplayConnectionCocoa::DisplayConnectionCocoa()
-: mGraphics(nullptr)
-{
-}
+DisplayConnectionCocoa::DisplayConnectionCocoa() = default;
-DisplayConnectionCocoa::~DisplayConnectionCocoa()
-{
-}
+DisplayConnectionCocoa::~DisplayConnectionCocoa() = default;
Any DisplayConnectionCocoa::GetDisplay()
{
@@ -50,40 +41,8 @@ void DisplayConnectionCocoa::ConsumeEvents()
{
}
-bool DisplayConnectionCocoa::InitializeEgl(EglInterface& egl)
-{
- EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
-
- if(!eglImpl.InitializeGles(EGL_DEFAULT_DISPLAY))
- {
- DALI_LOG_ERROR("Failed to initialize GLES.\n");
- return false;
- }
-
- return true;
-}
-
-bool DisplayConnectionCocoa::InitializeGraphics()
-{
- auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
- EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
- if(!eglImpl.InitializeGles(EGL_DEFAULT_DISPLAY))
- {
- DALI_LOG_ERROR("Failed to initialize GLES.\n");
- return false;
- }
-
- return true;
-}
-
void DisplayConnectionCocoa::SetSurfaceType(Dali::RenderSurfaceInterface::Type type)
{
}
-void DisplayConnectionCocoa::SetGraphicsInterface(GraphicsInterface& graphics)
-{
- mGraphics = &graphics;
-}
-
} // namespace Dali::Internal::Adaptor
diff --git a/dali/internal/window-system/macos/display-connection-impl-mac.h b/dali/internal/window-system/macos/display-connection-impl-mac.h
index 16bba7d45..6c9c31c93 100644
--- a/dali/internal/window-system/macos/display-connection-impl-mac.h
+++ b/dali/internal/window-system/macos/display-connection-impl-mac.h
@@ -1,7 +1,7 @@
#pragma once
/*
- * 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.
@@ -20,7 +20,6 @@
// INTERNAL INCLUDES
#include <dali/internal/graphics/gles/egl-implementation.h>
#include <dali/internal/window-system/common/display-connection-impl.h>
-#include <dali/public-api/object/base-object.h>
namespace Dali::Internal::Adaptor
{
@@ -46,48 +45,29 @@ public:
/**
* @copydoc Dali::DisplayConnection::GetDisplay
*/
- Any GetDisplay();
+ Any GetDisplay() override;
/**
* @copydoc Dali::DisplayConnection::ConsumeEvents
*/
- void ConsumeEvents();
-
- /**
- * @copydoc Dali::DisplayConnection::InitializeEgl
- */
- bool InitializeEgl(EglInterface& egl);
-
- /**
- * @copydoc Dali::DisplayConnection::InitializeGraphics
- */
- bool InitializeGraphics();
+ void ConsumeEvents() override;
/**
* @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType
*/
- void SetSurfaceType(Dali::RenderSurfaceInterface::Type type);
-
- /**
- * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface
- */
- void SetGraphicsInterface(GraphicsInterface& graphics);
+ void SetSurfaceType(Dali::RenderSurfaceInterface::Type type) override;
public:
/**
* Destructor
*/
- virtual ~DisplayConnectionCocoa();
+ ~DisplayConnectionCocoa() override;
-private:
// Undefined
DisplayConnectionCocoa(const DisplayConnectionCocoa&) = delete;
// Undefined
DisplayConnectionCocoa& operator=(const DisplayConnectionCocoa& rhs) = delete;
-
-private:
- GraphicsInterface* mGraphics; ///< The graphics interface
};
} // namespace Dali::Internal::Adaptor
diff --git a/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp
index 136f20aaa..4f9fc4eee 100644
--- a/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp
+++ b/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp
@@ -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.
@@ -16,7 +16,6 @@
*/
// CLASS HEADER
-#include <dali/internal/graphics/gles/egl-graphics.h>
#include <dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h>
// EXTERNAL_HEADERS
@@ -45,7 +44,6 @@ DisplayConnection* DisplayConnectionEcoreWl::New()
DisplayConnectionEcoreWl::DisplayConnectionEcoreWl()
: mDisplay(NULL),
mSurfaceType(RenderSurfaceInterface::WINDOW_RENDER_SURFACE),
- mGraphics(nullptr),
mBufMgr(nullptr)
{
}
@@ -67,20 +65,6 @@ void DisplayConnectionEcoreWl::ConsumeEvents()
{
}
-bool DisplayConnectionEcoreWl::InitializeGraphics()
-{
- auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
- EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
- if(!eglImpl.InitializeGles(mDisplay))
- {
- DALI_LOG_ERROR("Failed to initialize GLES.\n");
- return false;
- }
-
- return true;
-}
-
void DisplayConnectionEcoreWl::SetSurfaceType(Dali::RenderSurfaceInterface::Type type)
{
mSurfaceType = type;
@@ -100,14 +84,9 @@ void DisplayConnectionEcoreWl::SetSurfaceType(Dali::RenderSurfaceInterface::Type
}
}
-void DisplayConnectionEcoreWl::SetGraphicsInterface(GraphicsInterface& graphics)
-{
- mGraphics = &graphics;
-}
-
EGLNativeDisplayType DisplayConnectionEcoreWl::GetNativeDisplay()
{
- mBufMgr = tbm_bufmgr_init(-1); // -1 is meaningless. The parameter in this function is deprecated.
+ mBufMgr = tbm_bufmgr_init(-1); // -1 is meaningless. The parameter in this function is deprecated.
if(mBufMgr == nullptr)
{
DALI_LOG_ERROR("Fail to init tbm buf mgr\n");
diff --git a/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h b/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h
index 06a3dad13..20e5d6673 100644
--- a/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h
+++ b/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h
@@ -2,7 +2,7 @@
#define DALI_INTERNAL_WINDOWSYSTEM_ECOREWL_DISPLAY_CONNECTION_IMPL_ECORE_WL_H
/*
- * 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.
@@ -54,35 +54,30 @@ public:
/**
* @copydoc Dali::DisplayConnection::GetDisplay
*/
- Any GetDisplay();
+ Any GetDisplay() override;
/**
* @copydoc Dali::DisplayConnection::ConsumeEvents
*/
- void ConsumeEvents();
-
- /**
- * @copydoc Dali::DisplayConnection::InitializeGraphics
- */
- bool InitializeGraphics();
+ void ConsumeEvents() override;
/**
* @brief Sets the surface type
* @param[in] type The surface type
*/
- void SetSurfaceType(Dali::RenderSurfaceInterface::Type type);
-
- /**
- * @brief Sets the graphics interface
- * @param[in] graphics The graphics interface
- */
- void SetGraphicsInterface(GraphicsInterface& graphics);
+ void SetSurfaceType(Dali::RenderSurfaceInterface::Type type) override;
public:
/**
* Destructor
*/
- virtual ~DisplayConnectionEcoreWl();
+ ~DisplayConnectionEcoreWl() override;
+
+ // Undefined
+ DisplayConnectionEcoreWl(const DisplayConnectionEcoreWl&) = delete;
+
+ // Undefined
+ DisplayConnectionEcoreWl& operator=(const DisplayConnectionEcoreWl& rhs) = delete;
protected:
/**
@@ -95,16 +90,9 @@ protected:
*/
void ReleaseNativeDisplay();
- // Undefined
- DisplayConnectionEcoreWl(const DisplayConnectionEcoreWl&);
-
- // Undefined
- DisplayConnectionEcoreWl& operator=(const DisplayConnectionEcoreWl& rhs);
-
private:
EGLNativeDisplayType mDisplay; ///< Wayland-display for rendering
Dali::RenderSurfaceInterface::Type mSurfaceType; ///< The surface type
- GraphicsInterface* mGraphics; ///< The graphics interface
tbm_bufmgr mBufMgr; ///< For creating tbm_dummy_display
};
diff --git a/dali/internal/window-system/tizen-wayland/native-image-surface-impl-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/native-image-surface-impl-ecore-wl.cpp
index 52fe66deb..7408c367c 100644
--- a/dali/internal/window-system/tizen-wayland/native-image-surface-impl-ecore-wl.cpp
+++ b/dali/internal/window-system/tizen-wayland/native-image-surface-impl-ecore-wl.cpp
@@ -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.
@@ -96,10 +96,9 @@ void NativeImageSurfaceEcoreWl::InitializeGraphics()
mGraphics = std::unique_ptr<GraphicsInterface>(&graphicsFactory.Create());
GraphicsInterface* graphics = mGraphics.get();
auto eglGraphics = static_cast<EglGraphics*>(graphics);
- eglGraphics->Initialize(mDepth, mStencil, false, mMSAA);
- mDisplayConnection = std::unique_ptr<Dali::DisplayConnection>(Dali::DisplayConnection::New(*mGraphics, Dali::RenderSurfaceInterface::Type::NATIVE_RENDER_SURFACE));
- mDisplayConnection->Initialize();
+ mDisplayConnection = std::unique_ptr<Dali::DisplayConnection>(Dali::DisplayConnection::New(Dali::RenderSurfaceInterface::Type::NATIVE_RENDER_SURFACE));
+ eglGraphics->Initialize(*mDisplayConnection, mDepth, mStencil, false, mMSAA);
mEGL = &eglGraphics->GetEglInterface();
diff --git a/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp b/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp
index c3e9b20f2..1ca482bb5 100644
--- a/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp
+++ b/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp
@@ -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.
@@ -19,11 +19,9 @@
#include <dali/internal/window-system/ubuntu-x11/display-connection-impl-x.h>
// EXTERNAL_HEADERS
-#include <dali/integration-api/debug.h>
#include <dali/internal/system/linux/dali-ecore-x.h>
// INTERNAL HEADERS
-#include <dali/internal/graphics/gles/egl-graphics.h>
#include <dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h>
namespace Dali
@@ -34,15 +32,13 @@ namespace Adaptor
{
DisplayConnection* DisplayConnectionX11::New()
{
- //DisplayConnection* pDisplayConnection(new DisplayConnection());
-
- //return pDisplayConnection;
return nullptr;
+ DisplayConnection* pDisplayConnection(new DisplayConnectionX11());
+ return pDisplayConnection;
}
DisplayConnectionX11::DisplayConnectionX11()
-: mGraphics(nullptr),
- mDisplay(nullptr)
+: mDisplay(nullptr)
{
}
@@ -56,7 +52,7 @@ DisplayConnectionX11::~DisplayConnectionX11()
Any DisplayConnectionX11::GetDisplay()
{
- return Any(mDisplay);
+ return {mDisplay};
}
void DisplayConnectionX11::ConsumeEvents()
@@ -79,20 +75,6 @@ void DisplayConnectionX11::ConsumeEvents()
} while(events > 0);
}
-bool DisplayConnectionX11::InitializeGraphics()
-{
- auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
- EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
- if(!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
- {
- DALI_LOG_ERROR("Failed to initialize GLES.\n");
- return false;
- }
-
- return true;
-}
-
void DisplayConnectionX11::SetSurfaceType(Dali::RenderSurfaceInterface::Type type)
{
if(type == Dali::RenderSurfaceInterface::WINDOW_RENDER_SURFACE)
@@ -102,11 +84,6 @@ void DisplayConnectionX11::SetSurfaceType(Dali::RenderSurfaceInterface::Type typ
}
}
-void DisplayConnectionX11::SetGraphicsInterface(GraphicsInterface& graphics)
-{
- mGraphics = &graphics;
-}
-
} // namespace Adaptor
} // namespace Internal
diff --git a/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.h b/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.h
index 9ddd4e22a..c9725fe0d 100644
--- a/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.h
+++ b/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.h
@@ -2,7 +2,7 @@
#define DALI_INTERNAL_WINDOWSYSTEM_ECOREX_DISPLAY_CONNECTION_IMPL_ECORE_X_H
/*
- * 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.
@@ -26,9 +26,7 @@ namespace Dali
{
class DisplayConnection;
-namespace Internal
-{
-namespace Adaptor
+namespace Internal::Adaptor
{
class Impl
{
@@ -58,51 +56,35 @@ public:
/**
* @copydoc Dali::DisplayConnection::GetDisplay
*/
- Any GetDisplay();
+ Any GetDisplay() override;
/**
* @copydoc Dali::DisplayConnection::ConsumeEvents
*/
- void ConsumeEvents();
-
- /**
- * @copydoc Dali::DisplayConnection::InitializeGraphics
- */
- bool InitializeGraphics();
+ void ConsumeEvents() override;
/**
* @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType
*/
- void SetSurfaceType(Dali::RenderSurfaceInterface::Type type);
-
- /**
- * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface
- */
- void SetGraphicsInterface(GraphicsInterface& graphics);
+ void SetSurfaceType(Dali::RenderSurfaceInterface::Type type) override;
public:
/**
* Destructor
*/
- virtual ~DisplayConnectionX11();
+ ~DisplayConnectionX11() override;
-protected:
// Undefined
DisplayConnectionX11(const DisplayConnectionX11&) = delete;
// Undefined
DisplayConnectionX11& operator=(const DisplayConnectionX11& rhs) = delete;
-private:
- GraphicsInterface* mGraphics; ///< The graphics interface
-
public:
XDisplay* mDisplay; ///< X-display for rendering
};
-} // namespace Adaptor
-
-} // namespace Internal
+} // namespace Internal::Adaptor
} // namespace Dali
diff --git a/dali/internal/window-system/windows/display-connection-impl-win.cpp b/dali/internal/window-system/windows/display-connection-impl-win.cpp
index 4fd5d5548..d39fd2289 100644
--- a/dali/internal/window-system/windows/display-connection-impl-win.cpp
+++ b/dali/internal/window-system/windows/display-connection-impl-win.cpp
@@ -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.
@@ -32,19 +32,18 @@ namespace Adaptor
{
DisplayConnection* DisplayConnectionWin::New()
{
- DisplayConnection* pDisplayConnection(new DisplayConnectionWin());
+ auto* pDisplayConnection(new DisplayConnectionWin());
- return pDisplayConnection;
+ return static_cast<DisplayConnection*>(pDisplayConnection);
}
DisplayConnectionWin::DisplayConnectionWin()
-: mDisplay(NULL)
+: mDisplay(nullptr),
+ mGraphics(nullptr)
{
}
-DisplayConnectionWin::~DisplayConnectionWin()
-{
-}
+DisplayConnectionWin::~DisplayConnectionWin() = default;
Any DisplayConnectionWin::GetDisplay()
{
@@ -55,33 +54,6 @@ void DisplayConnectionWin::ConsumeEvents()
{
}
-bool DisplayConnectionWin::InitializeEgl(EglInterface& egl)
-{
- EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
-
- if(!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
- {
- DALI_LOG_ERROR("Failed to initialize GLES.\n");
- return false;
- }
-
- return true;
-}
-
-bool DisplayConnectionWin::InitializeGraphics()
-{
- auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
- EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
- if(!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
- {
- DALI_LOG_ERROR("Failed to initialize GLES.\n");
- return false;
- }
-
- return true;
-}
-
void DisplayConnectionWin::SetSurfaceType(Dali::RenderSurfaceInterface::Type type)
{
if(type == Dali::RenderSurfaceInterface::WINDOW_RENDER_SURFACE)
@@ -90,11 +62,6 @@ void DisplayConnectionWin::SetSurfaceType(Dali::RenderSurfaceInterface::Type typ
}
}
-void DisplayConnectionWin::SetGraphicsInterface(GraphicsInterface& graphics)
-{
- mGraphics = &graphics;
-}
-
} // namespace Adaptor
} // namespace Internal
diff --git a/dali/internal/window-system/windows/display-connection-impl-win.h b/dali/internal/window-system/windows/display-connection-impl-win.h
index f20e85ea7..0885a607d 100644
--- a/dali/internal/window-system/windows/display-connection-impl-win.h
+++ b/dali/internal/window-system/windows/display-connection-impl-win.h
@@ -2,7 +2,7 @@
#define DALI_INTERNAL_WIN_DIPLAY_CONNECTION_H
/*
- * 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.
@@ -54,40 +54,24 @@ public:
/**
* @copydoc Dali::DisplayConnection::GetDisplay
*/
- Any GetDisplay();
+ Any GetDisplay() override;
/**
* @copydoc Dali::DisplayConnection::ConsumeEvents
*/
- void ConsumeEvents();
-
- /**
- * @copydoc Dali::DisplayConnection::InitializeEgl
- */
- bool InitializeEgl(EglInterface& egl);
-
- /**
- * @copydoc Dali::DisplayConnection::InitializeGraphics
- */
- bool InitializeGraphics();
+ void ConsumeEvents() override;
/**
* @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType
*/
- void SetSurfaceType(Dali::RenderSurfaceInterface::Type type);
-
- /**
- * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface
- */
- void SetGraphicsInterface(GraphicsInterface& graphics);
+ void SetSurfaceType(Dali::RenderSurfaceInterface::Type type) override;
public:
/**
* Destructor
*/
- virtual ~DisplayConnectionWin();
+ ~DisplayConnectionWin() override;
-private:
// Undefined
DisplayConnectionWin(const DisplayConnectionWin&) = delete;
@@ -96,7 +80,7 @@ private:
private:
GraphicsInterface* mGraphics; ///< The graphics interface
- HDC mDisplay;
+ HDC mDisplay{};
};
} // namespace Adaptor
diff --git a/dali/internal/window-system/x11/display-connection-impl-x.cpp b/dali/internal/window-system/x11/display-connection-impl-x.cpp
index 98806ce09..5e2c85474 100644
--- a/dali/internal/window-system/x11/display-connection-impl-x.cpp
+++ b/dali/internal/window-system/x11/display-connection-impl-x.cpp
@@ -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.
@@ -19,32 +19,22 @@
#include <dali/internal/window-system/x11/display-connection-impl-x.h>
// EXTERNAL_HEADERS
-#include <dali/integration-api/debug.h>
// INTERNAL HEADERS
-#include <dali/internal/graphics/gles/egl-graphics.h>
-#include <dali/internal/window-system/x11/pixmap-render-surface-x.h>
#include <dali/internal/window-system/x11/window-system-x.h>
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
+namespace Dali::Internal::Adaptor
{
DisplayConnectionX11::DisplayConnectionX11()
-: mGraphics(nullptr),
- mDisplay(nullptr)
+: mDisplay(nullptr)
{
}
-DisplayConnectionX11::~DisplayConnectionX11()
-{
-}
+DisplayConnectionX11::~DisplayConnectionX11() = default;
Any DisplayConnectionX11::GetDisplay()
{
- return Any(mDisplay);
+ return {mDisplay};
}
void DisplayConnectionX11::ConsumeEvents()
@@ -52,20 +42,6 @@ void DisplayConnectionX11::ConsumeEvents()
// Event consumption should only be done in WindowSystemX.
}
-bool DisplayConnectionX11::InitializeGraphics()
-{
- auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
- EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
- if(!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
- {
- DALI_LOG_ERROR("Failed to initialize GLES.\n");
- return false;
- }
-
- return true;
-}
-
void DisplayConnectionX11::SetSurfaceType(Dali::RenderSurfaceInterface::Type type)
{
if(type == Dali::RenderSurfaceInterface::WINDOW_RENDER_SURFACE)
@@ -74,13 +50,4 @@ void DisplayConnectionX11::SetSurfaceType(Dali::RenderSurfaceInterface::Type typ
}
}
-void DisplayConnectionX11::SetGraphicsInterface(GraphicsInterface& graphics)
-{
- mGraphics = &graphics;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+} // namespace Dali::Internal::Adaptor
diff --git a/dali/internal/window-system/x11/display-connection-impl-x.h b/dali/internal/window-system/x11/display-connection-impl-x.h
index cd50b7e76..1affaa8ce 100644
--- a/dali/internal/window-system/x11/display-connection-impl-x.h
+++ b/dali/internal/window-system/x11/display-connection-impl-x.h
@@ -2,7 +2,7 @@
#define DALI_INTERNAL_WINDOW_SYSTEM_X11_DISPLAY_CONNECTION_IMPL_X_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.
@@ -20,22 +20,13 @@
// INTERNAL INCLUDES
#include <dali/internal/window-system/common/display-connection-impl.h>
-#include <X11/Xlib.h>
namespace Dali
{
class DisplayConnection;
-namespace Internal
+namespace Internal::Adaptor
{
-namespace Adaptor
-{
-class Impl
-{
-public:
- ::Display* mDisplay; ///< X-display for rendering
-};
-
/**
* DisplayConnection implementation
*/
@@ -58,51 +49,33 @@ public:
/**
* @copydoc Dali::DisplayConnection::GetDisplay
*/
- Any GetDisplay();
+ Any GetDisplay() override;
/**
* @copydoc Dali::DisplayConnection::ConsumeEvents
*/
- void ConsumeEvents();
-
- /**
- * @copydoc Dali::DisplayConnection::InitializeGraphics
- */
- bool InitializeGraphics();
+ void ConsumeEvents() override;
/**
* @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType
*/
- void SetSurfaceType(Dali::RenderSurfaceInterface::Type type);
-
- /**
- * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface
- */
- void SetGraphicsInterface(GraphicsInterface& graphics);
+ void SetSurfaceType(Dali::RenderSurfaceInterface::Type type) override;
public:
/**
* Destructor
*/
- virtual ~DisplayConnectionX11();
+ ~DisplayConnectionX11() override;
-protected:
- // Undefined
DisplayConnectionX11(const DisplayConnectionX11&) = delete;
- // Undefined
DisplayConnectionX11& operator=(const DisplayConnectionX11& rhs) = delete;
-private:
- GraphicsInterface* mGraphics; ///< The graphics interface
-
public:
::Display* mDisplay; ///< X-display for rendering
};
-} // namespace Adaptor
-
-} // namespace Internal
+} // namespace Internal::Adaptor
} // namespace Dali