src/gui/egl/qegl_stub.cpp
changeset 23 89e065397ea6
child 30 5dc02b23752f
equal deleted inserted replaced
22:79de32ba3296 23:89e065397ea6
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the QtGui module of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #include <QtGui/qpaintdevice.h>
       
    43 #include <QtGui/qpixmap.h>
       
    44 #include <QtGui/qwidget.h>
       
    45 #include <QtCore/qdebug.h>
       
    46 
       
    47 #include "qegl_p.h"
       
    48 
       
    49 QT_BEGIN_NAMESPACE
       
    50 
       
    51 static void noegl(const char *fn)
       
    52 {
       
    53     qWarning() << fn << " called, but Qt configured without EGL" << endl;
       
    54 }
       
    55 
       
    56 #define NOEGL noegl(__FUNCTION__);
       
    57 
       
    58 EGLDisplay QEglContext::dpy = 0;
       
    59 
       
    60 QEglContext::QEglContext()
       
    61     : apiType(QEgl::OpenGL)
       
    62     , ctx(0)
       
    63     , cfg(0)
       
    64     , currentSurface(0)
       
    65     , current(false)
       
    66     , ownsContext(true)
       
    67     , sharing(false)
       
    68 {
       
    69     NOEGL
       
    70 }
       
    71 
       
    72 QEglContext::~QEglContext()
       
    73 {
       
    74     NOEGL
       
    75 }
       
    76 
       
    77 bool QEglContext::isValid() const
       
    78 {
       
    79     NOEGL
       
    80     return false;
       
    81 }
       
    82 
       
    83 bool QEglContext::isCurrent() const
       
    84 {
       
    85     NOEGL
       
    86     return false;
       
    87 }
       
    88 
       
    89 bool QEglContext::chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match)
       
    90 {
       
    91     Q_UNUSED(properties)
       
    92     Q_UNUSED(match)
       
    93     NOEGL
       
    94     return false;
       
    95 }
       
    96 
       
    97 EGLSurface QEglContext::createSurface(QPaintDevice* device, const QEglProperties *properties)
       
    98 {
       
    99     Q_UNUSED(device)
       
   100     Q_UNUSED(properties)
       
   101     NOEGL
       
   102     return 0;
       
   103 }
       
   104 
       
   105 
       
   106 // Create the EGLContext.
       
   107 bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties *properties)
       
   108 {
       
   109     Q_UNUSED(shareContext)
       
   110     Q_UNUSED(properties)
       
   111     NOEGL
       
   112     return false;
       
   113 }
       
   114 
       
   115 // Destroy an EGL surface object.  If it was current on this context
       
   116 // then call doneCurrent() for it first.
       
   117 void QEglContext::destroySurface(EGLSurface surface)
       
   118 {
       
   119     Q_UNUSED(surface)
       
   120     NOEGL
       
   121 }
       
   122 
       
   123 // Destroy the context.  Note: this does not destroy the surface.
       
   124 void QEglContext::destroyContext()
       
   125 {
       
   126     NOEGL
       
   127 }
       
   128 
       
   129 bool QEglContext::makeCurrent(EGLSurface surface)
       
   130 {
       
   131     Q_UNUSED(surface)
       
   132     NOEGL
       
   133     return false;
       
   134 }
       
   135 
       
   136 bool QEglContext::doneCurrent()
       
   137 {
       
   138     NOEGL
       
   139     return false;
       
   140 }
       
   141 
       
   142 // Act as though doneCurrent() was called, but keep the context
       
   143 // and the surface active for the moment.  This allows makeCurrent()
       
   144 // to skip a call to eglMakeCurrent() if we are using the same
       
   145 // surface as the last set of painting operations.  We leave the
       
   146 // currentContext() pointer as-is for now.
       
   147 bool QEglContext::lazyDoneCurrent()
       
   148 {
       
   149     NOEGL
       
   150     return false;
       
   151 }
       
   152 
       
   153 bool QEglContext::swapBuffers(EGLSurface surface)
       
   154 {
       
   155     Q_UNUSED(surface)
       
   156     NOEGL
       
   157     return false;
       
   158 }
       
   159 
       
   160 bool QEglContext::configAttrib(int name, EGLint *value) const
       
   161 {
       
   162     Q_UNUSED(name)
       
   163     Q_UNUSED(value)
       
   164     NOEGL
       
   165     return false;
       
   166 }
       
   167 
       
   168 void QEglContext::clearError()
       
   169 {
       
   170     NOEGL
       
   171     return;
       
   172 }
       
   173 
       
   174 EGLint QEglContext::error()
       
   175 {
       
   176     NOEGL
       
   177     return 0;
       
   178 }
       
   179 
       
   180 EGLDisplay QEglContext::display()
       
   181 {
       
   182     NOEGL
       
   183     return 0;
       
   184 }
       
   185 
       
   186 // Return the error string associated with a specific code.
       
   187 QString QEglContext::errorString(EGLint code)
       
   188 {
       
   189     Q_UNUSED(code)
       
   190     NOEGL
       
   191     return QString();
       
   192 }
       
   193 
       
   194 // Dump all of the EGL configurations supported by the system.
       
   195 void QEglContext::dumpAllConfigs()
       
   196 {
       
   197     NOEGL
       
   198 }
       
   199 
       
   200 QString QEglContext::extensions()
       
   201 {
       
   202     NOEGL
       
   203     return QString();
       
   204 }
       
   205 
       
   206 bool QEglContext::hasExtension(const char* extensionName)
       
   207 {
       
   208     Q_UNUSED(extensionName)
       
   209     NOEGL
       
   210     return false;
       
   211 }
       
   212 
       
   213 QEglContext *QEglContext::currentContext(QEgl::API api)
       
   214 {
       
   215     Q_UNUSED(api)
       
   216     NOEGL
       
   217     return false;
       
   218 }
       
   219 
       
   220 void QEglContext::setCurrentContext(QEgl::API api, QEglContext *context)
       
   221 {
       
   222     Q_UNUSED(api)
       
   223     Q_UNUSED(context)
       
   224     NOEGL
       
   225 }
       
   226 
       
   227 EGLNativeDisplayType QEglContext::nativeDisplay()
       
   228 {
       
   229     NOEGL
       
   230     return 0;
       
   231 }
       
   232 
       
   233 void QEglContext::waitClient()
       
   234 {
       
   235     NOEGL
       
   236 }
       
   237 
       
   238 void QEglContext::waitNative()
       
   239 {
       
   240     NOEGL
       
   241 }
       
   242 
       
   243 QEglProperties QEglContext::configProperties(EGLConfig cfg) const
       
   244 {
       
   245     Q_UNUSED(cfg)
       
   246     NOEGL
       
   247     return QEglProperties();
       
   248 }
       
   249 
       
   250 QT_END_NAMESPACE