src/gui/egl/qegl_qws.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
    40 ****************************************************************************/
    40 ****************************************************************************/
    41 
    41 
    42 #include <QtGui/qpaintdevice.h>
    42 #include <QtGui/qpaintdevice.h>
    43 #include <QtGui/qpixmap.h>
    43 #include <QtGui/qpixmap.h>
    44 #include <QtGui/qwidget.h>
    44 #include <QtGui/qwidget.h>
       
    45 
    45 #include "qegl_p.h"
    46 #include "qegl_p.h"
       
    47 #include "qeglcontext_p.h"
    46 
    48 
    47 #if !defined(QT_NO_EGL)
    49 #if !defined(QT_NO_EGL)
    48 
    50 
    49 #include <qscreen_qws.h>
    51 #include <qscreen_qws.h>
    50 #include <qscreenproxy_qws.h>
    52 #include <qscreenproxy_qws.h>
    51 #include <qapplication.h>
    53 #include <qapplication.h>
    52 #include <qdesktopwidget.h>
    54 #include <qdesktopwidget.h>
    53 
    55 
    54 QT_BEGIN_NAMESPACE
    56 QT_BEGIN_NAMESPACE
    55 
       
    56 // Create the surface for a QPixmap, QImage, or QWidget.
       
    57 // We don't have QGLScreen to create EGL surfaces for us,
       
    58 // so surface creation needs to be done in QtOpenGL or
       
    59 // QtOpenVG for Qt/Embedded.
       
    60 EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties *properties)
       
    61 {
       
    62     Q_UNUSED(device);
       
    63     Q_UNUSED(properties);
       
    64     return EGL_NO_SURFACE;
       
    65 }
       
    66 
    57 
    67 static QScreen *screenForDevice(QPaintDevice *device)
    58 static QScreen *screenForDevice(QPaintDevice *device)
    68 {
    59 {
    69     QScreen *screen = qt_screen;
    60     QScreen *screen = qt_screen;
    70     if (!screen)
    61     if (!screen)
    99         setPixelFormat(static_cast<QImage *>(dev)->format());
    90         setPixelFormat(static_cast<QImage *>(dev)->format());
   100     else
    91     else
   101         setPixelFormat(screen->pixelFormat());
    92         setPixelFormat(screen->pixelFormat());
   102 }
    93 }
   103 
    94 
       
    95 EGLNativeDisplayType QEgl::nativeDisplay()
       
    96 {
       
    97     return  EGLNativeDisplayType(EGL_DEFAULT_DISPLAY);
       
    98 }
       
    99 
       
   100 EGLNativeWindowType QEgl::nativeWindow(QWidget* widget)
       
   101 {
       
   102     return (EGLNativeWindowType)(widget->winId()); // Might work
       
   103 }
       
   104 
       
   105 EGLNativePixmapType QEgl::nativePixmap(QPixmap*)
       
   106 {
       
   107     qWarning("QEgl: EGL pixmap surfaces not supported on QWS");
       
   108     return (EGLNativePixmapType)0;
       
   109 }
       
   110 
       
   111 
   104 QT_END_NAMESPACE
   112 QT_END_NAMESPACE
   105 
   113 
   106 #endif // !QT_NO_EGL
   114 #endif // !QT_NO_EGL