2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/graphics/gles/egl-implementation.h>
22 #include <dali/integration-api/debug.h>
23 #include <dali/integration-api/trace.h>
24 #include <dali/public-api/common/dali-vector.h>
28 #include <dali/internal/graphics/gles/egl-debug.h>
29 #include <dali/internal/graphics/gles/gl-implementation.h>
30 #include <dali/public-api/dali-adaptor-common.h>
32 // EGL constants use C style casts
33 #pragma GCC diagnostic push
34 #pragma GCC diagnostic ignored "-Wold-style-cast"
38 const uint32_t THRESHOLD_SWAPBUFFER_COUNT = 5;
39 const uint32_t CHECK_EXTENSION_NUMBER = 4;
40 const uint32_t EGL_VERSION_SUPPORT_SURFACELESS_CONTEXT = 15;
41 const std::string EGL_KHR_SURFACELESS_CONTEXT = "EGL_KHR_surfaceless_context";
42 const std::string EGL_KHR_CREATE_CONTEXT = "EGL_KHR_create_context";
43 const std::string EGL_KHR_PARTIAL_UPDATE = "EGL_KHR_partial_update";
44 const std::string EGL_KHR_SWAP_BUFFERS_WITH_DAMAGE = "EGL_KHR_swap_buffers_with_damage";
46 DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_EGL, true);
55 #define TEST_EGL_ERROR(lastCommand) \
57 EGLint err = eglGetError(); \
58 if(err != EGL_SUCCESS) \
60 DALI_LOG_ERROR("EGL error after %s\n", lastCommand); \
61 Egl::PrintError(err); \
62 DALI_ASSERT_ALWAYS(0 && "EGL error"); \
66 EglImplementation::EglImplementation(int multiSamplingLevel,
67 Integration::DepthBufferAvailable depthBufferRequired,
68 Integration::StencilBufferAvailable stencilBufferRequired,
69 Integration::PartialUpdateAvailable partialUpdateRequired)
73 mCurrentEglNativePixmap(0),
77 mCurrentEglSurface(0),
78 mCurrentEglContext(EGL_NO_CONTEXT),
79 mMultiSamplingLevel(multiSamplingLevel),
81 mColorDepth(COLOR_DEPTH_24),
82 mGlesInitialized(false),
85 mDepthBufferRequired(depthBufferRequired == Integration::DepthBufferAvailable::TRUE),
86 mStencilBufferRequired(stencilBufferRequired == Integration::StencilBufferAvailable::TRUE),
87 mPartialUpdateRequired(partialUpdateRequired == Integration::PartialUpdateAvailable::TRUE),
88 mIsSurfacelessContextSupported(false),
89 mIsKhrCreateContextSupported(false),
90 mSwapBufferCountAfterResume(0),
91 mEglSetDamageRegionKHR(0),
92 mEglSwapBuffersWithDamageKHR(0)
96 EglImplementation::~EglImplementation()
101 bool EglImplementation::InitializeGles(EGLNativeDisplayType display, bool isOwnSurface)
103 if(!mGlesInitialized)
105 mEglNativeDisplay = display;
107 // Try to get the display connection for the native display first
108 mEglDisplay = eglGetDisplay(mEglNativeDisplay);
110 if(mEglDisplay == EGL_NO_DISPLAY)
112 // If failed, try to get the default display connection
113 mEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
116 if(mEglDisplay == EGL_NO_DISPLAY)
118 // Still failed to get a display connection
119 throw Dali::DaliException("", "OpenGL ES is not supported");
122 EGLint majorVersion = 0;
123 EGLint minorVersion = 0;
124 if(!eglInitialize(mEglDisplay, &majorVersion, &minorVersion))
128 eglBindAPI(EGL_OPENGL_ES_API);
130 mIsOwnSurface = isOwnSurface;
133 const char* const versionStr = eglQueryString(mEglDisplay, EGL_VERSION);
134 const char* const extensionStr = eglQueryString(mEglDisplay, EGL_EXTENSIONS);
136 // Query EGL extensions to check whether required extensions are supported
137 std::istringstream versionStream(versionStr);
138 std::string majorVersion, minorVersion;
139 std::getline(versionStream, majorVersion, '.');
140 std::getline(versionStream, minorVersion);
141 uint32_t extensionCheckCount = 0;
142 if(stoul(majorVersion) * 10 + stoul(minorVersion) >= EGL_VERSION_SUPPORT_SURFACELESS_CONTEXT)
144 mIsSurfacelessContextSupported = true;
145 mIsKhrCreateContextSupported = true;
146 extensionCheckCount += 2;
149 std::istringstream stream(extensionStr);
150 std::string currentExtension;
151 bool isKhrPartialUpdateSupported = false;
152 bool isKhrSwapBuffersWithDamageSupported = false;
153 while(std::getline(stream, currentExtension, ' ') && extensionCheckCount < CHECK_EXTENSION_NUMBER)
155 if(currentExtension == EGL_KHR_SURFACELESS_CONTEXT && !mIsSurfacelessContextSupported)
157 mIsSurfacelessContextSupported = true;
158 extensionCheckCount++;
160 if(currentExtension == EGL_KHR_CREATE_CONTEXT && !mIsKhrCreateContextSupported)
162 mIsKhrCreateContextSupported = true;
163 extensionCheckCount++;
165 if(currentExtension == EGL_KHR_PARTIAL_UPDATE)
167 isKhrPartialUpdateSupported = true;
168 extensionCheckCount++;
170 if(currentExtension == EGL_KHR_SWAP_BUFFERS_WITH_DAMAGE)
172 isKhrSwapBuffersWithDamageSupported = true;
173 extensionCheckCount++;
177 if(!isKhrPartialUpdateSupported || !isKhrSwapBuffersWithDamageSupported)
179 mPartialUpdateRequired = false;
182 mGlesInitialized = true;
184 // We want to display this information all the time, so use the LogMessage directly
185 Integration::Log::LogMessage(Integration::Log::DebugInfo,
187 " PartialUpdate %d\n"
192 mPartialUpdateRequired,
193 eglQueryString(mEglDisplay, EGL_VENDOR),
195 eglQueryString(mEglDisplay, EGL_CLIENT_APIS),
198 return mGlesInitialized;
201 bool EglImplementation::CreateContext()
203 // make sure a context isn't created twice
204 DALI_ASSERT_ALWAYS((mEglContext == 0) && "EGL context recreated");
206 mEglContext = eglCreateContext(mEglDisplay, mEglConfig, NULL, &(mContextAttribs[0]));
207 TEST_EGL_ERROR("eglCreateContext render thread");
209 DALI_ASSERT_ALWAYS(EGL_NO_CONTEXT != mEglContext && "EGL context not created");
211 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VENDOR : %s ***\n", glGetString(GL_VENDOR));
212 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_RENDERER : %s ***\n", glGetString(GL_RENDERER));
213 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VERSION : %s ***\n", glGetString(GL_VERSION));
214 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_SHADING_LANGUAGE_VERSION : %s***\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
215 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** Supported Extensions ***\n%s\n\n", glGetString(GL_EXTENSIONS));
217 mEglSetDamageRegionKHR = reinterpret_cast<PFNEGLSETDAMAGEREGIONKHRPROC>(eglGetProcAddress("eglSetDamageRegionKHR"));
218 if(!mEglSetDamageRegionKHR)
220 DALI_LOG_ERROR("Coudn't find eglSetDamageRegionKHR!\n");
221 mPartialUpdateRequired = false;
223 mEglSwapBuffersWithDamageKHR = reinterpret_cast<PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC>(eglGetProcAddress("eglSwapBuffersWithDamageKHR"));
224 if(!mEglSwapBuffersWithDamageKHR)
226 DALI_LOG_ERROR("Coudn't find eglSwapBuffersWithDamageKHR!\n");
227 mPartialUpdateRequired = false;
232 bool EglImplementation::CreateWindowContext(EGLContext& eglContext)
234 // make sure a context isn't created twice
235 DALI_ASSERT_ALWAYS((eglContext == 0) && "EGL context recreated");
237 eglContext = eglCreateContext(mEglDisplay, mEglConfig, mEglContext, &(mContextAttribs[0]));
238 TEST_EGL_ERROR("eglCreateContext render thread");
240 DALI_ASSERT_ALWAYS(EGL_NO_CONTEXT != eglContext && "EGL context not created");
242 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VENDOR : %s ***\n", glGetString(GL_VENDOR));
243 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_RENDERER : %s ***\n", glGetString(GL_RENDERER));
244 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VERSION : %s ***\n", glGetString(GL_VERSION));
245 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_SHADING_LANGUAGE_VERSION : %s***\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
246 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** Supported Extensions ***\n%s\n\n", glGetString(GL_EXTENSIONS));
248 mEglWindowContexts.push_back(eglContext);
250 mEglSetDamageRegionKHR = reinterpret_cast<PFNEGLSETDAMAGEREGIONKHRPROC>(eglGetProcAddress("eglSetDamageRegionKHR"));
251 if(!mEglSetDamageRegionKHR)
253 DALI_LOG_ERROR("Coudn't find eglSetDamageRegionKHR!\n");
254 mPartialUpdateRequired = false;
256 mEglSwapBuffersWithDamageKHR = reinterpret_cast<PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC>(eglGetProcAddress("eglSwapBuffersWithDamageKHR"));
257 if(!mEglSwapBuffersWithDamageKHR)
259 DALI_LOG_ERROR("Coudn't find eglSwapBuffersWithDamageKHR!\n");
260 mPartialUpdateRequired = false;
265 void EglImplementation::DestroyContext(EGLContext& eglContext)
269 eglDestroyContext(mEglDisplay, eglContext);
274 void EglImplementation::DestroySurface(EGLSurface& eglSurface)
276 if(mIsOwnSurface && eglSurface)
278 // Make context null to prevent crash in driver side
280 eglDestroySurface(mEglDisplay, eglSurface);
285 void EglImplementation::MakeContextCurrent(EGLSurface eglSurface, EGLContext eglContext)
287 if(mCurrentEglContext == eglContext)
292 mCurrentEglSurface = eglSurface;
296 eglMakeCurrent(mEglDisplay, eglSurface, eglSurface, eglContext);
298 mCurrentEglContext = eglContext;
301 EGLint error = eglGetError();
303 if(error != EGL_SUCCESS)
305 Egl::PrintError(error);
307 DALI_ASSERT_ALWAYS(false && "MakeContextCurrent failed!");
311 void EglImplementation::MakeCurrent(EGLNativePixmapType pixmap, EGLSurface eglSurface)
313 if(mCurrentEglContext == mEglContext)
318 mCurrentEglNativePixmap = pixmap;
319 mCurrentEglSurface = eglSurface;
323 eglMakeCurrent(mEglDisplay, eglSurface, eglSurface, mEglContext);
325 mCurrentEglContext = mEglContext;
328 EGLint error = eglGetError();
330 if(error != EGL_SUCCESS)
332 Egl::PrintError(error);
334 DALI_ASSERT_ALWAYS(false && "MakeCurrent failed!");
338 void EglImplementation::MakeContextNull()
340 // clear the current context
341 eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
342 mCurrentEglContext = EGL_NO_CONTEXT;
345 void EglImplementation::TerminateGles()
349 // Make context null to prevent crash in driver side
352 for(auto eglSurface : mEglWindowSurfaces)
354 if(mIsOwnSurface && eglSurface)
356 eglDestroySurface(mEglDisplay, eglSurface);
359 eglDestroyContext(mEglDisplay, mEglContext);
360 for(auto eglContext : mEglWindowContexts)
362 eglDestroyContext(mEglDisplay, eglContext);
365 eglTerminate(mEglDisplay);
370 mCurrentEglSurface = NULL;
371 mCurrentEglContext = EGL_NO_CONTEXT;
373 mGlesInitialized = false;
377 bool EglImplementation::IsGlesInitialized() const
379 return mGlesInitialized;
382 void EglImplementation::SwapBuffers(EGLSurface& eglSurface)
384 if(eglSurface != EGL_NO_SURFACE) // skip if using surfaceless context
386 #ifndef DALI_PROFILE_UBUNTU
387 if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
389 DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffers started. eglSurface(%p)\n", eglSurface);
390 DALI_TRACE_BEGIN(gTraceFilter, "DALI_EGL_SWAP_BUFFERS");
392 #endif //DALI_PROFILE_UBUNTU
394 // DALI_LOG_ERROR("EglImplementation::SwapBuffers()\n");
395 eglSwapBuffers(mEglDisplay, eglSurface);
397 #ifndef DALI_PROFILE_UBUNTU
398 if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
400 DALI_TRACE_END(gTraceFilter, "DALI_EGL_SWAP_BUFFERS");
401 DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffers finished.\n");
402 mSwapBufferCountAfterResume++;
404 #endif //DALI_PROFILE_UBUNTU
408 EGLint EglImplementation::GetBufferAge(EGLSurface& eglSurface) const
411 eglQuerySurface(mEglDisplay, eglSurface, EGL_BUFFER_AGE_EXT, &age);
414 DALI_LOG_ERROR("eglQuerySurface(%d)\n", eglGetError());
418 // 0 - invalid buffer
422 DALI_LOG_ERROR("EglImplementation::GetBufferAge() buffer age %d > 3\n", age);
423 age = 0; // shoudn't be more than 3 back buffers, if there is just reset, I don't want to add extra history level
429 void EglImplementation::SetDamageRegion(EGLSurface& eglSurface, std::vector<Rect<int>>& damagedRects)
431 if(!mPartialUpdateRequired)
436 if(eglSurface != EGL_NO_SURFACE) // skip if using surfaceless context
438 EGLBoolean result = mEglSetDamageRegionKHR(mEglDisplay, eglSurface, reinterpret_cast<int*>(damagedRects.data()), 1);
439 if(result == EGL_FALSE)
441 DALI_LOG_ERROR("eglSetDamageRegionKHR(%d)\n", eglGetError());
446 void EglImplementation::SwapBuffers(EGLSurface& eglSurface, const std::vector<Rect<int>>& damagedRects)
448 if(eglSurface != EGL_NO_SURFACE) // skip if using surfaceless context
450 if(!mPartialUpdateRequired)
452 SwapBuffers(eglSurface);
456 #ifndef DALI_PROFILE_UBUNTU
457 if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
459 DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffersWithDamageKHR started. eglSurface(%p)\n", eglSurface);
460 DALI_TRACE_BEGIN(gTraceFilter, "DALI_EGL_SWAP_BUFFERS_KHR");
462 #endif //DALI_PROFILE_UBUNTU
464 EGLBoolean result = mEglSwapBuffersWithDamageKHR(mEglDisplay, eglSurface, reinterpret_cast<int*>(const_cast<std::vector<Rect<int>>&>(damagedRects).data()), damagedRects.size());
465 if(result == EGL_FALSE)
467 DALI_LOG_ERROR("eglSwapBuffersWithDamageKHR(%d)\n", eglGetError());
470 #ifndef DALI_PROFILE_UBUNTU
471 if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
473 DALI_TRACE_END(gTraceFilter, "DALI_EGL_SWAP_BUFFERS_KHR");
474 DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffersWithDamageKHR finished.\n");
475 mSwapBufferCountAfterResume++;
477 #endif //DALI_PROFILE_UBUNTU
481 void EglImplementation::CopyBuffers(EGLSurface& eglSurface)
483 eglCopyBuffers(mEglDisplay, eglSurface, mCurrentEglNativePixmap);
486 void EglImplementation::WaitGL()
491 bool EglImplementation::ChooseConfig(bool isWindowType, ColorDepth depth)
493 if(mEglConfig && isWindowType == mIsWindow && mColorDepth == depth)
499 mIsWindow = isWindowType;
502 Vector<EGLint> configAttribs;
503 configAttribs.Reserve(31);
507 configAttribs.PushBack(EGL_SURFACE_TYPE);
508 configAttribs.PushBack(EGL_WINDOW_BIT);
512 configAttribs.PushBack(EGL_SURFACE_TYPE);
513 configAttribs.PushBack(EGL_PIXMAP_BIT);
516 configAttribs.PushBack(EGL_RENDERABLE_TYPE);
518 if(mGlesVersion >= 30)
520 configAttribs.PushBack(EGL_OPENGL_ES3_BIT_KHR);
524 configAttribs.PushBack(EGL_OPENGL_ES2_BIT);
527 // TODO: enable this flag when it becomes supported
528 // configAttribs.PushBack( EGL_CONTEXT_FLAGS_KHR );
529 // configAttribs.PushBack( EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR );
531 configAttribs.PushBack(EGL_RED_SIZE);
532 configAttribs.PushBack(8);
533 configAttribs.PushBack(EGL_GREEN_SIZE);
534 configAttribs.PushBack(8);
535 configAttribs.PushBack(EGL_BLUE_SIZE);
536 configAttribs.PushBack(8);
538 // For underlay video playback, we also need to set the alpha value of the 24/32bit window.
539 // TODO: When the tbm queue of GlView is 24bit, do we have to set the alpha size??
540 configAttribs.PushBack(EGL_ALPHA_SIZE);
541 configAttribs.PushBack(8);
543 configAttribs.PushBack(EGL_DEPTH_SIZE);
544 configAttribs.PushBack(mDepthBufferRequired ? 24 : 0);
545 configAttribs.PushBack(EGL_STENCIL_SIZE);
546 configAttribs.PushBack(mStencilBufferRequired ? 8 : 0);
548 #ifndef DALI_PROFILE_UBUNTU
549 if(mMultiSamplingLevel != EGL_DONT_CARE)
551 configAttribs.PushBack(EGL_SAMPLES);
552 configAttribs.PushBack(mMultiSamplingLevel);
553 configAttribs.PushBack(EGL_SAMPLE_BUFFERS);
554 configAttribs.PushBack(1);
556 #endif // DALI_PROFILE_UBUNTU
557 configAttribs.PushBack(EGL_NONE);
559 // Ensure number of configs is set to 1 as on some drivers,
560 // eglChooseConfig succeeds but does not actually create a proper configuration.
561 if((eglChooseConfig(mEglDisplay, &(configAttribs[0]), &mEglConfig, 1, &numConfigs) != EGL_TRUE) ||
564 if(mGlesVersion >= 30)
567 DALI_LOG_ERROR("Fail to use OpenGL es 3.0. Retrying to use OpenGL es 2.0.");
573 DALI_LOG_ERROR("No configurations found.\n");
575 TEST_EGL_ERROR("eglChooseConfig");
578 EGLint error = eglGetError();
581 case EGL_BAD_DISPLAY:
583 DALI_LOG_ERROR("Display is not an EGL display connection\n");
586 case EGL_BAD_ATTRIBUTE:
588 DALI_LOG_ERROR("The parameter configAttribs contains an invalid frame buffer configuration attribute or an attribute value that is unrecognized or out of range\n");
591 case EGL_NOT_INITIALIZED:
593 DALI_LOG_ERROR("Display has not been initialized\n");
596 case EGL_BAD_PARAMETER:
598 DALI_LOG_ERROR("The parameter numConfig is NULL\n");
603 DALI_LOG_ERROR("Unknown error.\n");
606 DALI_ASSERT_ALWAYS(false && "eglChooseConfig failed!");
609 Integration::Log::LogMessage(Integration::Log::DebugInfo, "Using OpenGL es %d.%d.\n", mGlesVersion / 10, mGlesVersion % 10);
611 mContextAttribs.Clear();
612 if(mIsKhrCreateContextSupported)
614 mContextAttribs.Reserve(5);
615 mContextAttribs.PushBack(EGL_CONTEXT_MAJOR_VERSION_KHR);
616 mContextAttribs.PushBack(mGlesVersion / 10);
617 mContextAttribs.PushBack(EGL_CONTEXT_MINOR_VERSION_KHR);
618 mContextAttribs.PushBack(mGlesVersion % 10);
622 mContextAttribs.Reserve(3);
623 mContextAttribs.PushBack(EGL_CONTEXT_CLIENT_VERSION);
624 mContextAttribs.PushBack(mGlesVersion / 10);
626 mContextAttribs.PushBack(EGL_NONE);
631 EGLSurface EglImplementation::CreateSurfaceWindow(EGLNativeWindowType window, ColorDepth depth)
633 mEglNativeWindow = window;
638 ChooseConfig(mIsWindow, mColorDepth);
640 mCurrentEglSurface = eglCreateWindowSurface(mEglDisplay, mEglConfig, mEglNativeWindow, NULL);
641 TEST_EGL_ERROR("eglCreateWindowSurface");
643 DALI_ASSERT_ALWAYS(mCurrentEglSurface && "Create window surface failed");
645 return mCurrentEglSurface;
648 EGLSurface EglImplementation::CreateSurfacePixmap(EGLNativePixmapType pixmap, ColorDepth depth)
650 mCurrentEglNativePixmap = pixmap;
655 ChooseConfig(mIsWindow, mColorDepth);
657 mCurrentEglSurface = eglCreatePixmapSurface(mEglDisplay, mEglConfig, mCurrentEglNativePixmap, NULL);
658 TEST_EGL_ERROR("eglCreatePixmapSurface");
660 DALI_ASSERT_ALWAYS(mCurrentEglSurface && "Create pixmap surface failed");
662 return mCurrentEglSurface;
665 bool EglImplementation::ReplaceSurfaceWindow(EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext)
667 bool contextLost = false;
669 // display connection has not changed, then we can just create a new surface
670 // the surface is bound to the context, so set the context to null
675 // destroy the surface
676 DestroySurface(eglSurface);
679 // create the EGL surface
680 EGLSurface newEglSurface = CreateSurfaceWindow(window, mColorDepth);
682 // set the context to be current with the new surface
683 MakeContextCurrent(newEglSurface, eglContext);
688 bool EglImplementation::ReplaceSurfacePixmap(EGLNativePixmapType pixmap, EGLSurface& eglSurface)
690 bool contextLost = false;
692 // display connection has not changed, then we can just create a new surface
693 // create the EGL surface
694 eglSurface = CreateSurfacePixmap(pixmap, mColorDepth);
696 // set the eglSurface to be current
697 MakeCurrent(pixmap, eglSurface);
702 void EglImplementation::SetGlesVersion(const int32_t glesVersion)
704 mGlesVersion = glesVersion;
707 void EglImplementation::SetFirstFrameAfterResume()
709 mSwapBufferCountAfterResume = 0;
712 EGLDisplay EglImplementation::GetDisplay() const
717 EGLContext EglImplementation::GetContext() const
722 int32_t EglImplementation::GetGlesVersion() const
727 bool EglImplementation::IsSurfacelessContextSupported() const
729 return mIsSurfacelessContextSupported;
732 void EglImplementation::WaitClient()
734 // Wait for EGL to finish executing all rendering calls for the current context
735 if(eglWaitClient() != EGL_TRUE)
737 TEST_EGL_ERROR("eglWaitClient");
741 bool EglImplementation::IsPartialUpdateRequired() const
743 return mPartialUpdateRequired;
746 } // namespace Adaptor
748 } // namespace Internal
752 #pragma GCC diagnostic pop