Changeset 846 for trunk/src/gui/egl/qegl_wince.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_wince.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 <windows.h> … … 50 52 QT_BEGIN_NAMESPACE 51 53 52 EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties *properties) 53 { 54 // Create the native drawable for the paint device. 55 int devType = device->devType(); 56 EGLNativePixmapType pixmapDrawable = 0; 57 EGLNativeWindowType windowDrawable = 0; 58 bool ok; 59 if (devType == QInternal::Pixmap) { 60 pixmapDrawable = 0; 61 ok = (pixmapDrawable != 0); 62 } else if (devType == QInternal::Widget) { 63 windowDrawable = (EGLNativeWindowType)(static_cast<QWidget *>(device))->winId(); 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 } 72 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 } 87 return surf; 88 } 89 90 EGLNativeDisplayType QEglContext::nativeDisplay() 54 EGLNativeDisplayType QEgl::nativeDisplay() 91 55 { 92 56 HDC myDc = GetDC(0); 93 94 57 if (!myDc) { 95 58 qWarning("QEglContext::nativeDisplay(): WinCE display is not open"); … … 97 60 } 98 61 return EGLNativeDisplayType(myDc); 62 63 64 65 66 67 68 69 70 71 72 99 73 } 100 74
Note:
See TracChangeset
for help on using the changeset viewer.