Qt 4.8
Enumerations | Functions
QEgl Namespace Reference

Enumerations

enum  API { OpenGL, OpenVG }
 
enum  ConfigOption { NoOptions = 0, Translucent = 0x01, Renderable = 0x02 }
 
enum  PixelFormatMatch { ExactPixelFormat, BestPixelFormat }
 

Functions

Q_GUI_EXPORT EGLConfig chooseConfig (const QEglProperties *configAttribs, QEgl::PixelFormatMatch match=QEgl::ExactPixelFormat)
 
Q_GUI_EXPORT EGLSurface createSurface (QPaintDevice *device, EGLConfig cfg, const QEglProperties *surfaceAttribs=0)
 
Q_GUI_EXPORT EGLConfig defaultConfig (int devType, API api, ConfigOptions options)
 
Q_GUI_EXPORT EGLDisplay display ()
 
Q_GUI_EXPORT void dumpAllConfigs ()
 
Q_GUI_EXPORT EGLImageKHR eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
 
Q_GUI_EXPORT EGLBoolean eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR img)
 
Q_GUI_EXPORT EGLBoolean eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint count, const EGLint *rects)
 
Q_GUI_EXPORT QString errorString (EGLint code=eglGetError())
 
Q_GUI_EXPORT QString extensions ()
 
Q_GUI_EXPORT VisualID getCompatibleVisualId (EGLConfig config)
 
Q_GUI_EXPORT bool hasExtension (const char *extensionName)
 
Q_GUI_EXPORT EGLNativeDisplayType nativeDisplay ()
 
Q_GUI_EXPORT EGLNativePixmapType nativePixmap (QPixmap *)
 
Q_GUI_EXPORT EGLNativeWindowType nativeWindow (QWidget *)
 

Enumeration Type Documentation

◆ API

enum QEgl::API
Enumerator
OpenGL 
OpenVG 

Definition at line 190 of file qegl_p.h.

191  {
192  OpenGL,
193  OpenVG
194  };

◆ ConfigOption

Enumerator
NoOptions 
Translucent 
Renderable 

Definition at line 202 of file qegl_p.h.

203  {
204  NoOptions = 0,
205  Translucent = 0x01,
206  Renderable = 0x02 // Config will be compatable with the paint engines (VG or GL)
207  };

◆ PixelFormatMatch

Enumerator
ExactPixelFormat 
BestPixelFormat 

Definition at line 196 of file qegl_p.h.

Function Documentation

◆ chooseConfig()

EGLConfig QEgl::chooseConfig ( const QEglProperties configAttribs,
QEgl::PixelFormatMatch  match = QEgl::ExactPixelFormat 
)

Definition at line 288 of file qegl.cpp.

Referenced by QEglContext::chooseConfig(), and QEglContext::setApi().

289 {
290  QEglProperties props(*properties);
291  EGLConfig cfg = QEGL_NO_CONFIG;
292  do {
293  // Get the number of matching configurations for this set of properties.
294  EGLint matching = 0;
295  EGLDisplay dpy = QEgl::display();
296  if (!eglChooseConfig(dpy, props.properties(), 0, 0, &matching) || !matching)
297  continue;
298 
299  // If we want the best pixel format, then return the first
300  // matching configuration.
301  if (match == QEgl::BestPixelFormat) {
302  eglChooseConfig(display(), props.properties(), &cfg, 1, &matching);
303  if (matching < 1)
304  continue;
305  return cfg;
306  }
307 
308  // Fetch all of the matching configurations and find the
309  // first that matches the pixel format we wanted.
310  EGLint size = matching;
311  EGLConfig *configs = new EGLConfig [size];
312  eglChooseConfig(display(), props.properties(), configs, size, &matching);
313  for (EGLint index = 0; index < size; ++index) {
314  EGLint red, green, blue, alpha;
315  eglGetConfigAttrib(display(), configs[index], EGL_RED_SIZE, &red);
316  eglGetConfigAttrib(display(), configs[index], EGL_GREEN_SIZE, &green);
317  eglGetConfigAttrib(display(), configs[index], EGL_BLUE_SIZE, &blue);
318  eglGetConfigAttrib(display(), configs[index], EGL_ALPHA_SIZE, &alpha);
319  if (red == props.value(EGL_RED_SIZE) &&
320  green == props.value(EGL_GREEN_SIZE) &&
321  blue == props.value(EGL_BLUE_SIZE) &&
322  (props.value(EGL_ALPHA_SIZE) == 0 ||
323  alpha == props.value(EGL_ALPHA_SIZE))) {
324  cfg = configs[index];
325  delete [] configs;
326  return cfg;
327  }
328  }
329  delete [] configs;
330  } while (props.reduceConfiguration());
331 
332 #ifdef EGL_BIND_TO_TEXTURE_RGBA
333  // Don't report an error just yet if we failed to get a pbuffer
334  // configuration with texture rendering. Only report failure if
335  // we cannot get any pbuffer configurations at all.
336  if (props.value(EGL_BIND_TO_TEXTURE_RGBA) == EGL_DONT_CARE &&
337  props.value(EGL_BIND_TO_TEXTURE_RGB) == EGL_DONT_CARE)
338 #endif
339  {
340  qWarning() << "QEglContext::chooseConfig(): Could not find a suitable EGL configuration";
341  qWarning() << "Requested:" << props.toString();
342  qWarning() << "Available:";
344  }
345  return QEGL_NO_CONFIG;
346 }
static bool match(const uchar *found, const char *target, uint len)
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
Q_CORE_EXPORT void qWarning(const char *,...)
#define QEGL_NO_CONFIG
Definition: qegl_p.h:129
Q_GUI_EXPORT void dumpAllConfigs()
Definition: qegl.cpp:770
static const QCssKnownValue properties[NumProperties - 1]
Definition: qcssparser.cpp:67
quint16 index

◆ createSurface()

EGLSurface QEgl::createSurface ( QPaintDevice device,
EGLConfig  cfg,
const QEglProperties surfaceAttribs = 0 
)

Definition at line 333 of file qegl_x11.cpp.

Referenced by QX11GLPixmapData::beginPaint(), QScreen::colorCount(), QEglContext::createSurface(), eglSwapBuffersRegion2NOK(), QMeeGoLivePixmapData::getSurfaceForBackingPixmap(), QX11GLSharedContexts::QX11GLSharedContexts(), QEglContext::setApi(), PvrEglScreen::setMode(), and QWSWindow::shuttingDown().

334 {
335  int devType = device->devType();
336 
337  if (devType == QInternal::Pbuffer) {
338  // TODO
339  return EGL_NO_SURFACE;
340  }
341 
342  QX11PixmapData *x11PixmapData = 0;
343  if (devType == QInternal::Pixmap) {
344  QPixmapData *pmd = static_cast<QPixmap*>(device)->data_ptr().data();
345  if (pmd->classId() == QPixmapData::X11Class)
346  x11PixmapData = static_cast<QX11PixmapData*>(pmd);
347  else {
348  // TODO: Replace the pixmap's data with a new QX11PixmapData
349  qWarning("WARNING: Creating an EGL surface on a QPixmap is only supported for QX11PixmapData");
350  return EGL_NO_SURFACE;
351  }
352  } else if ((devType != QInternal::Widget) && (devType != QInternal::Pbuffer)) {
353  qWarning("WARNING: Creating an EGLSurface for device type %d isn't supported", devType);
354  return EGL_NO_SURFACE;
355  }
356 
357  VisualID visualId = QEgl::getCompatibleVisualId(config);
358  EGLint alphaSize;
359  eglGetConfigAttrib(QEgl::display(), config, EGL_ALPHA_SIZE, &alphaSize);
360 
361  if (devType == QInternal::Widget) {
362  QWidget *widget = static_cast<QWidget*>(device);
363 
364  VisualID currentVisualId = 0;
366  currentVisualId = XVisualIDFromVisual((Visual*)widget->x11Info().visual());
367 
368  if (currentVisualId != visualId) {
369  // The window is either not created or has the wrong visual. Either way, we need
370  // to create a window with the correct visual and call create() on the widget:
371 
372  bool visible = widget->isVisible();
373  if (visible)
374  widget->hide();
375 
376  XVisualInfo visualInfo;
377  visualInfo.visualid = visualId;
378  {
379  XVisualInfo *visualInfoPtr;
380  int matchingCount = 0;
381  visualInfoPtr = XGetVisualInfo(widget->x11Info().display(), VisualIDMask,
382  &visualInfo, &matchingCount);
383  Q_ASSERT(visualInfoPtr); // visualId really should be valid!
384  visualInfo = *visualInfoPtr;
385  XFree(visualInfoPtr);
386  }
387 
388  Window parentWindow = RootWindow(widget->x11Info().display(), widget->x11Info().screen());
389  if (widget->parentWidget())
390  parentWindow = widget->parentWidget()->winId();
391 
392  XSetWindowAttributes windowAttribs;
393  QColormap colmap = QColormap::instance(widget->x11Info().screen());
394  windowAttribs.background_pixel = colmap.pixel(widget->palette().color(widget->backgroundRole()));
395  windowAttribs.border_pixel = colmap.pixel(Qt::black);
396 
397  unsigned int valueMask = CWBackPixel|CWBorderPixel;
398  if (alphaSize > 0) {
399  windowAttribs.colormap = XCreateColormap(widget->x11Info().display(), parentWindow,
400  visualInfo.visual, AllocNone);
401  valueMask |= CWColormap;
402  }
403 
404  Window window = XCreateWindow(widget->x11Info().display(), parentWindow,
405  widget->x(), widget->y(), widget->width(), widget->height(),
406  0, visualInfo.depth, InputOutput, visualInfo.visual,
407  valueMask, &windowAttribs);
408 
409  // This is a nasty hack to get round the fact that we can't be a friend of QWidget:
410  qt_set_winid_on_widget(widget, window);
411 
412  if (visible)
413  widget->show();
414  }
415 
416  // At this point, the widget's window should be created and have the correct visual. Now we
417  // just need to create the EGL surface for it:
418  const int *props;
419  if (properties)
420  props = properties->properties();
421  else
422  props = 0;
423  EGLSurface surf = eglCreateWindowSurface(QEgl::display(), config, (EGLNativeWindowType)widget->winId(), props);
424  if (surf == EGL_NO_SURFACE)
425  qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
426  return surf;
427  }
428 
429  if (x11PixmapData) {
430  // X11 Pixmaps are only created with a depth, so that's all we need to check
431  EGLint configDepth;
432  eglGetConfigAttrib(QEgl::display(), config, EGL_BUFFER_SIZE , &configDepth);
433  if (x11PixmapData->depth() != configDepth) {
434  // The bit depths are wrong which means the EGLConfig isn't compatable with
435  // this pixmap. So we need to replace the pixmap's existing data with a new
436  // one which is created with the correct depth:
437 
438 #ifndef QT_NO_XRENDER
439  if (configDepth == 32) {
440  qWarning("Warning: EGLConfig's depth (32) != pixmap's depth (%d), converting to ARGB32",
441  x11PixmapData->depth());
442  x11PixmapData->convertToARGB32(true);
443  } else
444 #endif
445  {
446  qWarning("Warning: EGLConfig's depth (%d) != pixmap's depth (%d)",
447  configDepth, x11PixmapData->depth());
448  }
449  }
450 
451  QEglProperties surfaceAttribs;
452 
453  // If the pixmap can't be bound to a texture, it's pretty useless
454  surfaceAttribs.setValue(EGL_TEXTURE_TARGET, EGL_TEXTURE_2D);
455  if (alphaSize > 0)
456  surfaceAttribs.setValue(EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGBA);
457  else
458  surfaceAttribs.setValue(EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB);
459 
460  EGLSurface surf = eglCreatePixmapSurface(QEgl::display(), config,
461  (EGLNativePixmapType) x11PixmapData->handle(),
462  surfaceAttribs.properties());
463  x11PixmapData->gl_surface = (void*)surf;
465  return surf;
466  }
467 
468  return EGL_NO_SURFACE;
469 }
QPalette palette
the widget&#39;s palette
Definition: qwidget.h:180
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
static QColormap instance(int screen=-1)
QPointer< QWidget > widget
int width
the width of the widget excluding any window frame
Definition: qwidget.h:166
NativePixmapType EGLNativePixmapType
Definition: qegl_p.h:117
bool isVisible() const
Definition: qwidget.h:1005
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
const QX11Info & x11Info() const
Returns information about the configuration of the X display used to display the widget.
QPalette::ColorRole backgroundRole() const
Returns the background role of the widget.
Definition: qwidget.cpp:4677
static void enableCleanupHooks(const QImage &image)
void qt_set_winid_on_widget(QWidget *w, Qt::HANDLE id)
Definition: qegl_x11.cpp:325
void setValue(int name, int value)
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
int x
the x coordinate of the widget relative to its parent including any window frame
Definition: qwidget.h:161
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
Definition: qpalette.h:107
NativeWindowType EGLNativeWindowType
Definition: qegl_p.h:116
virtual int devType() const
Definition: qpaintdevice.h:167
NSWindow * window
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
Qt::HANDLE handle() const
Definition: qpixmap_x11_p.h:95
int height
the height of the widget excluding any window frame
Definition: qwidget.h:167
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
Q_CORE_EXPORT void qWarning(const char *,...)
void convertToARGB32(bool preserveContents=true)
ClassId classId() const
void * visual() const
Returns the current visual.
void show()
Shows the widget and its child widgets.
uint pixel(const QColor &color) const
void hide()
Hides the widget.
Definition: qwidget.h:501
int depth() const
void * data_ptr(const QTransform &t)
Definition: qpainter_p.h:81
int y
the y coordinate of the widget relative to its parent and including any window frame ...
Definition: qwidget.h:162
static const QCssKnownValue properties[NumProperties - 1]
Definition: qcssparser.cpp:67
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
Q_GUI_EXPORT VisualID getCompatibleVisualId(EGLConfig config)
Definition: qegl_x11.cpp:133
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
static Display * display()
Returns the default display for the application.
int screen() const
Returns the number of the screen currently in use.

◆ defaultConfig()

EGLConfig QEgl::defaultConfig ( int  devType,
API  api,
ConfigOptions  options 
)

Definition at line 126 of file qegl.cpp.

Referenced by QMeeGoLivePixmapData::getSurfaceForBackingPixmap(), and QX11GLSharedContexts::QX11GLSharedContexts().

127 {
128  if ( (devType != QInternal::Pixmap) && ((options & Renderable) == 0))
129  qWarning("QEgl::defaultConfig() - Only configs for pixmaps make sense to be read-only!");
130 
131  EGLConfig* targetConfig = 0;
132 
133  static EGLConfig defaultVGConfigs[] = {
134  QEGL_NO_CONFIG, // 0 Window Renderable Translucent
135  QEGL_NO_CONFIG, // 1 Window Renderable Opaque
136  QEGL_NO_CONFIG, // 2 Pixmap Renderable Translucent
137  QEGL_NO_CONFIG, // 3 Pixmap Renderable Opaque
138  QEGL_NO_CONFIG, // 4 Pixmap ReadOnly Translucent
139  QEGL_NO_CONFIG // 5 Pixmap ReadOnly Opaque
140  };
141  if (api == OpenVG) {
142  if (devType == QInternal::Widget) {
143  if (options & Translucent)
144  targetConfig = &(defaultVGConfigs[0]);
145  else
146  targetConfig = &(defaultVGConfigs[1]);
147  } else if (devType == QInternal::Pixmap) {
148  if (options & Renderable) {
149  if (options & Translucent)
150  targetConfig = &(defaultVGConfigs[2]);
151  else // Opaque
152  targetConfig = &(defaultVGConfigs[3]);
153  } else { // Read-only
154  if (options & Translucent)
155  targetConfig = &(defaultVGConfigs[4]);
156  else // Opaque
157  targetConfig = &(defaultVGConfigs[5]);
158  }
159  }
160  }
161 
162 
163  static EGLConfig defaultGLConfigs[] = {
164  QEGL_NO_CONFIG, // 0 Window Renderable Translucent
165  QEGL_NO_CONFIG, // 1 Window Renderable Opaque
166  QEGL_NO_CONFIG, // 2 PBuffer Renderable Translucent
167  QEGL_NO_CONFIG, // 3 PBuffer Renderable Opaque
168  QEGL_NO_CONFIG, // 4 Pixmap Renderable Translucent
169  QEGL_NO_CONFIG, // 5 Pixmap Renderable Opaque
170  QEGL_NO_CONFIG, // 6 Pixmap ReadOnly Translucent
171  QEGL_NO_CONFIG // 7 Pixmap ReadOnly Opaque
172  };
173  if (api == OpenGL) {
174  if (devType == QInternal::Widget) {
175  if (options & Translucent)
176  targetConfig = &(defaultGLConfigs[0]);
177  else // Opaque
178  targetConfig = &(defaultGLConfigs[1]);
179  } else if (devType == QInternal::Pbuffer) {
180  if (options & Translucent)
181  targetConfig = &(defaultGLConfigs[2]);
182  else // Opaque
183  targetConfig = &(defaultGLConfigs[3]);
184  } else if (devType == QInternal::Pixmap) {
185  if (options & Renderable) {
186  if (options & Translucent)
187  targetConfig = &(defaultGLConfigs[4]);
188  else // Opaque
189  targetConfig = &(defaultGLConfigs[5]);
190  } else { // ReadOnly
191  if (options & Translucent)
192  targetConfig = &(defaultGLConfigs[6]);
193  else // Opaque
194  targetConfig = &(defaultGLConfigs[7]);
195  }
196  }
197  }
198 
199  if (!targetConfig) {
200  qWarning("QEgl::defaultConfig() - No default config for device/api/options combo");
201  return QEGL_NO_CONFIG;
202  }
203  if (*targetConfig != QEGL_NO_CONFIG)
204  return *targetConfig;
205 
206 
207  // We haven't found an EGL config for the target config yet, so do it now:
208 
209 
210  // Allow overriding from an environment variable:
211  QByteArray configId;
212  if (api == OpenVG)
213  configId = qgetenv("QT_VG_EGL_CONFIG");
214  else
215  configId = qgetenv("QT_GL_EGL_CONFIG");
216  if (!configId.isEmpty()) {
217  // Overridden, so get the EGLConfig for the specified config ID:
218  EGLint properties[] = {
219  EGL_CONFIG_ID, (EGLint)configId.toInt(),
220  EGL_NONE
221  };
222  EGLint configCount = 0;
223  eglChooseConfig(display(), properties, targetConfig, 1, &configCount);
224  if (configCount > 0)
225  return *targetConfig;
226  qWarning() << "QEgl::defaultConfig() -" << configId << "appears to be invalid";
227  }
228 
229  QEglProperties configAttribs;
230  configAttribs.setRenderableType(api);
231 
232  EGLint surfaceType;
233  switch (devType) {
234  case QInternal::Widget:
235  surfaceType = EGL_WINDOW_BIT;
236  break;
237  case QInternal::Pixmap:
238  surfaceType = EGL_PIXMAP_BIT;
239  break;
240  case QInternal::Pbuffer:
241  surfaceType = EGL_PBUFFER_BIT;
242  break;
243  default:
244  qWarning("QEgl::defaultConfig() - Can't create EGL surface for %d device type", devType);
245  return QEGL_NO_CONFIG;
246  };
247 #ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
248  // For OpenVG, we try to create a surface using a pre-multiplied format if
249  // the surface needs to have an alpha channel:
250  if (api == OpenVG && (options & Translucent))
251  surfaceType |= EGL_VG_ALPHA_FORMAT_PRE_BIT;
252 #endif
253  configAttribs.setValue(EGL_SURFACE_TYPE, surfaceType);
254 
255 #ifdef EGL_BIND_TO_TEXTURE_RGBA
256  if (devType == QInternal::Pixmap || devType == QInternal::Pbuffer) {
257  if (options & Translucent)
258  configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGBA, EGL_TRUE);
259  else
260  configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE);
261  }
262 #endif
263 
264  // Add paint engine requirements
265  if (api == OpenVG) {
266 #if !defined(QVG_SCISSOR_CLIP) && defined(EGL_ALPHA_MASK_SIZE)
267  configAttribs.setValue(EGL_ALPHA_MASK_SIZE, 1);
268 #endif
269  } else {
270  // Both OpenGL paint engines need to have stencil and sample buffers
271  configAttribs.setValue(EGL_STENCIL_SIZE, 1);
272  configAttribs.setValue(EGL_SAMPLE_BUFFERS, 1);
273 #ifndef QT_OPENGL_ES_2
274  // Additionally, the GL1 engine likes to have a depth buffer for clipping
275  configAttribs.setValue(EGL_DEPTH_SIZE, 1);
276 #endif
277  }
278 
279  if (options & Translucent)
280  configAttribs.setValue(EGL_ALPHA_SIZE, 1);
281 
282  *targetConfig = chooseConfig(&configAttribs, QEgl::BestPixelFormat);
283  return *targetConfig;
284 }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void setValue(int name, int value)
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
void setRenderableType(QEgl::API api)
Q_CORE_EXPORT void qWarning(const char *,...)
#define QEGL_NO_CONFIG
Definition: qegl_p.h:129
int toInt(bool *ok=0, int base=10) const
Returns the byte array converted to an int using base base, which is 10 by default and must be betwee...
static const QCssKnownValue properties[NumProperties - 1]
Definition: qcssparser.cpp:67
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
Q_GUI_EXPORT EGLConfig chooseConfig(const QEglProperties *configAttribs, QEgl::PixelFormatMatch match=QEgl::ExactPixelFormat)
Definition: qegl.cpp:288

◆ display()

EGLDisplay QEgl::display ( )

Definition at line 589 of file qegl.cpp.

Referenced by QSystemTrayIconSys::addToTray(), chooseConfig(), QX11Data::clipboardReadIncrementalProperty(), QXlibClipboard::clipboardReadProperty(), QX11Data::clipboardReadProperty(), QX11Data::clipboardWaitForEvent(), QEglContext::configAttrib(), QEglContext::createContext(), createContext(), QXlibCursor::createCursorBitmap(), QXlibCursor::createCursorShape(), QMeeGoGraphicsSystem::createFenceSync(), createSurface(), QTreeWidgetItem::data(), QEglContextTracker::deref(), QMeeGoPixmapData::destroyEGLSharedImage(), QMeeGoGraphicsSystem::destroyFenceSync(), QMeeGoLivePixmapData::destroySurfaceForPixmapData(), QX11EmbedContainer::discardClient(), QEglContext::display(), QItemDelegate::doLayout(), QEglContext::doneCurrent(), eglCreateImageKHR(), eglDestroyImageKHR(), eglSwapBuffersRegion2NOK(), QX11EmbedContainer::embedClient(), QX11EmbedWidget::embedInto(), QVGEGLWindowSurfaceDirect::ensureContext(), QX11EmbedWidget::event(), QX11EmbedContainer::event(), QX11EmbedWidget::eventFilter(), QX11EmbedContainer::eventFilter(), extensions(), QWSYellowSurface::flush(), QMeeGoPixmapData::fromEGLSharedImage(), getCompatibleVisualId(), QXlibClipboard::getDataInFormat(), QSystemTrayIconSys::getSysTrayVisualInfo(), QXcbWindow::glContext(), QXlibWindow::glContext(), QXlibClipboard::handleSelectionRequest(), hasExtension(), QGLPixelBuffer::hasOpenGLPbuffers(), QX11EmbedContainer::hideEvent(), QMeeGoPixmapData::imageToEGLSharedImage(), QMeeGoLivePixmapData::initializeThroughEGLImage(), QSystemTrayIconSys::locateSystemTray(), QMeeGoLivePixmapData::lock(), QEglContext::makeCurrent(), QXlibClipboard::mimeData(), QX11Data::motifdndEnable(), QBBScreen::newWindowCreated(), QBBIntegration::paintUsingOpenGL(), QDateTimeParser::parseFormat(), QDirectFbConvenience::pixelFomatHasAlpha(), QBBRootWindow::QBBRootWindow(), QEglProperties::QEglProperties(), QOpenKODEIntegration::QOpenKODEIntegration(), qt_glformat_from_eglconfig(), qt_init(), qt_mac_post_retranslateAppMenu(), qt_mac_unregister_widget(), qt_mac_updateContentBorderMetricts(), qt_vg_destroy_shared_context(), qt_vg_shared_surface(), query_colormap(), QVNCIntegration::QVNCIntegration(), QX11EmbedContainer::QX11EmbedContainer(), QX11EmbedWidget::QX11EmbedWidget(), QX11GLSharedContexts::QX11GLSharedContexts(), QMeeGoLivePixmapData::release(), QX11EmbedContainer::resizeEvent(), QBBIntegration::screenForWindow(), QXlibClipboard::sendSelection(), QXlibClipboard::sendTargetsSelection(), sendXEmbedMessage(), QWSConnectedEvent::setData(), QWidgetPrivate::setGeometry_sys(), QBBWindow::setScreen(), QMeeGoGraphicsSystem::setSurfaceScaling(), QX11EmbedContainer::showEvent(), QEglContext::swapBuffers(), QEglContext::swapBuffersRegion2NOK(), QXcbConnection::sync(), QSystemTrayIconSys::sysTrayTracker(), QGLWindowSurface::updateGeometry(), QCommonStylePrivate::viewItemLayout(), QVGEGLWindowSurfacePrivate::windowSurfaceSize(), QWSWindowSurface::winId(), QX11EmbedWidget::x11Event(), QX11EmbedContainer::x11Event(), QX11Data::xdndAtomToString(), QX11Data::xdndMimeAtomToString(), QX11Data::xdndMimeStringToAtom(), QX11Data::xdndStringToAtom(), QApplicationPrivate::~QApplicationPrivate(), QX11EmbedContainer::~QX11EmbedContainer(), and QX11EmbedWidget::~QX11EmbedWidget().

590 {
591  static EGLDisplay dpy = EGL_NO_DISPLAY;
593  dpy = eglGetDisplay(nativeDisplay());
595  if (dpy == EGL_NO_DISPLAY) {
596  qWarning("QEgl::display(): Falling back to EGL_DEFAULT_DISPLAY");
597  dpy = eglGetDisplay(EGLNativeDisplayType(EGL_DEFAULT_DISPLAY));
598  }
599  if (dpy == EGL_NO_DISPLAY) {
600  qWarning("QEgl::display(): Can't even open the default display");
601  return EGL_NO_DISPLAY;
602  }
603 
604  if (!eglInitialize(dpy, NULL, NULL)) {
605  qWarning() << "QEgl::display(): Cannot initialize EGL display:" << QEgl::errorString();
606  return EGL_NO_DISPLAY;
607  }
608 
609  // Resolve the egl extension function pointers:
610 #if (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES)
611  if (QEgl::hasExtension("EGL_KHR_image") || QEgl::hasExtension("EGL_KHR_image_base")) {
612  qt_eglCreateImageKHR = (_eglCreateImageKHR) eglGetProcAddress("eglCreateImageKHR");
613  qt_eglDestroyImageKHR = (_eglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR");
614  }
615 #endif
616 
617  if (QEgl::hasExtension("EGL_NOK_swap_region2")) {
618  qt_eglSwapBuffersRegion2NOK = (_eglSwapBuffersRegion2NOK) eglGetProcAddress("eglSwapBuffersRegion2NOK");
619  }
620  }
621 
622  return dpy;
623 }
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
Definition: qegl.cpp:743
static bool displayOpened()
Definition: qegl.cpp:75
static _eglSwapBuffersRegion2NOK qt_eglSwapBuffersRegion2NOK
Definition: qegl.cpp:587
Q_CORE_EXPORT void qWarning(const char *,...)
static void setDisplayOpened()
Definition: qegl.cpp:74
Q_GUI_EXPORT bool hasExtension(const char *extensionName)
Definition: qegl.cpp:791
Q_GUI_EXPORT EGLNativeDisplayType nativeDisplay()
Definition: qegl_qpa.cpp:55
NativeDisplayType EGLNativeDisplayType
Definition: qegl_p.h:118
EGLBoolean(EGLAPIENTRY * _eglSwapBuffersRegion2NOK)(EGLDisplay, EGLSurface, EGLint, const EGLint *)
Definition: qegl.cpp:585
static _eglCreateImageKHR qt_eglCreateImageKHR
Definition: qegl.cpp:582
EGLBoolean(EGLAPIENTRY * _eglDestroyImageKHR)(EGLDisplay, EGLImageKHR)
Definition: qegl.cpp:579
EGLImageKHR(EGLAPIENTRY * _eglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, const EGLint *)
Definition: qegl.cpp:578
static _eglDestroyImageKHR qt_eglDestroyImageKHR
Definition: qegl.cpp:583

◆ dumpAllConfigs()

void QEgl::dumpAllConfigs ( )

Definition at line 770 of file qegl.cpp.

Referenced by chooseConfig().

771 {
772  QEglProperties props;
773  EGLint count = 0;
774  if (!eglGetConfigs(display(), 0, 0, &count) || count < 1)
775  return;
776  EGLConfig *configs = new EGLConfig [count];
777  eglGetConfigs(display(), configs, count, &count);
778  for (EGLint index = 0; index < count; ++index) {
779  props = QEglProperties(configs[index]);
780  qWarning() << props.toString();
781  }
782  delete [] configs;
783 }
QString toString() const
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
Q_CORE_EXPORT void qWarning(const char *,...)
quint16 index

◆ eglCreateImageKHR()

EGLImageKHR QEgl::eglCreateImageKHR ( EGLDisplay  dpy,
EGLContext  ctx,
EGLenum  target,
EGLClientBuffer  buffer,
const EGLint *  attrib_list 
)

Definition at line 625 of file qegl.cpp.

Referenced by QMeeGoPixmapData::fromEGLSharedImage(), QMeeGoPixmapData::imageToEGLSharedImage(), QMeeGoLivePixmapData::initializeThroughEGLImage(), and QDri2Context::resize().

626 {
628  return qt_eglCreateImageKHR(dpy, ctx, target, buffer, attrib_list);
629 
630  QEgl::display(); // Initialises function pointers
632  return qt_eglCreateImageKHR(dpy, ctx, target, buffer, attrib_list);
633 
634  qWarning("QEgl::eglCreateImageKHR() called but EGL_KHR_image(_base) extension not present");
635  return 0;
636 }
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
Q_CORE_EXPORT void qWarning(const char *,...)
#define ctx
Definition: qgl.cpp:6094
static _eglCreateImageKHR qt_eglCreateImageKHR
Definition: qegl.cpp:582

◆ eglDestroyImageKHR()

EGLBoolean QEgl::eglDestroyImageKHR ( EGLDisplay  dpy,
EGLImageKHR  img 
)

Definition at line 638 of file qegl.cpp.

Referenced by QMeeGoPixmapData::fromEGLSharedImage(), QMeeGoPixmapData::imageToEGLSharedImage(), QMeeGoLivePixmapData::initializeThroughEGLImage(), and QDri2Context::resize().

639 {
641  return qt_eglDestroyImageKHR(dpy, img);
642 
643  QEgl::display(); // Initialises function pointers
645  return qt_eglDestroyImageKHR(dpy, img);
646 
647  qWarning("QEgl::eglDestroyImageKHR() called but EGL_KHR_image(_base) extension not present");
648  return 0;
649 }
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
Q_CORE_EXPORT void qWarning(const char *,...)
static _eglDestroyImageKHR qt_eglDestroyImageKHR
Definition: qegl.cpp:583

◆ eglSwapBuffersRegion2NOK()

EGLBoolean QEgl::eglSwapBuffersRegion2NOK ( EGLDisplay  dpy,
EGLSurface  surface,
EGLint  count,
const EGLint *  rects 
)

Definition at line 651 of file qegl.cpp.

Referenced by QEglContext::swapBuffersRegion2NOK().

652 {
654  return qt_eglSwapBuffersRegion2NOK(dpy, surface, count, rects);
655 
656  QEgl::display(); // Initialises function pointers
658  return qt_eglSwapBuffersRegion2NOK(dpy, surface, count, rects);
659 
660  qWarning("QEgl::eglSwapBuffersRegion2NOK() called but EGL_NOK_swap_region2 extension not present");
661  return 0;
662 }
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
static _eglSwapBuffersRegion2NOK qt_eglSwapBuffersRegion2NOK
Definition: qegl.cpp:587
Q_CORE_EXPORT void qWarning(const char *,...)

◆ errorString()

QString QEgl::errorString ( EGLint  code = eglGetError())

Definition at line 743 of file qegl.cpp.

Referenced by QHttpNetworkConnectionChannel::_q_error(), QX11GLPixmapData::beginPaint(), QEglContext::createContext(), QUrlPrivate::createErrorString(), createPixmapDataSync(), display(), QEglContext::doneCurrent(), QHttpNetworkConnectionPrivate::errorDetail(), QNetworkAccessHttpBackend::httpError(), QGLPixelBufferPrivate::init(), QEglContext::makeCurrent(), QNetworkAccessHttpBackend::needsResetableUploadData(), QDeclarativeDataBlob::networkError(), QDeclarativePixmapReader::networkRequestDone(), QDeclarativeXmlListModelPrivate::notifyQueryStarted(), QRegExp::operator!=(), QSslError::operator!=(), QX11GLSharedContexts::QX11GLSharedContexts(), QDeclarativeTypeData::resolveTypes(), QNetworkSessionPrivate::setALREnabled(), QAbstractFileEngine::setError(), QUrl::swap(), QEglContext::swapBuffers(), QEglContext::swapBuffersRegion2NOK(), QIODevice::write(), QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl(), QXmlContentHandler::~QXmlContentHandler(), QXmlDeclHandler::~QXmlDeclHandler(), QXmlDefaultHandler::~QXmlDefaultHandler(), QXmlDTDHandler::~QXmlDTDHandler(), QXmlEntityResolver::~QXmlEntityResolver(), QXmlErrorHandler::~QXmlErrorHandler(), and QXmlLexicalHandler::~QXmlLexicalHandler().

744 {
745  static const char * const errors[] = {
746  "Success (0x3000)", // No tr
747  "Not initialized (0x3001)", // No tr
748  "Bad access (0x3002)", // No tr
749  "Bad alloc (0x3003)", // No tr
750  "Bad attribute (0x3004)", // No tr
751  "Bad config (0x3005)", // No tr
752  "Bad context (0x3006)", // No tr
753  "Bad current surface (0x3007)", // No tr
754  "Bad display (0x3008)", // No tr
755  "Bad match (0x3009)", // No tr
756  "Bad native pixmap (0x300A)", // No tr
757  "Bad native window (0x300B)", // No tr
758  "Bad parameter (0x300C)", // No tr
759  "Bad surface (0x300D)", // No tr
760  "Context lost (0x300E)" // No tr
761  };
762  if (code >= 0x3000 && code <= 0x300E) {
763  return QString::fromLatin1(errors[code - 0x3000]);
764  } else {
765  return QLatin1String("0x") + QString::number(int(code), 16);
766  }
767 }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188

◆ extensions()

QString QEgl::extensions ( )

Definition at line 785 of file qegl.cpp.

Referenced by QGL2PaintEngineEx::begin(), buildSpec(), QSvgSwitch::draw(), hasExtension(), QImageReaderPrivate::initHandler(), QVGPaintEnginePrivate::initObjects(), parseCoreNode(), q_hasEglExtension(), qgl_use_font(), qglx_getProcAddress(), qt_format_to_attrib_list(), qt_gl_resolve_features(), qt_resolve_buffer_extensions(), QGtkStylePrivate::setupGtkFileChooser(), and QGLContext::tryVisual().

786 {
787  const char* exts = eglQueryString(QEgl::display(), EGL_EXTENSIONS);
788  return QString(QLatin1String(exts));
789 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589

◆ getCompatibleVisualId()

VisualID QEgl::getCompatibleVisualId ( EGLConfig  config)

defined(QT_NO_XRENDER)

Definition at line 133 of file qegl_x11.cpp.

Referenced by createSurface().

134 {
135  VisualID visualId = 0;
136  EGLint eglValue = 0;
137 
138  EGLint configRedSize = 0;
139  eglGetConfigAttrib(display(), config, EGL_RED_SIZE, &configRedSize);
140 
141  EGLint configGreenSize = 0;
142  eglGetConfigAttrib(display(), config, EGL_GREEN_SIZE, &configGreenSize);
143 
144  EGLint configBlueSize = 0;
145  eglGetConfigAttrib(display(), config, EGL_BLUE_SIZE, &configBlueSize);
146 
147  EGLint configAlphaSize = 0;
148  eglGetConfigAttrib(display(), config, EGL_ALPHA_SIZE, &configAlphaSize);
149 
150  eglGetConfigAttrib(display(), config, EGL_CONFIG_ID, &eglValue);
151  int configId = eglValue;
152 
153  // See if EGL provided a valid VisualID:
154  eglGetConfigAttrib(display(), config, EGL_NATIVE_VISUAL_ID, &eglValue);
155  visualId = (VisualID)eglValue;
156  if (visualId) {
157  // EGL has suggested a visual id, so get the rest of the visual info for that id:
158  XVisualInfo visualInfoTemplate;
159  memset(&visualInfoTemplate, 0, sizeof(XVisualInfo));
160  visualInfoTemplate.visualid = visualId;
161 
162  XVisualInfo *chosenVisualInfo;
163  int matchingCount = 0;
164  chosenVisualInfo = XGetVisualInfo(X11->display, VisualIDMask, &visualInfoTemplate, &matchingCount);
165  if (chosenVisualInfo) {
166  // Skip size checks if implementation supports non-matching visual
167  // and config (http://bugreports.qt-project.org/browse/QTBUG-9444).
168  if (QEgl::hasExtension("EGL_NV_post_convert_rounding")) {
169  XFree(chosenVisualInfo);
170  return visualId;
171  }
172 
173  int visualRedSize = countBits(chosenVisualInfo->red_mask);
174  int visualGreenSize = countBits(chosenVisualInfo->green_mask);
175  int visualBlueSize = countBits(chosenVisualInfo->blue_mask);
176  int visualAlphaSize = -1; // Need XRender to tell us the alpha channel size
177 
178 #if !defined(QT_NO_XRENDER)
179  if (X11->use_xrender) {
180  // If we have XRender, actually check the visual supplied by EGL is ARGB
181  XRenderPictFormat *format;
182  format = XRenderFindVisualFormat(X11->display, chosenVisualInfo->visual);
183  if (format && (format->type == PictTypeDirect))
184  visualAlphaSize = countBits(format->direct.alphaMask);
185  }
186 #endif
187 
188  bool visualMatchesConfig = false;
189  if ( visualRedSize == configRedSize &&
190  visualGreenSize == configGreenSize &&
191  visualBlueSize == configBlueSize )
192  {
193  // We need XRender to check the alpha channel size of the visual. If we don't have
194  // the alpha size, we don't check it against the EGL config's alpha size.
195  if (visualAlphaSize >= 0)
196  visualMatchesConfig = visualAlphaSize == configAlphaSize;
197  else
198  visualMatchesConfig = true;
199  }
200 
201  if (!visualMatchesConfig) {
202  if (visualAlphaSize >= 0) {
203  qWarning("Warning: EGL suggested using X Visual ID %d (ARGB%d%d%d%d) for EGL config %d (ARGB%d%d%d%d), but this is incompatable",
204  (int)visualId, visualAlphaSize, visualRedSize, visualGreenSize, visualBlueSize,
205  configId, configAlphaSize, configRedSize, configGreenSize, configBlueSize);
206  } else {
207  qWarning("Warning: EGL suggested using X Visual ID %d (RGB%d%d%d) for EGL config %d (RGB%d%d%d), but this is incompatable",
208  (int)visualId, visualRedSize, visualGreenSize, visualBlueSize,
209  configId, configRedSize, configGreenSize, configBlueSize);
210  }
211  visualId = 0;
212  }
213  } else {
214  qWarning("Warning: EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID",
215  (int)visualId, configId);
216  visualId = 0;
217  }
218  XFree(chosenVisualInfo);
219  }
220 #ifdef QT_DEBUG_X11_VISUAL_SELECTION
221  else
222  qDebug("EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId);
223 #endif
224 
225  if (visualId) {
226 #ifdef QT_DEBUG_X11_VISUAL_SELECTION
227  if (configAlphaSize > 0)
228  qDebug("Using ARGB Visual ID %d provided by EGL for config %d", (int)visualId, configId);
229  else
230  qDebug("Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId);
231 #endif
232  return visualId;
233  }
234 
235 
236  // If EGL didn't give us a valid visual ID, try XRender
237 #if !defined(QT_NO_XRENDER)
238  if (!visualId && X11->use_xrender) {
239  XVisualInfo visualInfoTemplate;
240  memset(&visualInfoTemplate, 0, sizeof(XVisualInfo));
241 
242  visualInfoTemplate.c_class = TrueColor;
243 
244  XVisualInfo *matchingVisuals;
245  int matchingCount = 0;
246  matchingVisuals = XGetVisualInfo(X11->display,
247  VisualClassMask,
248  &visualInfoTemplate,
249  &matchingCount);
250 
251  for (int i = 0; i < matchingCount; ++i) {
252  XRenderPictFormat *format;
253  format = XRenderFindVisualFormat(X11->display, matchingVisuals[i].visual);
254 
255  // Check the format for the visual matches the EGL config
256  if ( (countBits(format->direct.redMask) == configRedSize) &&
257  (countBits(format->direct.greenMask) == configGreenSize) &&
258  (countBits(format->direct.blueMask) == configBlueSize) &&
259  (countBits(format->direct.alphaMask) == configAlphaSize) )
260  {
261  visualId = matchingVisuals[i].visualid;
262  break;
263  }
264  }
265  if (matchingVisuals)
266  XFree(matchingVisuals);
267 
268  }
269  if (visualId) {
270 # ifdef QT_DEBUG_X11_VISUAL_SELECTION
271  if (configAlphaSize > 0)
272  qDebug("Using ARGB Visual ID %d provided by XRender for EGL config %d", (int)visualId, configId);
273  else
274  qDebug("Using Opaque Visual ID %d provided by XRender for EGL config %d", (int)visualId, configId);
275 # endif // QT_DEBUG_X11_VISUAL_SELECTION
276  return visualId;
277  }
278 # ifdef QT_DEBUG_X11_VISUAL_SELECTION
279  else
280  qDebug("Failed to find an XVisual which matches EGL config %d using XRender", configId);
281 # endif // QT_DEBUG_X11_VISUAL_SELECTION
282 
283 #endif
284 
285 
286  // Finally, if XRender also failed to find a visual (or isn't present), try to
287  // use XGetVisualInfo and only use the bit depths to match on:
288  if (!visualId) {
289  XVisualInfo visualInfoTemplate;
290  memset(&visualInfoTemplate, 0, sizeof(XVisualInfo));
291  XVisualInfo *matchingVisuals;
292  int matchingCount = 0;
293 
294  visualInfoTemplate.depth = configRedSize + configGreenSize + configBlueSize + configAlphaSize;
295  matchingVisuals = XGetVisualInfo(X11->display,
296  VisualDepthMask,
297  &visualInfoTemplate,
298  &matchingCount);
299  if (!matchingVisuals) {
300  // Try again without taking the alpha channel into account:
301  visualInfoTemplate.depth = configRedSize + configGreenSize + configBlueSize;
302  matchingVisuals = XGetVisualInfo(X11->display,
303  VisualDepthMask,
304  &visualInfoTemplate,
305  &matchingCount);
306  }
307 
308  if (matchingVisuals) {
309  visualId = matchingVisuals[0].visualid;
310  XFree(matchingVisuals);
311  }
312  }
313 
314  if (visualId) {
315 #ifdef QT_DEBUG_X11_VISUAL_SELECTION
316  qDebug("Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId);
317 #endif
318  return visualId;
319  }
320 
321  qWarning("Unable to find an X11 visual which matches EGL config %d", configId);
322  return (VisualID)0;
323 }
#define X11
Definition: qt_x11_p.h:724
static int countBits(unsigned long mask)
Definition: qegl_x11.cpp:81
Q_CORE_EXPORT void qDebug(const char *,...)
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
Q_CORE_EXPORT void qWarning(const char *,...)
Q_GUI_EXPORT bool hasExtension(const char *extensionName)
Definition: qegl.cpp:791

◆ hasExtension()

bool QEgl::hasExtension ( const char *  extensionName)

Definition at line 791 of file qegl.cpp.

Referenced by display(), getCompatibleVisualId(), QGLWindowSurface::hijackWindow(), QMeeGoExtensions::initialize(), and QGLContext::makeCurrent().

792 {
794  QByteArray(reinterpret_cast<const char *>
795  (eglQueryString(QEgl::display(), EGL_EXTENSIONS))).split(' ');
796  return extensions.contains(extensionName);
797 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
Q_GUI_EXPORT QString extensions()
Definition: qegl.cpp:785
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays...

◆ nativeDisplay()

EGLNativeDisplayType QEgl::nativeDisplay ( )

◆ nativePixmap()

EGLNativePixmapType QEgl::nativePixmap ( QPixmap pixmap)

Definition at line 65 of file qegl_qpa.cpp.

Referenced by eglSwapBuffersRegion2NOK(), and screenForDevice().

66 {
67  Q_UNUSED(pixmap);
68  return 0;
69 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ nativeWindow()

EGLNativeWindowType QEgl::nativeWindow ( QWidget widget)

Definition at line 60 of file qegl_qpa.cpp.

Referenced by eglSwapBuffersRegion2NOK(), and screenForDevice().

61 {
62  return (EGLNativeWindowType)(widget->winId());
63 }
NativeWindowType EGLNativeWindowType
Definition: qegl_p.h:116
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557