From cf13838fd26e34e6ed25ceee04a56b1090d8222f Mon Sep 17 00:00:00 2001 From: Sunghyun kim Date: Tue, 26 Feb 2019 13:09:02 +0900 Subject: [PATCH] [Tizen] Revert "Support multiple window rendering" This reverts commit 09e6892adcddf6d2bf7c88dc8442a42da2ac57f5. Change-Id: I72bb2db355fdd841fa1393a7b3ec2086ff4046e3 --- .../src/dali-adaptor-internal/CMakeLists.txt | 1 - automated-tests/src/dali-adaptor/CMakeLists.txt | 1 - .../dali-test-suite-utils/test-application.cpp | 27 ++-- .../dali-test-suite-utils/test-application.h | 13 +- .../dali-test-suite-utils/test-render-surface.cpp | 115 --------------- .../dali-test-suite-utils/test-render-surface.h | 155 --------------------- .../src/dali-platform-abstraction/CMakeLists.txt | 1 - dali/devel-api/adaptor-framework/window-devel.cpp | 37 +---- dali/devel-api/adaptor-framework/window-devel.h | 67 +-------- dali/integration-api/adaptor.h | 10 +- dali/integration-api/egl-interface.h | 9 +- dali/integration-api/file.list | 2 +- dali/integration-api/native-render-surface.h | 7 +- ...render-surface-interface.h => render-surface.h} | 132 ++++++------------ dali/internal/adaptor/common/adaptor-impl.cpp | 72 ++++------ dali/internal/adaptor/common/adaptor-impl.h | 34 +++-- .../adaptor/common/adaptor-internal-services.h | 4 +- dali/internal/adaptor/common/adaptor.cpp | 10 +- dali/internal/adaptor/common/application-impl.cpp | 5 +- .../common/combined-update-render-controller.cpp | 70 ++++------ .../common/combined-update-render-controller.h | 8 +- .../adaptor/common/thread-controller-interface.h | 4 +- .../adaptor/tizen-wayland/framework-tizen.cpp | 16 +-- dali/internal/graphics/gles/egl-graphics.cpp | 1 + dali/internal/graphics/gles/egl-implementation.cpp | 98 +++++-------- dali/internal/graphics/gles/egl-implementation.h | 35 ++--- .../input-method-context-impl-ecore-wl.cpp | 2 +- dali/internal/system/common/thread-controller.cpp | 2 +- dali/internal/system/common/thread-controller.h | 4 +- .../window-system/common/display-connection-impl.h | 2 +- .../window-system/common/display-connection.cpp | 2 +- .../window-system/common/display-connection.h | 2 +- .../window-system/common/event-handler.cpp | 2 +- dali/internal/window-system/common/event-handler.h | 7 +- .../common/native-render-surface-factory.cpp | 1 - .../window-system/common/pixmap-render-surface.h | 27 +--- dali/internal/window-system/common/window-impl.cpp | 90 ++---------- dali/internal/window-system/common/window-impl.h | 54 +------ .../window-system/common/window-render-surface.cpp | 63 +++------ .../window-system/common/window-render-surface.h | 65 +++------ .../display-connection-impl-ecore-wl.cpp | 8 +- .../display-connection-impl-ecore-wl.h | 4 +- .../tizen-wayland/indicator-impl-ecore-wl.cpp | 16 ++- .../tizen-wayland/indicator-impl-ecore-wl.h | 6 + .../native-render-surface-ecore-wl.cpp | 63 +++------ .../tizen-wayland/native-render-surface-ecore-wl.h | 53 +++---- .../ubuntu-x11/display-connection-impl-x.cpp | 4 +- .../ubuntu-x11/display-connection-impl-x.h | 2 +- .../ubuntu-x11/pixmap-render-surface-ecore-x.cpp | 19 +-- .../ubuntu-x11/pixmap-render-surface-ecore-x.h | 39 +++--- dali/public-api/adaptor-framework/window.cpp | 1 - dali/public-api/adaptor-framework/window.h | 3 - 52 files changed, 373 insertions(+), 1102 deletions(-) delete mode 100644 automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.cpp delete mode 100644 automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.h rename dali/integration-api/{render-surface-interface.h => render-surface.h} (59%) diff --git a/automated-tests/src/dali-adaptor-internal/CMakeLists.txt b/automated-tests/src/dali-adaptor-internal/CMakeLists.txt index ea46563..f60e70d 100644 --- a/automated-tests/src/dali-adaptor-internal/CMakeLists.txt +++ b/automated-tests/src/dali-adaptor-internal/CMakeLists.txt @@ -31,7 +31,6 @@ LIST(APPEND TC_SOURCES ../dali-adaptor/dali-test-suite-utils/test-native-image.cpp ../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp ../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp - ../dali-adaptor/dali-test-suite-utils/test-render-surface.cpp ../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp ../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp ) diff --git a/automated-tests/src/dali-adaptor/CMakeLists.txt b/automated-tests/src/dali-adaptor/CMakeLists.txt index f2b10e6..41cc886 100644 --- a/automated-tests/src/dali-adaptor/CMakeLists.txt +++ b/automated-tests/src/dali-adaptor/CMakeLists.txt @@ -33,7 +33,6 @@ LIST(APPEND TC_SOURCES dali-test-suite-utils/test-native-image.cpp dali-test-suite-utils/test-platform-abstraction.cpp dali-test-suite-utils/test-render-controller.cpp - dali-test-suite-utils/test-render-surface.cpp dali-test-suite-utils/test-trace-call-stack.cpp dali-test-suite-utils/adaptor-test-adaptor-impl.cpp ) diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp index 1562d27..c953f50 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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,6 +54,8 @@ void TestApplication::Initialize() Integration::StencilBufferAvailable::TRUE ); mCore->ContextCreated(); + mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight ); + mCore->SetDpi( mDpi.x, mDpi.y ); Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage); Dali::Integration::Log::InstallLogFunction(logFunction); @@ -63,22 +65,12 @@ void TestApplication::Initialize() Dali::Integration::Trace::LogContext( true, "Test" ); - mRenderSurface = new TestRenderSurface( Dali::PositionSize( 0, 0, mSurfaceWidth, mSurfaceHeight ) ); - mScene = Dali::Integration::Scene::New( Vector2( static_cast( mSurfaceWidth ), static_cast( mSurfaceHeight ) ) ); - mScene.SetSurface( *mRenderSurface ); - - mScene.SetDpi( Vector2( static_cast( mDpi.x ), static_cast( mDpi.y ) ) ); - - mCore->SurfaceResized( mRenderSurface ); - mCore->SceneCreated(); - mCore->Initialize(); } TestApplication::~TestApplication() { Dali::Integration::Log::UninstallLogFunction(); - delete mRenderSurface; delete mCore; } @@ -157,6 +149,19 @@ void TestApplication::SendNotification() mCore->ProcessEvents(); } +void TestApplication::SetSurfaceWidth( uint32_t width, uint32_t height ) +{ + mSurfaceWidth = width; + mSurfaceHeight = height; + + mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight ); +} + +void TestApplication::SetTopMargin( uint32_t margin ) +{ + mCore->SetTopMargin( margin ); +} + void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* location ) { if( GetUpdateStatus() == 0 && diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h index fc2929c..d1e042d 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h @@ -2,7 +2,7 @@ #define __DALI_TEST_APPLICATION_H__ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -24,11 +24,9 @@ #include "test-gl-sync-abstraction.h" #include "test-gl-abstraction.h" #include "test-render-controller.h" -#include "test-render-surface.h" #include #include #include -#include namespace Dali { @@ -71,6 +69,8 @@ public: TestGestureManager& GetGestureManager(); void ProcessEvent(const Integration::Event& event); void SendNotification(); + void SetSurfaceWidth( uint32_t width, unsigned height ); + void SetTopMargin( uint32_t margin ); bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL ); uint32_t GetUpdateStatus(); bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL ); @@ -83,11 +83,6 @@ public: mLoggingEnabled = enabled; } - Integration::Scene GetScene() const - { - return mScene; - } - private: void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL ); @@ -97,13 +92,11 @@ protected: TestGlAbstraction mGlAbstraction; TestGlSyncAbstraction mGlSyncAbstraction; TestGestureManager mGestureManager; - TestRenderSurface* mRenderSurface; Integration::UpdateStatus mStatus; Integration::RenderStatus mRenderStatus; Integration::Core* mCore; - Dali::Integration::Scene mScene; uint32_t mSurfaceWidth; uint32_t mSurfaceHeight; diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.cpp deleted file mode 100644 index 332d77e..0000000 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2019 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 "test-render-surface.h" - -namespace Dali -{ - -TestRenderSurface::TestRenderSurface( Dali::PositionSize positionSize ) -: mPositionSize( positionSize ), - mBackgroundColor() -{ -} - -TestRenderSurface::~TestRenderSurface() -{ -} - -Dali::PositionSize TestRenderSurface::GetPositionSize() const -{ - return mPositionSize; -}; - -void TestRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) -{ - dpiHorizontal = dpiVertical = 96; -}; - -void TestRenderSurface::InitializeGraphics() -{ -} - -void TestRenderSurface::CreateSurface() -{ -} - -void TestRenderSurface::DestroySurface() -{ -} - -bool TestRenderSurface::ReplaceGraphicsSurface() -{ - return false; -} - -void TestRenderSurface::MoveResize( Dali::PositionSize positionSize ) -{ - mPositionSize = positionSize; -} - -void TestRenderSurface::StartRender() -{ -} - -bool TestRenderSurface::PreRender( bool resizingSurface ) -{ - return true; -} - -void TestRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) -{ -} - -void TestRenderSurface::StopRender() -{ -} - -void TestRenderSurface::ReleaseLock() -{ -} - -Dali::Integration::RenderSurface::Type TestRenderSurface::GetSurfaceType() -{ - return WINDOW_RENDER_SURFACE; -} - -void TestRenderSurface::MakeContextCurrent() -{ -} - -Integration::DepthBufferAvailable TestRenderSurface::GetDepthBufferRequired() -{ - return Integration::DepthBufferAvailable::TRUE; -} - -Integration::StencilBufferAvailable TestRenderSurface::GetStencilBufferRequired() -{ - return Integration::StencilBufferAvailable::TRUE; -} - -void TestRenderSurface::SetBackgroundColor( Vector4 color ) -{ - mBackgroundColor = color; -} - -Vector4 TestRenderSurface::GetBackgroundColor() -{ - return mBackgroundColor; -} - -} // Namespace dali diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.h deleted file mode 100644 index fba89c2..0000000 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.h +++ /dev/null @@ -1,155 +0,0 @@ -#ifndef TEST_REENDER_SURFACE_H -#define TEST_REENDER_SURFACE_H - -/* - * Copyright (c) 2019 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 -#include - -namespace Dali -{ - -/** - * Concrete implementation of the RenderSurface class. - */ -class DALI_CORE_API TestRenderSurface : public Dali::Integration::RenderSurface -{ -public: - - /** - * @copydoc Dali::Integration::RenderSurface::RenderSurface - */ - TestRenderSurface( Dali::PositionSize positionSize ); - - /** - * @copydoc Dali::Integration::RenderSurface::~RenderSurface - */ - virtual ~TestRenderSurface(); - - /** - * @copydoc Dali::Integration::RenderSurface::GetPositionSize - */ - virtual Dali::PositionSize GetPositionSize() const; - - /** - * @copydoc Dali::Integration::RenderSurface::GetDpi - */ - virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ); - - /** - * @copydoc Dali::Integration::RenderSurface::InitializeGraphics - */ - virtual void InitializeGraphics(); - - /** - * @copydoc Dali::Integration::RenderSurface::CreateSurface - */ - virtual void CreateSurface(); - - /** - * @copydoc Dali::Integration::RenderSurface::DestroySurface - */ - virtual void DestroySurface(); - - /** - * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface - */ - virtual bool ReplaceGraphicsSurface(); - - /** - * @copydoc Dali::Integration::RenderSurface::MoveResize - */ - virtual void MoveResize( Dali::PositionSize positionSize ); - - /** - * @copydoc Dali::Integration::RenderSurface::StartRender - */ - virtual void StartRender(); - - /** - * @copydoc Dali::Integration::RenderSurface::PreRender - */ - virtual bool PreRender( bool resizingSurface ); - - /** - * @copydoc Dali::Integration::RenderSurface::PostRender - */ - virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ); - - /** - * @copydoc Dali::Integration::RenderSurface::StopRender - */ - virtual void StopRender(); - - /** - * @copydoc Dali::Integration::RenderSurface::ReleaseLock - */ - virtual void ReleaseLock(); - - /** - * @copydoc Dali::Integration::RenderSurface::GetSurfaceType - */ - virtual Dali::Integration::RenderSurface::Type GetSurfaceType(); - - /** - * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent - */ - virtual void MakeContextCurrent(); - - /** - * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired - */ - virtual Integration::DepthBufferAvailable GetDepthBufferRequired(); - - /** - * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired - */ - virtual Integration::StencilBufferAvailable GetStencilBufferRequired(); - - /** - * @copydoc Dali::Integration::RenderSurface::SetBackgroundColor - */ - virtual void SetBackgroundColor( Vector4 color ); - - /** - * @copydoc Dali::Integration::RenderSurface::GetBackgroundColor - */ - virtual Vector4 GetBackgroundColor(); - -private: - - /** - * @brief Undefined copy constructor. RenderSurface cannot be copied - */ - TestRenderSurface( const TestRenderSurface& rhs ); - - /** - * @brief Undefined assignment operator. RenderSurface cannot be copied - */ - TestRenderSurface& operator=( const TestRenderSurface& rhs ); - -private: - - Dali::PositionSize mPositionSize; - Vector4 mBackgroundColor; ///< The background color of the surface -}; - -} // Dali - -#endif diff --git a/automated-tests/src/dali-platform-abstraction/CMakeLists.txt b/automated-tests/src/dali-platform-abstraction/CMakeLists.txt index be00390..6ad89b6 100644 --- a/automated-tests/src/dali-platform-abstraction/CMakeLists.txt +++ b/automated-tests/src/dali-platform-abstraction/CMakeLists.txt @@ -21,7 +21,6 @@ LIST(APPEND TC_SOURCES ../dali-adaptor/dali-test-suite-utils/test-native-image.cpp ../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp ../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp - ../dali-adaptor/dali-test-suite-utils/test-render-surface.cpp ../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp ../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp tct-dali-platform-abstraction-core.cpp diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index a2a1246..f14bc8d 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -30,41 +30,6 @@ void SetPositionSize( Window window, PositionSize positionSize ) GetImplementation( window ).SetPositionSize( positionSize ); } -void Add( Window window, Dali::Actor actor ) -{ - GetImplementation( window ).Add( actor ); -} - -void Remove( Window window, Dali::Actor actor ) -{ - GetImplementation( window ).Remove( actor ); -} - -void SetBackgroundColor( Window window, Vector4 color ) -{ - GetImplementation( window ).SetBackgroundColor( color ); -} - -Vector4 GetBackgroundColor( Window window ) -{ - return GetImplementation( window ).GetBackgroundColor(); -} - -Dali::Layer GetRootLayer( Window window ) -{ - return GetImplementation( window ).GetRootLayer(); -} - -uint32_t GetLayerCount( Window window ) -{ - return GetImplementation( window ).GetLayerCount(); -} - -Dali::Layer GetLayer( Window window, uint32_t depth ) -{ - return GetImplementation( window ).GetLayer( depth ); -} - } // namespace DevelWindow } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index eec41b7..9ed8a18 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -2,7 +2,7 @@ #define DALI_WINDOW_DEVEL_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -35,71 +35,6 @@ namespace DevelWindow */ DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize ); -/** - * @brief Adds a child Actor to the Window. - * - * The child will be referenced. - * @param[in] window The window instance - * @param[in] actor The child - * @pre The actor has been initialized. - * @pre The actor does not have a parent. - */ -DALI_ADAPTOR_API void Add( Window window, Dali::Actor actor ); - -/** - * @brief Removes a child Actor from the Window. - * - * The child will be unreferenced. - * @param[in] window The window instance - * @param[in] actor The child - * @pre The actor has been added to the stage. - */ -DALI_ADAPTOR_API void Remove( Window window, Dali::Actor actor ); - -/** - * @brief Sets the background color of the window. - * - * @param[in] window The window instance - * @param[in] color The new background color - */ -DALI_ADAPTOR_API void SetBackgroundColor( Window window, Vector4 color ); - -/** - * @brief Gets the background color of the surface. - * - * @param[in] window The window instance - * @return The background color - */ -DALI_ADAPTOR_API Vector4 GetBackgroundColor( Window window ); - -/** - * @brief Returns the Scene's Root Layer. - * - * @param[in] window The window instance - * @return The root layer - */ -DALI_ADAPTOR_API Dali::Layer GetRootLayer( Window window ); - -/** - * @brief Queries the number of on-stage layers. - * - * Note that a default layer is always provided (count >= 1). - * @param[in] window The window instance - * @return The number of layers - */ -DALI_ADAPTOR_API uint32_t GetLayerCount( Window window ); - -/** - * @brief Retrieves the layer at a specified depth. - * - * @param[in] window The window instance - * @param[in] depth The depth - * @return The layer found at the given depth - * @pre Depth is less than layer count; see GetLayerCount(). - */ -DALI_ADAPTOR_API Dali::Layer GetLayer( Window window, uint32_t depth ); - - } // namespace DevelWindow } // namespace Dali diff --git a/dali/integration-api/adaptor.h b/dali/integration-api/adaptor.h index 04f9429..14ff203 100755 --- a/dali/integration-api/adaptor.h +++ b/dali/integration-api/adaptor.h @@ -41,7 +41,7 @@ namespace Dali { -class RenderSurfaceInterface; +class RenderSurface; namespace Internal { @@ -141,7 +141,7 @@ public: * @param[in] surface The surface to draw onto * @return a reference to the adaptor handle */ - static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface ); + static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface ); /** * @brief Create a new adaptor using render surface. @@ -151,7 +151,7 @@ public: * @param[in] configuration The context loss configuration. * @return a reference to the adaptor handle */ - static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS); + static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS); /** * @brief Virtual Destructor. @@ -221,14 +221,14 @@ public: * @param[in] nativeWindow native window handle * @param[in] surface to use */ - void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface ); + void ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ); /** * @brief Get the render surface the adaptor is using to render to. * * @return reference to current render surface */ - Dali::RenderSurfaceInterface& GetSurface(); + RenderSurface& GetSurface(); /** * @brief Gets native window handle diff --git a/dali/integration-api/egl-interface.h b/dali/integration-api/egl-interface.h index 823cfa6..5208501 100644 --- a/dali/integration-api/egl-interface.h +++ b/dali/integration-api/egl-interface.h @@ -18,9 +18,6 @@ * */ -// EXTERNAL INCLUDES -#include - namespace Dali { @@ -45,7 +42,7 @@ public: /** * Make the OpenGL context current */ - virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ) = 0; + virtual void MakeContextCurrent() = 0; /** * Terminate GL @@ -55,12 +52,12 @@ public: /** * Performs an OpenGL swap buffers command */ - virtual void SwapBuffers( EGLSurface& eglSurface ) = 0; + virtual void SwapBuffers() = 0; /** * Performs an OpenGL copy buffers command */ - virtual void CopyBuffers( EGLSurface& eglSurface ) = 0; + virtual void CopyBuffers() = 0; /** * Performs an EGL wait GL command diff --git a/dali/integration-api/file.list b/dali/integration-api/file.list index 40f91cf..d091cf0 100755 --- a/dali/integration-api/file.list +++ b/dali/integration-api/file.list @@ -4,7 +4,7 @@ adaptor_integration_api_header_files = \ $(adaptor_integration_api_dir)/log-factory-interface.h \ $(adaptor_integration_api_dir)/native-render-surface.h \ $(adaptor_integration_api_dir)/native-render-surface-factory.h \ - $(adaptor_integration_api_dir)/render-surface-interface.h \ + $(adaptor_integration_api_dir)/render-surface.h \ $(adaptor_integration_api_dir)/thread-synchronization-interface.h \ $(adaptor_integration_api_dir)/trigger-event-interface.h \ $(adaptor_integration_api_dir)/trigger-event-factory-interface.h \ diff --git a/dali/integration-api/native-render-surface.h b/dali/integration-api/native-render-surface.h index 530468d..bbd5e9b 100644 --- a/dali/integration-api/native-render-surface.h +++ b/dali/integration-api/native-render-surface.h @@ -20,13 +20,12 @@ // INTERNAL INCLUDES #include - #ifdef DALI_ADAPTOR_COMPILATION #include -#include +#include #else #include -#include +#include #endif namespace Dali @@ -37,7 +36,7 @@ class TriggerEventInterface; /** * Native interface of render surface. */ -class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurfaceInterface +class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurface { public: diff --git a/dali/integration-api/render-surface-interface.h b/dali/integration-api/render-surface.h similarity index 59% rename from dali/integration-api/render-surface-interface.h rename to dali/integration-api/render-surface.h index ad672ca..edb9022 100644 --- a/dali/integration-api/render-surface-interface.h +++ b/dali/integration-api/render-surface.h @@ -1,5 +1,5 @@ -#ifndef DALI_RENDER_SURFACE_INTERFACE_H -#define DALI_RENDER_SURFACE_INTERFACE_H +#ifndef DALI_RENDER_SURFACE_H +#define DALI_RENDER_SURFACE_H /* * Copyright (c) 2018 Samsung Electronics Co., Ltd. @@ -19,11 +19,13 @@ */ // EXTERNAL INCLUDES -#include -#include -#include +#include +#include +#include // INTERNAL INCLUDES +#include + namespace Dali { @@ -33,12 +35,27 @@ class ThreadSynchronizationInterface; namespace Internal { + namespace Adaptor { -class AdaptorInternalServices; + class GraphicsInterface; -} -} + +} // namespace Adaptor + +} // namespace Internal + +namespace Integration +{ + +class GlAbstraction; + +} // namespace Integration + +/** + * @brief The position and size of the render surface. + */ +typedef Dali::Rect PositionSize; /** * @brief Interface for a render surface onto which Dali draws. @@ -53,34 +70,34 @@ class GraphicsInterface; * implementation of RenderSurface for the given platform */ -class RenderSurfaceInterface : public Dali::Integration::RenderSurface +class RenderSurface { public: + enum Type + { + WINDOW_RENDER_SURFACE, + PIXMAP_RENDER_SURFACE, + NATIVE_RENDER_SURFACE + }; + /** * @brief Constructor * Inlined as this is a pure abstract interface */ - RenderSurfaceInterface() - : mAdaptor( nullptr ), - mGraphics( nullptr ), - mDisplayConnection( nullptr ), - mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ), - mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE ), - mBackgroundColor() - {} + RenderSurface() {} /** * @brief Virtual Destructor. * Inlined as this is a pure abstract interface */ - virtual ~RenderSurfaceInterface() {} + virtual ~RenderSurface() {} /** * @brief Return the size and position of the surface. * @return The position and size */ - virtual Dali::PositionSize GetPositionSize() const = 0; + virtual PositionSize GetPositionSize() const = 0; /** * @brief Get DPI @@ -91,8 +108,10 @@ public: /** * @brief InitializeGraphics the platform specific graphics surface interfaces + * @param[in] graphics The abstracted graphics interface + * @param[in] displayConnection The display connection interface */ - virtual void InitializeGraphics() = 0; + virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) = 0; /** * @brief Creates the Surface @@ -157,86 +176,21 @@ public: /** * @brief Gets the surface type */ - virtual Dali::Integration::RenderSurface::Type GetSurfaceType() = 0; - - /** - * @brief Makes the graphics context current - */ - virtual void MakeContextCurrent() = 0; - - /** - * @brief Get whether the depth buffer is required - * @return TRUE if the depth buffer is required - */ - virtual Integration::DepthBufferAvailable GetDepthBufferRequired() = 0; - - /** - * @brief Get whether the stencil buffer is required - * @return TRUE if the stencil buffer is required - */ - virtual Integration::StencilBufferAvailable GetStencilBufferRequired() = 0; - - /** - * @brief Sets the background color of the surface. - * @param[in] color The new background color - */ - virtual void SetBackgroundColor( Vector4 color ) override - { - mBackgroundColor = color; - } - - /** - * @brief Gets the background color of the surface. - * @return The background color - */ - virtual Vector4 GetBackgroundColor() override - { - return mBackgroundColor; - } - -public: - - void SetAdaptor( Dali::Internal::Adaptor::AdaptorInternalServices& adaptor ) - { - mAdaptor = &adaptor; - } - - void SetGraphicsInterface( Dali::Internal::Adaptor::GraphicsInterface& graphics ) - { - mGraphics = &graphics; - } - - void SetDisplayConnection( Dali::DisplayConnection& displayConnection ) - { - mDisplayConnection = &displayConnection; - } + virtual RenderSurface::Type GetSurfaceType() = 0; private: /** * @brief Undefined copy constructor. RenderSurface cannot be copied */ - RenderSurfaceInterface( const RenderSurfaceInterface& rhs ); + RenderSurface( const RenderSurface& rhs ); /** * @brief Undefined assignment operator. RenderSurface cannot be copied */ - RenderSurfaceInterface& operator=( const RenderSurfaceInterface& rhs ); - -protected: - - Dali::Internal::Adaptor::AdaptorInternalServices* mAdaptor; - Dali::Internal::Adaptor::GraphicsInterface* mGraphics; - Dali::DisplayConnection* mDisplayConnection; - -private: - - Integration::DepthBufferAvailable mDepthBufferRequired; ///< Whether the depth buffer is required - Integration::StencilBufferAvailable mStencilBufferRequired; ///< Whether the stencil buffer is required - - Vector4 mBackgroundColor; ///< The background color of the surface + RenderSurface& operator=( const RenderSurface& rhs ); }; } // namespace Dali -#endif // DALI_RENDER_SURFACE_INTERFACE_H +#endif // DALI_RENDER_SURFACE_H diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index daeb943..73c18d8 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -83,7 +83,7 @@ thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer } // unnamed namespace -Dali::Adaptor* Adaptor::New( Any nativeWindow, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ) +Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ) { Dali::Adaptor* adaptor = new Dali::Adaptor; Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions ); @@ -108,7 +108,7 @@ Dali::Adaptor* Adaptor::New( Dali::Window window, Dali::Configuration::ContextLo return adaptor; } -Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Any nativeWindow, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ) +Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ) { Dali::Adaptor* adaptor = new Dali::Adaptor; // Public adaptor Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions ); // Impl adaptor @@ -166,8 +166,6 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: PositionSize size = defaultWindow.surface->GetPositionSize(); - defaultWindow.surface->SetAdaptor(*this); - mGestureManager = new GestureManager(*this, Vector2(size.width, size.height), mCallbackManager, *mEnvironmentOptions); mGraphics = &( graphicsFactory.Create() ); @@ -175,9 +173,6 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: auto eglGraphics = static_cast( mGraphics ); // This interface is temporary until Core has been updated to match - // This will only be created once - eglGraphics->Create(); - GlImplementation& mGLES = eglGraphics->GetGlesInterface(); EglSyncImplementation& eglSyncImpl = eglGraphics->GetSyncImplementation(); @@ -276,6 +271,8 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: { Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() ); } + + SetupSystemInformation(); } Adaptor::~Adaptor() @@ -324,10 +321,6 @@ void Adaptor::Start() return; } - mCore->Initialize(); - - SetupSystemInformation(); - // Start the callback manager mCallbackManager->Start(); @@ -347,12 +340,17 @@ void Adaptor::Start() defaultWindow.surface->GetDpi( dpiHor, dpiVer ); + // tell core about the DPI value + mCore->SetDpi(dpiHor, dpiVer); + // set the DPI value for font rendering FontClient fontClient = FontClient::Get(); fontClient.SetDpi( dpiHor, dpiVer ); // Tell the core the size of the surface just before we start the render-thread - mCore->SurfaceResized( defaultWindow.surface ); + PositionSize size = defaultWindow.surface->GetPositionSize(); + + mCore->SurfaceResized( size.width, size.height ); // Initialize the thread controller mThreadController->Initialize(); @@ -490,17 +488,18 @@ void Adaptor::FeedKeyEvent( KeyEvent& keyEvent ) mEventHandler->FeedKeyEvent( keyEvent ); } -void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& newSurface ) +void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& newSurface ) { + PositionSize positionSize = newSurface.GetPositionSize(); + // Let the core know the surface size has changed - mCore->SurfaceResized( &newSurface ); + mCore->SurfaceResized( positionSize.width, positionSize.height ); mResizedSignal.Emit( mAdaptor ); WindowPane newDefaultWindow; newDefaultWindow.nativeWindow = nativeWindow; newDefaultWindow.surface = &newSurface; - newDefaultWindow.surface->SetAdaptor(*this); WindowPane oldDefaultWindow = mWindowFrame.front(); @@ -520,7 +519,7 @@ void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& ne oldDefaultWindow.surface = nullptr; } -Dali::RenderSurfaceInterface& Adaptor::GetSurface() const +RenderSurface& Adaptor::GetSurface() const { WindowPane defaultWindow = mWindowFrame.front(); return *(defaultWindow.surface); @@ -568,21 +567,19 @@ void Adaptor::SetPreRenderCallback( CallbackBase* callback ) bool Adaptor::AddWindow( Dali::Window* childWindow, const std::string& childWindowName, const std::string& childWindowClassName, const bool& childWindowMode ) { - Window& windowImpl = Dali::GetImplementation( *childWindow ); - windowImpl.SetAdaptor( Get() ); - // This is any Window that is not the main (default) one WindowPane additionalWindow; additionalWindow.instance = childWindow; additionalWindow.window_name = childWindowName; additionalWindow.class_name = childWindowClassName; additionalWindow.window_mode = childWindowMode; - additionalWindow.surface = windowImpl.GetSurface(); - additionalWindow.id = windowImpl.GetId(); // Add the new Window to the Frame - the order is not important mWindowFrame.push_back( additionalWindow ); + Window& windowImpl = Dali::GetImplementation( *childWindow ); + windowImpl.SetAdaptor( Get() ); + return true; } @@ -614,20 +611,6 @@ bool Adaptor::RemoveWindow( std::string childWindowName ) return false; } -bool Adaptor::RemoveWindow( Window* childWindow ) -{ - for ( WindowFrames::iterator iter = mWindowFrame.begin(); iter != mWindowFrame.end(); ++iter ) - { - if( iter->id == childWindow->GetId() ) - { - mWindowFrame.erase( iter ); - return true; - } - } - - return false; -} - Dali::Adaptor& Adaptor::Get() { DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" ); @@ -691,7 +674,7 @@ SocketFactoryInterface& Adaptor::GetSocketFactoryInterface() return mSocketFactory; } -Dali::RenderSurfaceInterface* Adaptor::GetRenderSurfaceInterface() +RenderSurface* Adaptor::GetRenderSurfaceInterface() { if( !mWindowFrame.empty()) { @@ -911,15 +894,15 @@ void Adaptor::OnDamaged( const DamageArea& area ) RequestUpdate( false ); } -void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize ) +void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize ) { // Let the core know the surface size has changed - mCore->SurfaceResized( surface ); + mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() ); mResizedSignal.Emit( mAdaptor ); } -void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize ) +void Adaptor::SurfaceResizeComplete( SurfaceSize surfaceSize ) { // Flush the event queue to give the update-render thread chance // to start processing messages for new camera setup etc as soon as possible @@ -974,6 +957,12 @@ void Adaptor::RequestUpdateOnce() } } +void Adaptor::IndicatorSizeChanged(int height) +{ + // Let the core know the indicator height is changed + mCore->SetTopMargin(height); +} + bool Adaptor::ProcessCoreEventsFromIdle() { ProcessCoreEvents(); @@ -984,7 +973,7 @@ bool Adaptor::ProcessCoreEventsFromIdle() return false; } -Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions) +Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions) : mResizedSignal(), mLanguageChangedSignal(), mAdaptor( adaptor ), @@ -1022,7 +1011,6 @@ Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, Dali::RenderSurfaceIn WindowPane defaultWindow; defaultWindow.nativeWindow = nativeWindow; defaultWindow.surface = surface; - defaultWindow.id = 0; std::vector::iterator iter = mWindowFrame.begin(); iter = mWindowFrame.insert( iter, defaultWindow ); diff --git a/dali/internal/adaptor/common/adaptor-impl.h b/dali/internal/adaptor/common/adaptor-impl.h index 428680c..af7eb87 100755 --- a/dali/internal/adaptor/common/adaptor-impl.h +++ b/dali/internal/adaptor/common/adaptor-impl.h @@ -49,7 +49,7 @@ namespace Dali { -class RenderSurfaceInterface; +class RenderSurface; class Window; namespace Integration @@ -106,7 +106,7 @@ public: * @param[in] environmentOptions A pointer to the environment options. If NULL then one is created. */ static Dali::Adaptor* New( Any nativeWindow, - Dali::RenderSurfaceInterface* surface, + RenderSurface* surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ); @@ -132,7 +132,7 @@ public: */ static Dali::Adaptor* New( GraphicsFactory& graphicsFactory, Any nativeWindow, - Dali::RenderSurfaceInterface* surface, + RenderSurface* surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ); @@ -224,12 +224,12 @@ public: // AdaptorInternalServices implementation /** * @copydoc AdaptorInterface::ReplaceSurface() */ - virtual void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface ); + virtual void ReplaceSurface( Any nativeWindow, RenderSurface& surface ); /** * @copydoc Dali::Adaptor::GetSurface() */ - virtual Dali::RenderSurfaceInterface& GetSurface() const; + virtual RenderSurface& GetSurface() const; /** * @copydoc Dali::Adaptor::ReleaseSurfaceLock() @@ -283,12 +283,6 @@ public: // AdaptorInternalServices implementation */ void SetPreRenderCallback( CallbackBase* callback ); - /** - * Removes an existing Window instance from the Adaptor - * @param[in] childWindow The Window instance - */ - bool RemoveWindow( Dali::Internal::Adaptor::Window* childWindow ); - public: /** @@ -386,6 +380,11 @@ public: void RequestUpdateOnce(); /** + * Request adaptor to update indicator's height + */ + void IndicatorSizeChanged(int height); + + /** * @copydoc Dali::Adaptor::NotifySceneCreated() */ void NotifySceneCreated(); @@ -403,12 +402,12 @@ public: /** * Informs core the surface size has changed */ - void SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize ); + void SurfaceResizePrepare( SurfaceSize surfaceSize ); /** * Informs ThreadController the surface size has changed */ - void SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize ); + void SurfaceResizeComplete( SurfaceSize surfaceSize ); /** * Sets layout direction of root by system language @@ -471,7 +470,7 @@ public: //AdaptorInternalServices /** * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetRenderSurfaceInterface() */ - virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface(); + virtual RenderSurface* GetRenderSurfaceInterface(); /** * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetVSyncMonitorInterface() @@ -566,7 +565,7 @@ private: * Assigns the render surface to the adaptor * */ - void SetSurface(Dali::RenderSurfaceInterface *surface); + void SetSurface(RenderSurface *surface); /** * called after surface is created @@ -616,7 +615,7 @@ private: * - Window, adaptor will use existing Window to draw on to * @param[in] environmentOptions A pointer to the environment options. If NULL then one is created. */ - Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions ); + Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions ); private: // Types @@ -637,8 +636,7 @@ private: // Types std::string class_name; ///< Class name that the window belongs to bool window_mode; ///< Display mode of the window Any nativeWindow; ///< window identifier - uint32_t id; ///< unique Window ID - Dali::RenderSurfaceInterface* surface; ///< The surface the Window is bound to + RenderSurface* surface; ///< The surface the Window is bound to } WindowPane; typedef std::vector WindowFrames; diff --git a/dali/internal/adaptor/common/adaptor-internal-services.h b/dali/internal/adaptor/common/adaptor-internal-services.h index db4a360..4823a6b 100644 --- a/dali/internal/adaptor/common/adaptor-internal-services.h +++ b/dali/internal/adaptor/common/adaptor-internal-services.h @@ -25,7 +25,6 @@ // INTERNAL INCLUDES #include #include -#include #include #include #include @@ -35,6 +34,7 @@ #include #include + namespace Dali { @@ -97,7 +97,7 @@ public: /** * @return render surface */ - virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface() = 0; + virtual RenderSurface* GetRenderSurfaceInterface() = 0; /** * @return vsync monitor interface diff --git a/dali/internal/adaptor/common/adaptor.cpp b/dali/internal/adaptor/common/adaptor.cpp index 66b28ee..377a031 100755 --- a/dali/internal/adaptor/common/adaptor.cpp +++ b/dali/internal/adaptor/common/adaptor.cpp @@ -41,14 +41,14 @@ Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) return *adaptor; } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface ) +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface ) { return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration ) { - Dali::RenderSurfaceInterface* pSurface = const_cast(&surface); + Dali::RenderSurface* pSurface = const_cast(&surface); Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL ); return *adaptor; } @@ -88,7 +88,7 @@ void Adaptor::RemoveIdle( CallbackBase* callback ) mImpl->RemoveIdle( callback ); } -void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface ) +void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ) { mImpl->ReplaceSurface(nativeWindow, surface); } @@ -103,7 +103,7 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal() return mImpl->LanguageChangedSignal(); } -Dali::RenderSurfaceInterface& Adaptor::GetSurface() +RenderSurface& Adaptor::GetSurface() { return mImpl->GetSurface(); } diff --git a/dali/internal/adaptor/common/application-impl.cpp b/dali/internal/adaptor/common/application-impl.cpp index 8e90b04..7856020 100644 --- a/dali/internal/adaptor/common/application-impl.cpp +++ b/dali/internal/adaptor/common/application-impl.cpp @@ -27,11 +27,8 @@ #include #include #include -#include #include -#undef Status - namespace Dali { @@ -442,7 +439,7 @@ void Application::ReplaceWindow( const PositionSize& positionSize, const std::st GetImplementation( newWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) ); } - Internal::Adaptor::WindowRenderSurface* renderSurface = windowImpl.GetSurface(); + Dali::RenderSurface* renderSurface = windowImpl.GetSurface(); Any nativeWindow = newWindow.GetNativeHandle(); Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface); diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 25555a5..4c7b79f 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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,9 +29,6 @@ #include #include #include -#include -#include -#include namespace Dali { @@ -122,7 +119,7 @@ CombinedUpdateRenderController::CombinedUpdateRenderController( AdaptorInternalS SetRenderRefreshRate( environmentOptions.GetRenderRefreshRate() ); // Set the thread-synchronization interface on the render-surface - Dali::RenderSurfaceInterface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); + RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); if( currentSurface ) { currentSurface->SetThreadSynchronization( *this ); @@ -172,7 +169,7 @@ void CombinedUpdateRenderController::Start() sem_wait( &mEventThreadSemaphore ); } - Integration::RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); + RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); if( currentSurface ) { currentSurface->StartRender(); @@ -218,7 +215,7 @@ void CombinedUpdateRenderController::Stop() LOG_EVENT_TRACE; // Stop Rendering and the Update/Render Thread - Integration::RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); + RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); if( currentSurface ) { currentSurface->StopRender(); @@ -278,7 +275,7 @@ void CombinedUpdateRenderController::RequestUpdateOnce() } } -void CombinedUpdateRenderController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface ) +void CombinedUpdateRenderController::ReplaceSurface( RenderSurface* newSurface ) { LOG_EVENT_TRACE; @@ -410,38 +407,12 @@ void CombinedUpdateRenderController::UpdateRenderThread() LOG_UPDATE_RENDER( "THREAD CREATED" ); - // Initialize EGL & OpenGL - Dali::DisplayConnection& displayConnection = mAdaptorInterfaces.GetDisplayConnectionInterface(); - displayConnection.Initialize(); - - RenderSurfaceInterface* currentSurface = nullptr; - -#if DALI_GLES_VERSION >= 30 - - GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface(); - EglGraphics* eglGraphics = static_cast(&graphics); - - // This will only be created once - EglInterface* eglInterface = &eglGraphics->GetEglInterface(); - - Internal::Adaptor::EglImplementation& eglImpl = static_cast( *eglInterface ); - eglImpl.ChooseConfig( true, COLOR_DEPTH_32 ); // Always use this for shared context??? - - // Create a surfaceless OpenGL context for shared resources - eglImpl.CreateContext(); - eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() ); - -#else // DALI_GLES_VERSION >= 30 - - currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); + RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); if( currentSurface ) { - currentSurface->InitializeGraphics(); - currentSurface->MakeContextCurrent(); + currentSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() ); } -#endif - // Tell core it has a context mCore.ContextCreated(); @@ -487,7 +458,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() // REPLACE SURFACE ////////////////////////////// - Integration::RenderSurface* newSurface = ShouldSurfaceBeReplaced(); + RenderSurface* newSurface = ShouldSurfaceBeReplaced(); if( DALI_UNLIKELY( newSurface ) ) { LOG_UPDATE_RENDER_TRACE_FMT( "Replacing Surface" ); @@ -498,7 +469,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() // If the new surface has a different display connection, then the context will be lost mAdaptorInterfaces.GetDisplayConnectionInterface().Initialize(); - newSurface->InitializeGraphics(); + newSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() ); newSurface->ReplaceGraphicsSurface(); SurfaceReplaced(); } @@ -545,6 +516,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() } // Check resize + bool surfaceResized = false; bool shouldSurfaceBeResized = ShouldSurfaceBeResized(); if( DALI_UNLIKELY( shouldSurfaceBeResized ) ) { @@ -552,6 +524,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() { LOG_UPDATE_RENDER_TRACE_FMT( "Resizing Surface" ); SurfaceResized(); + surfaceResized = true; } } @@ -574,10 +547,11 @@ void CombinedUpdateRenderController::UpdateRenderThread() } } -#if DALI_GLES_VERSION >= 30 - // Make the shared surfaceless context as current before rendering - eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() ); -#endif + currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); + if( currentSurface ) + { + currentSurface->PreRender( surfaceResized ); + } Integration::RenderStatus renderStatus; @@ -587,6 +561,14 @@ void CombinedUpdateRenderController::UpdateRenderThread() mForceClear = false; + if( renderStatus.NeedsPostRender() ) + { + if( currentSurface ) + { + currentSurface->PostRender( isRenderingToFbo, ( mNewSurface != NULL ), surfaceResized ); + } + } + // Trigger event thread to request Update/Render thread to sleep if update not required if( ( Integration::KeepUpdating::NOT_REQUESTED == keepUpdatingStatus ) && !renderStatus.NeedsUpdate() ) { @@ -709,11 +691,11 @@ bool CombinedUpdateRenderController::UpdateRenderReady( bool& useElapsedTime, bo return ! mDestroyUpdateRenderThread; } -Integration::RenderSurface* CombinedUpdateRenderController::ShouldSurfaceBeReplaced() +RenderSurface* CombinedUpdateRenderController::ShouldSurfaceBeReplaced() { ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition ); - Integration::RenderSurface* newSurface = mNewSurface; + RenderSurface* newSurface = mNewSurface; mNewSurface = NULL; return newSurface; diff --git a/dali/internal/adaptor/common/combined-update-render-controller.h b/dali/internal/adaptor/common/combined-update-render-controller.h index bdb51b0..6eafcf1 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.h +++ b/dali/internal/adaptor/common/combined-update-render-controller.h @@ -36,7 +36,7 @@ namespace Dali { -class RenderSurfaceInterface; +class RenderSurface; class TriggerEventInterface; namespace Internal @@ -124,7 +124,7 @@ public: /** * @copydoc ThreadControllerInterface::ReplaceSurface() */ - virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface ); + virtual void ReplaceSurface( RenderSurface* surface ); /** * @copydoc ThreadControllerInterface::ResizeSurface() @@ -217,7 +217,7 @@ private: * * @return Pointer to the new surface, NULL otherwise */ - Integration::RenderSurface* ShouldSurfaceBeReplaced(); + RenderSurface* ShouldSurfaceBeReplaced(); /** * Called by the Update/Render thread after a surface has been replaced. @@ -334,7 +334,7 @@ private: volatile unsigned int mUseElapsedTimeAfterWait; ///< Whether we should use the elapsed time after waiting (set by the event-thread, read by the update-render-thread). - Integration::RenderSurface* volatile mNewSurface; ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread). + RenderSurface* volatile mNewSurface; ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread). volatile unsigned int mPostRendering; ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread). volatile unsigned int mSurfaceResized; ///< Will be set to resize the surface (set by the event-thread, read & cleared by the update-render thread). diff --git a/dali/internal/adaptor/common/thread-controller-interface.h b/dali/internal/adaptor/common/thread-controller-interface.h index 6885819..8f4aabc 100644 --- a/dali/internal/adaptor/common/thread-controller-interface.h +++ b/dali/internal/adaptor/common/thread-controller-interface.h @@ -23,7 +23,7 @@ namespace Dali { -class RenderSurfaceInterface; +class RenderSurface; namespace Internal { @@ -83,7 +83,7 @@ public: * Replaces the surface. * @param surface new surface */ - virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface ) = 0; + virtual void ReplaceSurface( RenderSurface* surface ) = 0; /** * Resize the surface. diff --git a/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp b/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp index 8e6d5be..f944bd7 100644 --- a/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp +++ b/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp @@ -193,20 +193,12 @@ struct Framework::Impl mApplicationType = type; mCallbackManager = CallbackManager::New(); - char* region = nullptr; - char* language = nullptr; + char* region; + char* language; system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ®ion ); system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language ); - - if (region != nullptr) - { - mRegion = std::string( region ); - } - - if ( language != nullptr) - { - mLanguage = std::string( language ); - } + mRegion = std::string( region ); + mLanguage = std::string( language ); } ~Impl() diff --git a/dali/internal/graphics/gles/egl-graphics.cpp b/dali/internal/graphics/gles/egl-graphics.cpp index ebaaa5a..de42dea 100644 --- a/dali/internal/graphics/gles/egl-graphics.cpp +++ b/dali/internal/graphics/gles/egl-graphics.cpp @@ -72,6 +72,7 @@ void EglGraphics::Destroy() { } +//Dali::Integration::GlAbstraction& EglGraphics::GetGlesInterface() GlImplementation& EglGraphics::GetGlesInterface() { return *mGLES; diff --git a/dali/internal/graphics/gles/egl-implementation.cpp b/dali/internal/graphics/gles/egl-implementation.cpp index 1e6ce24..783c06a 100755 --- a/dali/internal/graphics/gles/egl-implementation.cpp +++ b/dali/internal/graphics/gles/egl-implementation.cpp @@ -68,6 +68,7 @@ EglImplementation::EglImplementation( int multiSamplingLevel, mColorDepth( COLOR_DEPTH_24 ), mGlesInitialized( false ), mIsOwnSurface( true ), + mContextCurrent( false ), mIsWindow( true ), mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ), mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE ) @@ -148,53 +149,32 @@ bool EglImplementation::CreateContext() return true; } -bool EglImplementation::CreateWindowContext( EGLContext& eglContext ) -{ - // make sure a context isn't created twice - DALI_ASSERT_ALWAYS( (eglContext == 0) && "EGL context recreated" ); - - eglContext = eglCreateContext(mEglDisplay, mEglConfig, mEglContext, &(mContextAttribs[0])); - TEST_EGL_ERROR("eglCreateContext render thread"); - - DALI_ASSERT_ALWAYS( EGL_NO_CONTEXT != eglContext && "EGL context not created" ); - - DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VENDOR : %s ***\n", glGetString(GL_VENDOR)); - DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_RENDERER : %s ***\n", glGetString(GL_RENDERER)); - DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VERSION : %s ***\n", glGetString(GL_VERSION)); - DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_SHADING_LANGUAGE_VERSION : %s***\n", glGetString(GL_SHADING_LANGUAGE_VERSION)); - DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** Supported Extensions ***\n%s\n\n", glGetString(GL_EXTENSIONS)); - - mEglWindowContexts.push_back( eglContext ); - - return true; -} - -void EglImplementation::DestroyContext( EGLContext& eglContext ) +void EglImplementation::DestroyContext() { DALI_ASSERT_ALWAYS( mEglContext && "no EGL context" ); - eglDestroyContext( mEglDisplay, eglContext ); - eglContext = 0; + eglDestroyContext( mEglDisplay, mEglContext ); + mEglContext = 0; } -void EglImplementation::DestroySurface( EGLSurface& eglSurface ) +void EglImplementation::DestroySurface() { - if(mIsOwnSurface && eglSurface) + if(mIsOwnSurface && mCurrentEglSurface) { // Make context null to prevent crash in driver side MakeContextNull(); - eglDestroySurface( mEglDisplay, eglSurface ); - eglSurface = 0; + eglDestroySurface( mEglDisplay, mCurrentEglSurface ); + mCurrentEglSurface = 0; } } -void EglImplementation::MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ) +void EglImplementation::MakeContextCurrent() { - mCurrentEglSurface = eglSurface; + mContextCurrent = true; if(mIsOwnSurface) { - eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, eglContext ); + eglMakeCurrent( mEglDisplay, mCurrentEglSurface, mCurrentEglSurface, mEglContext ); } EGLint error = eglGetError(); @@ -225,7 +205,7 @@ void EglImplementation::MakeCurrent( EGLNativePixmapType pixmap, EGLSurface eglS if(mIsOwnSurface) { - eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, mEglContext ); + eglMakeCurrent( mEglDisplay, mCurrentEglSurface, mCurrentEglSurface, mEglContext ); } EGLint error = eglGetError(); @@ -240,6 +220,7 @@ void EglImplementation::MakeCurrent( EGLNativePixmapType pixmap, EGLSurface eglS void EglImplementation::MakeContextNull() { + mContextCurrent = false; // clear the current context eglMakeCurrent( mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT ); } @@ -251,18 +232,11 @@ void EglImplementation::TerminateGles() // Make context null to prevent crash in driver side MakeContextNull(); - for ( auto eglSurface : mEglWindowSurfaces ) + if(mIsOwnSurface && mCurrentEglSurface) { - if(mIsOwnSurface && eglSurface) - { - eglDestroySurface(mEglDisplay, eglSurface); - } + eglDestroySurface(mEglDisplay, mCurrentEglSurface); } eglDestroyContext(mEglDisplay, mEglContext); - for ( auto eglContext : mEglWindowContexts ) - { - eglDestroyContext(mEglDisplay, eglContext); - } eglTerminate(mEglDisplay); @@ -280,17 +254,14 @@ bool EglImplementation::IsGlesInitialized() const return mGlesInitialized; } -void EglImplementation::SwapBuffers( EGLSurface& eglSurface ) +void EglImplementation::SwapBuffers() { - if ( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context - { - eglSwapBuffers( mEglDisplay, eglSurface ); - } + eglSwapBuffers( mEglDisplay, mCurrentEglSurface ); } -void EglImplementation::CopyBuffers( EGLSurface& eglSurface ) +void EglImplementation::CopyBuffers() { - eglCopyBuffers( mEglDisplay, eglSurface, mCurrentEglNativePixmap ); + eglCopyBuffers( mEglDisplay, mCurrentEglSurface, mCurrentEglNativePixmap ); } void EglImplementation::WaitGL() @@ -305,8 +276,6 @@ void EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) return; } - bool isTransparent = ( depth == COLOR_DEPTH_32 ); - mIsWindow = isWindowType; EGLint numConfigs; @@ -357,18 +326,15 @@ void EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) configAttribs.PushBack( EGL_BLUE_SIZE ); configAttribs.PushBack( 8 ); - if ( isTransparent ) - { - configAttribs.PushBack( EGL_ALPHA_SIZE ); + configAttribs.PushBack( EGL_ALPHA_SIZE ); #ifdef _ARCH_ARM_ - // For underlay video playback, we also need to set the alpha value of the 24/32bit window. - configAttribs.PushBack( 8 ); + // For underlay video playback, we also need to set the alpha value of the 24/32bit window. + configAttribs.PushBack( 8 ); #else - // There is a bug in the desktop emulator - // setting EGL_ALPHA_SIZE to 8 results in eglChooseConfig failing - configAttribs.PushBack( 8 ); + // There is a bug in the desktop emulator + // setting EGL_ALPHA_SIZE to 8 results in eglChooseConfig failing + configAttribs.PushBack( 0 ); #endif // _ARCH_ARM_ - } configAttribs.PushBack( EGL_DEPTH_SIZE ); configAttribs.PushBack( mDepthBufferRequired ? 24 : 0 ); @@ -427,8 +393,10 @@ void EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) } } -EGLSurface EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth ) +void EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth ) { + DALI_ASSERT_ALWAYS( ( mCurrentEglSurface == 0 ) && "EGL surface already exists" ); + mEglNativeWindow = window; mColorDepth = depth; mIsWindow = true; @@ -440,8 +408,6 @@ EGLSurface EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, C TEST_EGL_ERROR("eglCreateWindowSurface"); DALI_ASSERT_ALWAYS( mCurrentEglSurface && "Create window surface failed" ); - - return mCurrentEglSurface; } EGLSurface EglImplementation::CreateSurfacePixmap( EGLNativePixmapType pixmap, ColorDepth depth ) @@ -461,7 +427,7 @@ EGLSurface EglImplementation::CreateSurfacePixmap( EGLNativePixmapType pixmap, C return mCurrentEglSurface; } -bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext ) +bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window ) { bool contextLost = false; @@ -470,13 +436,13 @@ bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window, EGLSur MakeContextNull(); // destroy the surface - DestroySurface( eglSurface ); + DestroySurface(); // create the EGL surface CreateSurfaceWindow( window, mColorDepth ); // set the context to be current with the new surface - MakeContextCurrent( eglSurface, eglContext ); + MakeContextCurrent(); return contextLost; } @@ -500,7 +466,7 @@ EGLDisplay EglImplementation::GetDisplay() const return mEglDisplay; } -EGLContext EglImplementation::GetContext() const +EGLDisplay EglImplementation::GetContext() const { return mEglContext; } diff --git a/dali/internal/graphics/gles/egl-implementation.h b/dali/internal/graphics/gles/egl-implementation.h index e299da7..eeb33e3 100644 --- a/dali/internal/graphics/gles/egl-implementation.h +++ b/dali/internal/graphics/gles/egl-implementation.h @@ -22,7 +22,6 @@ #include #include #include -#include #include // INTERNAL INCLUDES @@ -70,31 +69,25 @@ public: bool InitializeGles( EGLNativeDisplayType display, bool isOwnSurface = true ); /** - * Create the OpenGL context for the shared resource. + * Create the OpenGL context. * @return true if successful */ virtual bool CreateContext(); /** - * Create the OpenGL context for the window. - * @return true if successful - */ - bool CreateWindowContext( EGLContext& mEglContext ); - - /** * Destroy the OpenGL context. */ - void DestroyContext( EGLContext& eglContext ); + void DestroyContext(); /** * Destroy the OpenGL surface. */ - void DestroySurface( EGLSurface& eglSurface ); + void DestroySurface(); /** * Make the OpenGL context current */ - virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ); + virtual void MakeContextCurrent(); /** * clear the OpenGL context @@ -123,12 +116,12 @@ public: /** * Performs an OpenGL swap buffers command */ - virtual void SwapBuffers( EGLSurface& eglSurface ); + virtual void SwapBuffers(); /** * Performs an OpenGL copy buffers command */ - virtual void CopyBuffers( EGLSurface& eglSurface ); + virtual void CopyBuffers(); /** * Performs an EGL wait GL command @@ -146,9 +139,9 @@ public: * Create an OpenGL surface using a window * @param window The window to create the surface on * @param colorDepth Bit per pixel value (ex. 32 or 24) - * @return Handle to an on-screen EGL window surface (the requester has an ownership of this egl surface) + * @return true on success, false on failure */ - EGLSurface CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth ); + void CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth ); /** * Create the OpenGL surface using a pixmap @@ -164,7 +157,7 @@ public: * @return true if the context was lost due to a change in display * between old surface and new surface */ - bool ReplaceSurfaceWindow( EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext ); + bool ReplaceSurfaceWindow( EGLNativeWindowType window ); /** * Replaces the render surface @@ -199,22 +192,16 @@ private: EGLDisplay mEglDisplay; EGLConfig mEglConfig; - EGLContext mEglContext; ///< The resource context holding assets such as textures to be shared - - typedef std::vector EglWindowContextContainer; - EglWindowContextContainer mEglWindowContexts; ///< The EGL context for the window - + EGLContext mEglContext; EGLSurface mCurrentEglSurface; - typedef std::vector EglWindowSurfaceContainer; - EglWindowSurfaceContainer mEglWindowSurfaces; ///< The EGL surface for the window - int mMultiSamplingLevel; ColorDepth mColorDepth; bool mGlesInitialized; bool mIsOwnSurface; + bool mContextCurrent; bool mIsWindow; bool mDepthBufferRequired; bool mStencilBufferRequired; diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp index 34255a5..0a50e91 100755 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp @@ -329,7 +329,7 @@ void InputMethodContextEcoreWl::CreateContext() // If we fail to get window id, we can't use the InputMethodContext correctly. // Thus you have to call "ecore_imf_context_client_window_set" somewhere. // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent(). - Dali::RenderSurfaceInterface& renderSurface = Dali::Adaptor::Get().GetSurface(); + RenderSurface& renderSurface = Dali::Adaptor::Get().GetSurface(); WindowRenderSurface& windowRenderSurface = static_cast< WindowRenderSurface& >( renderSurface ); int windowId = windowRenderSurface.GetNativeWindowId(); diff --git a/dali/internal/system/common/thread-controller.cpp b/dali/internal/system/common/thread-controller.cpp index 3d70efe..3cffd54 100644 --- a/dali/internal/system/common/thread-controller.cpp +++ b/dali/internal/system/common/thread-controller.cpp @@ -85,7 +85,7 @@ void ThreadController::RequestUpdateOnce() mThreadControllerInterface->RequestUpdateOnce(); } -void ThreadController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface ) +void ThreadController::ReplaceSurface( RenderSurface* newSurface ) { mThreadControllerInterface->ReplaceSurface( newSurface ); } diff --git a/dali/internal/system/common/thread-controller.h b/dali/internal/system/common/thread-controller.h index 85d94fa..e4c3541 100644 --- a/dali/internal/system/common/thread-controller.h +++ b/dali/internal/system/common/thread-controller.h @@ -25,7 +25,7 @@ namespace Dali { -class RenderSurfaceInterface; +class RenderSurface; namespace Internal { @@ -105,7 +105,7 @@ public: * * @param surface new surface */ - void ReplaceSurface( Dali::RenderSurfaceInterface* surface ); + void ReplaceSurface( RenderSurface* surface ); /** * Resize the surface. diff --git a/dali/internal/window-system/common/display-connection-impl.h b/dali/internal/window-system/common/display-connection-impl.h index 4c21cb6..b5fe5b3 100644 --- a/dali/internal/window-system/common/display-connection-impl.h +++ b/dali/internal/window-system/common/display-connection-impl.h @@ -74,7 +74,7 @@ public: * Sets the render surface type * @param[in] type The render surface type */ - virtual void SetSurfaceType( Integration::RenderSurface::Type type ) = 0; + virtual void SetSurfaceType( RenderSurface::Type type ) = 0; /** * Sets the graphics interface diff --git a/dali/internal/window-system/common/display-connection.cpp b/dali/internal/window-system/common/display-connection.cpp index 8d3a080..1535056 100644 --- a/dali/internal/window-system/common/display-connection.cpp +++ b/dali/internal/window-system/common/display-connection.cpp @@ -38,7 +38,7 @@ DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInte return new DisplayConnection(internal); } -DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, Integration::RenderSurface::Type type ) +DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type ) { auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory(); auto displayConnection = factory->CreateDisplayConnection(); diff --git a/dali/internal/window-system/common/display-connection.h b/dali/internal/window-system/common/display-connection.h index 00c67c8..1fc12ca 100644 --- a/dali/internal/window-system/common/display-connection.h +++ b/dali/internal/window-system/common/display-connection.h @@ -56,7 +56,7 @@ public: * @param[in] type Render surface type * @return A handle to a newly allocated DisplayConnection resource. */ - static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics, Integration::RenderSurface::Type type ); + static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type ); /** * @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New(). diff --git a/dali/internal/window-system/common/event-handler.cpp b/dali/internal/window-system/common/event-handler.cpp index 744d9a9..a52915f 100755 --- a/dali/internal/window-system/common/event-handler.cpp +++ b/dali/internal/window-system/common/event-handler.cpp @@ -97,7 +97,7 @@ static unsigned int GetCurrentMilliSeconds(void) } // unnamed namespace -EventHandler::EventHandler( Integration::RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector ) +EventHandler::EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector ) : mCoreEventInterface( coreEventInterface ), mGestureManager( gestureManager ), mStyleMonitor( StyleMonitor::Get() ), diff --git a/dali/internal/window-system/common/event-handler.h b/dali/internal/window-system/common/event-handler.h index be46842..18125f8 100755 --- a/dali/internal/window-system/common/event-handler.h +++ b/dali/internal/window-system/common/event-handler.h @@ -35,13 +35,8 @@ namespace Dali { -namespace Integration -{ - class RenderSurface; -} - namespace Internal { @@ -70,7 +65,7 @@ public: * @param[in] damageObserver The damage observer (to pass damage events to). * @param[in] dndDetector The Drag & Drop listener (to pass DnD events to). */ - EventHandler( Integration::RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector ); + EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector ); /** * Destructor. diff --git a/dali/internal/window-system/common/native-render-surface-factory.cpp b/dali/internal/window-system/common/native-render-surface-factory.cpp index f1eb81c..ded1216 100644 --- a/dali/internal/window-system/common/native-render-surface-factory.cpp +++ b/dali/internal/window-system/common/native-render-surface-factory.cpp @@ -18,7 +18,6 @@ // INTERNAL INCLUDES #include #include -#include namespace Dali { diff --git a/dali/internal/window-system/common/pixmap-render-surface.h b/dali/internal/window-system/common/pixmap-render-surface.h index 6d139d6..4b5512f 100644 --- a/dali/internal/window-system/common/pixmap-render-surface.h +++ b/dali/internal/window-system/common/pixmap-render-surface.h @@ -19,14 +19,7 @@ */ // INTERNAL INCLUDES - -#ifdef DALI_ADAPTOR_COMPILATION -#include -#include -#else -#include -#endif - +#include namespace Dali { @@ -41,7 +34,7 @@ namespace Adaptor /** * Pixmap interface of render surface. */ -class PixmapRenderSurface : public Dali::RenderSurfaceInterface +class PixmapRenderSurface : public Dali::RenderSurface { public: @@ -69,22 +62,6 @@ public: // API */ virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) = 0; - /** - * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired() - */ - Integration::DepthBufferAvailable GetDepthBufferRequired() override - { - return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE; - } - - /** - * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired() - */ - Integration::StencilBufferAvailable GetStencilBufferRequired() override - { - return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE; - } - private: /** diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index fd9d99a..2d8cc15 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -21,12 +21,9 @@ // EXTERNAL HEADERS #include #include -#include -#include #include #include #include -#include #include // INTERNAL HEADERS @@ -45,8 +42,6 @@ namespace Internal namespace Adaptor { -uint32_t Window::mWindowCounter = 0; - namespace { @@ -65,13 +60,13 @@ Window* Window::New( const PositionSize& positionSize, const std::string& name, } Window::Window() -: mId( mWindowCounter++ ), - mSurface( nullptr ), +: mSurface( NULL ), mWindowBase(), mIndicatorVisible( Dali::Window::INVISIBLE ), // TODO: Enable this after indicator implementation based on tizen 5. mIndicatorIsShown( false ), mShowRotatedIndicatorOnClose( false ), mStarted( false ), + mIsTransparent( false ), mIsFocusAcceptable( true ), mVisible( true ), mIconified( false ), @@ -102,11 +97,10 @@ Window::~Window() { mAdaptor->RemoveObserver( *this ); mAdaptor->SetDragAndDropDetector( NULL ); - mAdaptor->RemoveWindow( this ); mAdaptor = NULL; } - mSurface.reset( nullptr ); + delete mSurface; } void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className) @@ -114,7 +108,8 @@ void Window::Initialize(const PositionSize& positionSize, const std::string& nam // Create a window render surface Any surface; auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory(); - mSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent ); + auto windowRenderSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent ); + mSurface = windowRenderSurface.release(); // Get a window base mWindowBase = mSurface->GetWindowBase(); @@ -145,16 +140,6 @@ void Window::SetAdaptor(Dali::Adaptor& adaptor) DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" ); mStarted = true; - PositionSize positionSize = mSurface->GetPositionSize(); - mScene = Dali::Integration::Scene::New( Vector2(positionSize.width, positionSize.height) ); - mScene.SetSurface( *mSurface.get() ); - - unsigned int dpiHorizontal, dpiVertical; - dpiHorizontal = dpiVertical = 0; - - mSurface->GetDpi( dpiHorizontal, dpiVertical ); - mScene.SetDpi( Vector2( static_cast( dpiHorizontal ), static_cast( dpiVertical ) ) ); - // Create one overlay for the main window only Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor); mAdaptor = &adaptorImpl; @@ -173,13 +158,11 @@ void Window::SetAdaptor(Dali::Adaptor& adaptor) { mIndicator->SetAdaptor(mAdaptor); } - - mSurface->SetAdaptor( *mAdaptor ); } WindowRenderSurface* Window::GetSurface() { - return mSurface.get(); + return mSurface; } void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode ) @@ -235,44 +218,6 @@ void Window::Activate() mWindowBase->Activate(); } -void Window::Add( Dali::Actor actor ) -{ - mScene.Add( actor ); -} - -void Window::Remove( Dali::Actor actor ) -{ - mScene.Remove( actor ); -} - -Dali::Layer Window::GetRootLayer() const -{ - return mScene.GetRootLayer(); -} - -uint32_t Window::GetLayerCount() const -{ - return mScene.GetLayerCount(); -} - -Dali::Layer Window::GetLayer( uint32_t depth ) const -{ - return mScene.GetLayer( depth ); -} - -void Window::SetBackgroundColor( Vector4 color ) -{ - if ( mSurface ) - { - mSurface->SetBackgroundColor( color ); - } -} - -Vector4 Window::GetBackgroundColor() const -{ - return mSurface ? mSurface->GetBackgroundColor() : Vector4(); -} - void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation ) { bool found = false; @@ -533,11 +478,11 @@ void Window::SetSize( Dali::Window::WindowSize size ) { Uint16Pair newSize( newRect.width, newRect.height ); - mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); + mAdaptor->SurfaceResizePrepare( newSize ); mResizedSignal.Emit( newSize ); - mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize ); + mAdaptor->SurfaceResizeComplete( newSize ); } } @@ -587,11 +532,11 @@ void Window::SetPositionSize( PositionSize positionSize ) { Uint16Pair newSize( newRect.width, newRect.height ); - mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize ); + mAdaptor->SurfaceResizePrepare( newSize ); mResizedSignal.Emit( newSize ); - mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize ); + mAdaptor->SurfaceResizeComplete( newSize ); } } @@ -624,12 +569,12 @@ void Window::RotationDone( int orientation, int width, int height ) { mSurface->RequestRotation( orientation, width, height ); - mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( width, height ) ); + mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) ); // Emit signal mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) ); - mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( width, height ) ); + mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) ); } void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation ) @@ -765,8 +710,8 @@ void Window::OnFocusChanged( bool focusIn ) void Window::OnOutputTransformed() { PositionSize positionSize = mSurface->GetPositionSize(); - mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); - mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); + mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); + mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); } void Window::OnDeleteRequest() @@ -844,11 +789,6 @@ void Window::OnDestroy() mAdaptor = NULL; } -uint32_t Window::GetId() const -{ - return mId; -} - } // Adaptor } // Internal diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index 1f10653..77979c0 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -21,9 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include -#include -#include // INTERNAL INCLUDES #include @@ -36,7 +33,6 @@ namespace Dali { class Adaptor; -class Actor; namespace Internal { @@ -124,41 +120,6 @@ public: void Activate(); /** - * @copydoc Dali::Window::Add() - */ - void Add( Dali::Actor actor ); - - /** - * @copydoc Dali::Window::Remove() - */ - void Remove( Dali::Actor remove ); - - /** - * @copydoc Dali::Window::SetBackgroundColor() - */ - void SetBackgroundColor(Vector4 color); - - /** - * @copydoc Dali::Window::GetBackgroundColor() - */ - Vector4 GetBackgroundColor() const; - - /** - * @copydoc Dali::Window::GetRootLayer() - */ - Dali::Layer GetRootLayer() const; - - /** - * @copydoc Dali::Window::GetLayerCount() - */ - uint32_t GetLayerCount() const; - - /** - * @copydoc Dali::Window::GetLayer() - */ - Dali::Layer GetLayer( uint32_t depth ) const; - - /** * @copydoc Dali::Window::AddAvailableOrientation() */ void AddAvailableOrientation(Dali::Window::WindowOrientation orientation); @@ -368,12 +329,6 @@ public: */ void RotationDone( int orientation, int width, int height ); - /** - * @brief Retrieves the unique ID of the window. - * @return The ID - */ - uint32_t GetId() const; - private: /** @@ -507,10 +462,7 @@ public: // Signals private: - static uint32_t mWindowCounter; ///< A counter to track the window creation - uint32_t mId; ///< A unique ID to identify the window starting from 0 - std::unique_ptr< WindowRenderSurface > mSurface; - Dali::Integration::Scene mScene; + WindowRenderSurface* mSurface; WindowBase* mWindowBase; Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state bool mIndicatorIsShown:1; ///< private state @@ -534,8 +486,6 @@ private: std::vector mAvailableOrientations; Dali::Window::WindowOrientation mPreferredOrientation; - Vector4 mBackgroundColor; - // Signals IndicatorSignalType mIndicatorVisibilityChangedSignal; FocusSignalType mFocusChangedSignal; diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 2ff7944..cac09c5 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -59,8 +58,6 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, Any s mRenderNotification( NULL ), mRotationTrigger( NULL ), mGraphics( nullptr ), - mEGLSurface( nullptr ), - mEGLContext( nullptr ), mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ), mOutputTransformedSignal(), mRotationAngle( 0 ), @@ -180,24 +177,28 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi mWindowBase->GetDpi( dpiHorizontal, dpiVertical ); } -void WindowRenderSurface::InitializeGraphics() +void WindowRenderSurface::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) { - - mGraphics = &mAdaptor->GetGraphicsInterface(); + mGraphics = &graphics; auto eglGraphics = static_cast(mGraphics); - mEGL = &eglGraphics->GetEglInterface(); - if ( mEGLContext == NULL ) - { - // Create the OpenGL context for this window - Internal::Adaptor::EglImplementation& eglImpl = static_cast(*mEGL); - eglImpl.ChooseConfig(true, mColorDepth); - eglImpl.CreateWindowContext( mEGLContext ); + EglInterface* mEGL = eglGraphics->Create(); - // Create the OpenGL surface - CreateSurface(); - } + // Initialize EGL & OpenGL + displayConnection.Initialize(); + + Internal::Adaptor::EglImplementation& eglImpl = static_cast(*mEGL); + eglImpl.ChooseConfig(true, mColorDepth); + + // Create the OpenGL context + mEGL->CreateContext(); + + // Create the OpenGL surface + CreateSurface(); + + // Make it current + mEGL->MakeContextCurrent(); } void WindowRenderSurface::CreateSurface() @@ -222,7 +223,7 @@ void WindowRenderSurface::CreateSurface() auto eglGraphics = static_cast(mGraphics); Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - mEGLSurface = eglImpl.CreateSurfaceWindow( window, mColorDepth ); + eglImpl.CreateSurfaceWindow( window, mColorDepth ); // Check rotation capability mRotationSupported = mWindowBase->IsEglWindowRotationSupported(); @@ -237,7 +238,7 @@ void WindowRenderSurface::DestroySurface() auto eglGraphics = static_cast(mGraphics); Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - eglImpl.DestroySurface( mEGLSurface ); + eglImpl.DestroySurface(); mWindowBase->DestroyEglWindow(); } @@ -270,7 +271,7 @@ bool WindowRenderSurface::ReplaceGraphicsSurface() auto eglGraphics = static_cast(mGraphics); Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - return eglImpl.ReplaceSurfaceWindow( window, mEGLSurface, mEGLContext ); + return eglImpl.ReplaceSurfaceWindow( window ); } void WindowRenderSurface::MoveResize( Dali::PositionSize positionSize ) @@ -325,8 +326,6 @@ void WindowRenderSurface::StartRender() bool WindowRenderSurface::PreRender( bool resizingSurface ) { - MakeContextCurrent(); - if( resizingSurface ) { #ifdef OVER_TIZEN_VERSION_4 @@ -405,7 +404,7 @@ void WindowRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, b } Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - eglImpl.SwapBuffers( mEGLSurface ); + eglImpl.SwapBuffers(); if( mRenderNotification ) { @@ -430,29 +429,11 @@ void WindowRenderSurface::ReleaseLock() // Nothing to do. } -Integration::RenderSurface::Type WindowRenderSurface::GetSurfaceType() +RenderSurface::Type WindowRenderSurface::GetSurfaceType() { return RenderSurface::WINDOW_RENDER_SURFACE; } -void WindowRenderSurface::MakeContextCurrent() -{ - if ( mEGL != nullptr ) - { - mEGL->MakeContextCurrent( mEGLSurface, mEGLContext ); - } -} - -Integration::DepthBufferAvailable WindowRenderSurface::GetDepthBufferRequired() -{ - return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE; -} - -Integration::StencilBufferAvailable WindowRenderSurface::GetStencilBufferRequired() -{ - return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE; -} - void WindowRenderSurface::OutputTransformed() { int screenRotationAngle = mWindowBase->GetScreenRotationAngle(); diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index 55bc955..a1ba715 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -19,20 +19,15 @@ */ // INTERNAL INCLUDES -#include - -#ifdef DALI_ADAPTOR_COMPILATION +#include #include -#include -#else -#include -#include -#endif +#include // EXTERNAL INCLUDES #include #include + namespace Dali { @@ -44,12 +39,11 @@ namespace Adaptor { class WindowBase; -class AdaptorInternalServices; /** * Window interface of render surface. */ -class WindowRenderSurface : public Dali::RenderSurfaceInterface, public ConnectionTracker +class WindowRenderSurface : public Dali::RenderSurface, public ConnectionTracker { public: @@ -118,10 +112,10 @@ public: // API */ OutputSignalType& OutputTransformedSignal(); -public: // from Dali::Integration::RenderSurface +public: // from Dali::RenderSurface /** - * @copydoc Dali::Integration::RenderSurface::GetPositionSize() + * @copydoc Dali::RenderSurface::GetPositionSize() */ virtual PositionSize GetPositionSize() const override; @@ -130,79 +124,64 @@ public: // from Dali::Integration::RenderSurface virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** - * @copydoc Dali::Integration::RenderSurface::InitializeGraphics() + * @copydoc Dali::RenderSurface::InitializeGraphics() */ - virtual void InitializeGraphics() override; + virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override; /** - * @copydoc Dali::Integration::RenderSurface::CreateSurface() + * @copydoc Dali::RenderSurface::CreateSurface() */ virtual void CreateSurface() override; /** - * @copydoc Dali::Integration::RenderSurface::DestroySurface() + * @copydoc Dali::RenderSurface::DestroySurface() */ virtual void DestroySurface() override; /** - * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface() + * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface() */ virtual bool ReplaceGraphicsSurface() override; /** - * @copydoc Dali::Integration::RenderSurface::MoveResize() + * @copydoc Dali::RenderSurface::MoveResize() */ virtual void MoveResize( Dali::PositionSize positionSize) override; /** - * @copydoc Dali::Integration::RenderSurface::StartRender() + * @copydoc Dali::RenderSurface::StartRender() */ virtual void StartRender() override; /** - * @copydoc Dali::Integration::RenderSurface::PreRender() + * @copydoc Dali::RenderSurface::PreRender() */ virtual bool PreRender( bool resizingSurface ) override; /** - * @copydoc Dali::Integration::RenderSurface::PostRender() + * @copydoc Dali::RenderSurface::PostRender() */ virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ); /** - * @copydoc Dali::Integration::RenderSurface::StopRender() + * @copydoc Dali::RenderSurface::StopRender() */ virtual void StopRender() override; /** - * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization + * @copydoc Dali::RenderSurface::SetThreadSynchronization */ virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override; /** - * @copydoc Dali::Integration::RenderSurface::ReleaseLock() + * @copydoc Dali::RenderSurface::ReleaseLock() */ virtual void ReleaseLock() override; /** - * @copydoc Dali::Integration::RenderSurface::GetSurfaceType() - */ - virtual Integration::RenderSurface::Type GetSurfaceType() override; - - /** - * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent() - */ - virtual void MakeContextCurrent() override; - - /** - * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired() - */ - virtual Integration::DepthBufferAvailable GetDepthBufferRequired() override; - - /** - * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired() + * @copydoc Dali::RenderSurface::GetSurfaceType() */ - virtual Integration::StencilBufferAvailable GetStencilBufferRequired() override; + virtual RenderSurface::Type GetSurfaceType() override; private: @@ -231,16 +210,12 @@ protected: private: // Data - EglInterface* mEGL; - Dali::DisplayConnection* mDisplayConnection; PositionSize mPositionSize; ///< Position std::unique_ptr< WindowBase > mWindowBase; ThreadSynchronizationInterface* mThreadSynchronization; TriggerEventInterface* mRenderNotification; ///< Render notification trigger TriggerEventInterface* mRotationTrigger; GraphicsInterface* mGraphics; ///< Graphics interface - EGLSurface mEGLSurface; - EGLContext mEGLContext; ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit) OutputSignalType mOutputTransformedSignal; int mRotationAngle; 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 f639ed5..195eda2 100755 --- 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 @@ -46,14 +46,14 @@ DisplayConnection* DisplayConnectionEcoreWl::New() DisplayConnectionEcoreWl::DisplayConnectionEcoreWl() : mDisplay( NULL ), - mSurfaceType( Integration::RenderSurface::WINDOW_RENDER_SURFACE ), + mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE ), mGraphics( nullptr ) { } DisplayConnectionEcoreWl::~DisplayConnectionEcoreWl() { - if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE ) + if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE ) { ReleaseNativeDisplay(); } @@ -82,11 +82,11 @@ bool DisplayConnectionEcoreWl::InitializeGraphics() return true; } -void DisplayConnectionEcoreWl::SetSurfaceType( Integration::RenderSurface::Type type ) +void DisplayConnectionEcoreWl::SetSurfaceType( RenderSurface::Type type ) { mSurfaceType = type; - if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE ) + if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE ) { mDisplay = GetNativeDisplay(); } 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 6bcf33d..cc31ef0 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 @@ -72,7 +72,7 @@ public: * @brief Sets the surface type * @param[in] type The surface type */ - void SetSurfaceType( Integration::RenderSurface::Type type ); + void SetSurfaceType( RenderSurface::Type type ); /** * @brief Sets the graphics interface @@ -107,7 +107,7 @@ protected: private: EGLNativeDisplayType mDisplay; ///< Wayland-display for rendering - Integration::RenderSurface::Type mSurfaceType; ///< The surface type + RenderSurface::Type mSurfaceType; ///< The surface type GraphicsInterface* mGraphics; ///< The graphics interface }; diff --git a/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.cpp index 3417ccb..b77457e 100644 --- a/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.cpp @@ -444,7 +444,8 @@ IndicatorEcoreWl::IndicatorEcoreWl( Adaptor* adaptor, Dali::Window::WindowOrient mIsShowing( true ), mIsAnimationPlaying( false ), mCurrentSharedFile( 0 ), - mBackgroundVisible( false ) + mBackgroundVisible( false ), + mTopMargin( 0 ) { mIndicatorContentActor = Dali::Actor::New(); mIndicatorContentActor.SetParentOrigin( ParentOrigin::TOP_CENTER ); @@ -591,6 +592,7 @@ void IndicatorEcoreWl::SetOpacityMode( Dali::Window::IndicatorBgOpacity mode ) mIndicatorContentActor.RemoveRenderer( mBackgroundRenderer ); mBackgroundVisible = false; } + UpdateTopMargin(); } void IndicatorEcoreWl::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate ) @@ -621,6 +623,7 @@ void IndicatorEcoreWl::SetVisible( Dali::Window::IndicatorVisibleMode visibleMod } mVisible = visibleMode; + UpdateTopMargin(); if( mForegroundRenderer && mForegroundRenderer.GetTextures().GetTexture( 0u ) ) { @@ -817,6 +820,7 @@ void IndicatorEcoreWl::Resize( int width, int height ) mIndicatorContentActor.SetSize( mImageWidth, mImageHeight ); mIndicatorActor.SetSize( mImageWidth, mImageHeight ); mEventActor.SetSize(mImageWidth, mImageHeight); + UpdateTopMargin(); } } @@ -930,6 +934,16 @@ void IndicatorEcoreWl::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent ) } } +void IndicatorEcoreWl::UpdateTopMargin() +{ + int newMargin = (mVisible == Dali::Window::VISIBLE && mOpacityMode == Dali::Window::OPAQUE) ? mImageHeight : 0; + if (mTopMargin != newMargin) + { + mTopMargin = newMargin; + mAdaptor->IndicatorSizeChanged( mTopMargin ); + } +} + void IndicatorEcoreWl::UpdateVisibility() { if( CheckVisibleState() ) diff --git a/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.h b/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.h index a6cd9a1..1f33fc1 100644 --- a/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.h @@ -275,6 +275,11 @@ private: void LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent ); /** + * Update top margin of the stage as much as indicator height + */ + void UpdateTopMargin(); + + /** * Update the visibility and position of the actors */ void UpdateVisibility(); @@ -417,6 +422,7 @@ private: SharedFileInfo mSharedFileInfo[SHARED_FILE_NUMBER]; ///< Table to store shared file info bool mBackgroundVisible; ///< Indicate whether background is visible + int mTopMargin; ///< Top margin of the stage for indicator }; } // Adaptor diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp index 38a44b4..e019b0a 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp @@ -38,8 +38,6 @@ #include #include #include -#include -#include namespace Dali { @@ -57,9 +55,6 @@ NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl( Dali::PositionSize posit : mPosition( positionSize ), mRenderNotification( NULL ), mGraphics( NULL ), - mEGL( nullptr ), - mEGLSurface( nullptr ), - mEGLContext( nullptr ), mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ), mTbmFormat( isTransparent ? TBM_FORMAT_ARGB8888 : TBM_FORMAT_RGB888 ), mOwnSurface( false ), @@ -137,25 +132,31 @@ void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned i dpiVertical = int( yres + 0.5f ); } -void NativeRenderSurfaceEcoreWl::InitializeGraphics() +void NativeRenderSurfaceEcoreWl::InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection ) { DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter ); unsetenv( "EGL_PLATFORM" ); - mGraphics = &mAdaptor->GetGraphicsInterface(); + mGraphics = &graphics; + auto eglGraphics = static_cast(mGraphics); - mEGL = &eglGraphics->GetEglInterface(); + EglInterface* mEGL = eglGraphics->Create(); - if ( mEGLContext == NULL ) - { - // Create the OpenGL context for this window - Internal::Adaptor::EglImplementation& eglImpl = static_cast(*mEGL); - eglImpl.CreateWindowContext( mEGLContext ); + // Initialize EGL & OpenGL + displayConnection.Initialize(); - // Create the OpenGL surface - CreateSurface(); - } + Internal::Adaptor::EglImplementation& eglImpl = static_cast(*mEGL); + eglImpl.ChooseConfig(true, mColorDepth); + + // Create the OpenGL context + mEGL->CreateContext(); + + // Create the OpenGL surface + CreateSurface(); + + // Make it current + mEGL->MakeContextCurrent(); } void NativeRenderSurfaceEcoreWl::CreateSurface() @@ -165,7 +166,7 @@ void NativeRenderSurfaceEcoreWl::CreateSurface() auto eglGraphics = static_cast(mGraphics); Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - mEGLSurface = eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mColorDepth ); + eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mColorDepth ); } void NativeRenderSurfaceEcoreWl::DestroySurface() @@ -175,7 +176,7 @@ void NativeRenderSurfaceEcoreWl::DestroySurface() auto eglGraphics = static_cast(mGraphics); Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - eglImpl.DestroySurface( mEGLSurface ); + eglImpl.DestroySurface(); } bool NativeRenderSurfaceEcoreWl::ReplaceGraphicsSurface() @@ -190,7 +191,7 @@ bool NativeRenderSurfaceEcoreWl::ReplaceGraphicsSurface() auto eglGraphics = static_cast(mGraphics); Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mEGLSurface, mEGLContext ); + return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ) ); } void NativeRenderSurfaceEcoreWl::MoveResize( Dali::PositionSize positionSize ) @@ -214,7 +215,7 @@ void NativeRenderSurfaceEcoreWl::PostRender( bool renderToFbo, bool replacingSur { Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - eglImpl.SwapBuffers( mEGLSurface ); + eglImpl.SwapBuffers(); } if( mThreadSynchronization ) @@ -268,27 +269,9 @@ void NativeRenderSurfaceEcoreWl::SetThreadSynchronization( ThreadSynchronization mThreadSynchronization = &threadSynchronization; } -Integration::RenderSurface::Type NativeRenderSurfaceEcoreWl::GetSurfaceType() -{ - return Integration::RenderSurface::NATIVE_RENDER_SURFACE; -} - -void NativeRenderSurfaceEcoreWl::MakeContextCurrent() -{ - if ( mEGL != nullptr ) - { - mEGL->MakeContextCurrent( mEGLSurface, mEGLContext ); - } -} - -Integration::DepthBufferAvailable NativeRenderSurfaceEcoreWl::GetDepthBufferRequired() -{ - return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE; -} - -Integration::StencilBufferAvailable NativeRenderSurfaceEcoreWl::GetStencilBufferRequired() +RenderSurface::Type NativeRenderSurfaceEcoreWl::GetSurfaceType() { - return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE; + return RenderSurface::NATIVE_RENDER_SURFACE; } void NativeRenderSurfaceEcoreWl::ReleaseLock() diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h index 8cd5a55..1199b3e 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h @@ -32,7 +32,6 @@ namespace Dali { class DisplayConnection; -class EglInterface; /** * Ecore Wayland Native implementation of render surface. @@ -70,92 +69,77 @@ public: // from WindowRenderSurface */ virtual void WaitUntilSurfaceReplaced() override; -public: // from Dali::Integration::RenderSurface +public: // from Dali::RenderSurface /** - * @copydoc Dali::Integration::RenderSurface::GetPositionSize() + * @copydoc Dali::RenderSurface::GetPositionSize() */ virtual PositionSize GetPositionSize() const override; /** - * @copydoc Dali::Integration::RenderSurface::GetDpi() + * @copydoc Dali::RenderSurface::GetDpi() */ virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** - * @copydoc Dali::Integration::RenderSurface::InitializeGraphics() + * @copydoc Dali::RenderSurface::InitializeGraphics() */ - virtual void InitializeGraphics() override; + virtual void InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection ) override; /** - * @copydoc Dali::Integration::RenderSurface::CreateSurface() + * @copydoc Dali::RenderSurface::CreateSurface() */ virtual void CreateSurface() override; /** - * @copydoc Dali::Integration::RenderSurface::DestroySurface() + * @copydoc Dali::RenderSurface::DestroySurface() */ virtual void DestroySurface() override; /** - * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface() + * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface() */ virtual bool ReplaceGraphicsSurface() override; /** - * @copydoc Dali::Integration::RenderSurface::MoveResize() + * @copydoc Dali::RenderSurface::MoveResize() */ virtual void MoveResize( Dali::PositionSize positionSize) override; /** - * @copydoc Dali::Integration::RenderSurface::StartRender() + * @copydoc Dali::RenderSurface::StartRender() */ virtual void StartRender() override; /** - * @copydoc Dali::Integration::RenderSurface::PreRender() + * @copydoc Dali::RenderSurface::PreRender() */ virtual bool PreRender( bool resizingSurface ) override; /** - * @copydoc Dali::Integration::RenderSurface::PostRender() + * @copydoc Dali::RenderSurface::PostRender() */ virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ); /** - * @copydoc Dali::Integration::RenderSurface::StopRender() + * @copydoc Dali::RenderSurface::StopRender() */ virtual void StopRender() override; /** - * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization + * @copydoc Dali::RenderSurface::SetThreadSynchronization */ virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )override; /** - * @copydoc Dali::Integration::RenderSurface::GetSurfaceType() + * @copydoc Dali::RenderSurface::GetSurfaceType() */ - virtual Integration::RenderSurface::Type GetSurfaceType() override; - - /** - * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent() - */ - virtual void MakeContextCurrent() override; - - /** - * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired() - */ - virtual Integration::DepthBufferAvailable GetDepthBufferRequired() override; - - /** - * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired() - */ - virtual Integration::StencilBufferAvailable GetStencilBufferRequired() override; + virtual RenderSurface::Type GetSurfaceType() override; private: /** - * @copydoc Dali::Integration::RenderSurface::ReleaseLock() + * @copydoc Dali::RenderSurface::ReleaseLock() */ virtual void ReleaseLock() override; @@ -174,9 +158,6 @@ private: // Data PositionSize mPosition; TriggerEventInterface* mRenderNotification; Internal::Adaptor::GraphicsInterface* mGraphics; ///< The graphics interface - EglInterface* mEGL; - EGLSurface mEGLSurface; - EGLContext mEGLContext; ColorDepth mColorDepth; tbm_format mTbmFormat; bool mOwnSurface; 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 ba1af14..e605892 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 @@ -97,9 +97,9 @@ bool DisplayConnectionX11::InitializeGraphics() return true; } -void DisplayConnectionX11::SetSurfaceType( Integration::RenderSurface::Type type ) +void DisplayConnectionX11::SetSurfaceType( RenderSurface::Type type ) { - if( type == Integration::RenderSurface::WINDOW_RENDER_SURFACE ) + if( type == RenderSurface::WINDOW_RENDER_SURFACE ) { // Because of DDK issue, we need to use separated x display instead of ecore default display mDisplay = XOpenDisplay(0); 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 4f6890f..ef2ac82 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 @@ -81,7 +81,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType */ - void SetSurfaceType( Integration::RenderSurface::Type type ); + void SetSurfaceType( RenderSurface::Type type ); /** * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp index c8e049c..03259eb 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp @@ -35,8 +35,6 @@ #include #include #include -#include -#include namespace Dali @@ -148,11 +146,10 @@ void PixmapRenderSurfaceEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned in dpiVertical = int( yres + 0.5f ); } -void PixmapRenderSurfaceEcoreX::InitializeGraphics() +void PixmapRenderSurfaceEcoreX::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) { - mGraphics = &mAdaptor->GetGraphicsInterface(); - mDisplayConnection = &mAdaptor->GetDisplayConnectionInterface(); - + mGraphics = &graphics; + mDisplayConnection = &displayConnection; auto eglGraphics = static_cast(mGraphics); Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); @@ -188,7 +185,7 @@ void PixmapRenderSurfaceEcoreX::DestroySurface() // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit XPixmap pixmap = static_cast( mX11Pixmaps[i] ); eglImpl.MakeCurrent( EGLNativePixmapType( pixmap ), mEglSurfaces[i] ); - eglImpl.DestroySurface( mEglSurfaces[i] ); + eglImpl.DestroySurface(); } } @@ -310,13 +307,9 @@ void PixmapRenderSurfaceEcoreX::ReleaseLock() } } -Integration::RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType() -{ - return Integration::RenderSurface::PIXMAP_RENDER_SURFACE; -} - -void PixmapRenderSurfaceEcoreX::MakeContextCurrent() +RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType() { + return RenderSurface::PIXMAP_RENDER_SURFACE; } void PixmapRenderSurfaceEcoreX::CreateRenderable() diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h index 1f4a305..873e7f4 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h @@ -70,82 +70,77 @@ public: // from WindowRenderSurface */ virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override; -public: // from Dali::Integration::RenderSurface +public: // from Dali::RenderSurface /** - * @copydoc Dali::Integration::RenderSurface::GetPositionSize() + * @copydoc Dali::RenderSurface::GetPositionSize() */ virtual PositionSize GetPositionSize() const override; /** - * @copydoc Dali::Integration::RenderSurface::GetDpi() + * @copydoc Dali::RenderSurface::GetDpi() */ virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; /** - * @copydoc Dali::Integration::RenderSurface::InitializeGraphics() + * @copydoc Dali::RenderSurface::InitializeGraphics() */ - virtual void InitializeGraphics() override; + virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override; /** - * @copydoc Dali::Integration::RenderSurface::CreateSurface() + * @copydoc Dali::RenderSurface::CreateSurface() */ virtual void CreateSurface() override; /** - * @copydoc Dali::Integration::RenderSurface::DestroySurface() + * @copydoc Dali::RenderSurface::DestroySurface() */ virtual void DestroySurface() override; /** - * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface() + * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface() */ virtual bool ReplaceGraphicsSurface() override; /** - * @copydoc Dali::Integration::RenderSurface::MoveResize() + * @copydoc Dali::RenderSurface::MoveResize() */ virtual void MoveResize( Dali::PositionSize positionSize) override {} /** - * @copydoc Dali::Integration::RenderSurface::StartRender() + * @copydoc Dali::RenderSurface::StartRender() */ virtual void StartRender() override; /** - * @copydoc Dali::Integration::RenderSurface::PreRender() + * @copydoc Dali::RenderSurface::PreRender() */ virtual bool PreRender( bool resizingSurface ) override; /** - * @copydoc Dali::Integration::RenderSurface::PostRender() + * @copydoc Dali::RenderSurface::PostRender() */ virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) override; /** - * @copydoc Dali::Integration::RenderSurface::StopRender() + * @copydoc Dali::RenderSurface::StopRender() */ virtual void StopRender() override; /** - * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization + * @copydoc Dali::RenderSurface::SetThreadSynchronization */ virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override; /** - * @copydoc Dali::Integration::RenderSurface::GetSurfaceType() + * @copydoc Dali::RenderSurface::GetSurfaceType() */ - virtual Integration::RenderSurface::Type GetSurfaceType() override; - - /** - * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent() - */ - virtual void MakeContextCurrent() override; + virtual RenderSurface::Type GetSurfaceType() override; private: // from PixmapRenderSurface /** - * @copydoc Dali::Integration::RenderSurface::ReleaseLock() + * @copydoc Dali::RenderSurface::ReleaseLock() */ virtual void ReleaseLock() override; diff --git a/dali/public-api/adaptor-framework/window.cpp b/dali/public-api/adaptor-framework/window.cpp index 9eeb2d9..f2a8068 100644 --- a/dali/public-api/adaptor-framework/window.cpp +++ b/dali/public-api/adaptor-framework/window.cpp @@ -19,7 +19,6 @@ #include // INTERNAL INCLUDES -#include #include #include diff --git a/dali/public-api/adaptor-framework/window.h b/dali/public-api/adaptor-framework/window.h index 6ec35a5..adda302 100755 --- a/dali/public-api/adaptor-framework/window.h +++ b/dali/public-api/adaptor-framework/window.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -50,8 +49,6 @@ class Window; class DragAndDropDetector; class Orientation; -class Actor; -class Layer; /** * @brief The window class is used internally for drawing. -- 2.7.4