src/gui/egl/qeglproperties.cpp
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
    37 **
    37 **
    38 ** $QT_END_LICENSE$
    38 ** $QT_END_LICENSE$
    39 **
    39 **
    40 ****************************************************************************/
    40 ****************************************************************************/
    41 
    41 
    42 #include "qeglproperties_p.h"
       
    43 
       
    44 QT_BEGIN_NAMESPACE
       
    45 
       
    46 #include <QtCore/qdebug.h>
    42 #include <QtCore/qdebug.h>
    47 #include <QtCore/qstringlist.h>
    43 #include <QtCore/qstringlist.h>
       
    44 
       
    45 #include "qeglproperties_p.h"
       
    46 
       
    47 QT_BEGIN_NAMESPACE
    48 
    48 
    49 #include "qegl_p.h"
    49 #include "qegl_p.h"
    50 
    50 
    51 
    51 
    52 // Initialize a property block.
    52 // Initialize a property block.
    58 QEglProperties::QEglProperties(EGLConfig cfg)
    58 QEglProperties::QEglProperties(EGLConfig cfg)
    59 {
    59 {
    60     props.append(EGL_NONE);
    60     props.append(EGL_NONE);
    61     for (int name = 0x3020; name <= 0x304F; ++name) {
    61     for (int name = 0x3020; name <= 0x304F; ++name) {
    62         EGLint value;
    62         EGLint value;
    63         if (name != EGL_NONE && eglGetConfigAttrib(QEglContext::defaultDisplay(0), cfg, name, &value))
    63         if (name != EGL_NONE && eglGetConfigAttrib(QEglContext::display(), cfg, name, &value))
    64             setValue(name, value);
    64             setValue(name, value);
    65     }
    65     }
    66     eglGetError();  // Clear the error state.
    66     eglGetError();  // Clear the error state.
    67 }
    67 }
    68 
    68 
   271 }
   271 }
   272 
   272 
   273 void QEglProperties::dumpAllConfigs()
   273 void QEglProperties::dumpAllConfigs()
   274 {
   274 {
   275     EGLint count = 0;
   275     EGLint count = 0;
   276     eglGetConfigs(QEglContext::defaultDisplay(0), 0, 0, &count);
   276     eglGetConfigs(QEglContext::display(), 0, 0, &count);
   277     if (count < 1)
   277     if (count < 1)
   278         return;
   278         return;
   279 
   279 
   280     EGLConfig *configs = new EGLConfig [count];
   280     EGLConfig *configs = new EGLConfig [count];
   281     eglGetConfigs(QEglContext::defaultDisplay(0), configs, count, &count);
   281     eglGetConfigs(QEglContext::display(), configs, count, &count);
   282     for (EGLint index = 0; index < count; ++index)
   282     for (EGLint index = 0; index < count; ++index)
   283         qWarning() << QEglProperties(configs[index]).toString();
   283         qWarning() << QEglProperties(configs[index]).toString();
   284     delete [] configs;
   284     delete [] configs;
   285 }
   285 }
   286 
   286