22QEGLPbuffer::QEGLPbuffer(EGLDisplay display,
const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface,
23 QEGLPlatformContext::Flags flags)
24 : QPlatformOffscreenSurface(offscreenSurface)
27 , m_pbuffer(EGL_NO_SURFACE)
29 m_hasSurfaceless = !flags.testFlag(QEGLPlatformContext::NoSurfaceless)
30 && q_hasEglExtension(display,
"EGL_KHR_surfaceless_context");
35 EGLConfig config = q_configFromGLFormat(m_display, m_format,
false, EGL_PBUFFER_BIT);
38 const EGLint attributes[] = {
39 EGL_WIDTH, offscreenSurface->size().width(),
40 EGL_HEIGHT, offscreenSurface->size().height(),
41 EGL_LARGEST_PBUFFER, EGL_FALSE,
45 m_pbuffer = eglCreatePbufferSurface(m_display, config, attributes);
47 if (m_pbuffer != EGL_NO_SURFACE)
48 m_format = q_glFormatFromConfig(m_display, config);