#include <map>
#include <unordered_map>
+namespace
+{
+DALI_INIT_TIME_CHECKER_FILTER(gTimeCheckerFilter, DALI_EGL_PERFORMANCE_LOG_THRESHOLD_TIME);
+}
+
namespace Dali::Graphics::GLES
{
struct Context::Impl
void Context::PrepareForNativeRendering()
{
+ DALI_TIME_CHECKER_BEGIN(gTimeCheckerFilter);
+
// this should be pretty much constant
auto display = eglGetCurrentDisplay();
auto drawSurface = eglGetCurrentSurface(EGL_DRAW);
if(!mImpl->mNativeDrawContext)
{
EGLint configId{0u};
- eglQueryContext(display, mImpl->mController.GetSharedContext(), EGL_CONFIG_ID, &configId);
+
+ {
+ DALI_TIME_CHECKER_SCOPE(gTimeCheckerFilter, "eglQueryContext(Native)");
+ eglQueryContext(display, mImpl->mController.GetSharedContext(), EGL_CONFIG_ID, &configId);
+ }
EGLint configAttribs[3];
configAttribs[0] = EGL_CONFIG_ID;
EGLConfig config;
EGLint numConfigs;
- if(eglChooseConfig(display, configAttribs, &config, 1, &numConfigs) != EGL_TRUE)
{
- DALI_LOG_ERROR("eglChooseConfig failed!\n");
- return;
+ DALI_TIME_CHECKER_SCOPE(gTimeCheckerFilter, "eglChooseConfig(Native)");
+ if(eglChooseConfig(display, configAttribs, &config, 1, &numConfigs) != EGL_TRUE)
+ {
+ DALI_LOG_ERROR("eglChooseConfig failed!\n");
+ return;
+ }
}
auto version = int(mImpl->mController.GetGLESVersion());
attribs.push_back(version % 10);
attribs.push_back(EGL_NONE);
- mImpl->mNativeDrawContext = eglCreateContext(display, config, mImpl->mController.GetSharedContext(), attribs.data());
- if(mImpl->mNativeDrawContext == EGL_NO_CONTEXT)
{
- DALI_LOG_ERROR("eglCreateContext failed!\n");
- return;
+ DALI_TIME_CHECKER_SCOPE(gTimeCheckerFilter, "eglCreateContext(Native)");
+ mImpl->mNativeDrawContext = eglCreateContext(display, config, mImpl->mController.GetSharedContext(), attribs.data());
+ if(mImpl->mNativeDrawContext == EGL_NO_CONTEXT)
+ {
+ DALI_LOG_ERROR("eglCreateContext failed!\n");
+ return;
+ }
}
}
eglMakeCurrent(display, drawSurface, readSurface, mImpl->mNativeDrawContext);
- // make sure it's current window context
- eglMakeCurrent(display, mImpl->mCacheDrawWriteSurface, mImpl->mCacheDrawReadSurface, mImpl->mCacheEGLGraphicsContext);
+
+ DALI_TIME_CHECKER_END_WITH_MESSAGE(gTimeCheckerFilter, "PrepareForNativeRendering");
}
void Context::ResetGLESState()
void Context::RestoreFromNativeRendering()
{
+ DALI_TIME_CHECKER_SCOPE(gTimeCheckerFilter, "RestoreFromNativeRendering");
auto display = eglGetCurrentDisplay();
// bring back original context