summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Performance: Convert QGLFormat to use implicit sharingRhys Weatherley2009-09-071-1/+20
| | | | | | | | | | | | 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
* Split QGLEngineShaderManager into a shared and a per engine part.Kim Motoyoshi Kalland2009-09-021-2/+2
| | | | | | | | | 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
* Fixed initialization order in QGLContextGroup constructor.Kim Motoyoshi Kalland2009-08-311-1/+1
| | | | Reviewed-by: Trond
* Remove unused variable in GL2 engine.Kim Motoyoshi Kalland2009-08-311-1/+1
| | | | Reviewed-by: Trust Me
* Added context pointer to QGLContextGroupResources.Kim Motoyoshi Kalland2009-08-311-14/+27
| | | | | | | | | | | | 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
* Fixed crash when sharing OpenGL contexts in the GL2 paint engine.Kim Motoyoshi Kalland2009-08-311-0/+4
| | | | | | | | | | | Shader objects had a pointer to the context they were originally created in. If the context was destroyed, the shader would (on Windows) dereference an invalid pointer and cause the program to crash. I replaced the context pointer with a pointer to the context group. I also added checks in debug mode to make sure the context associated with the shader shares resources with the current context. Reviewed-by: Tom
* 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
* | Move QGLShareContextScope to qgl_p.h so other things can use it.Rhys Weatherley2009-08-311-0/+40
| | | | | | | | Reviewed-by: trustme
* | New variant of QGLContext::bindTexture that does not require mipmap generationGunnar Sletta2009-08-271-12/+21
| | | | | | | | | | | | | | and y-axis inversion and overall less conversion, making significantly faster for plain usecases Reviewed-by: Trond
* | Removed PBO texture upload from QGLContextPrivate::bindTexture().Samuel Rødal2009-08-211-1/+0
| | | | | | | | | | | | | | | | | | 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
* | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Refactor texture_from_pixmap to not re-create the gl surface each bindTom Cooksey2009-07-291-4/+7
| | | | | | | | | | | | | | | | Make a clear seperation between the GL texture and the GLX pixmap. A GLXPixmap is valid in any GL context and thus does not need to be re-created every time the pixmap has changed. Reviewed-By: Samuel
* | Refactor QImage/QPixmap cleanup hooks into a seperate classTom Cooksey2009-07-281-1/+2
| | | | | | | | | | | | | | The new class alows more than one hook to be installed at a time and, for QPixmaps, the hook is told which pixmap is getting deleted. Reviewed-By: Samuel
* | Fix build on MacTom Cooksey2009-07-221-0/+1
| | | | | | | | | | | | | | | | | | The texture_from_pixmap patch removed a bindTexture overload from QGLContextPrivate which is actually needed by all architectures. It was just it's use in the mac compat methods which broke the build and highlighted the issue. Reviewed-By: Trustme
* | Plug a texture leak when deleting QPixmaps without a current contextTom Cooksey2009-07-221-3/+8
| | | | | | | | | | | | | | | | | | ~QGLTexture wouldn't make the texture's context current if the current context was zero, meaning the texture would leak. This also means deleteBoundPixmap doesn't need to make the context currnet anymore (as it's only called from ~QGLTexture). Reviewed-By: Kim
* | Use texture_from_pixmap on X11 & avoid copiesTom Cooksey2009-07-221-9/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch tries to use texture_from_pixmap extentions on glX to properly bind an X Pixmap to a texture in QGLContextPrivate::bindTexture(QPixmap,). Because GL & X have different coordinate systems, the pixmap will be inverted about the y-axis. The extension does however allow a GLX_Y_INVERTED_EXT attribute to be set which will bind the pixmap the correct way up. If the underlying driver doesn't support this, texture_from_pixmap can't be used for QGLContext::bindTexture, because that function expects the resulting texture to be the right way up. However, it can still be used internally by the paint engine for drawPixmap operations. For these cases, if the pixmap is inverted, the paint engine can simply invert the texture coords to compensate. This is why this patch also moves QGLTexture into qgl_p.h. QGLContextPrivate::bindTexture(QPixmap,) now returns a QGLTexture which the paint engine can inspect to see if it needs to invert the texture coords. Finally, it seems on some (probably all) drivers, deleting an X pixmap which has been bound to a texture before calling glFinish/swapBuffers renders garbage. Presumably this is because X deletes the pixmap behind the driver's back before it's had a chance to use it. To fix this, we reference all QPixmaps which have been bound to stop them being deleted and only deref them after we swap the buffer, when they can be safely deleted. Reviewed-By: Kim
* | Fixed GL2 engine shader manager to work with more than one context.Kim Motoyoshi Kalland2009-07-211-53/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I added a QGLContextResource class which can be used internally in Qt for sharing resources between contexts. The QGLContextResource is a hash map where the context is used as 'key', and the resource is the 'value'. All the sharing contexts point to the same resource, and the resource is automatically deleted when it is not referenced any more. Now, the shader manager uses the QGLContextResource class. I also added a pointer to a struct in the QGLContextPrivate class. The struct is shared between all the sharing contexts and is deleted automatically. Currently, the struct only contains the resolved OpenGL function pointers. The shared context register code has been simplified. Reviewed-by: Tom
* | Fixed cleanup of glyph cache textures in the GL 2 engine.Trond Kjernåsen2009-07-011-0/+4
| | | | | | | | | | | | | | This could potentially crash when a context was destroyed before the actual font engine holding the QGLTextureGlyphCache was destroyed. Reviewed-by: Samuel
* | Merge license header changes from 4.5Volker Hilsheimer2009-06-161-2/+2
|\ \ | |/
| * Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | | | | | Reviewed-by: Trust Me
| * BT: Fix Cocoa bug w/OpenGL widgets in dock widgets would disappear.Norwegian Rock Cat2009-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The NSOpenGLContext seems to be tied to the window. So if the view changes from one window to another, the OpenGL context needs to be cleared. We can do this by hooking into the viewWillChangeWindow and viewDidChangeWindow events and clear and reset the drawable respectively. We also found out that QCocoaOpenGLView was not being used at all, so just remove it to get rid of any confusion. Task-number: 250066 Reviewed-by: Trond
| * Long live Qt 4.5!Lars Knoll2009-03-231-0/+394
|
* Make OpenGL/ES 1.1 work again for Qt/EmbeddedRhys Weatherley2009-06-091-2/+1
| | | | Reviewed-by: trustme
* Made GL2 engine default for QGLWidget, and added GL2 sync() functionSamuel Rødal2009-05-291-1/+1
| | | | | | | | | | | | To allow mixing QPainter and raw OpenGL commands we need to have some way for the user to say that's he's about to use raw OpenGL so that we are free to do buffering optimizations in the paint engines and use either GL1 or GL2 paint engine. As there's already a syncState() function in QPaintEngine we've reused this and added QPaintEngineEx::sync() which takes care of syncing/flushing the paint engine. Reviewed-by: Trond
* Make QGLWidgets have the same background colour as QWidgetsTom Cooksey2009-05-271-0/+1
| | | | | | | | QWidgets are filled with Qt::transparent when WA_TranslucentBackground is set, reguardless of what their background colour has been set to. This patch makes QGLWidgets behave the same way. Reviewed-By: Samuel Rødal
* Fixed bugs in GL2 paint engine when several engines are active.Samuel Rødal2009-05-271-0/+1
| | | | | | | Make sure makeCurrent() on a window surface unbinds any active FBO, and simplify ensureActive() code in GL2 paint engine a bit. We don't need the last_engine pointer as ensureActive() will take care of ensuring the correct engine is active anway.
* Make QtOpenGL compile on OpenGL ES 1.1 againTom Cooksey2009-05-141-2/+15
|
* Reverted use of GL 2 engine as default on desktop.Samuel Rødal2009-05-131-3/+2
| | | | | | | | | | | | Using GL 2 as default engine breaks the use cases where OpenGL commands are inter-mixed with QPainter commands, such as when using raw OpenGL in graphicsview. For now we'll use the old OpenGL engine for QGLWidget, QGLPixelBuffer, and QGLFramebufferObject on desktop, and the OpenGL 2 paint engine when the OpenGL graphics system is used. Reviewed-by: Trond
* Enabled compilation of both GL and GL2 paint engine.Samuel Rødal2009-05-131-2/+13
| | | | | | | Compile both GL and GL2 paint engine on desktop, and choose between them at run-time based on GL version flags. Reviewed-by: Tom
* Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-graphics-teamGunnar Sletta2009-04-171-1/+7
|\
| * Use FBOs as pixmap backend in GL graphics system.Samuel Rødal2009-04-161-1/+7
| | | | | | | | | | | | | | | | We now use FBOs to implement render-to-pixmap for the GL pixmap backend. A multisample FBO is used for rendering, and is then blitted onto a non-multisample FBO dynamically bound to the relevant texture. Reviewed-by: Tom
* | Merge branch 'qt/main'Gunnar Sletta2009-04-171-0/+1
|\ \ | |/ |/| | | | | Conflicts: src/opengl/opengl.pro
| * BT: Fix Cocoa bug w/OpenGL widgets in dock widgets would disappear.Norwegian Rock Cat2009-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The NSOpenGLContext seems to be tied to the window. So if the view changes from one window to another, the OpenGL context needs to be cleared. We can do this by hooking into the viewWillChangeWindow and viewDidChangeWindow events and clear and reset the drawable respectively. We also found out that QCocoaOpenGLView was not being used at all, so just remove it to get rid of any confusion. Task-number: 250066 Reviewed-by: Trond
* | Fixes: Add blitting and multisample API to QGLFramebufferObject.Samuel Rødal2009-04-011-1/+2
| | | | | | | | | | | | RevBy: Trond Details: Support GL_EXT_framebuffer_multisample and GL_EXT_framebuffer_blit in the QGLFramebufferObject API.
* | Fixes: Enable use of the GL pixmap backend in the GL 2 paint engine.Samuel Rødal2009-04-011-0/+4
| |
* | Fixes: Move QGLDrawable into qgl_p.h so that we can use it in the GL 2 ↵Samuel Rødal2009-04-011-0/+33
|/ | | | | | | | paint engine. RevBy: Tom Details: Now we can use the GL 2 paint engine on non-widget paint devices like pixel buffers, framebuffer objects, and GL window surfaces. Using -graphicssystem opengl works now.
* Long live Qt!Lars Knoll2009-03-231-0/+396