summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fixed extension checks and usage of the GL 2 engine on old X11 systems.Trond Kjernåsen2009-11-161-24/+34
| | | | | | | | | | | | | | This fixes a regression from 4.5, where exporting a GL capable display from an old X11 HP/Sun workstation to a modern Linux machine causes crashes and lots of X11 error output. Just relying on the client GL version number is not enough under X11, since the server might only support GL 1.1 with non or very few extensions. Also, the extension checks worked a bit randomly since it checked for sub-strings which might or might not occur within one or more full extension names. Task-number: QTBUG-5853 Reviewed-by: Kim
* Make isSharing() reset to false when context no longer sharingRhys Weatherley2009-11-151-1/+1
| | | | | | | | | | The documentation for QGLContext::isSharing() indicates that the function returns true only when the context is sharing. However, previously the sharing flag would stay on if the context was created as sharing but is no longer sharing. Task-number: QTBUG-5578 Reviewed-by: Sarah Smith
* API review: Rename functions numColors(), setNumColors() and numBytes()Marius Storm-Olsen2009-11-061-1/+1
| | | | | | | | | | QPaintDevice and QImage used the functions numColors(), setNumColors(), and numBytes(). However, this is not consistent with the rest of the Qt API which uses *Count() and set*Count(). Removed all usage of these functions inside Qt and test-cases. Reviewed-by: Andreas Aardal Hanssen
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-graphics-team into 4.6Gunnar Sletta2009-11-021-2/+4
|\
| * Minor doc fixes for QGLContext::BindOption.Samuel Rødal2009-11-021-1/+3
| | | | | | | | Reviewed-by: Gunnar Sletta
| * Fixed compiler warning on GCC about empty while statement.Samuel Rødal2009-11-021-1/+1
| |
* | Safeguard isNull() pixmaps in bindTexture and remove a compile warningGunnar Sletta2009-11-021-0/+39
|/ | | | Reviewed-by: TrustMe
* Added QImagePixmapCleanupHooks functions for enabling hooks.Samuel Rødal2009-10-291-2/+2
| | | | | | | Better than having to befriend QPixmapData and setting is_cached manually. Reviewed-by: Tom Cooksey
* Reset the GL error stack prior to checking for errors in bindTexture()Gunnar Sletta2009-10-271-0/+5
| | | | Reviewed-by: Tom
* Fixed an assert when running the composition demo on Mac.Trond Kjernåsen2009-10-201-16/+19
| | | | | | | We can't create a QGLWidget in the QGLEngineSelector, since it may be called before a QApplication object has been constructed. Reviewed-by: Kim
* Separate modification & destruction pixmap cleanup hooksTom Cooksey2009-10-191-4/+17
| | | | | | | | | | | | | Before the QExplicitlySharedDataPointer change, the ref-count was 0 when calling the cleanup hooks from ~QPixmap. That enabled the hook to figure out if the pixmap is being modified or deleted. As the ref count is now 1 when calling the cleanup hooks in ~QPixmap, we need to seperate the hooks. This change should make using textre-from-pixmap faster as the EGL/glX surface wont get re-created everytime the pixmap is modified. Reviewed-By: Gunnar
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-191-15/+8
|\
| * Remove unnecessary QWSGLPaintDevice now that we have QGLPaintDeviceRhys Weatherley2009-10-151-1/+0
| | | | | | | | Reviewed-by: Tom
| * Centralize all GL paint engine creations into qt_qgl_paint_engine()Rhys Weatherley2009-10-151-14/+8
| | | | | | | | | | | | | | | | | | The qt_qgl_paint_engine() function was being used by QWS, but there's no reason why it can't be used by other platforms too. This should also fix ES 2.0 paint engine support under QWS, which was stubbed out. Reviewed-by: Sarah Smith Reviewed-by: Gunnar
| * Work around broken ATI X1600 drivers on Mac OS XGunnar Sletta2009-10-131-1/+19
| | | | | | | | | | | | | | | | | | | | The GLSL implementation messes up return values from functions so that all our srcPixel()'s become black and several matrices are off. We don't want to rewrite the shader code to fit an "ancient" graphics card, so we simply fall back to the GL 1 engine. Reviewed-by: Trond (cherry picked from commit 33ed3d0bacddce214a43be60eb6481903e753a88)
* | Optimized QPixmap::fill for GL backend when pixmap is used as is.Samuel Rødal2009-10-151-19/+27
| | | | | | | | | | | | | | | | | | When QGLPixmapData is bound after a fill(), without being painted on in the mean-time, it's cheaper to directly generate a source image than to go through convertToGLFormat(), since all the pixels in the image will have the same value. Reviewed-by: Trond
* | Fixed buggy bitmap drawing in GL 2 engine on X11.Samuel Rødal2009-10-151-1/+1
| | | | | | | | | | | | Don't use texture_from_pixmap extension for QBitmaps. Reviewed-by: Tom
* | Work around broken ATI X1600 drivers on Mac OS XGunnar Sletta2009-10-131-1/+19
|/ | | | | | | | | The GLSL implementation messes up return values from functions so that all our srcPixel()'s become black and several matrices are off. We don't want to rewrite the shader code to fit an "ancient" graphics card, so we simply fall back to the GL 1 engine. Reviewed-by: Trond
* Fixed an assert occuring on X11 when destroying QPixmaps under GL.Trond Kjernåsen2009-10-061-2/+4
| | | | | | | The cleanup code for the QX11PixmapData was called incorrectly for QGLPixmapData. Reviewed-by: Samuel
* Fixed the X11 error output from the demos/boxes demo.Trond Kjernåsen2009-10-061-0/+5
| | | | | | | | | After we started caching the current context internally, it revealed an old bug: when a QGLWidget is reparented under X11, it will get a new window id, but its context will still be bound to the old window, so we need to rebind it. Reviewed-by: Samuel
* Merge QGLContextReference into QGLContextGroupRhys Weatherley2009-10-041-22/+42
| | | | Reviewed-by: trustme
* Move QGLContextResource management into QGLContextGroupRhys Weatherley2009-10-041-84/+25
| | | | | | | | | Context resources are per-group, so they should be managed by the group. This should also improve performance of context shutdown slightly by removing QGLSignalProxy::aboutToDestroyContext() signal dispatches to the resources. Reviewed-by: trustme
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-021-32/+41
|\
| * Remove QHash overhead from QGLShareRegisterRhys Weatherley2009-10-021-22/+18
| | | | | | | | | | | | | | Move the list of shared contexts from QGLShareRegister into QGLContextGroup. There is then no need for the QHash. Reviewed-by: trustme
| * Doc: Mark new overloads with \since 4.6.Volker Hilsheimer2009-10-011-1/+6
| |
| * QGLContext::areSharing() to check for GL share relationshipsRhys Weatherley2009-10-011-6/+15
| | | | | | | | Reviewed-by: Samuel
| * Fix EGL/GLX surface leak when using texture-from-pixmapTom Cooksey2009-09-291-3/+2
| | | | | | | | | | | | | | | | | | The QScopedPointer changes mean that the pixmap data's reference count is now decremented after the cleanup hooks are called. The hooks should also only be called when the pixmap data gets deleted, so we don't actually have to check the reference count at all. Reviewed-by: TrustMe
* | Added timings to the QGL_BIND_TEXTURE_DEBUG debug outputsGunnar Sletta2009-10-021-8/+20
|/ | | | Reviewed-by: TrustMe
* Fixed a crash in the boxes demo when using -graphicssystem opengl.Trond Kjernaasen2009-09-281-1/+1
| | | | | | | | | | | | Several problems: 1. The demo leaked the scene contents, which caused cleanup problems. 2. The QGLContext::currentContext() could be changed behind Qt's back under Windows (the temp contexts never reset the current context). 3. QGLFormat::openGLVersionFlags() function would return uninitialized flags if the QGLWidget constructor happened to call qt_gl_preferGL2Engine(). Reviewed-by: Kim
* QGLContext::drawTexture() is not supported under OpenGL/ES 2.0Rhys Weatherley2009-09-281-2/+15
| | | | Reviewed-by: trustme
* Start to separate the EGLSurface from QEglContext in QtOpenGLRhys Weatherley2009-09-241-0/+1
| | | | | | | Also, move the EGL makeCurrent(), doneCurrent(), swapBuffers(), and reset() functions into the common qgl_egl.cpp. Reviewed-by: Sarah Smith
* qdoc: QGLContext::drawTexture referring to itself.Rhys Weatherley2009-09-171-4/+0
|
* Performance: reduce TLS overhead of QGLContext::currentContext()Rhys Weatherley2009-09-141-3/+24
| | | | | | | | | | | | | The handling for the current QGLContext was looking up the same TLS data several times per call (hasLocalData() and localData() calls particularly). This change also refactors the code a little so that the setting of the QGLContext within makeCurrent() and doneCurrent() is in one location in the code instead of six (one per platform). Reviewed-by: Michael Brasser Reviewed-by: Sarah Smith
* qdoc: QGLWidget::colormap() returns a QGLColormap, not a QColormapRhys Weatherley2009-09-141-2/+2
|
* Use redF(), etc when setting GL colorsRhys Weatherley2009-09-141-5/+3
| | | | Reviewed-by: Sarah Smith
* qdoc: QGLFormat documentation improvementsRhys Weatherley2009-09-141-5/+9
|
* qdoc: QGLWidgets -> QGLWidget, etc, for proper doc linking.Rhys Weatherley2009-09-131-10/+10
|
* QGLWidget::fontDisplayListBase() is not supported under OpenGL/ESRhys Weatherley2009-09-131-2/+8
| | | | | | Update documentation and #ifdef out the implementation. Reviewed-by: trustme
* qdoc: qglColor() doesn't work under OpenGL/ES 2.0Rhys Weatherley2009-09-131-0/+4
|
* Make QGLWidget::renderText() desktop onlyRhys Weatherley2009-09-131-175/+72
| | | | | | | | | The renderText() function is only for legacy desktop systems, so revert the previous attempts to port it to OpenGL/ES. Documentation note added to direct users to QPainter::drawText() for the correct way to render text onto an OpenGL paint device. Reviewed-by: trustme
* Make mipmaps work on OpenGL/ES 2.0Rhys Weatherley2009-09-111-0/+12
| | | | Reviewed-by: Gunnar
* Dump texture formats in hex, not decimalRhys Weatherley2009-09-111-2/+2
| | | | Reviewed-by: trustme
* Recognize the OES_packed_depth_stencil extensionRhys Weatherley2009-09-111-0/+4
| | | | Reviewed-by: trustme
* Resolve ARB_framebuffer_object and OES_framebuffer_object extensionsRhys Weatherley2009-09-101-0/+9
| | | | Reviewed-by: trustme
* Upload texturedata in matching internal format..Gunnar Sletta2009-09-101-12/+26
| | | | Reviewed-by: Tom
* Fixed crash on shutdown with GL when leaking QGLWidgetsGunnar Sletta2009-09-101-2/+7
| | | | | | | | The problem was the QGLContextResource destructor which was called when the QtOpenGL dll was unloaded. At this point in time, the gl driver had already been unloaded so any gl calls at this point in time would crash. It is simply wrong for the destructor to try to clean up, so we instead output a warning if resources are leaked.
* Suppress warnings in QtOpenGL on OpenGL/ES 1.1 systemsRhys Weatherley2009-09-091-2/+5
| | | | Reviewed-by: trustme
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Rhys Weatherley2009-09-091-4/+4
|\
| * Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | | | | | Reviewed-by: Trust Me
* | Clean up shader programs properlyRhys Weatherley2009-09-091-0/+29
|/ | | | | | | | | | | | | | | QGLShader and QGLShaderProgram used to delete the GL object id in the wrong context. But fixing this means we must keep track of when contexts are destroyed so that we don't try to access a context from a shader if it goes away. We also need to transfer ownership from one context to another when they are shared. This change introduces QGLSharedResourceGuard, which keeps track of a context and a GL object identifier. When the context goes away, ownership is passed to a shared context. When there are no more shared contexts, the identifier automatically zeroes. Reviewed-by: trustme