}
mThreadController->Pause();
- mCore->Suspend();
mState = PAUSED;
}
}
(*iter)->OnResume();
}
- // Resume core so it processes any requests as well
- mCore->Resume();
+ // trigger processing of events queued up while paused
+ mCore->ProcessEvents();
// Do at end to ensure our first update/render after resumption includes the processed messages as well
mThreadController->Resume();
}
mThreadController->Stop();
- mCore->Suspend();
// Delete the TTS player
for(int i =0; i < Dali::TtsPlayer::MODE_NUM; i++)
return mTtsPlayers[mode];
}
-bool Adaptor::AddIdle( CallbackBase* callback )
+bool Adaptor::AddIdle( CallbackBase* callback, bool forceAdd )
{
bool idleAdded(false);
// Only add an idle if the Adaptor is actually running
- if( RUNNING == mState )
+ if( RUNNING == mState || forceAdd )
{
idleAdded = mCallbackManager->AddIdleCallback( callback );
}
}
}
-void Adaptor::RequestUpdate()
+void Adaptor::RequestUpdate( bool forceUpdate )
{
- // When Dali applications are partially visible behind the lock-screen,
- // the indicator must be updated (therefore allow updates in the PAUSED state)
- if ( PAUSED == mState ||
- RUNNING == mState )
+ switch( mState )
{
- mThreadController->RequestUpdate();
+ case RUNNING:
+ {
+ mThreadController->RequestUpdate();
+ break;
+ }
+ case PAUSED:
+ case PAUSED_WHILE_HIDDEN:
+ {
+ // When Dali applications are partially visible behind the lock-screen,
+ // the indicator must be updated (therefore allow updates in the PAUSED state)
+ if( forceUpdate )
+ {
+ mThreadController->RequestUpdateOnce();
+ }
+ break;
+ }
+ default:
+ {
+ // Do nothing
+ break;
+ }
}
}
-void Adaptor::RequestProcessEventsOnIdle()
+void Adaptor::RequestProcessEventsOnIdle( bool forceProcess )
{
// Only request a notification if the Adaptor is actually running
// and we haven't installed the idle notification
- if( ( ! mNotificationOnIdleInstalled ) && ( RUNNING == mState ) )
+ if( ( ! mNotificationOnIdleInstalled ) && ( RUNNING == mState || forceProcess ) )
{
- mNotificationOnIdleInstalled = AddIdle( MakeCallback( this, &Adaptor::ProcessCoreEventsFromIdle ) );
+ mNotificationOnIdleInstalled = AddIdle( MakeCallback( this, &Adaptor::ProcessCoreEventsFromIdle ), forceProcess );
}
}
void Adaptor::OnDamaged( const DamageArea& area )
{
// This is needed for the case where Dali window is partially obscured
- RequestUpdate();
+ RequestUpdate( false );
}
void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
void Adaptor::RequestUpdateOnce()
{
- if( PAUSED_WHILE_HIDDEN != mState )
+ if( mThreadController )
{
- if( mThreadController )
- {
- mThreadController->RequestUpdateOnce();
- }
+ mThreadController->RequestUpdateOnce();
}
}
/**
* @copydoc Dali::Adaptor::AddIdle()
*/
- virtual bool AddIdle( CallbackBase* callback );
+ virtual bool AddIdle( CallbackBase* callback, bool forceAdd );
/**
* @copydoc Dali::Adaptor::RemoveIdle()
private: // From Dali::Integration::RenderController
/**
- * Called by the Dali core when it requires another update
+ * @copydoc Dali::Integration::RenderController::RequestUpdate()
*/
- virtual void RequestUpdate();
+ virtual void RequestUpdate( bool forceUpdate );
/**
- * Called by Dali core when it requires an notification event being sent on idle.
- * Multi-threading note: this method must be called from the main thread only.
+ * @copydoc Dali::Integration::RenderController::RequestProcessEventsOnIdle()
*/
- virtual void RequestProcessEventsOnIdle();
+ virtual void RequestProcessEventsOnIdle( bool forceProcess );
private: // From Dali::Internal::Adaptor::WindowVisibilityObserver
Any mNativeWindow; ///< window identifier
RenderSurface* mSurface; ///< Current surface
- TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
+ TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
EventHandler* mEventHandler; ///< event handler
CallbackManager* mCallbackManager; ///< Used to install callbacks
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
{
}
-void TestRenderController::RequestUpdate()
+void TestRenderController::RequestUpdate( bool forceUpdate )
{
mRequestUpdateCalled = true;
}
-void TestRenderController::RequestProcessEventsOnIdle()
+void TestRenderController::RequestProcessEventsOnIdle( bool forceProcess )
{
mRequestProcessEventsOnIdleCalled = true;
}
#define __TEST_RENDER_CONTROLLER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
TestRenderController();
~TestRenderController();
- virtual void RequestUpdate();
- virtual void RequestProcessEventsOnIdle();
+ virtual void RequestUpdate( bool forceUpdate );
+ virtual void RequestProcessEventsOnIdle( bool forceProcess );
typedef enum
{