summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Cleanup of QGLPaintDevice before it goes inTom Cooksey2009-09-081-237/+0
| | | | | | | | | This is the last patch in the QGLPaintDevice series. Although previous patches have not been reviewed individually, Samuel's reviewed QGLPaintDevice API and all the changes as the code stands with this patch. Reviewed-by: Samuel
* Move buffer clear out of the paint engine and into the QGLPaintDevicesTom Cooksey2009-09-081-5/+4
| | | | | | | | | | | | Previously, the paint engine cleared the surface's buffers in begin. This logic really belongs in QGLPaintDevice::beginPaint as not all paint devices will want this behaviour (in fact most don't). This also makes QGLPaintDevice API much simpler as the virtual getters for the clear color, etc. can be removed. It's much cleaner this way. The only possible problem is with the GL1 engine, which also cleared the accumulation & depth buffers in begin. However, the engine will also clear the depth buffer later as part of it's clipping logic. It also doesn't use the accumulation buffer, so clearing it seems unnessisary.
* Replace QGLDrawable with a new QGLPaintDeviceTom Cooksey2009-09-081-1/+4
| | | | | | | | | | | | | | | | | This patch adds a new abstract base class which inherits from QPaintDevice called QGLPaintDevice. This base class will contain everything the GL paint engines need to know about the surface they are drawing onto. As such, new surfaces can be targeted by the GL paint engines without having to modify QtOpenGL. This is very useful for plugins, specifically QGraphicsSystem plugins. To unify things a little, the GL paint engines will use the same QGLPaintDevice API to render into existing target surfaces (QGLWidget, QGLPixelBuffer & QGLFrameBufferObject). Ideally we'd make QGLPaintDevice a common ancestor for these surfaces, but obviously that wil break B/C. This patch only implements QGLWidget using the new interface. Rendering to other surfaces will be fixed in following patches.
* Added a public function to enforce usage og the old GL engine.Trond Kjernåsen2009-09-081-0/+68
| | | | | | | | | | | Some applications that uses a mix of OpenGL and QPainter code may not work correctly with the new GL 2 engine (e.g. the composition demo). The same is most likely also true for user apps, therefore we need a way to enforce the usage of the old GL 1 engine for the sake of compatibility. Task-number: 260872 Reviewed-by: Samuel
* Texture format must be GL_RGB when pixel type is GL_UNSIGNED_SHORT_5_6_5Rhys Weatherley2009-09-081-0/+1
| | | | | | | | | | | | QImage::Format_RGB16 textures were broken on some OpenGL/ES 1.1 systems because the "format" was set to GL_RGBA and the "texture_format" was set to GL_RGB, with a pixel type of GL_UNSIGNED_SHORT_5_6_5. OpenGL/ES 1.1, ES 2.0, and desktop GL all require the two format parameters to glTexImage2D() to be GL_RGB if the pixel type is GL_UNSIGNED_SHORT_5_6_5. Reviewed-by: Sarah Smith
* Make the matrix and viewport logic in renderText() a bit betterRhys Weatherley2009-09-081-50/+137
| | | | | | | The original renderText() was using the highly unportable (to OpenGL/ES) glGetDoublev() and glGetIntegerv() functions. Reviewed-by: Sarah Smith
* qdoc: improve the QGLFormat documentationRhys Weatherley2009-09-071-17/+20
| | | | Reviewed-by: trustme
* Performance: Convert QGLFormat to use implicit sharingRhys Weatherley2009-09-071-4/+34
| | | | | | | | | | | | QGLFormat was being deep-copied many times per frame because of code like this: if (context()->format().doubleBuffer()) { ... This change modifies QGLFormat to use implicit sharing to reduce the overhead of the above type of checks. Reviewed-by: Sarah Smith
* Update QGLFormat::operator== to include all fields.Rhys Weatherley2009-09-061-1/+6
| | | | | | | The documentation says "Returns true if all the options of the two QGLFormats are equal", but that's not what it was doing. Reviewed-by: Sarah Smith
* Fixed bindTexture() on bigendian and older implementationsGunnar Sletta2009-09-031-4/+33
| | | | Reviewed-by: Trond
* Fixed reparenting OpenGL widgets on Windows.Kim Motoyoshi Kalland2009-09-031-6/+1
| | | | | Task-number: 260697 Reviewed-by: Trond
* Split QGLEngineShaderManager into a shared and a per engine part.Kim Motoyoshi Kalland2009-09-021-4/+4
| | | | | | | | | Both the shaders and the engine states were shared between OpenGL contexts, but the states should be only apply to one context, not a group of contexts. This commit separates the shaders and the states. Task-number: 257254 Reviewed-by: Samuel
* Added context pointer to QGLContextGroupResources.Kim Motoyoshi Kalland2009-08-311-11/+23
| | | | | | | | | | | | I renamed QGLContextGroupResources to QGLContextGroup because we are using it to identify context groups. I also added a pointer to one of the contexts in the group. Together with qgl_share_reg(), the pointer can be used to find all contexts in a group. I renamed QGLContextPrivate::qt_get_extension_funcs() to QGLContextPrivate::extensionFuncs() to follow Qt's naming convention. Reviewed-by: Trond
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-08-281-6/+50
|\ \
| * | Fixed QGLWidget::renderText() when using the GL 2 paint engine.Trond Kjernåsen2009-08-281-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | QGLWidget::renderText() needs to respect the current depth and scissor tests that the user has set. Therefore we needs some special casing in the GL 2 paint engine to handle the custom depth testing. The private setRenderTextActive() has been added for this purpose. Reviewed-by: Samuel
| * | doc: Fixed several qdoc errors.Martin Smith2009-08-281-2/+18
| | |
* | | Attempting to make EGL compile again and fix some potentialGunnar Sletta2009-08-281-1/+7
|/ / | | | | | | issues with flipped pixmaps on X11
* | compile on x11Gunnar Sletta2009-08-271-1/+1
| |
* | New variant of QGLContext::bindTexture that does not require mipmap generationGunnar Sletta2009-08-271-58/+224
| | | | | | | | | | | | | | and y-axis inversion and overall less conversion, making significantly faster for plain usecases Reviewed-by: Trond
* | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-publicJason Barron2009-08-211-1/+1
|\ \
| * | compile.Harald Fernengel2009-08-211-1/+1
| | |
* | | Merge commit 'qt/master'Jason Barron2009-08-211-42/+9
|\ \ \ | |/ / |/| |
| * | Fix QGLWidget::showFullScreen() on X11/EGLTom Cooksey2009-08-211-2/+5
| | | | | | | | | | | | | | | | | | It seems the winId can change during a WindowStateChange event too. Reviewed-By: Trustme
| * | Removed PBO texture upload from QGLContextPrivate::bindTexture().Samuel Rødal2009-08-211-40/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The PBO code path causes a crash on certain AMD graphics cards, plus seems to perform worse than the straight forward glTexImage2D code path on several configurations. Task-number: 257353 Reviewed-by: Gunnar Sletta
* | | Merge commit 'qt/master'Jason Barron2009-08-181-5/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/examples.qdoc doc/src/plugins-howto.qdoc doc/src/topics.qdoc examples/phonon/musicplayer/mainwindow.cpp src/3rdparty/freetype/src/base/ftobjs.c src/corelib/global/qglobal.h src/corelib/tools/qalgorithms.h src/corelib/tools/qshareddata.cpp src/corelib/tools/qsharedpointer.cpp src/corelib/tools/tools.pri src/corelib/xml/qxmlstream.h src/gui/painting/painting.pri src/gui/widgets/qdatetimeedit.cpp tests/auto/qdesktopservices/qdesktopservices.pro tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp tests/auto/qtextcodec/test/test.pro