X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-application.cpp;h=3f7318a89bb489ded9956868cfb3ac8b0451fe8f;hb=c4a92ccf72121cbe2a015711e4253e8d16f28fef;hp=df3ae2e08b19ae4544ae8b0c0014683d6a31a521;hpb=826a077bb3183b5d317bfb22e14ab4e217d26f40;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git 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 df3ae2e..3f7318a 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 @@ -48,6 +48,7 @@ TestApplication::TestApplication( bool initialize, mSurfaceHeight( surfaceHeight ), mFrame( 0u ), mDpi( horizontalDpi, verticalDpi ), + mLastVSyncTime(0u), mDataRetentionPolicy( policy ) { if ( initialize ) @@ -58,6 +59,9 @@ TestApplication::TestApplication( bool initialize, void TestApplication::Initialize() { + // We always need the first update! + mStatus.keepUpdating = Integration::KeepUpdating::STAGE_KEEP_RENDERING; + mCore = Dali::Integration::Core::New( mRenderController, mPlatformAbstraction, @@ -150,23 +154,28 @@ void TestApplication::SetSurfaceWidth( unsigned int width, unsigned height ) mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight ); } -void TestApplication::DoUpdate( unsigned int intervalMilliseconds ) +void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* location ) { - unsigned int seconds(0u), microseconds(0u); - mPlatformAbstraction.GetTimeMicroseconds( seconds, microseconds ); - mLastVSyncTime = ( seconds * 1e3 ) + ( microseconds / 1e3 ); - unsigned int nextVSyncTime = mLastVSyncTime + 16; - - // Update Time values - mPlatformAbstraction.IncrementGetTimeResult( intervalMilliseconds ); + if( GetUpdateStatus() == 0 && + mRenderStatus.NeedsUpdate() == false && + ! GetRenderController().WasCalled(TestRenderController::RequestUpdateFunc) ) + { + fprintf(stderr, "WARNING - Update not required :%s\n", location==NULL?"NULL":location); + } + unsigned int nextVSyncTime = mLastVSyncTime + intervalMilliseconds; float elapsedSeconds = intervalMilliseconds / 1e3f; + mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus ); + + GetRenderController().Initialize(); + + mLastVSyncTime = nextVSyncTime; } -bool TestApplication::Render( unsigned int intervalMilliseconds ) +bool TestApplication::Render( unsigned int intervalMilliseconds, const char* location ) { - DoUpdate( intervalMilliseconds ); + DoUpdate( intervalMilliseconds, location ); mCore->Render( mRenderStatus ); mFrame++; @@ -185,6 +194,15 @@ bool TestApplication::UpdateOnly( unsigned int intervalMilliseconds ) return mStatus.KeepUpdating(); } +bool TestApplication::GetRenderNeedsUpdate() +{ + return mRenderStatus.NeedsUpdate(); +} +bool TestApplication::GetRenderHasRendered() +{ + return mRenderStatus.HasRendered(); +} + bool TestApplication::RenderOnly( ) { // Update Time values @@ -198,6 +216,7 @@ bool TestApplication::RenderOnly( ) void TestApplication::ResetContext() { mCore->ContextDestroyed(); + mGlAbstraction.Initialize(); mCore->ContextCreated(); }