7#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
12#include <QtCore/QDebug>
14#include "wayland-brcm-client-protocol.h"
22 qDebug() <<
"Using Brcm-EGL";
25void QWaylandBrcmEglIntegration::wlDisplayHandleGlobal(
void *data,
struct ::wl_registry *registry, uint32_t id,
const QString &interface, uint32_t version)
28 if (interface ==
"qt_brcm") {
30 integration->m_waylandBrcm =
static_cast<
struct qt_brcm *>(wl_registry_bind(registry, id, &qt_brcm_interface, 1));
41 eglTerminate(m_eglDisplay);
46 m_display = waylandDisplay;
47 m_waylandDisplay = waylandDisplay->wl_display();
48 waylandDisplay->addRegistryListener(wlDisplayHandleGlobal,
this);
50 m_eglDisplay = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY);
51 if (m_eglDisplay == NULL) {
52 qWarning(
"EGL not available");
54 if (!eglInitialize(m_eglDisplay, &major, &minor)) {
55 qWarning(
"failed to initialize EGL display");
59 eglFlushBRCM = (PFNEGLFLUSHBRCMPROC)eglGetProcAddress(
"eglFlushBRCM");
61 qWarning(
"failed to resolve eglFlushBRCM, performance will suffer");
64 eglCreateGlobalImageBRCM = (PFNEGLCREATEGLOBALIMAGEBRCMPROC)eglGetProcAddress(
"eglCreateGlobalImageBRCM");
65 if (!eglCreateGlobalImageBRCM) {
66 qWarning(
"failed to resolve eglCreateGlobalImageBRCM");
70 eglDestroyGlobalImageBRCM = (PFNEGLDESTROYGLOBALIMAGEBRCMPROC)eglGetProcAddress(
"eglDestroyGlobalImageBRCM");
71 if (!eglDestroyGlobalImageBRCM) {
72 qWarning(
"failed to resolve eglDestroyGlobalImageBRCM");
80 return new QWaylandBrcmEglWindow(window, m_display);
90 return QEGLPlatformContext::createFrom<QWaylandBrcmGLContext>(context, contextDisplay, m_eglDisplay, shareContext);
EGLDisplay eglDisplay() const
QWaylandWindow * createEglWindow(QWindow *window)
struct qt_brcm * waylandBrcm() const
void * nativeResourceForContext(NativeResource resource, QPlatformOpenGLContext *context) override
QOpenGLContext * createOpenGLContext(EGLContext context, EGLDisplay contextDisplay, QOpenGLContext *shareContext) const override
void * nativeResource(NativeResource resource) override
QPlatformOpenGLContext * createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const override
~QWaylandBrcmEglIntegration()
void initialize(QWaylandDisplay *waylandDisplay) override
QWaylandBrcmEglIntegration()
EGLConfig eglConfig() const
EGLContext eglContext() const
Combined button and popup list for selecting options.