void SurfaceResizeComplete(Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize);
/**
+ * @brief Increase surface resize completed counter.
+ * This API will be ignored if thread controller is not exist.
+ */
+ void IncreaseSurfaceResizeCounter();
+
+ /**
* Sets layout direction of root by system language
* @param[in] locale System locale
*/
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));
}
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);
}
}
}
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;
}
}
namespace Internal
{
-
namespace Adaptor
{
class AdaptorInternalServices;
* Called by the Update/Render thread after a surface has been resized.
*
* This will lock the mutex in mEventThreadWaitCondition
+ * @param[in] resizedCount The number of resized count for given surface.
*/
- void SurfaceResized();
+ void SurfaceResized(uint32_t resizedCount);
/**
* PreCompile shaders for launching time
///< Ensures we do not go to sleep if we have not processed the most recent update-request.
volatile unsigned int mUseElapsedTimeAfterWait; ///< Whether we should use the elapsed time after waiting (set by the event-thread, read by the update-render-thread).
- volatile unsigned int mIsPreCompileCancelled; ///< Whether we need to do precompile shader.
+ volatile unsigned int mIsPreCompileCancelled; ///< Whether we need to do precompile shader.
Dali::RenderSurfaceInterface* volatile mNewSurface; ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread).
Dali::RenderSurfaceInterface* volatile mDeletedSurface; ///< Will be set to the deleted surface if requested (set by the event-thread, read & cleared by the update-render thread).