Changeset 846 for trunk/src/gui/egl/qegl_symbian.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/egl/qegl_symbian.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 43 43 #include <QtGui/qpixmap.h> 44 44 #include <QtGui/qwidget.h> 45 45 46 #include "qegl_p.h" 47 46 48 47 49 #include <coecntrl.h> … … 49 51 QT_BEGIN_NAMESPACE 50 52 51 EGL Surface QEglContext::createSurface(QPaintDevice *device, const QEglProperties *properties)53 EGL) 52 54 { 53 // Create the native drawable for the paint device. 54 int devType = device->devType(); 55 EGLNativePixmapType pixmapDrawable = 0; 56 EGLNativeWindowType windowDrawable = 0; 57 bool ok; 58 if (devType == QInternal::Pixmap) { 59 pixmapDrawable = 0; 60 ok = (pixmapDrawable != 0); 61 } else if (devType == QInternal::Widget) { 62 QWidget *w = static_cast<QWidget *>(device); 63 windowDrawable = (EGLNativeWindowType)(w->winId()->DrawableWindow()); 64 ok = (windowDrawable != 0); 65 } else { 66 ok = false; 67 } 68 if (!ok) { 69 qWarning("QEglContext::createSurface(): Cannot create the native EGL drawable"); 70 return EGL_NO_SURFACE; 71 } 55 return EGL_DEFAULT_DISPLAY; 56 } 72 57 73 // Create the EGL surface to draw into, based on the native drawable. 74 const int *props; 75 if (properties) 76 props = properties->properties(); 77 else 78 props = 0; 79 EGLSurface surf; 80 if (devType == QInternal::Widget) 81 surf = eglCreateWindowSurface(dpy, cfg, windowDrawable, props); 82 else 83 surf = eglCreatePixmapSurface(dpy, cfg, pixmapDrawable, props); 84 if (surf == EGL_NO_SURFACE) 85 qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError()); 86 return surf; 58 EGLNativeWindowType QEgl::nativeWindow(QWidget* widget) 59 { 60 return (EGLNativeWindowType)(widget->winId()->DrawableWindow()); 61 } 62 63 EGLNativePixmapType QEgl::nativePixmap(QPixmap*) 64 { 65 qWarning("QEgl: EGL pixmap surfaces not implemented yet on Symbian"); 66 return (EGLNativePixmapType)0; 87 67 } 88 68
Note:
See TracChangeset
for help on using the changeset viewer.