From 0f4675a0315595a0ca60a1f6103834165c1791d3 Mon Sep 17 00:00:00 2001 From: Anton Obzhirov Date: Mon, 24 Jun 2019 14:54:01 +0100 Subject: [PATCH] Remove vsync-monitor since is not used anymore and move egl-image-extensions-ubuntu.cpp to generic. Change-Id: Ie7567fca26a5ce0ca6a303c34d19975755f1f30c --- .../utc-Dali-CommandLineOptions.cpp | 6 - dali/integration-api/adaptor.h | 8 -- dali/internal/adaptor/common/adaptor-impl.cpp | 15 -- dali/internal/adaptor/common/adaptor-impl.h | 11 -- .../adaptor/common/adaptor-internal-services.h | 6 - dali/internal/adaptor/common/adaptor.cpp | 5 - dali/internal/adaptor/common/application-impl.cpp | 6 - .../graphics/common/vsync-monitor-interface.h | 81 ----------- dali/internal/graphics/common/vsync-monitor.h | 103 -------------- dali/internal/graphics/file.list | 8 +- .../egl-image-extensions-generic.cpp} | 4 - .../graphics/tizen/vsync-monitor-tizen.cpp | 155 --------------------- .../graphics/ubuntu/vsync-monitor-ubuntu.cpp | 116 --------------- .../graphics/windows/vsync-monitor-win.cpp | 106 -------------- .../system/common/command-line-options.cpp | 9 +- dali/internal/system/common/command-line-options.h | 2 - dali/public-api/adaptor-framework/application.h | 1 - 17 files changed, 6 insertions(+), 636 deletions(-) delete mode 100644 dali/internal/graphics/common/vsync-monitor-interface.h delete mode 100644 dali/internal/graphics/common/vsync-monitor.h rename dali/internal/graphics/{ubuntu/egl-image-extensions-ubuntu.cpp => generic/egl-image-extensions-generic.cpp} (97%) delete mode 100644 dali/internal/graphics/tizen/vsync-monitor-tizen.cpp delete mode 100644 dali/internal/graphics/ubuntu/vsync-monitor-ubuntu.cpp delete mode 100755 dali/internal/graphics/windows/vsync-monitor-win.cpp diff --git a/automated-tests/src/dali-adaptor-internal/utc-Dali-CommandLineOptions.cpp b/automated-tests/src/dali-adaptor-internal/utc-Dali-CommandLineOptions.cpp index 4e332d1..f9a9404 100644 --- a/automated-tests/src/dali-adaptor-internal/utc-Dali-CommandLineOptions.cpp +++ b/automated-tests/src/dali-adaptor-internal/utc-Dali-CommandLineOptions.cpp @@ -53,7 +53,6 @@ int UtcDaliCommandLineOptionsNoArgs(void) DALI_TEST_EQUALS( argc, 1, TEST_LOCATION ); // Check values - DALI_TEST_EQUALS( options.noVSyncOnRender, 0, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageWidth, 0, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageHeight, 0, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageDPI, "", TEST_LOCATION ); @@ -81,7 +80,6 @@ int UtcDaliCommandLineOptionsDaliShortArgs(void) DALI_TEST_EQUALS( argc, 1, TEST_LOCATION ); // Check values - DALI_TEST_EQUALS( options.noVSyncOnRender, 0, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageWidth, 800, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageHeight, 1000, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageDPI, "4x5", TEST_LOCATION ); @@ -99,7 +97,6 @@ int UtcDaliCommandLineOptionsDaliLongArgsEqualsSign(void) "--width=800", "--height=1000", "--dpi=3x4", - "--no-vsync", "--help" }; int argc( sizeof( argList ) / sizeof( argList[0] ) ); @@ -111,7 +108,6 @@ int UtcDaliCommandLineOptionsDaliLongArgsEqualsSign(void) DALI_TEST_EQUALS( argc, 1, TEST_LOCATION ); // Check values - DALI_TEST_EQUALS( options.noVSyncOnRender, 1, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageWidth, 800, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageHeight, 1000, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageDPI, "3x4", TEST_LOCATION ); @@ -129,7 +125,6 @@ int UtcDaliCommandLineOptionsDaliLongArgsSpaces(void) "--width", "800", "--height", "1000", "--dpi", "3x4", - "--no-vsync", "--help" }; int argc( sizeof( argList ) / sizeof( argList[0] ) ); @@ -141,7 +136,6 @@ int UtcDaliCommandLineOptionsDaliLongArgsSpaces(void) DALI_TEST_EQUALS( argc, 1, TEST_LOCATION ); // Check values - DALI_TEST_EQUALS( options.noVSyncOnRender, 1, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageWidth, 800, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageHeight, 1000, TEST_LOCATION ); DALI_TEST_EQUALS( options.stageDPI, "3x4", TEST_LOCATION ); diff --git a/dali/integration-api/adaptor.h b/dali/integration-api/adaptor.h index 3369a73..2bce86e 100755 --- a/dali/integration-api/adaptor.h +++ b/dali/integration-api/adaptor.h @@ -353,14 +353,6 @@ public: void SetPreRenderCallback( CallbackBase* callback ); /** - * @brief Set whether the frame count per render is managed using the hardware VSync or - * manually timed. - * - * @param[in] useHardware True if the hardware VSync should be used - */ - void SetUseHardwareVSync(bool useHardware); - - /** * @brief Returns a reference to the instance of the adaptor used by the current thread. * * @return A reference to the adaptor. diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index b51693c..db49850 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -196,8 +195,6 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: mNotificationTrigger = mTriggerEventFactory.CreateTriggerEvent( MakeCallback( this, &Adaptor::ProcessCoreEvents ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER); - mVSyncMonitor = new VSyncMonitor; - mDisplayConnection = Dali::DisplayConnection::New( *mGraphics, defaultWindow->GetSurface()->GetSurfaceType() ); mThreadController = new ThreadController( *this, *mEnvironmentOptions ); @@ -304,7 +301,6 @@ Adaptor::~Adaptor() mWindows.clear(); delete mThreadController; // this will shutdown render thread, which will call Core::ContextDestroyed before exit - delete mVSyncMonitor; delete mObjectProfiler; delete mCore; @@ -657,11 +653,6 @@ void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender ) mThreadController->SetRenderRefreshRate( numberOfVSyncsPerRender ); } -void Adaptor::SetUseHardwareVSync( bool useHardware ) -{ - mVSyncMonitor->SetUseHardwareVSync( useHardware ); -} - Dali::DisplayConnection& Adaptor::GetDisplayConnectionInterface() { DALI_ASSERT_DEBUG( mDisplayConnection && "Display connection not created" ); @@ -704,11 +695,6 @@ Dali::RenderSurfaceInterface* Adaptor::GetRenderSurfaceInterface() return nullptr; } -VSyncMonitorInterface* Adaptor::GetVSyncMonitorInterface() -{ - return mVSyncMonitor; -} - TraceInterface& Adaptor::GetKernelTraceInterface() { return mKernelTracer; @@ -1046,7 +1032,6 @@ Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, mState( READY ), mCore( nullptr ), mThreadController( nullptr ), - mVSyncMonitor( nullptr ), mGraphics( nullptr ), mDisplayConnection( nullptr ), mWindows(), diff --git a/dali/internal/adaptor/common/adaptor-impl.h b/dali/internal/adaptor/common/adaptor-impl.h index 3d358d3..d6add77 100755 --- a/dali/internal/adaptor/common/adaptor-impl.h +++ b/dali/internal/adaptor/common/adaptor-impl.h @@ -321,11 +321,6 @@ public: void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender ); /** - * @copydoc Dali::Adaptor::SetUseHardwareVSync() - */ - void SetUseHardwareVSync(bool useHardware); - - /** * Return the PlatformAbstraction. * @return The PlatformAbstraction. */ @@ -472,11 +467,6 @@ public: //AdaptorInternalServices virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface(); /** - * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetVSyncMonitorInterface() - */ - virtual VSyncMonitorInterface* GetVSyncMonitorInterface(); - - /** * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetPerformanceInterface() */ virtual PerformanceInterface* GetPerformanceInterface(); @@ -653,7 +643,6 @@ private: // Data State mState; ///< Current state of the adaptor Dali::Integration::Core* mCore; ///< Dali Core ThreadController* mThreadController; ///< Controls the threads - VSyncMonitor* mVSyncMonitor; ///< Monitors VSync events GraphicsInterface* mGraphics; ///< Graphics interface Dali::DisplayConnection* mDisplayConnection; ///< Display connection diff --git a/dali/internal/adaptor/common/adaptor-internal-services.h b/dali/internal/adaptor/common/adaptor-internal-services.h index db4a360..de6c4e3 100644 --- a/dali/internal/adaptor/common/adaptor-internal-services.h +++ b/dali/internal/adaptor/common/adaptor-internal-services.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -100,11 +99,6 @@ public: virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface() = 0; /** - * @return vsync monitor interface - */ - virtual VSyncMonitorInterface* GetVSyncMonitorInterface() = 0; - - /** * @return performance interface */ virtual PerformanceInterface* GetPerformanceInterface() = 0; diff --git a/dali/internal/adaptor/common/adaptor.cpp b/dali/internal/adaptor/common/adaptor.cpp index dd2be7f..9b300bf 100755 --- a/dali/internal/adaptor/common/adaptor.cpp +++ b/dali/internal/adaptor/common/adaptor.cpp @@ -181,11 +181,6 @@ void Adaptor::SetPreRenderCallback( CallbackBase* callback ) mImpl->SetPreRenderCallback( callback ); } -void Adaptor::SetUseHardwareVSync(bool useHardware) -{ - mImpl->SetUseHardwareVSync( useHardware ); -} - Adaptor& Adaptor::Get() { return Internal::Adaptor::Adaptor::Get(); diff --git a/dali/internal/adaptor/common/application-impl.cpp b/dali/internal/adaptor/common/application-impl.cpp index a446635..94196b7 100755 --- a/dali/internal/adaptor/common/application-impl.cpp +++ b/dali/internal/adaptor/common/application-impl.cpp @@ -242,12 +242,6 @@ void Application::OnInit() // Run the adaptor mAdaptor->Start(); - // Check if user requires no vsyncing and set Adaptor - if (mCommandLineOptions->noVSyncOnRender) - { - mAdaptor->SetUseHardwareVSync(false); - } - if( ! mStylesheet.empty() ) { Dali::StyleMonitor::Get().SetTheme( mStylesheet ); diff --git a/dali/internal/graphics/common/vsync-monitor-interface.h b/dali/internal/graphics/common/vsync-monitor-interface.h deleted file mode 100644 index 63d70ba..0000000 --- a/dali/internal/graphics/common/vsync-monitor-interface.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef DALI_INTERNAL_BASE_VSYNC_MONITOR_INTERFACE_H -#define DALI_INTERNAL_BASE_VSYNC_MONITOR_INTERFACE_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. - * - */ - -// EXTERNAL INCLUDES -// INTERNAL INCLUDES - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -/** - * Interface for monitoring VSync - * Implementations must provide a DoSync method - */ -class VSyncMonitorInterface -{ -public: - - /** - * Initialize the vsync monitor. - */ - virtual void Initialize() = 0; - - /** - * Terminate the vsync monitor - */ - virtual void Terminate() = 0; - - /** - * Checks if hardware sync is available and enabled - * @return true if hardware sync is available and enabled - */ - virtual bool UseHardware() = 0; - - /** - * Wait for vertical blank sync. - * @param[out] frameNumber The current sequence number for this vsync (increments by one for each vsync) - * @param[out] seconds The timestamp (seconds) when the vsync occured - * @param[out] microseconds The timestamp (microseconds) when the vsync occured - * @return true if a valid sync was detected, false on error - */ - virtual bool DoSync( unsigned int& frameNumber, unsigned int& seconds, unsigned int& microseconds ) = 0; - -protected: - - /** - * Virtual protected destructor - no deletion through this interface - */ - virtual ~VSyncMonitorInterface() {} - -}; // class VSyncMonitorInterface - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_BASE_VSYNC_MONITOR_INTERFACE_H diff --git a/dali/internal/graphics/common/vsync-monitor.h b/dali/internal/graphics/common/vsync-monitor.h deleted file mode 100644 index 5c34deb..0000000 --- a/dali/internal/graphics/common/vsync-monitor.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef DALI_INTERNAL_VSYNC_MONITOR_IMPL_H -#define DALI_INTERNAL_VSYNC_MONITOR_IMPL_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. - * - */ - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -/** - * Tizen interface for monitoring VSync - */ -class VSyncMonitor : public VSyncMonitorInterface -{ -public: - /** - * Default constructor - */ - VSyncMonitor(); - - /** - * Destructor - */ - virtual ~VSyncMonitor(); - -public: - - /** - * Set the use hardware flag - * @param[in] useHardware The new state for the use hardware flag. - */ - void SetUseHardwareVSync( bool useHardware ); - - /** - * Set whether the vsync hardware is available. - * (This is public to allow callback method to work...) - */ - void SetHardwareVSyncAvailable(bool available); - -private: // From Dali::Internal::Adaptor::VSyncMonitorInterface - - /** - * copydoc Dali::Internal::Adaptor::VSyncMonitorInterface::Initialize - */ - virtual void Initialize(); - - /** - * copydoc Dali::Internal::Adaptor::VSyncMonitorInterface::Terminate - */ - virtual void Terminate(); - - /** - * copydoc Dali::Internal::Adaptor::VSyncMonitorInterface::UseHardware - */ - virtual bool UseHardware(); - - /** - * copydoc Dali::Internal::Adaptor::VSyncMonitorInterface::DoSync - */ - virtual bool DoSync( unsigned int& frameNumber, unsigned int& seconds, unsigned int& microseconds ); - -private: - - int mFileDescriptor; ///< DRM dev node file descriptor - drmVBlank mVBlankInfo; - // NOTE cannot use booleans as these are used from multiple threads, must use variable with machine word size for atomic read/write - unsigned int mUseHardwareVSync; ///< Whether to use hardware vsync - unsigned int mHardwareVSyncAvailable; ///< Whether hardware vsync is available -}; - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // DALI_INTERNAL_VSYNC_MONITOR_IMPL_H diff --git a/dali/internal/graphics/file.list b/dali/internal/graphics/file.list index 016a3d8..2b40768 100644 --- a/dali/internal/graphics/file.list +++ b/dali/internal/graphics/file.list @@ -12,10 +12,8 @@ adaptor_graphics_gles_src_files=\ # module: graphics, backend: tizen adaptor_graphics_tizen_src_files=\ - ${adaptor_graphics_dir}/tizen/egl-image-extensions-tizen.cpp \ - ${adaptor_graphics_dir}/tizen/vsync-monitor-tizen.cpp + ${adaptor_graphics_dir}/tizen/egl-image-extensions-tizen.cpp -# module: graphics, backend: ubuntu +# module: graphics, backend: generic adaptor_graphics_ubuntu_src_files=\ - ${adaptor_graphics_dir}/ubuntu/egl-image-extensions-ubuntu.cpp \ - ${adaptor_graphics_dir}/ubuntu/vsync-monitor-ubuntu.cpp + ${adaptor_graphics_dir}/generic/egl-image-extensions-generic.cpp diff --git a/dali/internal/graphics/ubuntu/egl-image-extensions-ubuntu.cpp b/dali/internal/graphics/generic/egl-image-extensions-generic.cpp similarity index 97% rename from dali/internal/graphics/ubuntu/egl-image-extensions-ubuntu.cpp rename to dali/internal/graphics/generic/egl-image-extensions-generic.cpp index 6901bf5..70ddfde 100644 --- a/dali/internal/graphics/ubuntu/egl-image-extensions-ubuntu.cpp +++ b/dali/internal/graphics/generic/egl-image-extensions-generic.cpp @@ -81,9 +81,6 @@ void* EglImageExtensions::CreateImageKHR(EGLClientBuffer clientBuffer) EGL_NONE }; -// EGL constants use C casts -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" EGLImageKHR eglImage = eglCreateImageKHRProc( mEglImplementation->GetDisplay(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, @@ -135,7 +132,6 @@ void* EglImageExtensions::CreateImageKHR(EGLClientBuffer clientBuffer) } } } -#pragma GCC diagnostic pop return eglImage; } diff --git a/dali/internal/graphics/tizen/vsync-monitor-tizen.cpp b/dali/internal/graphics/tizen/vsync-monitor-tizen.cpp deleted file mode 100644 index 5892951..0000000 --- a/dali/internal/graphics/tizen/vsync-monitor-tizen.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2014 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. - * - */ - -// EXTERNAL INCLUDES -#include -#include -#include -#include -#include -#include - -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ -// constants to keep code readability with unsigned int has to be used as boolean (due to multithreading) -const unsigned int TRUE = 1u; -const unsigned int FALSE = 0u; - -#if defined(DEBUG_ENABLED) -Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_VSYNC_MONITOR"); -#endif - -const char * const DRM_DEVICE( "/dev/dri/card0" ); -const int FD_NONE( -1 ); - -void ScreenStatusChanged(keynode_t* node, void* data) -{ - VSyncMonitor* vsyncMonitor( static_cast< VSyncMonitor* >( data ) ); - - int status = 0; - vconf_get_int( VCONFKEY_PM_STATE, &status ); - - // status values - // - VCONFKEY_PM_STATE_NORMAL : turn vsync on - // - VCONFKEY_PM_STATE_LCDDIM : turn vsync off - // - VCONFKEY_PM_STATE_LCDOFF : turn vsync off - // - VCONFKEY_PM_STATE_SLEEP : turn vsync off - const unsigned int screenOn( VCONFKEY_PM_STATE_NORMAL == status ); - - vsyncMonitor->SetHardwareVSyncAvailable( screenOn ); - - DALI_LOG_INFO( gLogFilter, Debug::Concise, "%s, Screen %s.\n", __PRETTY_FUNCTION__, screenOn ? "On" : "Off" ); -} - -} // unnamed namespace - -VSyncMonitor::VSyncMonitor() -: mFileDescriptor( FD_NONE ), - mUseHardwareVSync( TRUE ), - mHardwareVSyncAvailable( FALSE ) -{ - vconf_notify_key_changed( VCONFKEY_PM_STATE, ScreenStatusChanged, this ); -} - -VSyncMonitor::~VSyncMonitor() -{ - Terminate(); - - vconf_ignore_key_changed( VCONFKEY_PM_STATE, ScreenStatusChanged ); -} - -void VSyncMonitor::SetUseHardwareVSync( bool useHardware ) -{ - mUseHardwareVSync = useHardware; -} - -void VSyncMonitor::SetHardwareVSyncAvailable( bool hardwareVSyncAvailable ) -{ - mHardwareVSyncAvailable = hardwareVSyncAvailable; -} - -void VSyncMonitor::Initialize() -{ - DALI_ASSERT_DEBUG( mFileDescriptor == FD_NONE && "VSyncMonitor::Initialize() called twice" ); - - // Read initial 'use hardware' status - ScreenStatusChanged( NULL, this ); - - // open /dev node - mFileDescriptor = open( DRM_DEVICE, O_RDWR ); - - // setup vblank request - block and wait for next vblank - mVBlankInfo.request.type = DRM_VBLANK_NEXTONMISS; - mVBlankInfo.request.sequence = 0; - mVBlankInfo.request.signal = 0; - - // setup vblank reply - block and wait for next vblank - mVBlankInfo.reply.type = DRM_VBLANK_NEXTONMISS; - mVBlankInfo.reply.sequence = 0; - mVBlankInfo.reply.tval_sec = 0; - mVBlankInfo.reply.tval_usec = 0; -} - -void VSyncMonitor::Terminate() -{ - if( mFileDescriptor != FD_NONE ) - { - close( mFileDescriptor ); - mFileDescriptor = FD_NONE; - } -} - -bool VSyncMonitor::UseHardware() -{ - return mUseHardwareVSync && mHardwareVSyncAvailable && (FD_NONE != mFileDescriptor ); -} - -bool VSyncMonitor::DoSync( unsigned int& frameNumber, unsigned int& seconds, unsigned int& microseconds ) -{ - DALI_ASSERT_DEBUG( mFileDescriptor != FD_NONE && "ECoreX::VSyncMonitor is not initialized" ); - - if( 0 == drmWaitVBlank( mFileDescriptor, &mVBlankInfo ) ) - { - frameNumber = mVBlankInfo.reply.sequence; - seconds = mVBlankInfo.reply.tval_sec; - microseconds = mVBlankInfo.reply.tval_usec; - - return true; - } - - return false; -} - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali diff --git a/dali/internal/graphics/ubuntu/vsync-monitor-ubuntu.cpp b/dali/internal/graphics/ubuntu/vsync-monitor-ubuntu.cpp deleted file mode 100644 index 6edb84a..0000000 --- a/dali/internal/graphics/ubuntu/vsync-monitor-ubuntu.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2014 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. - * - */ - -// CLASS HEADER -#include - -// EXTERNAL INCLUDES -#include -#include -#include -#include - -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ -// constants to keep code readability with unsigned int has to be used as boolean (due to multithreading) -const unsigned int TRUE = 1u; -const unsigned int FALSE = 0u; - -const int FD_NONE( -1 ); - -} // unnamed namespace - -VSyncMonitor::VSyncMonitor() -: mFileDescriptor( FD_NONE ), - mUseHardwareVSync( FALSE ), - mHardwareVSyncAvailable( FALSE ) -{ -} - -VSyncMonitor::~VSyncMonitor() -{ - Terminate(); -} - -void VSyncMonitor::SetUseHardwareVSync( bool useHardware ) -{ - mUseHardwareVSync = useHardware; -} - -void VSyncMonitor::SetHardwareVSyncAvailable( bool hardwareVSyncAvailable ) -{ - mHardwareVSyncAvailable = hardwareVSyncAvailable; -} - -void VSyncMonitor::Initialize() -{ - DALI_ASSERT_DEBUG( mFileDescriptor == FD_NONE && "VSyncMonitor::Initialize() called twice" ); - - // setup vblank request - block and wait for next vblank - mVBlankInfo.request.type = DRM_VBLANK_NEXTONMISS; - mVBlankInfo.request.sequence = 0; - mVBlankInfo.request.signal = 0; - - // setup vblank reply - block and wait for next vblank - mVBlankInfo.reply.type = DRM_VBLANK_NEXTONMISS; - mVBlankInfo.reply.sequence = 0; - mVBlankInfo.reply.tval_sec = 0; - mVBlankInfo.reply.tval_usec = 0; -} - -void VSyncMonitor::Terminate() -{ -} - -bool VSyncMonitor::UseHardware() -{ - return mUseHardwareVSync && mHardwareVSyncAvailable && (FD_NONE != mFileDescriptor ); -} - - -bool VSyncMonitor::DoSync( unsigned int& frameNumber, unsigned int& seconds, unsigned int& microseconds ) -{ - DALI_ASSERT_DEBUG( mFileDescriptor != FD_NONE && "ECoreX::VSyncMonitor is not initialized" ); - - if( 0 == drmWaitVBlank( mFileDescriptor, &mVBlankInfo ) ) - { - frameNumber = mVBlankInfo.reply.sequence; - seconds = mVBlankInfo.reply.tval_sec; - microseconds = mVBlankInfo.reply.tval_usec; - - return true; - } - - return false; -} - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali diff --git a/dali/internal/graphics/windows/vsync-monitor-win.cpp b/dali/internal/graphics/windows/vsync-monitor-win.cpp deleted file mode 100755 index 9ba3026..0000000 --- a/dali/internal/graphics/windows/vsync-monitor-win.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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. - * 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. - * - */ - -// CLASS HEADER -#include - -// EXTERNAL INCLUDES -#include -#include -#include -#include - -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - -namespace -{ -// constants to keep code readability with unsigned int has to be used as boolean (due to multithreading) -const unsigned int TRUE = 1u; -const unsigned int FALSE = 0u; - -const int FD_NONE( -1 ); - -} // unnamed namespace - -VSyncMonitor::VSyncMonitor() -: mFileDescriptor( FD_NONE ), - mUseHardwareVSync( FALSE ), - mHardwareVSyncAvailable( FALSE ) -{ -} - -VSyncMonitor::~VSyncMonitor() -{ - Terminate(); -} - -void VSyncMonitor::SetUseHardwareVSync( bool useHardware ) -{ - mUseHardwareVSync = useHardware; -} - -void VSyncMonitor::SetHardwareVSyncAvailable( bool hardwareVSyncAvailable ) -{ - mHardwareVSyncAvailable = hardwareVSyncAvailable; -} - -void VSyncMonitor::Initialize() -{ - DALI_ASSERT_DEBUG( mFileDescriptor == FD_NONE && "VSyncMonitor::Initialize() called twice" ); - - // setup vblank request - block and wait for next vblank - mVBlankInfo.request.type = DRM_VBLANK_NEXTONMISS; - mVBlankInfo.request.sequence = 0; - mVBlankInfo.request.signal = 0; - - // setup vblank reply - block and wait for next vblank - mVBlankInfo.reply.type = DRM_VBLANK_NEXTONMISS; - mVBlankInfo.reply.sequence = 0; - mVBlankInfo.reply.tval_sec = 0; - mVBlankInfo.reply.tval_usec = 0; -} - -void VSyncMonitor::Terminate() -{ -} - -bool VSyncMonitor::UseHardware() -{ - return mUseHardwareVSync && mHardwareVSyncAvailable && (FD_NONE != mFileDescriptor ); -} - - -bool VSyncMonitor::DoSync( unsigned int& frameNumber, unsigned int& seconds, unsigned int& microseconds ) -{ - DALI_ASSERT_DEBUG( mFileDescriptor != FD_NONE && "Windows::VSyncMonitor is not initialized" ); - return false; -} - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali diff --git a/dali/internal/system/common/command-line-options.cpp b/dali/internal/system/common/command-line-options.cpp index 806e787..7270a23 100644 --- a/dali/internal/system/common/command-line-options.cpp +++ b/dali/internal/system/common/command-line-options.cpp @@ -56,7 +56,6 @@ struct Argument Argument EXPECTED_ARGS[] = { - { "no-vsync", "Disable VSync on Render" }, { "width", "Stage Width" }, { "height", "Stage Height" }, { "dpi", "Emulated DPI" }, @@ -66,8 +65,7 @@ Argument EXPECTED_ARGS[] = enum Option { - OPTION_NO_VSYNC = 0, - OPTION_STAGE_WIDTH, + OPTION_STAGE_WIDTH = 0, OPTION_STAGE_HEIGHT, OPTION_DPI, OPTION_HELP @@ -89,8 +87,8 @@ void ShowHelp() } // unnamed namespace CommandLineOptions::CommandLineOptions(int32_t *argc, char **argv[]) -: noVSyncOnRender(0), - stageWidth(0), stageHeight(0) +: stageWidth(0), + stageHeight(0) { // Exit gracefully if no arguments provided if ( !argc || !argv ) @@ -108,7 +106,6 @@ CommandLineOptions::CommandLineOptions(int32_t *argc, char **argv[]) const struct option options[]= { - { EXPECTED_ARGS[OPTION_NO_VSYNC].opt, no_argument, &noVSyncOnRender, 1 }, // "--no-vsync" { EXPECTED_ARGS[OPTION_STAGE_WIDTH].opt, required_argument, NULL, 'w' }, // "--width" { EXPECTED_ARGS[OPTION_STAGE_HEIGHT].opt, required_argument, NULL, 'h' }, // "--height" { EXPECTED_ARGS[OPTION_DPI].opt, required_argument, NULL, 'd' }, // "--dpi" diff --git a/dali/internal/system/common/command-line-options.h b/dali/internal/system/common/command-line-options.h index 5738159..5277ffd 100644 --- a/dali/internal/system/common/command-line-options.h +++ b/dali/internal/system/common/command-line-options.h @@ -38,7 +38,6 @@ namespace Adaptor * The following options are supported: * * @code - * --no-vsync Disable VSync on Render * -w|--width Stage Width * -h|--height Stage Height * -d|--dpi Emulated DPI @@ -66,7 +65,6 @@ public: public: // Command line parsed values - int32_t noVSyncOnRender; ///< If 1, then the user does not want VSync on Render int32_t stageWidth; ///< The width of the stage required. 0 if not set. int32_t stageHeight; ///< The height of the stage required. 0 if not set. std::string stageDPI; ///< DPI stored as hxv, where h is horizontal DPI and v is vertical DPI diff --git a/dali/public-api/adaptor-framework/application.h b/dali/public-api/adaptor-framework/application.h index b5a0666..38dec63 100644 --- a/dali/public-api/adaptor-framework/application.h +++ b/dali/public-api/adaptor-framework/application.h @@ -93,7 +93,6 @@ class Application; * This class accepts command line arguments as well. The following options are supported: * * @code - * --no-vsync Disable VSync on Render * -w|--width Stage Width * -h|--height Stage Height * -d|--dpi Emulated DPI -- 2.7.4