mPartialUpdateRequired = false;
}
+ mLogThreshold = GetPerformanceLogThresholdTime();
+ mLogEnabled = mLogThreshold > 0 ? true : false;
+
mGlesInitialized = true;
// We want to display this information all the time, so use the LogMessage directly
{
if(eglSurface != EGL_NO_SURFACE) // skip if using surfaceless context
{
+ uint32_t startTime = 0, endTime = 0;
+ if(mLogEnabled)
+ {
+ startTime = TimeService::GetMilliSeconds();
+ }
+
#ifndef DALI_PROFILE_UBUNTU
if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
{
mSwapBufferCountAfterResume++;
}
#endif //DALI_PROFILE_UBUNTU
+
+ if(mLogEnabled)
+ {
+ endTime = TimeService::GetMilliSeconds();
+ if(endTime - startTime > mLogThreshold)
+ {
+ DALI_LOG_DEBUG_INFO("eglSwapBuffers takes long time! [%u ms]\n", endTime - startTime);
+ }
+ }
}
}
EGLint EglImplementation::GetBufferAge(EGLSurface& eglSurface) const
{
- static uint32_t logThreshold = GetPerformanceLogThresholdTime();
- static bool logEnabled = logThreshold > 0 ? true : false;
-
- uint32_t startTime, endTime;
- if(logEnabled)
+ uint32_t startTime = 0, endTime = 0;
+ if(mLogEnabled)
{
startTime = TimeService::GetMilliSeconds();
}
age = 0;
}
- if(logEnabled)
+ if(mLogEnabled)
{
endTime = TimeService::GetMilliSeconds();
- if(endTime - startTime > logThreshold)
+ if(endTime - startTime > mLogThreshold)
{
DALI_LOG_DEBUG_INFO("eglQuerySurface takes long time! [%u ms]\n", endTime - startTime);
}
return;
}
+ uint32_t startTime = 0, endTime = 0;
+ if(mLogEnabled)
+ {
+ startTime = TimeService::GetMilliSeconds();
+ }
+
#ifndef DALI_PROFILE_UBUNTU
if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
{
mSwapBufferCountAfterResume++;
}
#endif //DALI_PROFILE_UBUNTU
+
+ if(mLogEnabled)
+ {
+ endTime = TimeService::GetMilliSeconds();
+ if(endTime - startTime > mLogThreshold)
+ {
+ DALI_LOG_DEBUG_INFO("eglSwapBuffersWithDamageKHR takes long time! [%u ms]\n", endTime - startTime);
+ }
+ }
}
}
#define DALI_INTERNAL_EGL_IMPLEMENTATION_H
/*
- * 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.
typedef std::vector<EGLSurface> EglWindowSurfaceContainer;
EglWindowSurfaceContainer mEglWindowSurfaces; ///< The EGL surface for the window
- int32_t mMultiSamplingLevel;
- int32_t mGlesVersion;
+ int32_t mMultiSamplingLevel;
+ int32_t mGlesVersion;
+ uint32_t mLogThreshold{0};
ColorDepth mColorDepth;
bool mPartialUpdateRequired;
bool mIsSurfacelessContextSupported;
bool mIsKhrCreateContextSupported;
+ bool mLogEnabled{false};
uint32_t mSwapBufferCountAfterResume;
PFNEGLSETDAMAGEREGIONKHRPROC mEglSetDamageRegionKHR;
#include <memory>
// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
#include <dali/internal/graphics/gles/gl-extensions-support.h>
#include <dali/internal/graphics/gles/gles-abstraction.h>
#include <dali/internal/graphics/gles/gles2-implementation.h>
#include <dali/internal/graphics/gles/gles3-implementation.h>
+#include <dali/internal/system/common/time-service.h>
namespace Dali
{
static constexpr const char* OES_EGL_IMAGE_EXTERNAL_STRING_ESSL3 = "#extension GL_OES_EGL_image_external_essl3:require\n";
+// Threshold time in miliseconds
+constexpr auto PERFORMANCE_LOG_THRESHOLD_TIME_ENV = "DALI_EGL_PERFORMANCE_LOG_THRESHOLD_TIME";
+
+uint32_t GetPerformanceLogThresholdTime()
+{
+ auto timeString = Dali::EnvironmentVariable::GetEnvironmentVariable(PERFORMANCE_LOG_THRESHOLD_TIME_ENV);
+ uint32_t time = timeString ? static_cast<uint32_t>(std::atoi(timeString)) : 0u;
+ return time;
+}
+
} // namespace
/**
}
}
+ mLogThreshold = GetPerformanceLogThresholdTime();
+ mLogEnabled = mLogThreshold > 0 ? true : false;
+
{
ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
mIsContextCreated = true;
void Clear(GLbitfield mask) override
{
+ uint32_t startTime = 0, endTime = 0;
+ if(mLogEnabled)
+ {
+ startTime = TimeService::GetMilliSeconds();
+ }
+
glClear(mask);
+
+ if(mLogEnabled)
+ {
+ endTime = TimeService::GetMilliSeconds();
+ if(endTime - startTime > mLogThreshold)
+ {
+ DALI_LOG_DEBUG_INFO("glClear takes long time! [%u ms]\n", endTime - startTime);
+ }
+ }
}
void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) override
std::string mFragmentShaderPrefix;
int32_t mGlesVersion;
int32_t mShadingLanguageVersion;
+ uint32_t mLogThreshold{0};
bool mShadingLanguageVersionCached;
bool mIsSurfacelessContextSupported;
bool mIsContextCreated;
+ bool mLogEnabled{false};
};
} // namespace Adaptor