src/gui/egl/qeglproperties.cpp
changeset 18 2f34d5167611
parent 3 41300fa6a67c
child 19 fcece45ef507
equal deleted inserted replaced
3:41300fa6a67c 18:2f34d5167611
     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 **
    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