summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fixed QGLWidget::grabFrameBuffer() to honor the 'withAlpha' value.Trond Kjernåsen2010-04-271-2/+10
| | | | | Task-number: QTBUG-7545 Reviewed-by: Kim
* Fix off-by-one error in mipmap count when loading PVRTC filesRhys Weatherley2010-02-241-1/+1
| | | | | Task-number: QT-2988 Reviewed-by: Julian de Bhal
* Fix several bugs with GL texture cacheTom Cooksey2010-02-121-23/+21
| | | | | Reviewed-By: Trond Autotest: tst_QGL::qglContextDefaultBindTexture
* Fixed drawing QPixmaps on QGLWidgets on different X11 screens.Trond Kjernåsen2010-02-101-1/+8
| | | | | | | | | | | Don't try to use the texture_from_pixmap extension when drawing a pixmap from one X11 screen onto a different X11 screen in the GL 2 engine. For that to work, the pixmap will have to be re-created on the new screen, which is exactly what the default bind method does (via QImage conversion). Task-number: QTBUG-8054 Reviewed-by: Kim
* Fixed a failure in tst_qgl.Trond Kjernåsen2010-02-021-1/+0
| | | | | | | The assert wrong, it may be that the texture isn't removed from the cache if it doesn't have the MemoryManaged bind option set. Reviewed-by: Samuel
* Fix GL texture leaks when pixmaps are deletedTom Cooksey2010-01-291-18/+14
| | | | | | | | | | | | | | This fixes quite a lot of issues: * QtOpenGL only registered qpixmap destruction hooks on X11 and those only cleanup the EGL/GLX surface, not the texture object. * The QPixmap destruction hooks were only being called from the QPixmap destructor. However, this means when a QPixmap is assigned to another QPixmap, the hooks don't get called. Task-number: QTBUG-7647 Reviewed-By: Samuel Reviewed-By: Trond
* Added a warning to QGLWidget::renderText().Trond Kjernåsen2010-01-271-2/+20
| | | | | | | | | renderText() can't be used while a GL 2 paint engine is active on the same device, because it will clash with the GL 1 engine and wreck havoc. We simply don't support that scenario. Task-number: QTBUG-7592 Reviewed-by: Samuel
* Updated docs regarding QGLWidget::renderText() limitations.Trond Kjernåsen2010-01-251-0/+7
| | | | Reviewed-by: Trust Me
* Fix QGLWidget::renderPixmap() on Windows.Trond Kjernaasen2010-01-141-6/+6
| | | | | | | | Using renderPixmap() with scenes that contained textures might not work due to the wrong texture format being used under certain circumstances. Task-number: QTBUG-7213 Reviewed-by: Gunnar
* Rework how Qt handles GL extensions.Trond Kjernåsen2010-01-131-23/+62
| | | | | | | | | | | | | | | | | | Qt used to store the GL extensions a particular implementation supported in a global cache, which was initialized once and never updated. This could cause problems because different types of context might support different kinds of extensions (e.g. the difference between sw and hw contexts). With this patch, the GL extensions are cached and updated within each QGLContext. It also makes the extension initialization lazy, which saves application initialization costs for embedded platforms. The patch introduces a internal cross platform QGLTemporaryContext class that is used to create a light-weight GL context without going via QGLWidget and friends (QWS and WinCE still have QGLWidget fallbacks for now). Reviewed-by: Kim Reviewed-by: Samuel
* Merge remote branch 'qt/4.6' into oslo-staging-2/4.6Paul Olav Tvete2010-01-121-1/+1
|\ | | | | | | | | Conflicts: dist/changes-4.6.1
| * Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Simon Hausmann2010-01-081-2/+0
| |\ | | | | | | | | | | | | Conflicts: src/multimedia/audio/qaudioformat.cpp
| * \ Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-071-1/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QIODevice: Fix readAll() Temporary hackiesh solution to prevent BOM in the xml data. Fixed qxmlstream autotest when using shadow builds. Attempt at readding the capital P headers for Phonon Remove special Phonon processing from syncqt. Use the lowercase/shortname.h headers for Phonon includes Fixes a crash when setting focus on a widget with a focus proxy. Update copyright year to 2010 doc: Clarified activeSubControls and subControls. Remove warning "statement with no effect" doc: Clarified that .lnk files are System files on Windows.
| | * | Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | | | | | | | | | Reviewed-by: Trust Me
* | | | Fixed bug where QGLPixmapData::toImage() returned too dark image.Kim Motoyoshi Kalland2010-01-121-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | QGLPixmapData::toImage() called qt_gl_read_texture() which didn't take into account that the texture was in a premultiplied format. Task-number: QTBUG-7190 Reviewed-by: Trond
* | | Remove unnecessary call to QWidget::setAttribute().Trond Kjernåsen2010-01-071-2/+0
|/ / | | | | | | | | | | This is already done in the QGLWidget constructor. Reviewed-by: Kim
* | Remove QGLShareRegister and transfer its functionality to QGLContextGroupRhys Weatherley2010-01-041-13/+15
| | | | | | | | | | Task-number: QT-2600 Reviewed-by: Samuel
* | Fixed QGLWidget::renderText().Trond Kjernaasen2009-12-301-19/+6
| | | | | | | | | | | | | | | | | | | | | | Fall back and use the GL 1 engine for the renderText() functions. Getting it to work with the GL 2 engine is a futile effort. Making it work with renderPixmap() in the GL 2 engine is not possible at all, since software contexts in general do not support shader programs. Task-number: QTBUG-5002, QTBUG-6931 Reviewed-by: Kim
* | Track which vertex attrib arrays are enabled in QGLContextPrivateTom Cooksey2009-12-301-0/+31
|/ | | | | | | | | | | | | The GL2 engine (and probably Qt/3D) needs to track which vertex attribute arrays are currently enabled and which are disabled. As this is per-context state, the logical place to track this is in the context and not in the paint engine. This patch also makes the GL2 engine's shader manager enable/disable the appropriate attribute arrays for a given shader program when it is used. Reviewed-By: Kim
* Disable depth testing during the 2D QGLWidget::renderText()Rhys Weatherley2009-12-171-0/+12
| | | | | | | | Also document the depth testing conditions for the 2D and 3D versions of the function. Task-number: QTBUG-5041 Reviewed-by: Daniel Pope
* Fix EGL surface leaks when re-parenting QGLWidget on X11/EGLTom Cooksey2009-12-151-0/+5
| | | | | | | | | | | | When a QGLWidget is re-parented, it's native X11 window usually gets destroyed and re-created. This also happens when you set a window attribute or flag. On EGL, we must destroy the surface for the window before destroying the window itself, otherwise we can leak the surface. This also fixes lots of BadDrawable errors when running the autotests (which were due to surface leaks!). Reviewed-By: TrustMe
* Optimized blur / drop shadow effects for the GL 2 paint engine.Samuel Rødal2009-12-141-17/+24
| | | | | | | | | Do the blur in half the resolution in software and then upload the result as a texture and smooth-scale it on the GPU. This leads to stable and decent performance regardless of the blur radius, and simplifies the implementation quite a bit. Reviewed-by: Bjørn Erik Nilsen
* Optimize our GL extension checks to avoid mallocs.Trond Kjernåsen2009-12-101-23/+24
| | | | | | | | | | We want to avoid any unnecessary mallocs when checking GL/GLX extensions. The GL extension string can be quite long and contain several hundred extensions. The old code forced one malloc for each extension + 1 extra malloc for the extension string itself when it was copied into the QByteArray. Reviewed-by: Kim
* GLES 2 should *not* use a multisampled format by default.Trond Kjernåsen2009-12-091-2/+1
| | | | | | | | This is a platform regression and should never have been there in the first place. Having this as the default format on embedded devices may drop the framerates with as much as 30% on selected HW. Reviewed-by: Tom Cooksey
* Merge upstream/4.6 into oslo-staging-2/4.6Olivier Goffart2009-12-091-1/+1
|\ | | | | | | | | Conflicts: src/s60installs/bwins/QtGuiu.def
| * Merge oslo-staging-2/4.6 into upstream/4.6Olivier Goffart2009-12-091-119/+381
| |\
| * \ Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Rhys Weatherley2009-12-061-1/+1
| |\ \
| | * | Replace glColor4ub() calls with glColor4f()Rhys Weatherley2009-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intel Q45/Q43 Express Chipset has problems with glColor4ub() not updating GL_CURRENT_COLOR correctly. Replace all references with calls to glColor4f() instead as it is more likely to be implemented correctly on all chipsets. Task-number: QTBUG-6217 Reviewed-by: Sarah Smith
| | * | Update license headers again.Jason McDonald2009-09-081-4/+4
| | | | | | | | | | | | | | | | Reviewed-by: Trust Me
* | | | Fix upside down PVR compressed textures.Rhys Weatherley2009-12-081-3/+4
| |_|/ |/| | | | | | | | | | | | | | | | | The "vertical flip" flag in the PVR format is the inverse of the "inverted y" state that we use in Qt. Reviewed-by: trustme
* | | Fix GL_BGRA formats under OpenGL/ES systemsRhys Weatherley2009-12-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenGL/ES requires that the internal and external formats be the same when calling glTexImage2D(). This caused problems with devices that had the GL_EXT_bgra extension. This change makes the formats the same just before the upload and also makes sure that the pixel type is GL_UNSIGNED_BYTE when GL_BGRA is used. No change for desktop systems. Reviewed-by: Donald Carr
* | | Detect GL2 paint engine based on fragment shaders, not programsRhys Weatherley2009-12-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | The auto-detect logic was looking for fragment programs to check for OpenGL2 support. It should have been looking for fragment shaders. Task-number: QTBUG-5638 Reviewed-by: Sarah Smith
* | | Compressed texture binding for QtOpenGL: ETC1 and PVRTCRhys Weatherley2009-12-061-117/+368
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QGLContext::bindTexture(QString) function has been augmented with support for ETC1, PVRTC2, and PVRTC4 compressed textures, in addition to the existing DDS support. The QGLPixmapData class has also been modified to recognize compressed texture formats in fromFile() and fromData(). This change also fixes a bug in bindTexture() that prevented the same compressed texture file from being bound in multiple contexts. There is now a separate file cache for each context group. Task-number: QT-2547 Reviewed-by: Trond
* | Rebind window surface fbo after native GL renderingRhys Weatherley2009-12-041-0/+1
| | | | | | | | | | | | | | | | | | If the user called QGLFramebufferObject::bind()/release() during a beginNativePainting() callout, the release() would reset the context's fbo to zero, not the actual window surface fbo. Task-number: QTBUG-6204 Reviewed-by: Tom
* | Reduce double-copying of textures when flipping upside downRhys Weatherley2009-12-021-7/+15
| | | | | | | | | | | | | | | | | | | | | | bindTexture() flipped images in-place, to reduce data copying. But there is one case where the in-place is worse: when the QImage is not detached. In that case, the flip was copying the entire image and then flipping the lines, effectively processing the contents twice. The new version uses mirrored() to reduce the overhead for non-detached images. Reviewed-by: Samuel
* | 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)