diff options
11 files changed, 45 insertions, 31 deletions
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.h index 993196ded..23e64d5b9 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.h +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.h @@ -86,6 +86,11 @@ public: mCallstack.PushCall("InitializeGraphicsAPI()", ""); } + Dali::Any GetDisplay() const override + { + return {}; + } + /** * Configure the graphics surface * diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 1c87cc57e..75d6b3534 100644 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -888,15 +888,7 @@ Any Adaptor::GetGraphicsDisplay() if(mGraphics) { -#if defined(VULKAN_ENABLED) - //@todo Implement this! -#else - auto graphics = mGraphics.get(); - auto eglGraphics = static_cast<EglGraphics*>(graphics); - - EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - display = eglImpl.GetDisplay(); -#endif + display = mGraphics->GetDisplay(); } return display; } diff --git a/dali/internal/graphics/common/graphics-interface.h b/dali/internal/graphics/common/graphics-interface.h index 1386bfa99..dfb5f8b71 100644 --- a/dali/internal/graphics/common/graphics-interface.h +++ b/dali/internal/graphics/common/graphics-interface.h @@ -48,16 +48,15 @@ namespace Graphics { class SurfaceFactory; - /** * @brief Surface identifier * * The surface id is used as the index for windows in the vulkan implementation */ -using SurfaceId = uint32_t; -const SurfaceId INVALID_SURFACE_ID=std::numeric_limits<SurfaceId>::max(); +using SurfaceId = uint32_t; +const SurfaceId INVALID_SURFACE_ID = std::numeric_limits<SurfaceId>::max(); -enum class DepthStencilMode +enum class DepthStencilMode { /** * No depth/stencil at all @@ -80,7 +79,7 @@ enum class DepthStencilMode DEPTH_STENCIL_EXPLICIT, }; -enum class SwapchainBufferingMode +enum class SwapchainBufferingMode { OPTIMAL = 0, @@ -89,15 +88,14 @@ enum class SwapchainBufferingMode TRIPLE_BUFFERING = 3, }; - struct GraphicsCreateInfo { - uint32_t surfaceWidth; - uint32_t surfaceHeight; - DepthStencilMode depthStencilMode; - SwapchainBufferingMode swapchainBufferingMode; - ColorDepth colorDepth; - int multiSamplingLevel; + uint32_t surfaceWidth; + uint32_t surfaceHeight; + DepthStencilMode depthStencilMode; + SwapchainBufferingMode swapchainBufferingMode; + ColorDepth colorDepth; + int multiSamplingLevel; }; /** @@ -110,8 +108,8 @@ public: * Constructor */ GraphicsInterface( - const GraphicsCreateInfo& info, - Integration::DepthBufferAvailable depthBufferRequired, + const GraphicsCreateInfo& info, + Integration::DepthBufferAvailable depthBufferRequired, Integration::StencilBufferAvailable stencilBufferRequired, Integration::PartialUpdateAvailable partialUpdateRequired) : mCreateInfo(info), @@ -154,6 +152,12 @@ public: virtual void InitializeGraphicsAPI(const Dali::DisplayConnection& displayConnection) = 0; /** + * Get the graphics display handle. It will be a type in the specific graphics backend, + * e.g. EGLDisplay. + */ + virtual Dali::Any GetDisplay() const = 0; + + /** * Configure the graphics surface * * @param[in] surface The surface to configure, or NULL if not present diff --git a/dali/internal/graphics/gles/egl-graphics-factory.cpp b/dali/internal/graphics/gles/egl-graphics-factory.cpp index 156234db8..6e9536cf9 100644 --- a/dali/internal/graphics/gles/egl-graphics-factory.cpp +++ b/dali/internal/graphics/gles/egl-graphics-factory.cpp @@ -40,10 +40,9 @@ GraphicsFactory::~GraphicsFactory() Graphics::GraphicsInterface& GraphicsFactory::Create() { Graphics::GraphicsCreateInfo info{}; - auto depthBufferRequired = (mEnvironmentOptions.DepthBufferRequired() ? Integration::DepthBufferAvailable::TRUE : Integration::DepthBufferAvailable::FALSE); + auto depthBufferRequired = (mEnvironmentOptions.DepthBufferRequired() ? Integration::DepthBufferAvailable::TRUE : Integration::DepthBufferAvailable::FALSE); auto stencilBufferRequired = (mEnvironmentOptions.StencilBufferRequired() ? Integration::StencilBufferAvailable::TRUE : Integration::StencilBufferAvailable::FALSE); - auto partialUpdateRequired = (mEnvironmentOptions.PartialUpdateRequired() ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE); info.multiSamplingLevel = mEnvironmentOptions.GetMultiSamplingLevel(); diff --git a/dali/internal/graphics/gles/egl-graphics.cpp b/dali/internal/graphics/gles/egl-graphics.cpp index 8bb67ef30..8fc0be556 100644 --- a/dali/internal/graphics/gles/egl-graphics.cpp +++ b/dali/internal/graphics/gles/egl-graphics.cpp @@ -176,6 +176,11 @@ void EglGraphics::InitializeGraphicsAPI(const Dali::DisplayConnection& displayCo mEglImplementation->InitializeGles(eglDisplay); } +Dali::Any EglGraphics::GetDisplay() const +{ + return {mEglImplementation->GetDisplay()}; +} + void EglGraphics::EglInitialize() { mEglSync = Utils::MakeUnique<EglSyncImplementation>(); diff --git a/dali/internal/graphics/gles/egl-graphics.h b/dali/internal/graphics/gles/egl-graphics.h index 3ede061ef..09ab88e89 100644 --- a/dali/internal/graphics/gles/egl-graphics.h +++ b/dali/internal/graphics/gles/egl-graphics.h @@ -72,6 +72,11 @@ public: void InitializeGraphicsAPI(const Dali::DisplayConnection& displayConnection) override; /** + * @copydoc Dali::Graphics::GraphicsInterface::GetDisplay() + */ + Dali::Any GetDisplay() const override; + + /** * @copydoc Dali::Graphics::GraphicsInterface::CreateSurface() */ Graphics::SurfaceId CreateSurface(Graphics::SurfaceFactory* surfaceFactory, WindowBase* windowBase, ColorDepth colorDepth, int width, int height) override; diff --git a/dali/internal/graphics/vulkan/vulkan-graphics-impl.cpp b/dali/internal/graphics/vulkan/vulkan-graphics-impl.cpp index 22133a801..8784003d8 100644 --- a/dali/internal/graphics/vulkan/vulkan-graphics-impl.cpp +++ b/dali/internal/graphics/vulkan/vulkan-graphics-impl.cpp @@ -67,6 +67,11 @@ void VulkanGraphics::InitializeGraphicsAPI(const Dali::DisplayConnection& displa // Not needed for xlib-xcb surface creation... } +Dali::Any VulkanGraphics::GetDisplay() const +{ + return {}; // We don't have a display equivalent for vulkan. +} + void VulkanGraphics::ConfigureSurface(Dali::Integration::RenderSurfaceInterface* surface) { surface->InitializeGraphics(); // Calls CreateSurface below diff --git a/dali/internal/graphics/vulkan/vulkan-graphics-impl.h b/dali/internal/graphics/vulkan/vulkan-graphics-impl.h index bf926a1d8..e412d8b03 100644 --- a/dali/internal/graphics/vulkan/vulkan-graphics-impl.h +++ b/dali/internal/graphics/vulkan/vulkan-graphics-impl.h @@ -47,8 +47,11 @@ public: void Initialize(const Dali::DisplayConnection& displayConnection) override; void Initialize(const Dali::DisplayConnection& displayConnection, bool depth, bool stencil, bool partialRendering, int msaa) override; + void InitializeGraphicsAPI(const Dali::DisplayConnection& displayConnection) override; + Dali::Any GetDisplay() const override; + void ConfigureSurface(Dali::Integration::RenderSurfaceInterface* surface) override; Graphics::SurfaceId CreateSurface( diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 146eeb0c8..6b7fbbb77 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -486,7 +486,7 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect } } - /** + /* * wl_egl_window_tizen_set_rotation(SetWindowRotation) -> PreRotation * wl_egl_window_tizen_set_buffer_transform(SetWindowBufferTransform) -> Screen Rotation * wl_egl_window_tizen_set_window_transform(SetWindowTransform) -> Window Rotation diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index 49241cc69..427df1ba3 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -353,9 +353,6 @@ private: using FrameCallbackInfoContainer = std::vector<std::unique_ptr<FrameCallbackInfo>>; private: // Data - // EglInterface* mEGL; - // EGLSurface mEGLSurface; - // EGLContext mEGLContext; Dali::DisplayConnection* mDisplayConnection; PositionSize mPositionSize; ///< Position std::unique_ptr<WindowBase> mWindowBase; diff --git a/dali/internal/window-system/macos/window-base-mac.mm b/dali/internal/window-system/macos/window-base-mac.mm index 5c0af5dac..a9b72ab6b 100644 --- a/dali/internal/window-system/macos/window-base-mac.mm +++ b/dali/internal/window-system/macos/window-base-mac.mm @@ -407,8 +407,7 @@ Dali::Any WindowBaseCocoa::CreateWindow(int width, int height) { // XXX: this method is called from a secondary thread, but // we can only resize the window from the main thread - //PositionSize size(0, 0, width, height); - //Resize(size); + return static_cast<void*>(mImpl->mWindow.contentView.layer); } |