Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/wayland/egl_wayland_backend.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 63 | { | |||
---|---|---|---|---|---|
65 | if (m_overlay) { | 65 | if (m_overlay) { | ||
66 | wl_egl_window_destroy(m_overlay); | 66 | wl_egl_window_destroy(m_overlay); | ||
67 | } | 67 | } | ||
68 | } | 68 | } | ||
69 | 69 | | |||
70 | bool EglWaylandBackend::initializeEgl() | 70 | bool EglWaylandBackend::initializeEgl() | ||
71 | { | 71 | { | ||
72 | initClientExtensions(); | 72 | initClientExtensions(); | ||
73 | EGLDisplay display = EGL_NO_DISPLAY; | 73 | EGLDisplay display = m_wayland->sceneEglDisplay(); | ||
74 | 74 | | |||
75 | // Use eglGetPlatformDisplayEXT() to get the display pointer | 75 | // Use eglGetPlatformDisplayEXT() to get the display pointer | ||
76 | // if the implementation supports it. | 76 | // if the implementation supports it. | ||
77 | if (display == EGL_NO_DISPLAY) { | ||||
77 | m_havePlatformBase = hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_base")); | 78 | m_havePlatformBase = hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_base")); | ||
78 | if (m_havePlatformBase) { | 79 | if (m_havePlatformBase) { | ||
79 | // Make sure that the wayland platform is supported | 80 | // Make sure that the wayland platform is supported | ||
80 | if (!hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_wayland"))) | 81 | if (!hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_wayland"))) | ||
81 | return false; | 82 | return false; | ||
82 | 83 | | |||
83 | display = eglGetPlatformDisplayEXT(EGL_PLATFORM_WAYLAND_EXT, m_wayland->display(), nullptr); | 84 | display = eglGetPlatformDisplayEXT(EGL_PLATFORM_WAYLAND_EXT, m_wayland->display(), nullptr); | ||
84 | } else { | 85 | } else { | ||
85 | display = eglGetDisplay(m_wayland->display()); | 86 | display = eglGetDisplay(m_wayland->display()); | ||
86 | } | 87 | } | ||
88 | } | ||||
87 | 89 | | |||
88 | if (display == EGL_NO_DISPLAY) | 90 | if (display == EGL_NO_DISPLAY) | ||
89 | return false; | 91 | return false; | ||
90 | setEglDisplay(display); | 92 | setEglDisplay(display); | ||
91 | return initEglAPI(); | 93 | return initEglAPI(); | ||
92 | } | 94 | } | ||
93 | 95 | | |||
94 | void EglWaylandBackend::init() | 96 | void EglWaylandBackend::init() | ||
▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines |