summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_p.h
Commit message (Collapse)AuthorAgeFilesLines
* 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