summaryrefslogtreecommitdiffstats
path: root/src/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Add an ARGB check for EGL-provided X visualsTom Cooksey2009-07-241-3/+20
| | | | | | | | Don't just assume they're going to be ARGB just because the config has an alpha channel. This makes QGLWidgets with WA_TranslucentBackground set work again on the rx71 when running under xcompmgr. Reviewed-By: Trustme
* Fix build on HPUXTom Cooksey2009-07-241-0/+2
| | | | Reviewed-By: Trustme
* Fix build on HarmattanTom Cooksey2009-07-231-1/+1
| | | | Reviewed-By: Trustme
* Add texture_from_pixmap defines for systems without themTom Cooksey2009-07-231-0/+19
| | | | | | | This fixes the build on older Solaris machines which don't have the GLX_EXT_texture_from_pixmap defines in glxext.h. Reviewed-By: Trustme
* Fix build on MacTom Cooksey2009-07-222-8/+28
| | | | | | | | | 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-222-16/+9
| | | | | | | | | ~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-228-174/+422
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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
* Corrected the value of GL_MAX_SAMPLES_EXT.Kim Motoyoshi Kalland2009-07-211-1/+1
| | | | 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-216-63/+228
| | | | | | | | | | | | | | | | | | 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
* Merge commit 'origin/4.5'Oswald Buddenhagen2009-07-201-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp src/3rdparty/webkit/WebCore/page/DOMWindow.idl src/corelib/io/qdiriterator.cpp src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h tests/auto/qxmlquery/tst_qxmlquery.cpp tools/linguist/lconvert/main.cpp
| * Fixed bug where line widths were rounded to integers in the GL engine.Kim Motoyoshi Kalland2009-07-161-1/+1
| | | | | | | | | | | | | | Regression from Qt 4.4. Task-number: 257990 Reviewed-by: Tom
* | Doc: A few cleanups, fixes and improvements.Volker Hilsheimer2009-07-192-3/+2
| |
* | Doc: add \since 4.6 for new APIsVolker Hilsheimer2009-07-191-24/+0
| |
* | 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
* | Fix warnings in mingwThierry Bastian2009-07-151-1/+1
| |
* | Build fix for mingwThierry Bastian2009-07-141-1/+1
| | | | | | | | | | we should include qt_windows.h and not windows.h because we have to define WINVER to 0x500.
* | Doc: Explicitly declare the module for each namespace to prevent strangeDavid Boddie2009-07-131-0/+1
| | | | | | | | | | | | | | omissions when qdoc is used in certain Windows environments. Task-number: 256415 Reviewed-by: Trust Me
* | Moved uniform enum to QGLEngineShaderManager.Kim Motoyoshi Kalland2009-07-034-83/+69
| | | | | | | | | | | | Simplified caching of uniform locations. Reviewed-by: Samuel
* | Enabled double buffering of window surfaces on Windows.Kim Motoyoshi Kalland2009-07-031-1/+1
| | | | | | | | | | | | Without this, QWindowSurface::flush() doesn't work. 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-012-3/+30
| | | | | | | | | | | | | | This could potentially crash when a context was destroyed before the actual font engine holding the QGLTextureGlyphCache was destroyed. Reviewed-by: Samuel
* | src/opengl: Remove QT_WA and non-Unicode code paths, dropping Win9x and NT ↵miniak2009-07-011-8/+4
| | | | | | | | | | | | | | support Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
* | Fixed some regressions in the OpenGL pixmap backend.Samuel Rødal2009-06-292-4/+13
| | | | | | | | | | | | | | | | 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
* | Silence trivial warningsThiago Macieira2009-06-261-4/+4
| |
* | 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
* | Merge commit 'origin/4.5'Oswald Buddenhagen2009-06-231-7/+13
|\ \ | |/ | | | | | | Conflicts: src/sql/drivers/psql/qsql_psql.cpp
| * Fixed drawTiledPixmap() for the GL paint engine.Trond Kjernåsen2009-06-221-7/+13
| | | | | | | | | | | | | | The offset was completely ignored for the GL 1 paint engine. Task-number: 256608 Reviewed-by: Samuel
* | Integrate the OpenVG graphics system into Qt 4.6Rhys Weatherley2009-06-2211-1421/+72
| | | | | | | | | | This change also moves the EGL support classes from QtOpenGL to QtGui so they can be shared between OpenGL and OpenVG.
* | Use QTransform more efficiently.Bjørn Erik Nilsen2009-06-182-8/+4
| | | | | | | | Reviewed-by: Samuel
* | Prevented unnecessary depth clip updates in OpenGL paint engine.Samuel Rødal2009-06-182-1/+10
| | | | | | | | | | | | | | | | | | Keep track of whether the depth clip has actually changed between states, so that when QPainter::restore() is called we don't call the potentially expensive updateDepthClip() function when not needed. Task-number: 254658 Reviewed-by: Trond
* | Added save state detection in OpenGL engine to avoid dirtying state.Samuel Rødal2009-06-181-0/+13
| | | | | | | | | | | | | | | | When setState() is called right after createState() it means that none of the OpenGL state needs changing, so we can simply return. Task-number: 254658 Reviewed-by: Trond
* | Speed up QPixmap::width(), height(), isNull() and depth().Andreas Aardal Hanssen2009-06-172-34/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-173-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Update license headers in files that are new in 4.6.Jason McDonald2009-06-175-10/+10
| | | | | | | | Reviewed-by: Trust Me
* | Merge license header changes from 4.5Volker Hilsheimer2009-06-1654-108/+108
|\ \ | |/
| * Update license headers as requested by the marketing department.Jason McDonald2009-06-1659-118/+118
| | | | | | | | 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
* | Disabled the use of VERSION_1_3 GLX functions on HPUX.Carlos Manuel Duclos Vergara2009-06-151-4/+8
| | | | | | | | | | | | This is a compilation fix reported by pulse agent on HPUXi. Reviewed-by: Samuel
* | 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
* | Re-enabled GL pixmap backend and window surface to work without GL2.Samuel Rødal2009-06-153-1/+15
| | | | | | | | | | | | | | 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-122-3/+5
| | | | | | | | | | | | | | | | | | 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