src/gui/egl/qegl_symbian.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
equal deleted inserted replaced
6:dee5afe5301f 7:3f74d0d4af4c
    76         props = properties->properties();
    76         props = properties->properties();
    77     else
    77     else
    78         props = 0;
    78         props = 0;
    79     EGLSurface surf;
    79     EGLSurface surf;
    80     if (devType == QInternal::Widget)
    80     if (devType == QInternal::Widget)
    81         surf = eglCreateWindowSurface(dpy, cfg, windowDrawable, 0);
    81         surf = eglCreateWindowSurface(dpy, cfg, windowDrawable, props);
    82     else
    82     else
    83         surf = eglCreatePixmapSurface(dpy, cfg, pixmapDrawable, 0);
    83         surf = eglCreatePixmapSurface(dpy, cfg, pixmapDrawable, props);
    84     if (surf == EGL_NO_SURFACE)
    84     if (surf == EGL_NO_SURFACE)
    85         qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
    85         qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
    86     return surf;
    86     return surf;
    87 }
       
    88 
       
    89 EGLDisplay QEglContext::getDisplay(QPaintDevice *device)
       
    90 {
       
    91     EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
       
    92     if (dpy == EGL_NO_DISPLAY)
       
    93         qWarning("QEglContext::defaultDisplay(): Falling back to EGL_DEFAULT_DISPLAY");
       
    94     return dpy;
       
    95 }
    87 }
    96 
    88 
    97 // Set pixel format and other properties based on a paint device.
    89 // Set pixel format and other properties based on a paint device.
    98 void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev)
    90 void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev)
    99 {
    91 {
   102 
    94 
   103     int devType = dev->devType();
    95     int devType = dev->devType();
   104     if (devType == QInternal::Image)
    96     if (devType == QInternal::Image)
   105         setPixelFormat(static_cast<QImage *>(dev)->format());
    97         setPixelFormat(static_cast<QImage *>(dev)->format());
   106     else
    98     else
   107         setPixelFormat(QImage::Format_RGB32);
    99         setPixelFormat(QImage::Format_ARGB32);
   108 }
   100 }
   109 
   101 
   110 
   102 
   111 QT_END_NAMESPACE
   103 QT_END_NAMESPACE