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 &&
uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
float elapsedSeconds = static_cast<float>(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++;
{
DoUpdate(intervalMilliseconds, location);
- mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
+ mCore->PreRender(mRenderStatus, false /*do not force clear*/);
mCore->PreRender(mScene, damagedRects);
return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
{
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++;
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++;
void ProcessEvent(const Integration::Event& event);
void SendNotification();
- bool Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL);
+ bool Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL, bool uploadOnly = false);
bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
bool RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
uint32_t GetUpdateStatus();
}
private:
- void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL);
+ void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL, bool uploadOnly = false);
protected:
TestPlatformAbstraction mPlatformAbstraction;
END_TEST;
}
+
+int UtcDaliRenderTaskUploadOnly(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask Render Once GlSync, using loaded image");
+
+ // SETUP AN OFFSCREEN RENDER TASK
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ auto& sync = application.GetGraphicsSyncImpl();
+ TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+ drawTrace.Enable(true);
+
+ Actor rootActor = Actor::New();
+ application.GetScene().Add(rootActor);
+
+ CameraActor offscreenCameraActor = CameraActor::New(Size(TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT));
+ application.GetScene().Add(offscreenCameraActor);
+ Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
+
+ application.GetScene().Add(secondRootActor);
+
+ RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ONCE, true);
+ bool finished = false;
+ RenderTaskFinished renderTaskFinished(finished);
+ newTask.FinishedSignal().Connect(&application, renderTaskFinished);
+ application.SendNotification();
+
+ DALI_TEST_CHECK(UpdateRender(application, drawTrace, true, finished, false, true, __LINE__));
+
+ Integration::GraphicsSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
+ DALI_TEST_CHECK(lastSyncObj != NULL);
+ sync.SetObjectSynced(lastSyncObj, true);
+
+ application.SendNotification();
+ application.Render(16, nullptr, true);
+
+ DALI_TEST_CHECK(!finished);
+
+ application.Render(16, nullptr, true);
+ application.SendNotification();
+
+ DALI_TEST_CHECK(!finished);
+ END_TEST;
+}
\ No newline at end of file
return mImpl->GetMaximumUpdateCount();
}
-void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo)
+void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly)
{
- mImpl->Update(elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo);
+ mImpl->Update(elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo, uploadOnly);
}
-void Core::PreRender(RenderStatus& status, bool forceClear, bool uploadOnly)
+void Core::PreRender(RenderStatus& status, bool forceClear)
{
- mImpl->PreRender(status, forceClear, uploadOnly);
+ mImpl->PreRender(status, forceClear);
}
void Core::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
mImpl->RenderScene(status, scene, renderToFbo, clippingRect);
}
-void Core::PostRender(bool uploadOnly)
+void Core::PostRender()
{
- mImpl->PostRender(uploadOnly);
+ mImpl->PostRender();
}
void Core::RegisterProcessor(Processor& processor, bool postProcessor)
* whether a Notification event should be sent, regardless of whether the multi-threading is used.
* @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
* @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
+ * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
*/
void Update(float elapsedSeconds,
uint32_t lastVSyncTimeMilliseconds,
uint32_t nextVSyncTimeMilliseconds,
UpdateStatus& status,
bool renderToFboEnabled,
- bool isRenderingToFbo);
+ bool isRenderingToFbo,
+ bool uploadOnly);
/**
* This is called before rendering any scene in the next frame. This method should be preceded
* @pre The GL context must have been created, and made current.
* @param[out] status showing whether update is required to run.
* @param[in] forceClear force the Clear on the framebuffer even if nothing is rendered.
- * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
*/
- void PreRender(RenderStatus& status, bool forceClear, bool uploadOnly);
+ void PreRender(RenderStatus& status, bool forceClear);
/**
* This is called before rendering any scene in the next frame. This method should be preceded
* followed by a call up RenderScene.
* Multi-threading note: this method should be called from a dedicated rendering thread.
* @pre The GL context must have been created, and made current.
- * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
*/
- void PostRender(bool uploadOnly);
+ void PostRender();
/**
* @brief Register a processor
{
}
-void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo)
+void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly)
{
// set the time delta so adaptor can easily print FPS with a release build with 0 as
// it is cached by frametime
lastVSyncTimeMilliseconds,
nextVSyncTimeMilliseconds,
renderToFboEnabled,
- isRenderingToFbo);
+ isRenderingToFbo,
+ uploadOnly);
// Check the Notification Manager message queue to set needsNotification
status.needsNotification = mNotificationManager->MessagesToProcess();
// Any message to update will wake it up anyways
}
-void Core::PreRender(RenderStatus& status, bool forceClear, bool uploadOnly)
+void Core::PreRender(RenderStatus& status, bool forceClear)
{
- mRenderManager->PreRender(status, forceClear, uploadOnly);
+ mRenderManager->PreRender(status, forceClear);
}
void Core::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
mRenderManager->RenderScene(status, scene, renderToFbo, clippingRect);
}
-void Core::PostRender(bool uploadOnly)
+void Core::PostRender()
{
- mRenderManager->PostRender(uploadOnly);
+ mRenderManager->PostRender();
}
void Core::SceneCreated()
/**
* @copydoc Dali::Integration::Core::Update()
*/
- void Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo);
+ void Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly);
/**
* @copydoc Dali::Integration::Core::PreRender()
*/
- void PreRender(Integration::RenderStatus& status, bool forceClear, bool uploadOnly);
+ void PreRender(Integration::RenderStatus& status, bool forceClear);
/**
* @copydoc Dali::Integration::Core::PreRender()
/**
* @copydoc Dali::Integration::Core::Render()
*/
- void PostRender(bool uploadOnly);
+ void PostRender();
/**
* @copydoc Dali::Integration::Core::SceneCreated()
mImpl->RemoveRenderTracker(renderTracker);
}
-void RenderManager::PreRender(Integration::RenderStatus& status, bool forceClear, bool uploadOnly)
+void RenderManager::PreRender(Integration::RenderStatus& status, bool forceClear)
{
DALI_PRINT_RENDER_START(mImpl->renderBufferIndex);
}
}
-void RenderManager::PostRender(bool uploadOnly)
+void RenderManager::PostRender()
{
// Notify RenderGeometries that rendering has finished
for(auto&& iter : mImpl->geometryContainer)
* @pre The graphics implementation must be initialized
* @param[out] status showing whether update is required to run.
* @param[in] forceClear force the Clear on the framebuffer even if nothing is rendered.
- * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
*/
- void PreRender(Integration::RenderStatus& status, bool forceClear, bool uploadOnly);
+ void PreRender(Integration::RenderStatus& status, bool forceClear);
// This method should be called from Core::PreRender()
* followed by a call up RenderScene.
* Multi-threading note: this method should be called from a dedicated rendering thread.
* @pre The graphics implementation must be initialized
- * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
*/
- void PostRender(bool uploadOnly);
+ void PostRender();
private:
/**
uint32_t lastVSyncTimeMilliseconds,
uint32_t nextVSyncTimeMilliseconds,
bool renderToFboEnabled,
- bool isRenderingToFbo)
+ bool isRenderingToFbo,
+ bool uploadOnly)
{
const BufferIndex bufferIndex = mSceneGraphBuffers.GetUpdateBufferIndex();
}
}
- for(auto&& scene : mImpl->scenes)
+ if(!uploadOnly)
{
- if(scene && scene->root && scene->taskList)
+ for(auto&& scene : mImpl->scenes)
{
- RenderTaskList::RenderTaskContainer& tasks = scene->taskList->GetTasks();
-
- // check the countdown and notify
- bool doRenderOnceNotify = false;
- mImpl->renderTaskWaiting = false;
- for(auto&& renderTask : tasks)
+ if(scene && scene->root && scene->taskList)
{
- renderTask->UpdateState();
+ RenderTaskList::RenderTaskContainer& tasks = scene->taskList->GetTasks();
- if(renderTask->IsWaitingToRender() &&
- renderTask->ReadyToRender(bufferIndex) /*avoid updating forever when source actor is off-stage*/)
+ // check the countdown and notify
+ bool doRenderOnceNotify = false;
+ mImpl->renderTaskWaiting = false;
+ for(auto&& renderTask : tasks)
{
- mImpl->renderTaskWaiting = true; // keep update/render threads alive
+ renderTask->UpdateState();
+
+ if(renderTask->IsWaitingToRender() &&
+ renderTask->ReadyToRender(bufferIndex) /*avoid updating forever when source actor is off-stage*/)
+ {
+ mImpl->renderTaskWaiting = true; // keep update/render threads alive
+ }
+
+ if(renderTask->HasRendered())
+ {
+ doRenderOnceNotify = true;
+ }
}
- if(renderTask->HasRendered())
+ if(doRenderOnceNotify)
{
- doRenderOnceNotify = true;
+ DALI_LOG_INFO(gRenderTaskLogFilter, Debug::General, "Notify a render task has finished\n");
+ mImpl->notificationManager.QueueCompleteNotification(scene->taskList->GetCompleteNotificationInterface());
}
}
-
- if(doRenderOnceNotify)
- {
- DALI_LOG_INFO(gRenderTaskLogFilter, Debug::General, "Notify a render task has finished\n");
- mImpl->notificationManager.QueueCompleteNotification(scene->taskList->GetCompleteNotificationInterface());
- }
}
}
* @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
* @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
* @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
+ * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
* @return True if further updates are required e.g. during animations.
*/
uint32_t Update(float elapsedSeconds,
uint32_t lastVSyncTimeMilliseconds,
uint32_t nextVSyncTimeMilliseconds,
bool renderToFboEnabled,
- bool isRenderingToFbo);
+ bool isRenderingToFbo,
+ bool uploadOnly);
/**
* @copydoc Dali::Stage::KeepRendering()