From 5cbe1ab387e9807f2f802bc47e79d9bce05982fb Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Thu, 23 May 2019 15:48:59 +0100 Subject: [PATCH] Add Devel API to retrieve the RenderTaskList from Window Change-Id: I85e173d5f40f56cb47e565331492c59b46870cbd --- dali/devel-api/adaptor-framework/window-devel.cpp | 5 +++++ dali/devel-api/adaptor-framework/window-devel.h | 9 +++++++++ dali/internal/window-system/common/window-impl.cpp | 6 +++++- dali/internal/window-system/common/window-impl.h | 5 +++++ dali/internal/window-system/common/window-render-surface.cpp | 6 ++++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 2496c21..17a2993 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -35,6 +35,11 @@ void SetPositionSize( Window window, PositionSize positionSize ) GetImplementation( window ).SetPositionSize( positionSize ); } +Dali::RenderTaskList GetRenderTaskList( Window window ) +{ + return GetImplementation( window ).GetRenderTaskList(); +} + Window Get( Actor actor ) { return Internal::Adaptor::Window::Get( actor ); diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index e80e55a..bbdac10 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -26,6 +26,7 @@ namespace Dali class KeyEvent; class TouchData; class WheelEvent; +class RenderTaskList; namespace DevelWindow { @@ -47,6 +48,14 @@ typedef Signal< void (const WheelEvent&) > WheelEventSignalType; ///< Touched DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize ); /** + * @brief Retrieves the list of render-tasks in the window. + * + * @param[in] window The window instance + * @return A valid handle to a RenderTaskList + */ +Dali::RenderTaskList GetRenderTaskList( Window window ); + +/** * @brief Retrieve the window that the given actor is added to. * * @param[in] actor The actor diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index 0ede554..568b79a 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -20,7 +20,6 @@ // EXTERNAL HEADERS #include -#include #include #include #include @@ -187,6 +186,11 @@ Dali::Layer Window::GetLayer( uint32_t depth ) const return mScene.GetLayer( depth ); } +Dali::RenderTaskList Window::GetRenderTaskList() const +{ + return mScene.GetRenderTaskList(); +} + void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation ) { bool found = false; diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index b4dd829..7fd04f9 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -129,6 +129,11 @@ public: Dali::Layer GetLayer( uint32_t depth ) const; /** + * @copydoc Dali::DevelWindow::GetRenderTaskList() + */ + Dali::RenderTaskList GetRenderTaskList() const; + + /** * @copydoc Dali::Window::AddAvailableOrientation() */ void AddAvailableOrientation(Dali::Window::WindowOrientation orientation); diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 04828cc..18ae128 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -411,6 +411,12 @@ void WindowRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, b { mRenderNotification->Trigger(); } + + if ( eglImpl.IsSurfacelessContextSupported() ) + { + // Switch to the shared context after rendering this surface + eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() ); + } } } -- 2.7.4