/*
- * Copyright (c) 2022 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.
#include "dali/public-api/common/dali-common.h"
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/thread-settings.h>
#include <dali/integration-api/adaptor-framework/trigger-event-factory.h>
#include <dali/internal/adaptor/common/adaptor-internal-services.h>
#include <dali/internal/adaptor/common/combined-update-render-controller-debug.h>
#include <dali/internal/graphics/gles/egl-implementation.h>
#include <dali/internal/system/common/environment-options.h>
#include <dali/internal/system/common/time-service.h>
+#include <dali/internal/thread/common/thread-settings-impl.h>
#include <dali/internal/window-system/common/window-impl.h>
namespace Dali
mDefaultHalfFrameNanoseconds(0u),
mUpdateRequestCount(0u),
mRunning(FALSE),
+ mThreadId(0),
mThreadMode(threadMode),
mUpdateRenderRunCount(0),
mDestroyUpdateRenderThread(FALSE),
{
ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
- mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will resize the surface now
// Surface is resized and the surface resized count is increased.
mSurfaceResized++;
mUpdateRenderThreadWaitCondition.Notify(lock);
}
}
+int32_t CombinedUpdateRenderController::GetThreadId() const
+{
+ return mThreadId;
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
// EVENT THREAD
///////////////////////////////////////////////////////////////////////////////////////////////////
void CombinedUpdateRenderController::UpdateRenderThread()
{
- SetThreadName("RenderThread\0");
+ ThreadSettings::SetThreadName("RenderThread\0");
+ mThreadId = ThreadSettings::GetThreadId();
// Install a function for logging
mEnvironmentOptions.InstallLogFunction();
{
LOG_UPDATE_RENDER_TRACE;
+ // For thread safe
+ bool uploadOnly = mUploadWithoutRendering;
+ unsigned int surfaceResized = mSurfaceResized;
+ Dali::RenderSurfaceInterface* deletedSurface = ShouldSurfaceBeDeleted();
+
// Performance statistics are logged upon a VSYNC tick so use this point for a VSync marker
AddPerformanceMarker(PerformanceInterface::VSYNC);
nextFrameTime,
updateStatus,
renderToFboEnabled,
- isRenderingToFbo);
+ isRenderingToFbo,
+ uploadOnly);
TRACE_UPDATE_RENDER_END("DALI_UPDATE");
AddPerformanceMarker(PerformanceInterface::UPDATE_END);
TRACE_UPDATE_RENDER_BEGIN("DALI_RENDER");
// Upload shared resources
- mCore.PreRender(renderStatus, mForceClear, mUploadWithoutRendering);
+ mCore.PreRender(renderStatus, mForceClear);
- if(!mUploadWithoutRendering)
+ if(!uploadOnly || surfaceResized)
{
// Go through each window
WindowContainer windows;
mAdaptorInterfaces.GetWindowContainerInterface(windows);
- bool sceneSurfaceResized;
-
for(auto&& window : windows)
{
Dali::Integration::Scene scene = window->GetScene();
{
Integration::RenderStatus windowRenderStatus;
- // Get Surface Resized flag
- sceneSurfaceResized = scene.IsSurfaceRectChanged();
- windowSurface->SetIsResizing(sceneSurfaceResized);
+ const bool sceneSurfaceResized = scene.IsSurfaceRectChanged();
// clear previous frame damaged render items rects, buffer history is tracked on surface level
mDamagedRects.clear();
}
}
- if(!mUploadWithoutRendering)
+ if(!uploadOnly)
{
graphics.PostRender();
}
- mCore.PostRender(mUploadWithoutRendering);
+ mCore.PostRender();
//////////////////////////////
// DELETE SURFACE
//////////////////////////////
-
- Dali::RenderSurfaceInterface* deletedSurface = ShouldSurfaceBeDeleted();
if(DALI_UNLIKELY(deletedSurface))
{
LOG_UPDATE_RENDER_TRACE_FMT("Deleting Surface");