From 2b8658fbe716d0e98b0afd89a6bfe4a06cf9ee12 Mon Sep 17 00:00:00 2001 From: Sunghyun kim Date: Tue, 26 Feb 2019 13:17:43 +0900 Subject: [PATCH] [Tizen]Revert "Support multiple window rendering" This reverts commit cae5ff7ab355baec219205047754e892a4580fb2. Change-Id: I2e3141d6dbd71916285684a2fde63bab3bfb7dce --- .../src/dali-toolkit-internal/CMakeLists.txt | 1 - .../src/dali-toolkit-styling/CMakeLists.txt | 1 - .../src/dali-toolkit-third-party/CMakeLists.txt | 1 - automated-tests/src/dali-toolkit/CMakeLists.txt | 1 - .../dali-toolkit-test-utils/test-application.cpp | 27 ++-- .../dali-toolkit-test-utils/test-application.h | 13 +- .../test-render-surface.cpp | 115 --------------- .../dali-toolkit-test-utils/test-render-surface.h | 155 --------------------- .../dali-toolkit-test-utils/toolkit-adaptor-impl.h | 38 ++++- .../dali-toolkit-test-utils/toolkit-adaptor.cpp | 13 +- .../src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp | 1 - 11 files changed, 61 insertions(+), 305 deletions(-) delete mode 100644 automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp delete mode 100644 automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.h diff --git a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt index 5e2e9ed..093f4fb 100755 --- a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt @@ -63,7 +63,6 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp - ../dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp dali-toolkit-test-utils/toolkit-text-utils.cpp diff --git a/automated-tests/src/dali-toolkit-styling/CMakeLists.txt b/automated-tests/src/dali-toolkit-styling/CMakeLists.txt index bc765c7..2366711 100644 --- a/automated-tests/src/dali-toolkit-styling/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-styling/CMakeLists.txt @@ -46,7 +46,6 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp - ../dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp ) diff --git a/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt b/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt index 6f50e82..a5fde09 100644 --- a/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt @@ -39,7 +39,6 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp - ../dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp ) diff --git a/automated-tests/src/dali-toolkit/CMakeLists.txt b/automated-tests/src/dali-toolkit/CMakeLists.txt index 678a4ae..1ef55f9 100755 --- a/automated-tests/src/dali-toolkit/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit/CMakeLists.txt @@ -118,7 +118,6 @@ LIST(APPEND TC_SOURCES dali-toolkit-test-utils/test-gl-sync-abstraction.cpp dali-toolkit-test-utils/test-platform-abstraction.cpp dali-toolkit-test-utils/test-render-controller.cpp - dali-toolkit-test-utils/test-render-surface.cpp dali-toolkit-test-utils/test-trace-call-stack.cpp dali-toolkit-test-utils/test-native-image.cpp ) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp index 1562d27..c953f50 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-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-toolkit/dali-toolkit-test-utils/test-application.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h index fc2929c..d1e042d 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-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-toolkit/dali-toolkit-test-utils/test-render-surface.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp deleted file mode 100644 index 332d77e..0000000 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-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-toolkit/dali-toolkit-test-utils/test-render-surface.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.h deleted file mode 100644 index fba89c2..0000000 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-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-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h index 902167c..ee60af1 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h @@ -18,7 +18,7 @@ * */ -#include +#include namespace Dali { @@ -45,6 +45,40 @@ class GlAbstraction; } // namespace Integration +class TestRenderSurface : public RenderSurface +{ +public: + virtual PositionSize GetPositionSize() const { PositionSize size; return size; } + + virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { dpiHorizontal = dpiVertical = 96; } + + virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) {}; + + virtual void CreateSurface() {} + + virtual void DestroySurface() {} + + virtual bool ReplaceGraphicsSurface() { return false; } + + virtual void MoveResize( Dali::PositionSize positionSize ) {} + + virtual void SetViewMode( ViewMode viewMode ) {} + + virtual void StartRender() {} + + virtual bool PreRender( bool resizingSurface ) { return false; } + + virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) {} + + virtual void StopRender() {} + + virtual void ReleaseLock() {} + + virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {} + + virtual RenderSurface::Type GetSurfaceType() { return RenderSurface::WINDOW_RENDER_SURFACE; } +}; + namespace Internal { namespace Adaptor @@ -58,7 +92,7 @@ public: ~Adaptor(); public: - static Dali::RenderSurfaceInterface& GetSurface(); + static Dali::RenderSurface& GetSurface(); static Dali::Adaptor::AdaptorSignalType& AdaptorSignal(); static bool mAvailable; static Vector mCallbacks; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp index 5d6cf4e..dcf0560 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp @@ -23,7 +23,6 @@ #include #include #include -#include namespace Dali { @@ -43,9 +42,9 @@ Dali::Adaptor& Adaptor::Get() return *adaptor; } -Dali::RenderSurfaceInterface& Adaptor::GetSurface() +Dali::RenderSurface& Adaptor::GetSurface() { - Dali::RenderSurfaceInterface* renderSurface = reinterpret_cast ( new Dali::TestRenderSurface( Dali::PositionSize( 0, 0, 480, 800 ) ) ); + Dali::RenderSurface *renderSurface = new Dali::TestRenderSurface; return *renderSurface; } @@ -68,12 +67,12 @@ Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) return Internal::Adaptor::Adaptor::Get(); } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface ) +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface ) { return Internal::Adaptor::Adaptor::Get(); } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration ) { return Internal::Adaptor::Adaptor::Get(); } @@ -130,7 +129,7 @@ void Adaptor::RemoveIdle( CallbackBase* callback ) } } -void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface ) +void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ) { } @@ -144,7 +143,7 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal() return Internal::Adaptor::Adaptor::AdaptorSignal(); } -Dali::RenderSurfaceInterface& Adaptor::GetSurface() +RenderSurface& Adaptor::GetSurface() { return Internal::Adaptor::Adaptor::GetSurface(); } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp index 438a496..a527eac 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp @@ -217,7 +217,6 @@ void CleanupTest() int UtcDaliScrollViewPagePathEffectSetup(void) { - ToolkitTestApplication application; tet_infoline(" UtcDaliScrollViewPagePathEffectSetup"); ScrollViewPagePathEffect effect; -- 2.7.4