/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
auto numberOfPrecompiledShader = precompiledShader->shaderCount;
for(int i = 0; i < numberOfPrecompiledShader; ++i)
{
- auto vertexShader = graphics.GetController().GetGlAbstraction().GetVertexShaderPrefix() + std::string(precompiledShader->vertexPrefix[i].data()) + std::string(precompiledShader->vertexShader.data());
+ auto vertexShader = graphics.GetController().GetGlAbstraction().GetVertexShaderPrefix() + std::string(precompiledShader->vertexPrefix[i].data()) + std::string(precompiledShader->vertexShader.data());
auto fragmentShader = graphics.GetController().GetGlAbstraction().GetFragmentShaderPrefix() + std::string(precompiledShader->fragmentPrefix[i].data()) + std::string(precompiledShader->fragmentShader.data());
PreCompileShader(std::move(vertexShader), std::move(fragmentShader));
}
while(UpdateRenderReady(useElapsedTime, updateRequired, timeToSleepUntil))
{
LOG_UPDATE_RENDER_TRACE;
- TRACE_UPDATE_RENDER_SCOPE("DALI_UPDATE_RENDER");
+ TRACE_UPDATE_RENDER_BEGIN("DALI_UPDATE_RENDER");
// For thread safe
bool uploadOnly = mUploadWithoutRendering;
mNotificationTrigger.Trigger();
LOG_UPDATE_RENDER("Notification Triggered");
}
+
+ if(uploadOnly && (keepUpdatingStatus & Dali::Integration::KeepUpdating::STAGE_KEEP_RENDERING))
+ {
+ // Render forcely if there exist some keep rendering required.
+ uploadOnly = false;
+ }
// Optional logging of update/render status
mUpdateStatusLogger.Log(keepUpdatingStatus);
TRACE_UPDATE_RENDER_SCOPE("DALI_RENDER_SCENE");
Integration::RenderStatus windowRenderStatus;
- const bool sceneSurfaceResized = scene.IsSurfaceRectChanged();
+ const uint32_t sceneSurfaceResized = scene.GetSurfaceRectChangedCount();
// clear previous frame damaged render items rects, buffer history is tracked on surface level
mDamagedRects.clear();
Rect<int> clippingRect; // Empty for fbo rendering
// Switch to the context of the surface, merge damaged areas for previous frames
- windowSurface->PreRender(sceneSurfaceResized, mDamagedRects, clippingRect); // Switch GL context
+ windowSurface->PreRender(sceneSurfaceResized > 0u, mDamagedRects, clippingRect); // Switch GL context
// Render the surface
mCore.RenderScene(windowRenderStatus, scene, false, clippingRect);
// Buffer swapping now happens when the surface render target is presented.
// If surface is resized, the surface resized count is decreased.
- if(DALI_UNLIKELY(sceneSurfaceResized))
+ if(DALI_UNLIKELY(sceneSurfaceResized > 0u))
{
- SurfaceResized();
+ SurfaceResized(sceneSurfaceResized);
}
}
}
}
+ else
+ {
+ DALI_LOG_RELEASE_INFO("DALI Rendering skip (upload only)\n");
+ }
TRACE_UPDATE_RENDER_BEGIN("DALI_POST_RENDER");
if(!uploadOnly)
}
}
+ TRACE_UPDATE_RENDER_END("DALI_UPDATE_RENDER");
+
// Render to FBO is intended to measure fps above 60 so sleep is not wanted.
if(0u == renderToFboInterval)
{
mSurfaceSemaphore.Release(1);
}
-void CombinedUpdateRenderController::SurfaceResized()
+void CombinedUpdateRenderController::SurfaceResized(uint32_t resizedCount)
{
ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
- if(mSurfaceResized)
+
+ if(mSurfaceResized >= resizedCount)
+ {
+ mSurfaceResized -= resizedCount;
+ }
+ else
{
- mSurfaceResized--;
+ mSurfaceResized = 0u;
}
}