summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łoś <[email protected]>2024-10-01 15:34:10 +0200
committerMichał Łoś <[email protected]>2024-10-15 14:21:46 +0200
commit994321c4a87b4517a6a6f0a39fbf404eccc4632b (patch)
treed83c333d9ac844197449b400d8380ea405810f2a
parent83bdc60067fc08970f677b80e59a25791f0a885a (diff)
Clear VxWorks MESA display artifacts on startup
This cherry-pick is a preparatory change as eglfs is not yet enabled on Intel VxWorks. Cherry-picked commit e39f3ebba61acddea2e6dfe6e9506ce0441bfd8b Author: Cliff Bilbrey <[email protected]> Date: Fri Jun 9 13:56:14 2023 -0500 Display artifacts are sometimes seen at startup in VxWorks applications that make use of the MESA OpenGL libraries. This issue has been demonstrated in the Wind River MESA OpenGL demos, which use the same technique incorporated here to mask the problem. Cyling through the complete set of framebuffers and clearing each during the initialization process creates a clean slate that prevents the artifacts from being noticeable to the end user. Task-number: QTBUG-115777 Change-Id: Ifce9074eac687c002c215c531ddff1443a4df6a0 Reviewed-by: Laszlo Agocs <[email protected]>
-rw-r--r--src/gui/opengl/platform/egl/qeglplatformcontext.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
index 0a6e83e875e..e1bf056d655 100644
--- a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
+++ b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
@@ -378,6 +378,21 @@ bool QEGLPlatformContext::makeCurrent(QPlatformSurface *surface)
if (eglSurface != EGL_NO_SURFACE) // skip if using surfaceless context
eglSwapInterval(eglDisplay(), m_swapInterval);
}
+#if defined(Q_OS_VXWORKS) && defined(Q_PROCESSOR_X86_64)
+ // Clear set of framebuffers as workaround for display artifacts found
+ // in Wind River's Mesa OpenGL implementation
+ static bool firstWindow = true;
+ if (firstWindow && (QSurface::Window == surface->surface()->surfaceClass())) {
+ glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ swapBuffers(surface);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ swapBuffers(surface);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ swapBuffers(surface);
+ firstWindow = false;
+ }
+#endif
} else {
qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError());
}