X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-application.cpp;h=0e640e7f3470824eea9d34e9df9cba063332b5f9;hp=3f7318a89bb489ded9956868cfb3ac8b0451fe8f;hb=399dfa8349a75c8c20e683620d927fd0f9420b85;hpb=e50ad843a871ba17493a375d47e7197aa91de584 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 3f7318a..0e640e7 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) 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. @@ -62,13 +62,15 @@ void TestApplication::Initialize() // We always need the first update! mStatus.keepUpdating = Integration::KeepUpdating::STAGE_KEEP_RENDERING; - mCore = Dali::Integration::Core::New( - mRenderController, - mPlatformAbstraction, - mGlAbstraction, - mGlSyncAbstraction, - mGestureManager, - mDataRetentionPolicy); + mCore = Dali::Integration::Core::New( mRenderController, + mPlatformAbstraction, + mGlAbstraction, + mGlSyncAbstraction, + mGestureManager, + mDataRetentionPolicy, + Integration::RenderToFrameBuffer::FALSE, + Integration::DepthBufferAvailable::TRUE, + Integration::StencilBufferAvailable::TRUE ); mCore->ContextCreated(); mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight ); @@ -154,6 +156,11 @@ void TestApplication::SetSurfaceWidth( unsigned int width, unsigned height ) mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight ); } +void TestApplication::SetTopMargin( unsigned int margin ) +{ + mCore->SetTopMargin( margin ); +} + void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* location ) { if( GetUpdateStatus() == 0 && @@ -166,7 +173,7 @@ void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* l unsigned int nextVSyncTime = mLastVSyncTime + intervalMilliseconds; float elapsedSeconds = intervalMilliseconds / 1e3f; - mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus ); + mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false ); GetRenderController().Initialize(); @@ -176,7 +183,7 @@ void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* l bool TestApplication::Render( unsigned int intervalMilliseconds, const char* location ) { DoUpdate( intervalMilliseconds, location ); - mCore->Render( mRenderStatus ); + mCore->Render( mRenderStatus, false ); mFrame++; @@ -198,15 +205,11 @@ bool TestApplication::GetRenderNeedsUpdate() { return mRenderStatus.NeedsUpdate(); } -bool TestApplication::GetRenderHasRendered() -{ - return mRenderStatus.HasRendered(); -} bool TestApplication::RenderOnly( ) { // Update Time values - mCore->Render( mRenderStatus ); + mCore->Render( mRenderStatus, false ); mFrame++; @@ -220,5 +223,17 @@ void TestApplication::ResetContext() mCore->ContextCreated(); } +unsigned int TestApplication::Wait( unsigned int durationToWait ) +{ + int time = 0; + + for(unsigned int i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++) + { + SendNotification(); + Render(RENDER_FRAME_INTERVAL); + time += RENDER_FRAME_INTERVAL; + } + return time; +} } // Namespace dali