summaryrefslogtreecommitdiffstats
path: root/src/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Mark new overloads with \since 4.6.Volker Hilsheimer2009-10-011-1/+6
|
* Fix warnings on mingwThierry Bastian2009-10-011-0/+1
| | | | Reviewed-by: trust me
* Split EGL config selection & surface creation into seperate functionsTom Cooksey2009-10-011-73/+102
| | | | | This is needed to implement render-to-pixmap on x11/EGL, which will also need to create an EGL surface for pixmaps.
* QGLContext::areSharing() to check for GL share relationshipsRhys Weatherley2009-10-016-19/+29
| | | | Reviewed-by: Samuel
* Add unit tests for QGLShareRegisterRhys Weatherley2009-10-011-1/+1
| | | | Reviewed-by: Sarah Smith
* Use QGLSharedResourceGuard to track contexts in the shader managerRhys Weatherley2009-10-012-5/+5
| | | | Reviewed-by: Sarah Smith
* Make QGLFramebufferObject crash-proof if QGLContext destroyed firstRhys Weatherley2009-10-012-26/+39
| | | | | | | | | | | | | | | | Sometimes it isn't possible to arrange for the QGLFramebufferObject to be destroyed before the QGLContext group in which it was created. Especially during application shutdown or in applications with multiple shared contexts. This change modifies QGLFramebufferObject to use QGLSharedResourceGuard, which ensures that when the last QGLContext in a sharing group is destroyed, any remaining FBO's will revert to !isValid(). It is now safe to destroy the context before the FBO, or the FBO before the context. Unit test included. Reviewed-by: Sarah Smith
* Add Qt::RenderHint to control rendering operations.Bjørn Erik Nilsen2009-09-301-9/+9
| | | | | | | | | | | We need a way to control various rendering operations. For example, whether quality is more important than performance, or the other way around. This change also replaces occurences of QPixmapFilter/QGraphicsEffect::BlurHint (introduced in 1a431e850893b6b162c833f4f148f090e2427dda) with Qt::RenderHint. Reviewed-by: Samuel
* Fix a memory leak of EGLSurface's in QGLContextRhys Weatherley2009-09-301-2/+4
| | | | Reviewed-by: Julian de Bhal
* Convert OpenGL convolution filter to OpenGL2 paint engineRhys Weatherley2009-09-301-120/+59
| | | | | | | The convolution filter was still using the old-style OpenGL1 method for interfacing to the paint engine. Reviewed-by: trustme
* Make QPF's implementation of alphaMapForGlyph() consistent.Rhys Weatherley2009-09-291-16/+0
| | | | | | | | | | | | | | The QPF implementation of alphaMapForGlyph() was returning color values of RGBA = (a, a, a, 255) instead of (0, 0, 0, a), which was inconsistent with all the other font engines. This inconsistency caused some QPF-specific workarounds in the OpenGL and OpenVG paint engines. This change removes the workarounds and makes QPF generate the right colors from the start. Paint engines that ignore the color table or which don't use the alphaMapForGlyph() function (e.g. raster) are not affected. Reviewed-by: Paul
* Fix EGL/GLX surface leak when using texture-from-pixmapTom Cooksey2009-09-291-3/+2
| | | | | | | | | The QScopedPointer changes mean that the pixmap data's reference count is now decremented after the cleanup hooks are called. The hooks should also only be called when the pixmap data gets deleted, so we don't actually have to check the reference count at all. Reviewed-by: TrustMe
* Use glXGetProcAddress to resolve glx extensionsTom Cooksey2009-09-292-57/+68
| | | | | | | | | | | | On systems where the GL driver is pluggable (like Mesa), we have to use the glXGetProcAddressARB extension to resolve other function pointers as the symbols wont be in the GL library, but rather in a plugin loaded by the GL library. This fix basically makes texture-from-pixmap work on Mesa drivers like intel i915 & friends. Reviewed-by: Trond
* Fixed a crash in the boxes demo when using -graphicssystem opengl.Trond Kjernaasen2009-09-283-2/+8
| | | | | | | | | | | | 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
* Suppress some compiler warnings that occur under OpenGL/ES 2.0Rhys Weatherley2009-09-282-0/+6
| | | | Reviewed-by: trustme
* QGLContext::drawTexture() is not supported under OpenGL/ES 2.0Rhys Weatherley2009-09-281-2/+15
| | | | Reviewed-by: trustme
* ifdef out convolution filter for OpenGL/ES 2.0Rhys Weatherley2009-09-281-2/+14
| | | | | | | | Convolution filter is not compatible with OpenGL/ES 2.0 in its current form, and we probably don't need it now that we have a special-purpose blur filter. Reviewed-by: trustme
* Make the GL graphics system work under OpenGL/ES 2.0Rhys Weatherley2009-09-281-4/+69
| | | | | | | Very basic port of the graphics system - performance may not be the best just yet. Reviewed-by: Sarah Smith
* qdoc fixes to QGLFramebufferObject::blitFramebuffer()Rhys Weatherley2009-09-281-6/+11
|
* Fixed crash with QPixmap::fill() when pixmap is painted to using opengl1Gunnar Sletta2009-09-251-9/+17
| | | | Reviewed-by: Samuel
* Added #define to GL 2 paint engine to turn off scissor testing.Samuel Rødal2009-09-251-15/+27
| | | | Reviewed-by: Gunnar Sletta
* Move common EGL functions to qgl_egl.cppRhys Weatherley2009-09-254-112/+37
| | | | | | | | There were several copies of the same stubbed functions in qgl_wince.cpp, qgl_qws.cpp, and qgl_x11egl.cpp. Move them all to a common location for easier maintainence. Reviewed-by: Sarah Smith
* Remove the storage of the EGLSurface from QEglContextRhys Weatherley2009-09-254-20/+21
| | | | Reviewed-by: Sarah Smith
* Start to separate the EGLSurface from QEglContext in QtOpenGLRhys Weatherley2009-09-247-163/+63
| | | | | | | Also, move the EGL makeCurrent(), doneCurrent(), swapBuffers(), and reset() functions into the common qgl_egl.cpp. Reviewed-by: Sarah Smith
* Added BlurType to blur graphics effect API.Samuel Rødal2009-09-241-10/+10
| | | | | | | | This lets the user control whether to use a fast dynamic blur when animating the radius of the blur for example, or to use a static high quality blur for one-time or constant radius blurring. Reviewed-by: Gunnar Sletta
* Prevented crash in svgviewer in graphics system OpenGL with QGLWidget.Samuel Rødal2009-09-241-0/+2
| | | | | | | Need to make sure the correct context is current when painting on the window surface FBO. Reviewed-by: Kim
* Made fast blur in GL 2 engine be radius independent.Samuel Rødal2009-09-242-140/+97
| | | | | | | | | | | This is useful when animating the blur radius, as you don't want to suffer the hit of compiling / linking a new shader program for each radius the first time the animation is played. Also use the fast blur when the radius is 5 or below, as the quality difference is insignificant. Reviewed-by: Rhys Weatherley
* Added a comment to clarify the purpose of a piece of code.Trond Kjernåsen2009-09-231-1/+1
| | | | Reviewed-by: Trust Me
* Fixed a warning.Trond Kjernåsen2009-09-221-0/+2
| | | | Reviewed-by: Kim
* Fixed text drawing in the GL2 engine after sub-pixel hinting was added.Trond Kjernåsen2009-09-222-19/+29
| | | | | | | | | | 1. The mono format was not handled at all. 2. We really, really wanted to use sub-pixel hinted glyphs even when they were not available. 3. The glyphFormat type in the FT font engine wasn't updated to reflect the correct system glyph type. Reviewed-by: Kim
* Resubmit support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-227-24/+185
| | | | | | | The antialiasing is currently not gamma corrected and is disabled on OpenGL ES 2.0. Reviewed-by: Samuel
* Revert "Resubmit support for subpixel antialiasing on text in the GL2 engine."Rhys Weatherley2009-09-217-185/+24
| | | | This reverts commit 1b34feacef7a2d3ac005449a7cfbcb08a6bbf947.
* Optimized GL2 engine to use scissor clipping more aggressively.Samuel Rødal2009-09-212-95/+72
| | | | | | | | | | | | | | | | There's no reason to stop using a scissor clip when a more complex clip is set. Instead, we can use a combination of scissoring and depth clipping to represent the final clip. When intersecting with a new clip path, if the clip path is a rectangle we simply intersect it against the scissor clip, and otherwise we intersect its bounding rect against the scissor clip and write the actual path to the depth buffer. The patch simplifies the logic in clip() quite a bit, except in the UniteClip case in which we don't care about performance anyways. It also fixes a bug which could cause rendering errors if the stencil buffer contains junk before painting. Reviewed-by: Gunnar Sletta
* Resubmit support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-217-24/+185
| | | | | | | The antialiasing is currently not gamma corrected and is disabled on OpenGL ES 2.0. Reviewed-by: Samuel
* Refactored gl window surface a bit.Gunnar Sletta2009-09-211-37/+43
| | | | | | | | | | | | The logic was a bit messy and didn't work on Mac OS X. On Linux we also had issues with 8xxx nvidia cards which didn't render properly. The FBO is now unbound between calls to beginPaint(), which prevents other gl calls from messing it up, which is probably what was the error in the first place. In addition, on Mac OS X, we also call the upatePaintDevice() as a result of setGeometry() to force-update the dimensions of the context. Reviewed-by: Trond
* Performance: reduce overhead of updateMatrix() in GL2 paint engineRhys Weatherley2009-09-211-32/+45
| | | | | | | | | | | The original code was performing 40 floating-point multiplications, 40 additions, and 2 divisions every time the matrix was changed. Because most of the components in the orthographic projection matrix are trivial, we can implement the same transformation with only 6 multiplications, 6 additions, and 2 divisions. Reviewed-by: Sarah Smith
* Fixed bug in GL pixmap backend (causing missing rendering in lance).Samuel Rødal2009-09-181-1/+5
| | | | | | | Since copyBackFromRenderFbo() manually changes the framebuffer object binding, we also need to update the context's current_fbo member. Reviewed-by: Kim
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-09-181-0/+1
|\
| * Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Tom Cooksey2009-09-178-184/+23
| |\ | | | | | | | | | | | | Conflicts: tests/auto/qtwidgets/tst_qtwidgets.cpp
| * | Add a QMAKE_LFLAGS_EGL and QMAKE_LFLAGS_OPENGLTom Cooksey2009-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you link cross-compiled applications on Linux, the linker needs to be able to find not just the libraries the application links against (like libQtGui.so), but the libraries' dependencies. E.g. examples/widgets/wiggly links against QtGui. QtGui links against libEGL.so. Therefore, when you link wiggly, the linker has to be able to find libEGL.so, even though wiggly doesn't use EGL directly. To facilitate this, -Wl,rpath-link=/path/to/egl needs to be added to QMAKE_PRL_LIBS in libQtGui.prl and -Wl,rpath-link=/path/to/gl needs to be added to QMAKE_PRL_LIBS in libQtOpenGL.prl. This only needs to be done when the EGL/GL libs are not in the default search directories. As the paths will also change depending on the mkspec, two new variables have been added: QMAKE_LFLAGS_EGL & QMAKE_LFLAGS_OPENGL. These can be set in the mkspec and will be added to the relevent prls. E.g. QMAKE_LFLAGS_EGL += -Wl,-rpath-link=$${QMAKE_LIBDIR_EGL} QMAKE_LFLAGS_OPENGL += -Wl,-rpath-link=$${QMAKE_LIBDIR_OPENGL} Reviewed-by: Marius Storm-Olsen
* | | context()->makeCurrent() is called above, so this is redundant.Gunnar Sletta2009-09-171-2/+0
| |/ |/| | | | | Reviewed-by: Samuel
* | qdoc: QGLContext::drawTexture referring to itself.Rhys Weatherley2009-09-171-4/+0
| |
* | Revert "Added support for subpixel antialiasing on text in the GL2 engine."Rhys Weatherley2009-09-177-180/+23
|/ | | | | | Breaks the GL2 paint engine on X11 and OpenGL/ES 2.0. This reverts commit b8ff02a67ebd8246253823b53cfed98eef400547.
* Make QtOpenGL on X11/EGL less chatty with it's debug outputTom Cooksey2009-09-161-5/+6
| | | | Reviewed-by: Trustme
* Added support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-167-23/+180
| | | | | | The antialiasing is currently not gamma corrected. Reviewed-by: Samuel
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-09-165-36/+62
|\
| * Reduce overhead of paint engine-specific pixmap filtersRhys Weatherley2009-09-164-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Engine-specific pixmap filters were being created, used, and destroyed every time draw() was called on QPixmapColorizeFilter, QPixmapBlurFilter, and so on. This had a heavy performance penalty and made it difficult for the GL paint engine to cache shaders from one request to the next. A generic filter can request an engine-specific filter that matches its parameters. The engine can either create a new one or return a previously allocated filter object. Ownership of engine-specific pixmap filter objects is moved to the paint engine itself. Reviewed-by: Andrew den Exter Reviewed-by: Michael Brasser Reviewed-by: Michael Goddard Reviewed-by: Sarah Smith
| * Only regenerate pixmap filter source if the parameters have changed.Rhys Weatherley2009-09-151-2/+31
| | | | | | | | Reviewed-by: trustme
| * Remove unnecessary definitions in GL pixmap filter code.Rhys Weatherley2009-09-151-5/+0
| | | | | | | | | | | | The code does not use QGLShader directly any more. Reviewed-by: trustme
| * Fix glMatrixMode() arguments for desktop OpenGLRhys Weatherley2009-09-151-2/+2
| | | | | | | | | | | | | | The defines are GL_MODELVIEW/GL_PROJECTION, not GL_MODELVIEW_MATRIX/etc. The _MATRIX defines are for fetching the matrix, not setting it. Reviewed-by: trustme