src/opengl/qglpixelbuffer_egl.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
equal deleted inserted replaced
6:dee5afe5301f 7:3f74d0d4af4c
    62 bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidget *shareWidget)
    62 bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidget *shareWidget)
    63 {
    63 {
    64     // Create the EGL context.
    64     // Create the EGL context.
    65     ctx = new QEglContext();
    65     ctx = new QEglContext();
    66     ctx->setApi(QEgl::OpenGL);
    66     ctx->setApi(QEgl::OpenGL);
    67 
       
    68     // Open the EGL display.
       
    69     if (!ctx->openDisplay(0)) {
       
    70         delete ctx;
       
    71         ctx = 0;
       
    72         return false;
       
    73     }
       
    74 
    67 
    75     // Find the shared context.
    68     // Find the shared context.
    76     QEglContext *shareContext = 0;
    69     QEglContext *shareContext = 0;
    77     if (shareWidget && shareWidget->d_func()->glcx)
    70     if (shareWidget && shareWidget->d_func()->glcx)
    78         shareContext = shareWidget->d_func()->glcx->d_func()->eglContext;
    71         shareContext = shareWidget->d_func()->glcx->d_func()->eglContext;
   213 }
   206 }
   214 
   207 
   215 bool QGLPixelBuffer::hasOpenGLPbuffers()
   208 bool QGLPixelBuffer::hasOpenGLPbuffers()
   216 {
   209 {
   217     // See if we have at least 1 configuration that matches the default format.
   210     // See if we have at least 1 configuration that matches the default format.
   218     EGLDisplay dpy = QEglContext::defaultDisplay(0);
   211     EGLDisplay dpy = QEglContext::display();
   219     if (dpy == EGL_NO_DISPLAY)
   212     if (dpy == EGL_NO_DISPLAY)
   220         return false;
   213         return false;
   221     QEglProperties configProps;
   214     QEglProperties configProps;
   222     qt_egl_set_format(configProps, QInternal::Pbuffer, QGLFormat::defaultFormat());
   215     qt_egl_set_format(configProps, QInternal::Pbuffer, QGLFormat::defaultFormat());
   223     configProps.setRenderableType(QEgl::OpenGL);
   216     configProps.setRenderableType(QEgl::OpenGL);