summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Removed warnings / debug output in the GL 2 engine / pixmap filter code.Samuel Rødal2009-08-251-2/+0
| | | | Reviewed-by: Tom
* Merge commit 'qt/master' into kinetic-graphicseffectBjørn Erik Nilsen2009-08-171-1/+1
|\
| * Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Fixed various valgrind-reported issues in GL 2 engine.Samuel Rødal2009-07-291-4/+5
| |
* | Merge commit 'qt-graphics-team/pixmapfilters-redux' into kinetic-graphicseffectSamuel Rødal2009-07-281-41/+93
|\ \ | |/ |/| | | | | | | | | | | | | | | | | Conflicts: src/opengl/gl2paintengineex/qglengineshadermanager.cpp src/opengl/gl2paintengineex/qglengineshadermanager_p.h src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h Merge custom shader / GL blur pixmap filter implementation from graphics team repo with implementation from kinetic graphics-team repo.
| * Refactored the GL QPixmap backend to use an FBO pool class.Samuel Rødal2009-07-021-41/+93
| | | | | | | | | | The FBO pool will be useful in other places as well, plus it makes it easier to deal with graphics memory management issues.
* | Use texture_from_pixmap on X11 & avoid copiesTom Cooksey2009-07-221-20/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 compile with -qtnamespace and MSVC.Rohan McGovern2009-07-221-1/+2
|/ | | | | When an extern function is declared in the scope of another function, MSVC sometimes ignores the enclosing namespace {}.
* Fixed some regressions in the OpenGL pixmap backend.Samuel Rødal2009-06-291-1/+8
| | | | | | | | Make sure a QPixmap gets an alpha channel when filled with a non-opaque color, and fix issues where shader manager did not active correct shader program. Reviewed-by: Tom
* Speed up QPixmap::width(), height(), isNull() and depth().Andreas Aardal Hanssen2009-06-171-28/+32
| | | | | | | | | | | | | | | | This change moves the w, h, d variables to QPixmapData and introduces is_null to keep track of nullness. This is possible only because QPixmapData is internal API; otherwise we'd have to be smarter. The optimization makes the QPixmap::width() function take 7 instructions, down from 34 before. For the calculator demo in the declarative ui branch this reduces a block of 750000 instructions (out of 30000000) to around 100000-150000 instructions. Tested on Windows, Linux, Mac. Raster, X11 and OpenGL paint engines. Have not tested the DirectFB engine. Reviewed-by: Trond
* Prevented infinite recursion in GL graphics system.Samuel Rødal2009-06-171-2/+5
| | | | | | | | | | | | If creating a QGLWidget triggers the creation of a QPixmap then we might end up in an infinite recursion due to QPixmap trying to access qt_gl_share_widget(). This can happen via setWindowIcon for example. Adding an initializing flag to QGLGlobalShareWidget and preventing QGLFramebufferObject::hasOpenGLFramebufferObjects() and ::hasOpenGLFramebufferBlit() from creating a QGLWidget every time they are called with no active GL context. Reviewed-by: Trond
* 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
| * Long live Qt 4.5!Lars Knoll2009-03-231-0/+313
|
* Re-enabled GL pixmap backend and window surface to work without GL2.Samuel Rødal2009-06-151-1/+2
| | | | | | | GL window surface and GL pixmap backend should work with old GL engine as well, though not supported to the same degree. Reviewed-by: Trond
* Fixed bitmap drawing in GL 2 engine when not using GL pixmap backend.Samuel Rødal2009-06-121-1/+1
| | | | | | | | | QPixmap shouldn't return true in hasAlphaChannel() for bitmaps, instead the paint engine should check whether the pixmap is a bitmap or not. In addition, QBrush::isOpaque() returned true for bitmap brushes, which is wrong according to the documentation. Reviewed-by: Trond
* Made QPixmap autotest pass with -graphicssystem openglSamuel Rødal2009-06-121-14/+53
| | | | | | | | | | | | | | The window surface has been modified to track widget deletion to make sure it doesn't try to access the widget's context data after deletion. QGLPixmapData now also uses GL_RGB instead of GL_RGBA when appropriate, and hasAlphaChannel() has been modified in view of this. A number of other issues have been fixed in QGLPixmapData, and the autotest has been modified to use a more lenient pixmap compare function due to off-by-one pixel errors here and there. Reviewed-by: Trond
* Prevented pixmap FBOs from growing too big.Samuel Rødal2009-06-091-0/+5
| | | | | | | | If we're painting to very wide and then very tall pixmaps we don't want the FBO to grow to max_width * max_height, instead we should recreate the FBO if it grows too large compared to what's being painted. Reviewed-by: Trond
* Added check in GL pixmap backend to fall back to raster if FBO fails.Samuel Rødal2009-05-291-32/+37
|
* Avoided expensive image upload for GL pixmap backend for QPixmap::fill.Samuel Rødal2009-05-271-9/+37
| | | | | | | In the fill case we can simply set a flag saying the pixmap needs to be filled, and then when painting on the pixmap we start by filling the background using glClear via the existing QGLDrawable::autoFillBackground interface.
* Fixed bug in uninitialized GL pixmaps.Samuel Rødal2009-05-251-0/+2
| | | | | | | When not setting filtering mode to GL_NEAREST/GL_LINEAR copying back from FBO to texture fails for some reason. Reviewed-by: Trond
* Reverted use of GL 2 engine as default on desktop.Samuel Rødal2009-05-131-4/+4
| | | | | | | | | | | | 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-4/+0
| | | | | | | Compile both GL and GL2 paint engine on desktop, and choose between them at run-time based on GL version flags. Reviewed-by: Tom
* Big GL Extension CleanupTom Cooksey2009-05-061-5/+5
| | | | | | | | | Clean up the extension naming and make things build on OpenGL ES 2.0 again. All the extensions which made it into OpenGL 2.0 spec have have the EXT postfix removed. This also eliminates defines on ES 2.0 as the code now refers to the in-spec names. Reviewed-by: sroedal
* Prevent copy back from FBO when initializing render FBO from texture.Samuel Rødal2009-04-201-3/+3
|
* Correctly handle using GL pixmaps that still have an active engine.Samuel Rødal2009-04-171-13/+30
| | | | | | | | | | | | | | | | | In the case where a GL pixmap is used when there it still has an active engine we need to ensure that the pixmap has been flushed from the render FBO first. The newly added QGLPixmapData::copyBackFromRenderFbo() handles this. In addition, because several GL 2 paint engines can be active on the same context at the same time, we can't make any assumptions and need to call the newly added QGL2PaintEngineEx::ensureCreated() in the beginning of any state-dependent paint engine function. QGL2PaintEngineEx::ensureCreated() correctly transfers control to the current engine if a different engine is active. Running lance with -pixmap and -graphicssystem opengl works correctly with the GL pixmap backend now.
* Use FBOs as pixmap backend in GL graphics system.Samuel Rødal2009-04-161-68/+168
| | | | | | | | 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
* Fixes: Enable use of the GL pixmap backend in the GL 2 paint engine.Samuel Rødal2009-04-011-3/+10
|
* Long live Qt!Lars Knoll2009-03-231-0/+321