summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'qt/master'Jason Barron2009-08-182-12/+31
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fixed text rendering on GL ES 2 implementations.Trond Kjernåsen2009-08-172-12/+31
| | | | | | | | | | | | | | | | | | | | | | Some GL ES 2 implementations seem to have problems with glCopyTexSubImage2D(), so we fall back and read the old font texture into system memory and re-upload the new font texture. Also, the precision used for texture coordinates in the fragment programs wasn't high enough, which could lead to rendering artifacts. Reviewed-by: Samuel
* | Merge commit 'qt/master'Jason Barron2009-08-139-14/+24
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/samplebuffers/glwidget.cpp src/corelib/io/qfsfileengine_unix.cpp src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer.cpp src/gui/gui.pro tests/auto/qhttp/tst_qhttp.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp
| * Update contact URL in license headers.Jason McDonald2009-08-129-9/+9
| | | | | | | | Reviewed-by: Trust Me
| * Fixed uploading of glyphs to the glyph cache in the GL2 engine.Kim Motoyoshi Kalland2009-08-111-5/+15
| | | | | | | | | | | | | | | | Upload the glyph one scanline at a time to work around what probably is a driver bug. This replaces a previous fix 6d0290b2202d4fc084595ba678c2a2d984392e72. Reviewed-by: Tom
* | Rename Q_DECLARE_SCOPED_PRIVATE back to Q_DECLARE_PRIVATEHarald Fernengel2009-08-061-1/+1
| | | | | | | | | | | | Rationale: We're using template magic now to get the private pointer in qglobal.h, so no need to have two macros. Also keeps backward compatibility with outside (KDE) code.
* | Merge commit 'origin/master'Jason Barron2009-08-041-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/kernel/qmetatype.cpp src/corelib/kernel/qobject.cpp src/corelib/thread/qthread_unix.cpp src/gui/graphicsview/qgraphicssceneevent.h src/gui/itemviews/qheaderview.h src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qgesture.h src/gui/kernel/qgesturerecognizer.h src/gui/painting/qpaintengine_raster.cpp src/network/access/qhttpnetworkreply.cpp src/network/access/qnetworkcookie.h src/network/socket/qnativesocketengine_unix.cpp
| * | Squashed commit of the topic/exceptions branch.Harald Fernengel2009-08-031-1/+1
| | | | | | | | | | | | | | | Contains some smaller fixes and renaming of macros. Looks big, but isn't scary at all ;)
* | | Merge commit 'qt/master-stable'Jason Barron2009-08-042-17/+80
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/openssl/openssl.pri demos/embedded/embedded.pro examples/itemviews/chart/chart.pro examples/network/network.pro examples/painting/painterpaths/painterpaths.pro examples/threads/mandelbrot/mandelbrot.pro qmake/project.cpp src/3rdparty/libtiff/libtiff/tif_config.h src/corelib/arch/arch.pri src/corelib/global/qglobal.cpp src/corelib/kernel/kernel.pri src/corelib/kernel/qcore_unix_p.h src/corelib/kernel/qobject.cpp src/corelib/thread/qthread_unix.cpp src/corelib/tools/qsharedpointer_impl.h src/corelib/tools/tools.pri src/gui/kernel/qaction.h src/gui/kernel/qapplication.cpp src/gui/painting/qregion.h src/gui/widgets/qlineedit.cpp src/gui/widgets/qlineedit_p.h src/network/socket/qnativesocketengine_unix.cpp tests/auto/qdir/tst_qdir.cpp tests/auto/qdiriterator/tst_qdiriterator.cpp tests/auto/qhttp/qhttp.pro tests/auto/qline/qline.pro tests/auto/qnetworkreply/tst_qnetworkreply.cpp tests/auto/qresourceengine/qresourceengine.pro tests/auto/qsharedpointer/qsharedpointer.pro tests/auto/qstring/qstring.pro tests/auto/qtcpsocket/qtcpsocket.pro tests/auto/qtcpsocket/tst_qtcpsocket.cpp
| * | Optimized single-rect clip case in OpenGL 2 paint engine.Samuel Rødal2009-07-292-17/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use scissor based clipping when only dealing with rectangular intersect clips. As soon as we get any more complex clips (or unite/replace clips) we fall back to depth buffer based clipping. Task-number: 258748 Reviewed-by: Tom
* | | Merge commit 'qt/master-stable'Jason Barron2009-07-276-138/+197
|\ \ \ | |/ / | | / | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe qmake/Makefile.unix qmake/generators/makefile.cpp src/corelib/global/qglobal.h src/corelib/kernel/kernel.pri src/corelib/kernel/qcoreevent.cpp src/corelib/kernel/qsharedmemory_unix.cpp src/gui/graphicsview/qgraphicsscene.cpp src/gui/kernel/qaction.cpp src/gui/kernel/qaction.h src/gui/kernel/qaction_p.h src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication.h src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget.h src/gui/kernel/qwidget_mac.mm src/gui/painting/qgraphicssystemfactory.cpp src/gui/styles/qwindowsstyle.cpp src/gui/text/qfontengine_qpf.cpp src/gui/widgets/qabstractscrollarea_p.h src/network/access/qnetworkaccessdebugpipebackend.cpp src/network/socket/qlocalsocket_unix.cpp src/network/socket/qnativesocketengine_p.h src/network/socket/qnativesocketengine_unix.cpp src/openvg/qpaintengine_vg.cpp tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp tests/auto/qcssparser/qcssparser.pro tests/auto/qdir/tst_qdir.cpp tests/auto/qfile/tst_qfile.cpp tests/auto/qobject/tst_qobject.cpp tests/auto/qpathclipper/qpathclipper.pro tests/auto/qprocess/tst_qprocess.cpp tests/auto/qsettings/tst_qsettings.cpp tests/auto/qsharedpointer/qsharedpointer.pro tests/auto/qsqlquerymodel/qsqlquerymodel.pro tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro tests/auto/qsqltablemodel/qsqltablemodel.pro tests/auto/qsqlthread/qsqlthread.pro tests/auto/qwidget/tst_qwidget.cpp
| * Use texture_from_pixmap on X11 & avoid copiesTom Cooksey2009-07-221-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 opacity bug in the GL2 paint engine.Kim Motoyoshi Kalland2009-07-211-0/+1
| | | | | | | | | | | | | | When premultiplying a color with the opacity, the color's alpha channel was not set correcly. Reviewed-by: Tom
| * Fixed gradient bug in the GL2 paint engine.Kim Motoyoshi Kalland2009-07-211-3/+3
| | | | | | | | | | | | | | Texture filtering was set before binding the texture, so the gradient spread was not set correctly. Reviewed-by: Tom
| * Fixed crash in the GL2 engine's texture glyph cache.Kim Motoyoshi Kalland2009-07-211-4/+12
| | | | | | | | Reviewed-by: Tom
| * Used QGLContextResource for the gradient cache in the GL2 paint engine.Kim Motoyoshi Kalland2009-07-213-30/+31
| | | | | | | | Reviewed-by: Tom
| * Fixed GL2 engine shader manager to work with more than one context.Kim Motoyoshi Kalland2009-07-213-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 text rendering with the GL2 paint engine.Kim Motoyoshi Kalland2009-07-161-2/+5
| | | | | | | | | | | | | | | | | | | | | | When copying a glyph image into the glyph cache, garbage appeared in the glyph cache in the lower part of the destination rectangle. This happened whenever the glyph image's width was not a multiple of four bytes. I suppose this is a driver bug (nVidia). As a workaround, I converted the glyph image to ARGB32 such that the width is guaranteed to be a multiple of four bytes. Reviewed-by: Tom
| * Moved uniform enum to QGLEngineShaderManager.Kim Motoyoshi Kalland2009-07-034-83/+69
| | | | | | | | | | | | Simplified caching of uniform locations. Reviewed-by: Samuel
| * Made QPainter / OpenGL intermixing in hellogl_es2 work properly again.Samuel Rødal2009-07-011-0/+5
| | | | | | | | | | | | | | Need to call syncState() to let the paint engine set depth clipping state parameters back to their OpenGL defaults. Reviewed-by: Trond
| * Fixed cleanup of glyph cache textures in the GL 2 engine.Trond Kjernåsen2009-07-011-3/+26
| | | | | | | | | | | | | | This could potentially crash when a context was destroyed before the actual font engine holding the QGLTextureGlyphCache was destroyed. Reviewed-by: Samuel
* | Compile the OpenGL2 paint engine after the QScopedPointer changesJason Barron2009-07-091-3/+3
|/ | | | | | This part of the code was not tested on Symbian so it's failure went unnoticed. This should get it compiling on platforms that use the OpenGL2 paint engine.
* Fixed some regressions in the OpenGL pixmap backend.Samuel Rødal2009-06-291-3/+5
| | | | | | | | 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
* Fixed missing restoration of state after a sync in the GL 2 engine.Samuel Rødal2009-06-252-2/+12
| | | | | | | | | The sync() function properly sets up the state to allow using raw OpenGL commands with an active QPainter, but we also need to properly restore the state after sync() has been called and some other painting operation is done. Reviewed-by: Trond
* Fixed buggy clipping when using projective transforms in GL 2 engine.Samuel Rødal2009-06-251-14/+4
| | | | | | | | | | | The gl_Position x, y, and z coordinates are always divided by the homogenuous w coordinate to yield the final coordinates. Since we want the depth to be constant for the whole item we need to premultiply it by the w-coordinate. We can do this in the main() function in the vertex programs since all the vertex programs use the depth uniform, thus simplifying the programs a bit. Reviewed-by: Trond
* Reduced number of state changes/uniform location queries in GL2 engine.Samuel Rødal2009-06-244-49/+168
| | | | | | | Keep track of uniform locations for the current shader program in the shader manager. Also don't change texture parameters unless necessary. Reviewed-by: Kim
* Use QTransform more efficiently.Bjørn Erik Nilsen2009-06-181-2/+1
| | | | Reviewed-by: Samuel
* Update license headers in files that are new in 4.6.Jason McDonald2009-06-173-6/+6
| | | | Reviewed-by: Trust Me
* Merge license header changes from 4.5Volker Hilsheimer2009-06-166-12/+12
|\
| * Update license headers as requested by the marketing department.Jason McDonald2009-06-1611-22/+22
| | | | | | | | Reviewed-by: Trust Me
| * Fixed a crash in the GL 2 paintengine when drawing text.Trond Kjernåsen2009-05-291-0/+3
| | | | | | | | | | | | | | | | The new glyph cache may return null images for e.g. space characters. Task-number: 253468 Reviewed-by: Samuel BT: yes
| * Long live Qt 4.5!Lars Knoll2009-03-2311-0/+3733
|
* Enabled switching multisampling on/off in GL2 engine on desktop.Samuel Rødal2009-06-151-0/+14
| | | | | | | Switching multisampling is not supported in GLES 2.0, but it's supported in GL 2.0 so we should do it on desktop at least. Reviewed-by: Trond
* Fixed bitmap drawing in GL 2 engine when not using GL pixmap backend.Samuel Rødal2009-06-121-2/+4
| | | | | | | | | 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
* Fixed off-by-one color bug in GL 2 paint engine.Samuel Rødal2009-06-121-5/+5
| | | | | Calling premultiplyColor() with a red channel of 255, alpha channel of 255, and opacity 1 would result in a color with red channel of 254.
* Fixed incorrect rendering of bitmap/pattern brushes in GL 2 engine.Samuel Rødal2009-06-125-8/+56
| | | | | | | | | The pen color should be used when drawPixmap is called with a bitmap, and the brush color should be used for texture patterns that are bitmaps. Task-number: 245802 Reviewed-by: Trond
* Optimized stencil buffer clearing in GL 2 paint engine.Samuel Rødal2009-06-092-42/+9
| | | | | | | | Based on Zack's patch, 17e1bca1ce366395f8331e16aa96b7176ca1abac. Instead of manually clearing the stencil buffer after drawing we simply do the clearing and drawing in one go. Reviewed-by: Trond
* Improved clipping in GL2 paint engine.Samuel Rødal2009-06-094-170/+246
| | | | | | | | | | | | | Use the stencil method to draw clip paths and regions to the Z-buffer instead of using glClear / glScissor. Using different depth values for the various clip parts also makes restore() very cheap when only IntersectClip is used. As an additional bonus this patch gives antialiased clip in the GL 2 paint engine. Task-number: 254658 Reviewed-by: Trond
* Compile with Sun CC 5.5.jasplin2009-06-051-1/+1
| | | | | | | | An alternative solution is to swap the order of -I../../include and -I../../include/QtOpenGL when compiling the opengl module. Reviewed-by: TrustMe
* All of Qt's own code compiles with -pedantic now (but pcre and webkit don't ↵David Faure2009-06-041-2/+2
| | | | | | | seem fixable easily) Merge-request: 594 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improvements to shader API in response to API reviewRhys Weatherley2009-06-041-2/+1
| | | | | Task-number: QT-80 Reviewed-by: Ian Walters
* Implemented QGLTextureGlyphCache to avoid wasting glyph cache memory.Samuel Rødal2009-06-034-29/+211
| | | | | | | | | Now there's only a copy of the texture glyph cache in graphics memory, avoiding the system memory copy that we used earlier. In addition the texture will use the GL_ALPHA texture format when possible, making it consume less graphics memory as well. Reviewed-by: Tom
* Made GL2 engine default for QGLWidget, and added GL2 sync() functionSamuel Rødal2009-05-292-0/+38
| | | | | | | | | | | | 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
* Fixed bug in GL graphics system when painting to pixmaps.Samuel Rødal2009-05-281-0/+3
| | | | | Make sure the correct texture unit is active when copying from the pixmap to the FBO in begin().
* Fixed incorrect handling of composition modes in GL2 paint engine.Samuel Rødal2009-05-282-22/+11
| | | | | | | | Even if the source pixels are opaque we have to enable blending for the non-trivial composition modes. Some of the composition modes are independent of source alpha and depend on destination alpha for example. Reviewed-by: Tom
* Compile fix with namespaces.hjk2009-05-287-3/+28
|
* Moved QGL2PaintEngineExPrivate into GL2 paint engine header file.Samuel Rødal2009-05-283-91/+95
| | | | Reviewed-by: Tom
* Make QGLWidgets have the same background colour as QWidgetsTom Cooksey2009-05-271-15/+8
| | | | | | | | 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
* Make WA_TranslucentBackground work on QGLWidget for X11Tom Cooksey2009-05-271-0/+10
| | | | | | | This patch enables QGLWidget's to have an ARGB visual on X11, alowing GL rendering on semi-transparent windows. Reviewed-By: Trond
* Avoided expensive image upload for GL pixmap backend for QPixmap::fill.Samuel Rødal2009-05-271-1/+7
| | | | | | | 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.