From: Heeyong Song Date: Tue, 16 Jun 2020 02:42:02 +0000 (+0900) Subject: Support a frame rendered / presented callback X-Git-Tag: dali_1.9.20~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=d057d1cc8269450c0c4c932a2b41722f4867b337;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Support a frame rendered / presented callback Change-Id: Ie6dfe10a1349c1c4c50ebf8b4005835b67b53c57 --- diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 44e9801..7d046ec 100755 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -153,6 +153,16 @@ void SetDamagedAreas(Window window, std::vector>& areas) GetImplementation(window).SetDamagedAreas(areas); } +void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ) +{ + GetImplementation( window ).AddFrameRenderedCallback( std::move( callback ), frameId ); +} + +void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ) +{ + GetImplementation( window ).AddFramePresentedCallback( std::move( callback ), frameId ); +} + } // 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 1eb3501..3c97559 100755 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -19,6 +19,7 @@ */ // EXTERNAL INCLUDES +#include // INTERNAL INCLUDES #include @@ -263,6 +264,40 @@ DALI_ADAPTOR_API int32_t GetNativeId( Window window ); */ DALI_ADAPTOR_API void SetDamagedAreas(Window window, std::vector>& areas); +/** + * @brief Adds a callback that is called when the frame rendering is done by the graphics driver. + * + * @param[in] window The window instance + * @param[in] callback The function to call + * @param[in] frameId The Id to specify the frame. It will be passed when the callback is called. + * + * @note A callback of the following type may be used: + * @code + * void MyFunction( int frameId ); + * @endcode + * This callback will be deleted once it is called. + * + * @note Ownership of the callback is passed onto this class. + */ +DALI_ADAPTOR_API void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ); + +/** + * @brief Adds a callback that is called when the frame is displayed on the display. + * + * @param[in] window The window instance + * @param[in] callback The function to call + * @param[in] frameId The Id to specify the frame. It will be passed when the callback is called. + * + * @note A callback of the following type may be used: + * @code + * void MyFunction( int frameId ); + * @endcode + * This callback will be deleted once it is called. + * + * @note Ownership of the callback is passed onto this class. + */ +DALI_ADAPTOR_API void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ); + } // namespace DevelWindow } // namespace Dali diff --git a/dali/integration-api/adaptor-framework/render-surface-interface.h b/dali/integration-api/adaptor-framework/render-surface-interface.h index e148662..6de1182 100644 --- a/dali/integration-api/adaptor-framework/render-surface-interface.h +++ b/dali/integration-api/adaptor-framework/render-surface-interface.h @@ -31,6 +31,11 @@ namespace Dali class DisplayConnection; class ThreadSynchronizationInterface; +namespace Integration +{ +class Scene; +} + namespace Internal { namespace Adaptor @@ -77,6 +82,7 @@ public: : mAdaptor( nullptr ), mGraphics( nullptr ), mDisplayConnection( nullptr ), + mScene( nullptr ), mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ), mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE ) {} @@ -206,6 +212,16 @@ public: mDisplayConnection = &displayConnection; } + /** + * @brief Sets a Scene that is rendered on this surface. + * @param scene The Scene object + */ + void SetScene( Dali::Integration::Scene& scene ) + { + // This will be changed to use the WeakHandle later. + mScene = &scene; + } + private: /** @@ -223,6 +239,7 @@ protected: Dali::Internal::Adaptor::AdaptorInternalServices* mAdaptor; Dali::Internal::Adaptor::GraphicsInterface* mGraphics; Dali::DisplayConnection* mDisplayConnection; + Dali::Integration::Scene* mScene; private: diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp index 5bbe94b..e296ea1 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -48,7 +48,7 @@ namespace { #if defined(DEBUG_ENABLED) -Integration::Log::Filter* gTouchEventLogFilter = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_TOUCH"); +Debug::Filter* gSceneHolderLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_SCENE_HOLDER" ); #endif // Copied from x server @@ -201,6 +201,7 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) mScene.SetDpi( Vector2( static_cast( dpiHorizontal ), static_cast( dpiVertical ) ) ); mSurface->SetAdaptor( *mAdaptor ); + mSurface->SetScene( mScene ); OnSurfaceSet( surface ); } @@ -272,6 +273,7 @@ void SceneHolder::SetAdaptor(Dali::Adaptor& adaptor) mScene.SetDpi( Vector2( static_cast( dpiHorizontal ), static_cast( dpiVertical ) ) ); mSurface->SetAdaptor( *mAdaptor ); + mSurface->SetScene( mScene ); } OnAdaptorSet( adaptor ); @@ -305,7 +307,7 @@ void SceneHolder::FeedTouchPoint( Dali::Integration::Point& point, int timeStamp Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent); if( type != Integration::TouchEventCombiner::DispatchNone ) { - DALI_LOG_INFO( gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y ); + DALI_LOG_INFO( gSceneHolderLogFilter, Debug::Verbose, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y ); // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback. // Keep the handle alive until the core events are processed. @@ -357,6 +359,20 @@ void SceneHolder::FeedKeyEvent( Dali::Integration::KeyEvent& keyEvent ) mAdaptor->ProcessCoreEvents(); } +void SceneHolder::AddFrameRenderedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId ) +{ + mScene.AddFrameRenderedCallback( std::move( callback ), frameId ); + + DALI_LOG_INFO( gSceneHolderLogFilter, Debug::General, "SceneHolder::AddFrameRenderedCallback:: Added [%d]\n", frameId ); +} + +void SceneHolder::AddFramePresentedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId ) +{ + mScene.AddFramePresentedCallback( std::move( callback ), frameId ); + + DALI_LOG_INFO( gSceneHolderLogFilter, Debug::General, "SceneHolder::AddFramePresentedCallback:: Added [%d]\n", frameId ); +} + Dali::Integration::SceneHolder SceneHolder::Get( Dali::Actor actor ) { SceneHolder* sceneHolderImpl = nullptr; diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index 3a830f9..38560cf 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.h +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.h @@ -171,6 +171,38 @@ public: void FeedKeyEvent( Dali::Integration::KeyEvent& keyEvent ); /** + * @brief Adds a callback that is called when the frame rendering is done by the graphics driver. + * + * @param[in] callback The function to call + * @param[in] frameId The Id to specify the frame. It will be passed when the callback is called. + * + * @note A callback of the following type may be used: + * @code + * void MyFunction( int frameId ); + * @endcode + * This callback will be deleted once it is called. + * + * @note Ownership of the callback is passed onto this class. + */ + void AddFrameRenderedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId ); + + /** + * @brief Adds a callback that is called when the frame rendering is done by the graphics driver. + * + * @param[in] callback The function to call + * @param[in] frameId The Id to specify the frame. It will be passed when the callback is called. + * + * @note A callback of the following type may be used: + * @code + * void MyFunction( int frameId ); + * @endcode + * This callback will be deleted once it is called. + * + * @note Ownership of the callback is passed onto this class. + */ + void AddFramePresentedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId ); + + /** * @copydoc Dali::Integration::SceneHolder::Get() */ static Dali::Integration::SceneHolder Get( Dali::Actor actor ); diff --git a/dali/internal/system/android/file-descriptor-monitor-android.cpp b/dali/internal/system/android/file-descriptor-monitor-android.cpp index 9bbfb01..b15b339 100644 --- a/dali/internal/system/android/file-descriptor-monitor-android.cpp +++ b/dali/internal/system/android/file-descriptor-monitor-android.cpp @@ -85,7 +85,7 @@ struct FileDescriptorMonitor::Impl // if there is an event, execute the callback if( type != FileDescriptorMonitor::FD_NO_EVENT ) { - CallbackBase::Execute( *impl->mCallback, static_cast< FileDescriptorMonitor::EventType >( type ) ); + CallbackBase::Execute( *impl->mCallback, static_cast< FileDescriptorMonitor::EventType >( type ), impl->mFileDescriptor ); } return 1; // Continue receiving callbacks diff --git a/dali/internal/system/common/file-descriptor-monitor.h b/dali/internal/system/common/file-descriptor-monitor.h index dafd064..a6aa316 100644 --- a/dali/internal/system/common/file-descriptor-monitor.h +++ b/dali/internal/system/common/file-descriptor-monitor.h @@ -66,7 +66,7 @@ public: * mFileDescriptorMonitor = new FileDescriptorMonitor( myFd, MakeCallback( this, &MyClass::FdCallback ), FileDescriptorMonitor::FD_READABLE ); * } * - * void MyClass::FdCallback( EventType event ) + * void MyClass::FdCallback( EventType event, int fileDescriptor ) * { * if( event & FileDescriptorMonitor::FD_ERROR) * { diff --git a/dali/internal/system/common/trigger-event.cpp b/dali/internal/system/common/trigger-event.cpp index 005f5ec..78044b4 100644 --- a/dali/internal/system/common/trigger-event.cpp +++ b/dali/internal/system/common/trigger-event.cpp @@ -90,7 +90,7 @@ void TriggerEvent::Trigger() } } -void TriggerEvent::Triggered( FileDescriptorMonitor::EventType eventBitMask ) +void TriggerEvent::Triggered( FileDescriptorMonitor::EventType eventBitMask, int fileDescriptor ) { if( !( eventBitMask & FileDescriptorMonitor::FD_READABLE ) ) { diff --git a/dali/internal/system/common/trigger-event.h b/dali/internal/system/common/trigger-event.h index 09ef23d..04e7835 100644 --- a/dali/internal/system/common/trigger-event.h +++ b/dali/internal/system/common/trigger-event.h @@ -80,8 +80,9 @@ private: /** * @brief Called when our event file descriptor has been written to. * @param[in] eventBitMask bit mask of events that occured on the file descriptor + * @param[in] fileDescriptor The file descriptor */ - void Triggered( FileDescriptorMonitor::EventType eventBitMask ); + void Triggered( FileDescriptorMonitor::EventType eventBitMask, int fileDescriptor ); private: diff --git a/dali/internal/system/linux/file-descriptor-monitor-ecore.cpp b/dali/internal/system/linux/file-descriptor-monitor-ecore.cpp index 88e9de3..83d63f4 100644 --- a/dali/internal/system/linux/file-descriptor-monitor-ecore.cpp +++ b/dali/internal/system/linux/file-descriptor-monitor-ecore.cpp @@ -72,7 +72,7 @@ struct FileDescriptorMonitor::Impl if( ecore_main_fd_handler_active_get( handler, ECORE_FD_ERROR) ) { - CallbackBase::Execute( *impl->mCallback, FileDescriptorMonitor::FD_ERROR); + CallbackBase::Execute( *impl->mCallback, FileDescriptorMonitor::FD_ERROR, impl->mFileDescriptor ); DALI_LOG_ERROR("ECORE_FD_ERROR occurred on %d\n", impl->mFileDescriptor); return ECORE_CALLBACK_CANCEL; @@ -97,7 +97,7 @@ struct FileDescriptorMonitor::Impl // if there is an event, execute the callback if( type != FileDescriptorMonitor::FD_NO_EVENT ) { - CallbackBase::Execute( *impl->mCallback, static_cast< FileDescriptorMonitor::EventType >(type ) ); + CallbackBase::Execute( *impl->mCallback, static_cast< FileDescriptorMonitor::EventType >(type ), impl->mFileDescriptor ); } return ECORE_CALLBACK_RENEW; diff --git a/dali/internal/window-system/android/window-base-android.cpp b/dali/internal/window-system/android/window-base-android.cpp index b894fa0..fa75f42 100644 --- a/dali/internal/window-system/android/window-base-android.cpp +++ b/dali/internal/window-system/android/window-base-android.cpp @@ -343,6 +343,16 @@ void WindowBaseAndroid::SetParent( WindowBase* parentWinBase ) { } +int WindowBaseAndroid::CreateFrameRenderedSyncFence() +{ + return -1; +} + +int WindowBaseAndroid::CreateFramePresentedSyncFence() +{ + return -1; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/android/window-base-android.h b/dali/internal/window-system/android/window-base-android.h index 86e8ddc..e970b7a 100644 --- a/dali/internal/window-system/android/window-base-android.h +++ b/dali/internal/window-system/android/window-base-android.h @@ -352,6 +352,16 @@ public: */ virtual void SetParent( WindowBase* parentWinBase ) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence() + */ + virtual int CreateFrameRenderedSyncFence() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence() + */ + virtual int CreateFramePresentedSyncFence() override; + private: /** diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 9871611..a5daaa2 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -335,6 +335,18 @@ public: */ virtual void SetParent( WindowBase* parentWinBase ) = 0; + /** + * @brief Create a sync fence that can tell the frame is rendered by the graphics driver. + * @return The file descriptor that tells when it is rendered. + */ + virtual int CreateFrameRenderedSyncFence() = 0; + + /** + * @brief Create a sync fence that can tell the frame is presented by the display server. + * @return The file descriptor that tells when it is presented. + */ + virtual int CreateFramePresentedSyncFence() = 0; + // Signals /** diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index dfaefa4..9c60476 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -60,11 +60,13 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, Any s mThreadSynchronization( NULL ), mRenderNotification( NULL ), mRotationTrigger( NULL ), + mFrameRenderedTrigger(), mGraphics( nullptr ), mEGLSurface( nullptr ), mEGLContext( nullptr ), mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ), mOutputTransformedSignal(), + mFrameCallbackInfoContainer(), mRotationAngle( 0 ), mScreenRotationAngle( 0 ), mOwnSurface( false ), @@ -354,6 +356,63 @@ void WindowRenderSurface::StartRender() bool WindowRenderSurface::PreRender( bool resizingSurface, const std::vector>& damagedRects, Rect& clippingRect ) { + Dali::Integration::Scene::FrameCallbackContainer callbacks; + + if( mScene ) + { + mScene->GetFrameRenderedCallback( callbacks ); + if( !callbacks.empty() ) + { + int frameRenderedSync = mWindowBase->CreateFrameRenderedSyncFence(); + if( frameRenderedSync != -1 ) + { + DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: CreateFrameRenderedSyncFence [%d]\n", frameRenderedSync ); + + mFrameCallbackInfoContainer.push_back( std::unique_ptr< FrameCallbackInfo >( new FrameCallbackInfo( callbacks, frameRenderedSync ) ) ); + + if( !mFrameRenderedTrigger ) + { + mFrameRenderedTrigger = std::unique_ptr< TriggerEventInterface >( TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessFrameCallback ), + TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER ) ); + } + mFrameRenderedTrigger->Trigger(); + } + else + { + DALI_LOG_ERROR( "WindowRenderSurface::PreRender: CreateFrameRenderedSyncFence is failed\n" ); + } + + // Clear callbacks + callbacks.clear(); + } + + mScene->GetFramePresentedCallback( callbacks ); + if( !callbacks.empty() ) + { + int framePresentedSync = mWindowBase->CreateFramePresentedSyncFence(); + if( framePresentedSync != -1 ) + { + DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: CreateFramePresentedSyncFence [%d]\n", framePresentedSync ); + + mFrameCallbackInfoContainer.push_back( std::unique_ptr< FrameCallbackInfo >( new FrameCallbackInfo( callbacks, framePresentedSync ) ) ); + + if( !mFrameRenderedTrigger ) + { + mFrameRenderedTrigger = std::unique_ptr< TriggerEventInterface >( TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessFrameCallback ), + TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER ) ); + } + mFrameRenderedTrigger->Trigger(); + } + else + { + DALI_LOG_ERROR( "WindowRenderSurface::PreRender: CreateFramePresentedSyncFence is failed\n" ); + } + + // Clear callbacks + callbacks.clear(); + } + } + MakeContextCurrent(); auto eglGraphics = static_cast(mGraphics); @@ -526,6 +585,47 @@ void WindowRenderSurface::ProcessRotationRequest() } } +void WindowRenderSurface::ProcessFrameCallback() +{ + for( auto&& iter : mFrameCallbackInfoContainer ) + { + if( !iter->fileDescriptorMonitor ) + { + iter->fileDescriptorMonitor = std::unique_ptr< FileDescriptorMonitor >( new FileDescriptorMonitor( iter->fileDescriptor, + MakeCallback( this, &WindowRenderSurface::OnFileDescriptorEventDispatched ), FileDescriptorMonitor::FD_READABLE ) ); + + DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::ProcessFrameCallback: Add handler [%d]\n", iter->fileDescriptor ); + } + } +} + +void WindowRenderSurface::OnFileDescriptorEventDispatched( FileDescriptorMonitor::EventType eventBitMask, int fileDescriptor ) +{ + if( !( eventBitMask & FileDescriptorMonitor::FD_READABLE ) ) + { + DALI_LOG_ERROR( "WindowRenderSurface::OnFileDescriptorEventDispatched: file descriptor error [%d]\n", eventBitMask ); + close( fileDescriptor ); + return; + } + + DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OnFileDescriptorEventDispatched: Frame rendered [%d]\n", fileDescriptor ); + + auto frameCallbackInfo = std::find_if( mFrameCallbackInfoContainer.begin(), mFrameCallbackInfoContainer.end(), + [fileDescriptor]( std::unique_ptr< FrameCallbackInfo >& callbackInfo ) + { + return callbackInfo->fileDescriptor == fileDescriptor; + } ); + if( frameCallbackInfo != mFrameCallbackInfoContainer.end() ) + { + // Call the connected callback + for( auto&& iter : ( *frameCallbackInfo )->callbacks ) + { + CallbackBase::Execute( *( iter.first ), iter.second ); + } + mFrameCallbackInfoContainer.erase( frameCallbackInfo ); + } +} + } // namespace Adaptor } // namespace internal diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index bc03611..6f982e4 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -21,11 +21,14 @@ // EXTERNAL INCLUDES #include #include +#include +#include // INTERNAL INCLUDES #include #include #include +#include namespace Dali { @@ -215,6 +218,18 @@ private: */ void ProcessRotationRequest(); + /** + * @brief Used as the callback for the frame rendered / presented. + */ + void ProcessFrameCallback(); + + /** + * @brief Called when our event file descriptor has been written to. + * @param[in] eventBitMask bit mask of events that occured on the file descriptor + * @param[in] fileDescriptor The file descriptor + */ + void OnFileDescriptorEventDispatched( FileDescriptorMonitor::EventType eventBitMask, int fileDescriptor ); + protected: // Undefined @@ -223,6 +238,36 @@ protected: // Undefined WindowRenderSurface& operator=(const WindowRenderSurface& rhs) = delete; +private: + + struct FrameCallbackInfo + { + FrameCallbackInfo( Dali::Integration::Scene::FrameCallbackContainer& callbackList, int fd ) + : callbacks(), + fileDescriptorMonitor(), + fileDescriptor( fd ) + { + // Transfer owership of the CallbackBase + for( auto&& iter : callbackList ) + { + callbacks.push_back( std::make_pair( std::move( iter.first ), iter.second ) ); + } + } + + ~FrameCallbackInfo() + { + // Delete FileDescriptorMonitor before close fd. + fileDescriptorMonitor.release(); + close( fileDescriptor ); + } + + Dali::Integration::Scene::FrameCallbackContainer callbacks; + std::unique_ptr< FileDescriptorMonitor > fileDescriptorMonitor; + int fileDescriptor; + }; + + using FrameCallbackInfoContainer = std::vector< std::unique_ptr< FrameCallbackInfo > >; + private: // Data EglInterface* mEGL; @@ -232,11 +277,13 @@ private: // Data ThreadSynchronizationInterface* mThreadSynchronization; TriggerEventInterface* mRenderNotification; ///< Render notification trigger TriggerEventInterface* mRotationTrigger; + std::unique_ptr< TriggerEventInterface > mFrameRenderedTrigger; GraphicsInterface* mGraphics; ///< Graphics interface EGLSurface mEGLSurface; EGLContext mEGLContext; ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit) OutputSignalType mOutputTransformedSignal; + FrameCallbackInfoContainer mFrameCallbackInfoContainer; int mRotationAngle; int mScreenRotationAngle; bool mOwnSurface; ///< Whether we own the surface (responsible for deleting it) diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 509ddd4..ac6879d 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -2146,6 +2146,16 @@ void WindowBaseEcoreWl::SetParent( WindowBase* parentWinBase ) ecore_wl_window_parent_set( mEcoreWindow, ecoreParent ); } +int WindowBaseEcoreWl::CreateFrameRenderedSyncFence() +{ + return -1; +} + +int WindowBaseEcoreWl::CreateFramePresentedSyncFence() +{ + return -1; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index 5811b5c..d9116e1 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -419,6 +419,16 @@ public: */ virtual void SetParent( WindowBase* parentWinBase ) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence() + */ + virtual int CreateFrameRenderedSyncFence() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence() + */ + virtual int CreateFramePresentedSyncFence() override; + private: /** diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index dbd8aa6..754fa5a 100755 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -2367,6 +2367,16 @@ void WindowBaseEcoreWl2::SetParent( WindowBase* parentWinBase ) ecore_wl2_window_parent_set( mEcoreWindow, ecoreParent ); } +int WindowBaseEcoreWl2::CreateFrameRenderedSyncFence() +{ + return wl_egl_window_tizen_create_commit_sync_fd( mEglWindow ); +} + +int WindowBaseEcoreWl2::CreateFramePresentedSyncFence() +{ + return wl_egl_window_tizen_create_presentation_sync_fd( mEglWindow ); +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index f429435..dad079d 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -441,6 +441,16 @@ public: */ virtual void SetParent( WindowBase* parentWinBase ) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence() + */ + virtual int CreateFrameRenderedSyncFence() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence() + */ + virtual int CreateFramePresentedSyncFence() override; + private: /** diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index ab67b43..ecc9e07 100755 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -909,6 +909,16 @@ void WindowBaseEcoreX::SetParent( WindowBase* parentWinBase ) } } +int WindowBaseEcoreX::CreateFrameRenderedSyncFence() +{ + return -1; +} + +int WindowBaseEcoreX::CreateFramePresentedSyncFence() +{ + return -1; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index 8ab7080..bdbe0a8 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -353,6 +353,16 @@ public: */ virtual void SetParent( WindowBase* parentWinBase ) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence() + */ + virtual int CreateFrameRenderedSyncFence() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence() + */ + virtual int CreateFramePresentedSyncFence() override; + private: /** diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index c968bea..7697790 100755 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -567,6 +567,16 @@ void WindowBaseWin::SetParent( WindowBase* parentWinBase ) } +int WindowBaseWin::CreateFrameRenderedSyncFence() +{ + return -1; +} + +int WindowBaseWin::CreateFramePresentedSyncFence() +{ + return -1; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index c0a17dc..48c0560 100755 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -341,6 +341,16 @@ public: */ virtual void SetParent( WindowBase* parentWinBase ) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence() + */ + virtual int CreateFrameRenderedSyncFence() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence() + */ + virtual int CreateFramePresentedSyncFence() override; + private: /**