X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Fdali-test-suite-utils%2Ftest-application.cpp;h=8bb7176a0f5aca266910af7a9160ce203dbb4c7a;hb=11a3c866f91cf439f404788b088bf90036f5cd48;hp=e8d9be4293f3475cecc28c4d6989dd7bab97dc1f;hpb=de2ca7c4b8120766f23113ac6695c12066657006;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp index e8d9be4..8bb7176 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp +++ b/automated-tests/src/dali/dali-test-suite-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 ); @@ -77,6 +79,11 @@ void TestApplication::Initialize() Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage); Dali::Integration::Log::InstallLogFunction(logFunction); + Dali::Integration::Trace::LogContextFunction logContextFunction(&TestApplication::LogContext); + Dali::Integration::Trace::InstallLogContextFunction( logContextFunction ); + + Dali::Integration::Trace::LogContext( true, "Test" ); + mCore->SceneCreated(); } @@ -86,6 +93,18 @@ TestApplication::~TestApplication() delete mCore; } +void TestApplication::LogContext( bool start, const char* tag ) +{ + if( start ) + { + fprintf(stderr, "INFO: Trace Start: %s", tag); + } + else + { + fprintf(stderr, "INFO: Trace End: %s", tag); + } +} + void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message) { switch(level) @@ -171,7 +190,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(); @@ -181,7 +200,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++; @@ -207,7 +226,7 @@ bool TestApplication::GetRenderNeedsUpdate() bool TestApplication::RenderOnly( ) { // Update Time values - mCore->Render( mRenderStatus ); + mCore->Render( mRenderStatus, false ); mFrame++; @@ -221,5 +240,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