X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-adaptor%2Fdali-test-suite-utils%2Ftest-application.cpp;h=a8354e85afea786f949c377b2121b122b52d451f;hb=55174521a2a5366f61a6b0959a0ae856e03a03ac;hp=e71166bd5b86e21c00f7a2937e5a9ed9d56e0656;hpb=537b8797089488e75b9d67b9c1b7088d1ae052e5;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp index e71166b..a8354e8 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -82,8 +82,9 @@ void TestApplication::CreateScene() // Create render target for the scene Graphics::RenderTargetCreateInfo rtInfo{}; rtInfo.SetExtent({mSurfaceWidth, mSurfaceHeight}); - mRenderTarget = mGraphicsController.CreateRenderTarget(rtInfo, nullptr); - mScene.SetSurfaceRenderTarget(mRenderTarget.get()); + rtInfo.SetSurface(&mSurfaceWidth); // Can point to anything, really. + + mScene.SetSurfaceRenderTarget(rtInfo); } void TestApplication::InitializeCore() @@ -98,15 +99,15 @@ TestApplication::~TestApplication() delete mCore; } -void TestApplication::LogContext(bool start, const char* tag) +void TestApplication::LogContext(bool start, const char* tag, const char* message) { if(start) { - fprintf(stderr, "INFO: Trace Start: %s\n", tag); + fprintf(stderr, "INFO: Trace Start: %s %s\n", tag, message ? message : ""); } else { - fprintf(stderr, "INFO: Trace End: %s\n", tag); + fprintf(stderr, "INFO: Trace End: %s %s\n", tag, message ? message : ""); } } @@ -116,13 +117,16 @@ void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, st { switch(level) { - case Dali::Integration::Log::DebugInfo: + case Dali::Integration::Log::DEBUG: + fprintf(stderr, "DEBUG: %s", message.c_str()); + break; + case Dali::Integration::Log::INFO: fprintf(stderr, "INFO: %s", message.c_str()); break; - case Dali::Integration::Log::DebugWarning: + case Dali::Integration::Log::WARNING: fprintf(stderr, "WARN: %s", message.c_str()); break; - case Dali::Integration::Log::DebugError: + case Dali::Integration::Log::ERROR: fprintf(stderr, "ERROR: %s", message.c_str()); break; default: @@ -178,7 +182,7 @@ void TestApplication::SendNotification() mCore->ProcessEvents(); } -void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* location) +void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* location, bool uploadOnly) { if(GetUpdateStatus() == 0 && mRenderStatus.NeedsUpdate() == false && @@ -190,25 +194,28 @@ void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* locati uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds; float elapsedSeconds = static_cast(intervalMilliseconds) * 0.001f; - mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false); + mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false, uploadOnly); GetRenderController().Initialize(); mLastVSyncTime = nextVSyncTime; } -bool TestApplication::Render(uint32_t intervalMilliseconds, const char* location) +bool TestApplication::Render(uint32_t intervalMilliseconds, const char* location, bool uploadOnly) { - DoUpdate(intervalMilliseconds, location); + DoUpdate(intervalMilliseconds, location, uploadOnly); // Reset the status mRenderStatus.SetNeedsUpdate(false); mRenderStatus.SetNeedsPostRender(false); - mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/); - mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); - mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/); - mCore->PostRender(false /*do not skip rendering*/); + mCore->PreRender(mRenderStatus, false /*do not force clear*/); + if(!uploadOnly) + { + mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); + mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/); + } + mCore->PostRender(); mFrame++; @@ -219,8 +226,8 @@ bool TestApplication::PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, { DoUpdate(intervalMilliseconds, location); - mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/); - mCore->PreRender(mRenderStatus, mScene, damagedRects); + mCore->PreRender(mRenderStatus, false /*do not force clear*/); + mCore->PreRender(mScene, damagedRects); return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate(); } @@ -229,7 +236,7 @@ bool TestApplication::RenderWithPartialUpdate(std::vector>& damagedRec { mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/, clippingRect); - mCore->PostRender(false /*do not skip rendering*/); + mCore->PostRender(); mFrame++; @@ -260,10 +267,10 @@ bool TestApplication::GetRenderNeedsPostRender() bool TestApplication::RenderOnly() { // Update Time values - mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/); + mCore->PreRender(mRenderStatus, false /*do not force clear*/); mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/); - mCore->PostRender(false /*do not skip rendering*/); + mCore->PostRender(); mFrame++;