summaryrefslogtreecommitdiffstats
path: root/src/gui/egl/qegl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Wrap EGL image function pointers and move into QEgl namespaceTom Cooksey2010-04-151-6/+37
| | | | | | | QtGui exporting a symbol called eglCreateImageKHR seems a pretty silly idea. Much better to have them in the QEgl namespace. Reviewed-By: Iain
* Support building with desktop OpenGL managed via EGLTom Cooksey2010-04-141-1/+8
| | | | | | | | | | | | | | | | This mostly replaces lots of QT_OPENGL_ES defines with QT_NO_EGL instead. It also switches off EGL auto-detection by default. This is to make sure we default to using GLX on systems with both EGL and desktop OpenGL. If -opengl es1|es2 or -openvg is specified, then EGL auto-detection is switched back on (as a requirement. If configure auto-detects OpenGL ES it also switches on EGL auto-detection, but failue then just disables both EGL & OpenGL. As a side effect, this patch also fixes building Qt when both EGL and glx are avaliable, as they are in Mesa >= 7.8.0. Reviewed-by: Trond Task-number: QTBUG-9691
* Change the ifdef for resolving function ptrs to match declarationTom Cooksey2010-04-061-1/+1
| | | | Reviewed-By: TrustMe
* Work-around Symbian 10.1's broken egl.hTom Cooksey2010-03-291-1/+1
| | | | | | | | | | | | | In Symbian 10.1, egl.h itself includes eglext.h. This leads to EGL_KHR_image & EGL_KHR_image_base being defined, but not the actual function prototypes for eglCreateImageKHR/eglDestroyImageKHR. But, because the extension defines were set, Qt assumed (wrongly) that the EGL library would define eglCreateImageKHR. This left these functions undefined. The work-around is to check the define EGL_EGLEXT_PROTOTYPES and still define the function pointers if it isn't set. Reviewed-By: TrustMe
* Don't try to resolve EGLImage function pointers if they are definedTom Cooksey2010-03-291-0/+2
| | | | | | | | We assume the presence of EGL_KHR_image or EGL_KHR_image_base means that the eglCreateImageKHR/eglDestroyImageKHR methods are exported by the EGL library and thus do not need to be resolved. Reviewed-By: TrustMe
* Change ORs to ANDs when checking EGLImage extension definesTom Cooksey2010-03-291-1/+1
| | | | | | | We should only define the EGLImage functions if both EGL_KHR_image _and_ EGL_KHR_image_base are undefined. Reviewed-By: TrustMe
* Protect EGLImage function definitions in #ifdefTom Cooksey2010-03-291-0/+2
| | | | | | This should fix the build on Symbian. Reviewed-By: TrustMe
* Implement Texture-From-Pixmap using EGLImage extensions on X11/EGLTom Cooksey2010-03-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | There's lots of EGLImage extensions, split between EGL and client rendering APIs like OpenGL ES & OpenVG. To implement texture-from- pixmap using EGLImage, both EGL extensions and OpenGL ES extensions are needed. This patch resolves the EGL extension function pointers after the display is initialized in QEgl::display(). These are then exported from QtGui so they can be used in QtOpenGL. The OpenGL ES extension function pointers are resolved using the usual qglextensions.cpp mechanism. Using EGLImage seems to remove a fixed ~10 millisecond overhead per pixmap bind when compared to using EGLSurface. Exact results per bind for 100 QPixmaps are: 8x8 Pixmap: 12 -> 1.71 msecs (EGLSurface -> EGLImage) 64x64 Pixmap: 11.6 -> 1.83 msecs (EGLSurface -> EGLImage) 128x128 Pixmap: 12.8 -> 2.74 msecs (EGLSurface -> EGLImage) 256x256 Pixmap: 16 -> 6.20 msecs (EGLSurface -> EGLImage) Reviewed-By: Trond
* Delete the QGLContext in ~QX11GLPixmapDataTom Cooksey2010-03-111-1/+1
| | | | | | | | This also includes changes which allow QGLContext to not own it's own QEglContext. With X11GL, the QEglContext gets reused by multiple QGLContexts so it is important QGLContext doesn't delete it. Reviewed-By: TrustMe
* Handle EGLSurfaces better, including more error detectionTom Cooksey2010-03-101-1/+6
| | | | | | | Note: This changes QX11PixmapData::gl_surface to a void* to enable build on 64-bit systems where EGLSurface is a pointer. Reviewed-By: TrustMe
* Fix & move QEgl::native* to platform-specific filesTom Cooksey2010-03-021-19/+0
| | | | | | This should fix build on Symbian & WinCE Reviewed-By: TrustMe
* Make bindTextureFromNativePixmap use new QEgl APIsTom Cooksey2010-03-021-5/+3
| | | | | | | The old qt_chooseEGLConfigForPixmap & qt_createEGLSurfaceForPixmap code will remain until QX11GLPixmapData can be re-written properly. Reviewed-By: TrustMe
* Move QGLWidget::setContext logic into QEgl & QGLContextTom Cooksey2010-03-021-1/+2
| | | | | | | | | | | | | | | | QEgl::createSurface() on X11 will now check to see if the device's X11 Visual is compatible with the EGLConfig passed in. If it is not compatible, the function will re-create the QPaintDevice's native drawable with a different Visual (one which is compatable with the EGLConfig). This represented the bulk of the QGLWidget::setContext method which is now much simpler. As a consequense of this change, QWidgets with graphicssystem opengl will behave much more like QGLWidget as most of the code is re-used. So things like WA_TranslucentBackground should now work with opengl graphicssystem too. Reviewed-By: TrustMe
* Add QEglContext::configAttrib(int name) helperTom Cooksey2010-03-021-0/+10
| | | | Reviewed-By: TrustMe
* Add QEgl::defaultConfig method to select configs suitable for QtTom Cooksey2010-03-021-0/+163
| | | | Reviewed-By: TrustMe
* Make QEgl::createSurface cross-platform and add native gettersTom Cooksey2010-03-021-0/+52
| | | | | | | | | | QEgl::createSurface was virtually identical for every platform apart from the line which returned the native window type. This patch just adds QEgl::nativePixmap and QEgl::nativeWindow which are platform specific (though the default widget->winId() works for everything apart from symbian). Reviewed-By: Aleksandar Sasha Babic
* Move chooseConfig and createSurface logic to QEgl functionsTom Cooksey2010-03-021-6/+18
| | | | | | | | We keep the methods in QEglContext, but these are useful helpers which wrap the QEgl version of the functions, which is where the bulk of the logic is (for these functions anyway). Reviewed-By: Aleksandar Sasha Babic
* Move static methods from QEglContext to QEgl namespaceTom Cooksey2010-03-021-39/+44
| | | | Reviewed-By: Aleksandar Sasha Babic
* Move qegl_p.h -> qeglcontext_p.h and add a new qegl_p.hTom Cooksey2010-03-021-0/+3
| | | | | | | | This puts the QEgl namespace in a single file which can be used by both qeglcontext and qeglproperties. Files which need QEglContext should now include qeglcontext_p.h. Reviewed-By: Aleksandar Sasha Babic
* Always use display() in QEglContext, so initialization can occurTom Cooksey2010-02-181-12/+11
| | | | Reviewed-By: Trustme
* Fixed compile for maemo6.Rohan McGovern2010-02-131-1/+1
| | | | | Explicit EGLNativeDisplayType casts are needed since maemo6 defines EGL_DEFAULT_DISPLAY as ((void*)0).
* Cleanup QEglContext & EGLDisplaysTom Cooksey2010-02-121-30/+34
| | | | | | | | | This basicaly replaces display(), openDisplay() & defaultDisplay() methods with a single display() and nativeDisplay(), the latter being implemented in the platform-specific files and everything else being cross-platform code. Reviewed-By: Trond
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* Better check for EGL extension stringsRhys Weatherley2009-12-041-1/+4
| | | | | | | | | The previous code might have failed if the desired extension name was a prefix of another name: "EGL_foo" member of "EGL_foo_bar". This change introduces a more precise check. Task-number: QTBUG-6454 Reviewed-by: Sarah Smith
* Bind the EGL API type before calling eglMakeCurrent()Rhys Weatherley2009-11-251-0/+12
| | | | | | | | | | When mixing GL and VG in the same thread, some devices require that eglBindAPI() be called before eglMakeCurrent() when switching between context types. The EGL spec indicates that this shouldn't be required unless the context parameter is EGL_NO_CONTEXT, but it isn't a big deal to work around slightly non-compliant devices. Reviewed-by: Tom Cooksey
* Detect context sharing on EGL systemsRhys Weatherley2009-11-091-0/+4
| | | | | | | | Context sharing was enabled on EGL systems, but QGLContext::isSharing() was still returning false because the flag in QGLContextPrivate was not updated. Reviewed-by: Sarah Smith
* Stop QEglContext destroying contexts it doesn't ownTom Cooksey2009-10-191-1/+2
| | | | Reviewed-By: Rhys Weatherley
* Make QEglContext API a little more flexibleRhys Weatherley2009-09-251-9/+3
| | | | | | | | | | Allow higher layers in QtOpenGL and QtOpenVG to set the EGLConfig and EGLContext manually if they have some other way to determine what the values should be (e.g. constructing a special config for a specific platform). Also add a QEglProperties argument to createContext() to allow fine-tuning of the context parameters. Reviewed-by: Sarah Smith
* Remove the storage of the EGLSurface from QEglContextRhys Weatherley2009-09-251-53/+0
| | | | Reviewed-by: Sarah Smith
* Push the "lazy doneCurrent" logic down from QtOpenVG into QEglRhys Weatherley2009-09-241-2/+81
| | | | | | | | | | | | | | QtOpenVG was doing a lot of housekeeping to avoid having to switch EGL contexts if the same surface was used over and over. This housekeeping really belongs in the QEgl layer so that QtOpenGL could potentially use it as well. This change also adds some overrides for makeCurrent(), swapBuffers(), and destroySurface() that take an EGLSurface directly. This is the first step in separating EGL surface management from context management. Reviewed-by: Sarah Smith
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Make QEglContext::extensions() staticTom Cooksey2009-08-211-1/+1
| | | | | | This is private API Reviewed-By: Trustme
* Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | Reviewed-by: Trust Me
* Make chooseConfig work on some EGL implementationsHarald Fernengel2009-08-101-1/+1
| | | | | | | | | | | According to the spec, if we pass a 0 out pointer, EGL should tell us how many configurations are available. However, we pass a 0 out pointer, but say that it's 256 elements big, it confuses some implementations. Fix that by passing a 0 out pointer and saying that it has space for 0 elements. Now we correctly get the amount of available configs. Reviewed-by: Rhys Weatherley <rhys.weatherley@nokia.com>
* Add a getter to QEglContext for the EGL extension stringTom Cooksey2009-07-291-0/+11
| | | | Reviewed-By: Rhys Weatherley
* Integrate the OpenVG graphics system into Qt 4.6Rhys Weatherley2009-06-221-0/+403
This change also moves the EGL support classes from QtOpenGL to QtGui so they can be shared between OpenGL and OpenVG.