summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
Commit message (Collapse)AuthorAgeFilesLines
* Fix possible crash in QStaticText and QDeclarativeTextLayoutEskil Abrahamsen Blomfeldt2010-10-291-12/+12
| | | | | | | | | | | | | The QStaticTextItem held an uncounted reference to QFontEngine. The pointer would dangle in some cases where there was no font object referencing the engine and the cache was cleaned out (e.g. when a new application font is added.) Properly count the reference, and also add reference counting to userData to make it harder to shoot yourself in the foot, since the QStaticTextItem class is now being used in different places, Task-number: QTBUG-14446 Reviewed-by: Martin Jones
* Fixed many spelling errors.Rohan McGovern2010-10-251-1/+1
|
* Functions that are externally defined to QtOpenGL needs to be imported.Jani Hautakangas2010-10-211-1/+1
| | | | | | This is needed for RVCT4 Reviewed-by: Jason Barron
* Fix GL_OES_element_index_uint and add GL_OES_depth24 detection.Jani Hautakangas2010-10-202-20/+9
| | | | | | | | | GL_OES_element_index_uint detection was not working because EGL config wasn't yet resolved. In addition QFrameBufferObject should use 24bit depth render buffer if extension is available. Task-number: QTBUG-14542 Reviewed-by: Gunnar
* Fix text rendering in GL when using the broken-fbo-fallbackEskil Abrahamsen Blomfeldt2010-10-071-1/+1
| | | | | | | | | | | This is a backport of 3874cd95e203da40d5205ef6455d7f56cba6923a which was committed to qt:master. Since the patch that originally exposed the bug was added to 4.7.2, this patch is required there as well. Bug is visible when resizing the glyph cache on devices where QGLContext::brokenFBOReadback defaults to true, or by setting this to true on desktop. Reviewed-by: Gunnar
* Quick fix for OSX and Windows/Mingw compilation errors.Jani Hautakangas2010-10-051-8/+8
| | | | | | | | | | On OSX AssertMacros.h header has macro called verify() and QRBTree::verify() function was substituted by this macro. On Windows/Mingw includes need to point to exported private include folder. Reviewed-by: Kim
* Fix gcc compilation problems in QtOpenGL. Actually was typo andJani Hautakangas2010-10-041-2/+2
| | | | | | for some reason rvct didn't catch that. Reviewed-by: TRUSTME
* Enable QtOpenGL vector path caching on Symbian/IVE3Jani Hautakangas2010-10-043-134/+320
| | | | | | | | | | IVE3 doesn't support UNSIGNED_INT <type> index values in DrawElements. This patch checks if GL_OES_element_index_uint extensions is supported and determines DrawElement indices type based on that. On desktop environment UNSIGNED_INT is always supported. Task-number: QTBUG-13563 Reviewed-by: Gunnar
* Fallback to A8 text rendering on Mac when LCD smoothing is disabledAaron Kennedy2010-09-291-0/+7
| | | | | Task-number: QTBUG-14050 Reviewed-by: Eskil Abrahamsen Blomfeldt
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7Aaron Kennedy2010-09-281-28/+2
|\
| * Compile on Symbian - rework the X11 mask patch a bit.Trond Kjernåsen2010-09-231-2/+2
| | | | | | | | | | | | | | | | Avoid adding a virtual QPixmapData::hasMask() function, we can do without it. Made QPixmap::hasAlpha() fast, so we can use that instead. Reviewed-by: Samuel
| * Fixed drawing of QPixmaps with masks in the GL 2 and X11 engines.Trond Kjernåsen2010-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | A regression from 4.6.x. This is an X11-only problem caused by the separate masks that an X11 QPixmap can contain. These masks we're not taken into account when a number optimizations were done for 4.7. Introduction of the texture-from-pixmap extension in 4.6 also broke masked pixmaps under X11. Task-number: QTBUG-13814 Reviewed-by: Samuel
| * Revert "Fixed painter path drawing on FBO without stencil buffer."Kim Motoyoshi Kalland2010-09-221-26/+0
| | | | | | | | | | This reverts commit 89cbb165600de9a557a8a621dc41b93c2a7a2b52. The patch should be applied to Qt 4.8, not 4.7.
* | Minimize parameter changes on glyph cache texturesAaron Kennedy2010-09-283-5/+32
| | | | | | | | | | | | | | Cache the last set filtering mode on glyph textures and update only when necessary. Reviewed-by: Gunnar Sletta
* | Only set maskTexture sampler uniform onceAaron Kennedy2010-09-282-6/+13
| | | | | | | | | | | | | | Qt always uses the same texture unit as the maskTexture, so it makes sense to set the uniform only once when the program is created. Reviewed-By: Gunnar Sletta
* | Only repopulate the glyph cache when we know something could have changedAaron Kennedy2010-09-281-11/+16
| | | | | | | | Reviewed-by: Gunnar Sletta
* | Remove unnecessary attribute changesAaron Kennedy2010-09-231-2/+0
| | | | | | | | | | | | | | The only consumer of TextDrawingMode is drawCachedGlyphs, and it always sets these two attrib pointers anyway. Reviewed-By: Gunnar Sletta
* | Invalidate QStaticText coord cache when texture size changesAaron Kennedy2010-09-231-1/+8
|/ | | | | | | If the glyph cache texture changes size, the texture coordinate array must be regenerated to point to the correct texture locations. Reviewed-By: Gunnar Sletta
* Fixed drawing a large number of glyphs with the same font under GL.Trond Kjernåsen2010-09-212-1/+12
| | | | | | | | | | | | | | Our glyph caching system doesn't take GL texture size limitation into account, and assumes you can create an infinitely large texture. On top of that, the cache will never create a cache that is wider than 256, or QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH, which means we'll hit the texture size limit even faster. With this patch the entire texture is utilized. However, to fix in properly we need to support having multiple texture for each font engine. That will be fixed shortly (see task QTBUG-13784). Task-number: QT-3971 Reviewed-by: Eskil
* Fixed painter path drawing on FBO without stencil buffer.Kim Motoyoshi Kalland2010-09-201-0/+26
| | | | | Task-number: QTBUG-13450 Reviewed-by: Samuel
* Fixes QPen dash offset for OpenGL paint engines (1.x & 2.x).Yoann Lopes2010-09-201-0/+1
| | | | | Task-number: QTBUG-13409 Reviewed-by: Trond
* Some optimizations to the GL pixmap data.Samuel Rødal2010-09-092-0/+8
| | | | | | | - Don't use toImage() / fromImage() to copy when a render FBO is active. - Use raster for rendering to small (< 32x32) pixmaps. Reviewed-by: Trond
* Introduce QtOpenGL module for Symbian.Jani Hautakangas2010-08-202-4/+20
| | | | | Task-number: QT-2139 Reviewed-by: Gunnar Sletta
* Silence warning when building with MSVC 2005Andy Shaw2010-07-141-1/+1
| | | | Reviewed-by: Eskil
* Fix text drawing into alpha pixmap with opengl engineEskil Abrahamsen Blomfeldt2010-07-072-6/+0
| | | | | | | | | | | | | The merge 03dc74984749adf5b11482bf871a47086217845c mistakenly merged the glyphMargin() (which had been removed in 4.7 because QGLTextureGlyphCache now inherits from the image glyph cache) with the glyphPadding() which had been introduced in separate commits in both branches (probably backported.) This broke text drawing into a pixmap with an alpha with the GL engine, because we'd assume a margin of 1, but the alphaMapForGlyph() function doesn't support margins. Task-number: QTBUG-11987 Reviewed-by: Gunnar
* Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Olivier Goffart2010-06-082-0/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp src/3rdparty/webkit/WebKit/qt/ChangeLog src/gui/painting/qpainter.cpp src/gui/painting/qtextureglyphcache.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtCoreu.def src/s60installs/eabi/QtGuiu.def src/s60installs/eabi/QtNetworku.def src/s60installs/eabi/QtOpenVGu.def tests/auto/qfontmetrics/tst_qfontmetrics.cpp tools/linguist/lupdate/main.cpp
| * Fix antialiasing with transformed text in OpenGL2 paint engineEskil Abrahamsen Blomfeldt2010-05-313-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the paint engine now transforms the prerendered glyphs instead of rendering transformed glyphs as paths, we need to turn on texture filtering to avoid antialiasing artifacts. In order to do this, we also need to pad the glyphs in the glyph cache, otherwise you will get artifacts when sampling the area around the glyph's bounding rect (where there might be other glyphs.) This done by adding a glyphPadding() function to the cache which returns the number of pixels to pad between each glyph. Updated: This also fixes a general issue where some combinations of font sizes and transformations will cause the engine to sample neighbouring glyphs, so this has been backported to Qt 4.6.x. Task-number: QTBUG-9706, QTBUG-11028 Reviewed-by: Tom Conflicts: src/gui/painting/qtextureglyphcache.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
* | Speed up QStaticText with affine transformation on GL2 engineEskil Abrahamsen Blomfeldt2010-06-012-22/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the OpenGL2 paint engine supports transforming the prerendered glyphs rather than rasterizing the glyphs with the transformation applied, we don't need to recalculate the QStaticText layout whenever the transformation changes. This means that we can do fast animated transforms for QStaticText on this paint engine. A quick test yields something like 100x speed-up on Windows. This also give visually better results, as we previously would animate the hinting of the glyphs, thus causing jittering. The autotest has been updated to reflect the fact that drawText() and drawStaticText() now go through identical paths on GL, also when transforms are set on the painter. However, the scale was changed in one test, because it was so great that drawText() would fall back to paths. With QStaticText the idea is speed, so you'll get a poor, but fast result instead, which is better than tricking people. Reviewed-by: Samuel
* | Fixed compilation of QtOpenGL.Samuel Rødal2010-05-271-1/+1
| | | | | | | | Reviewed-by: Eskil
* | Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Olivier Goffart2010-05-172-5/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/demos.pro mkspecs/features/resources.prf mkspecs/features/uic.prf src/corelib/io/qurl.cpp src/corelib/tools/qlocale_symbian.cpp src/gui/graphicsview/qgraphicsscene.cpp src/gui/graphicsview/qgraphicswidget_p.cpp src/gui/graphicsview/qgraphicswidget_p.h src/gui/util/qsystemtrayicon_win.cpp src/multimedia/audio/qaudioinput.cpp tests/auto/qhostinfo/qhostinfo.pro
| * Workaround for ATI driver bug when using QGraphicsEffect with GL.Kim Motoyoshi Kalland2010-05-122-5/+6
| | | | | | | | | | | | | | | | | | If you forward declare a shader function which takes a sampler as argument, the shader program will fail to link on ATI cards under Windows. Task-number: QTBUG-10510 Reviewed-by: Trond
* | Limit the lower glyph texture cache size to 16x16 in GL.Trond Kjernåsen2010-05-141-0/+12
| | | | | | | | | | | | | | | | | | | | | | The SGX chip has a limitation regarding FBOs in that it doesn't support FBO sizes that are POT and less than 16 pixels in width/height. Since the FBO we use in the GL glyph cache always mirrors the size of the texture itself, we limit that instead to avoid creating invalid FBOs. Task-number: QTBUG-10645 Reviewed-by: Gunnar
* | Added workarounds for two MBX/SGX specific GL ES bugs/problems.Trond Kjernåsen2010-05-142-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The workaround flags are put into the platform independent section for now, since there might be a general need for these as we expand our GL and GL ES usage. The workaround_needsFullClearOnEveryFrame flag covers the case where you get a performance penalty on PowerVR hw if all rendering buffers are not cleared. The workaround_brokenFBOReadBack flag covers the case where copying pixels from a texture (e.g. via glCopyTexSubImage2d()) bound in an FBO doesn't work. Task-number: QTBUG-10670 Reviewed-by: Gunnar
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-05-112-32/+59
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (24 commits) Stabilize tst_QColumnView::parentCurrentIndex Really fix tst_QDockWidget::taskQTBUG_9758_undockedGeometry on Linux Fix typos in Elastic Nodes example documentation. Made paint engine texture drawing work in GL ES 2 and updated docs. Opt out of visual-config size checks with extension Fix off-by-one in text layouts and widget size hints on Mac Stabilize tst_QDockWidget::taskQTBUG_9758_undockedGeometry Mark QFileDialog::Options as a Q_FLAGS fix tst_QDockWidget::taskQTBUG_9758_undockedGeometry on Linux Fixed scrolling bugs in widget graphics effect backend. Fixed source pixmap bug in widget graphics effect backend. Fix crash with stylesheet if widget change style in the changeEvent Fix textdrawing under GL on N900. Fixed bug in QIODevice::read after first reading 0 bytes. Fix auto-test failure on Mac/Linux/QWS. Some EGL implementations does not return a EGLNativeDisplayType Fixed the sizing of the dock area with fixed size dock widgets QSortFilterProxyModel: Warning or assert failure Performance issue with QGraphicsItem::ItemClipsChildrenToShape. Fixes crash in QGraphicsItem::mouseMove for untransformable items. ...
| * | Fix textdrawing under GL on N900.Gunnar Sletta2010-05-072-32/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver in the N900 doesn't support glCopyTexSubImage or glReadPixels for FBO's that have a GL_ALPHA or POT color attachment. The ifdef'ed code in resize() was a previous attempt to make this work which didn't. We could have changed the texture to be GL_RGBA and changed the texture size to be NPOT, but that would have wasted precious GPU memory and would have been slower, so we waste a bit of system memory instead, by having a QImage copy along with the texture. Reviewed-by: Eskil Reviewed-by: Trond
* | | Avoid many unnecessary allocations, so so that paint engines attached to pixmapsWarwick Allison2010-05-075-7/+16
|/ / | | | | | | | | | | | | | | | | do not consume excessive amounts of memory, and so can still be reasonably kept cached with the pixmap. Saves 8K for every pixmaps drawn to on raster paint engine. Saves about 2K for other graphicssystems. Task-number: QTBUG-10215 Reviewed-by: Gunnar
* | Fix crash in styles example when running with opengl graphicssystemTom Cooksey2010-04-281-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When drawing text using glyphs, the shader manager will select the "MaskFragmentShader" which requires a varying called "textureCoords" which is used to sample the glyph from the glyph texture. That's fine, except when you try to use one of the pattern brushes or a texture brush, because the src pixel fragment shader snippets for those brushes also sample from a texture (the brush texture) and name the verying they use "textureCoords" too. This led to textureCoords being defined twice, which in turn caused a shader compile error which then casued the seg-fault. This patch simply renames the varying used to pass the coordinates for the brush texture so it doesn't conflict. Reviewed-By: Kim Task-Number: QTBUG-9522
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-04-272-2/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Add unit tests covering most of QVector's API. Fix crash when CoreText fails to shape text for us Fix crash when using opengl graphicssystem on desktop
| * | Fix crash when using opengl graphicssystem on desktopTom Cooksey2010-04-272-2/+7
| | | | | | | | | | | | | | | Reviewed-By: Eskil Task-number: QTBUG-10225
* | | Correctly inherit extension propertiesAaron Kennedy2010-04-271-1/+1
|/ / | | | | | | Correct a typo that breaks extension properties in some cases.
* | Remove dead code left after a merge conflict resolutionTom Cooksey2010-04-222-22/+0
| | | | | | | | Reviewed-By: Kim
* | Use QGLContextPrivate to track attribarray enabled state.Gunnar Sletta2010-04-191-3/+3
| | | | | | | | | | Reviewed-by: Trond Reviewed-by: Tom
* | Move nativePaintingActive flag to GL2 engine's privateTom Cooksey2010-04-142-9/+10
| | | | | | | | Reviewed-By: Samuel
* | More adjustments to QTBUG-6800Carolina Gomes2010-04-142-6/+4
| | | | | | | | | | Merge-request: 2344 Reviewed-by: Tom Cooksey
* | QTBUG-6800 patch included, but only for OpenGL 2.0Carolina Gomes2010-04-142-1/+12
| | | | | | | | | | Merge-request: 2344 Reviewed-by: Tom Cooksey
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-04-124-6/+34
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (44 commits) QSlider and StyleSheet: fix one pixel error while drawing the SliderAddPage accelerate QWindowsPipeWriter for bigger chunks of data Fix antialiasing with transformed text in OpenGL2 paint engine Fix flattening of largely scaled, thin, dashed beziers. Increased the precision used to flatten beziers Fix QT_NO_MOVIE Fix compile error with QT_NO_ACTION in QtGui Fix QT_NO_COMPLETER Fix QT_NO_FSCOMPLETER Fix QT_NO_FILESYSTEMMODEL Build fix Safeguard ourselves against corrupt registry values for cleartype gamma fix cetest build properly qdrawhelper: optimize the fetch transformed bilinear functions Compile fix for WinCE Make sure the selectionChanged signal is not called too much Implement heightForWidth support for QTabWidget and QStackedLayout. Fix the doc for QFrame::frameStyle Don't use texture-from-pixmap if the target isn't GL_TEXTURE_2D Add runtime check for GLX >= 1.3 before using glXCreatePixmap ...
| * \ Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7Eskil Abrahamsen Blomfeldt2010-04-122-5/+27
| |\ \
| | * | Fix flattening of largely scaled, thin, dashed beziers.Gunnar Sletta2010-04-121-4/+24
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Samuel Task: http://bugreports.qt.nokia.com/browse/QTBUG-9218
| | * | Allow y-interted pixmaps for brushes in GL2 paint engineTom Cooksey2010-04-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means texture-from-pixmap can now be used for brush pixmaps. Task-number: QTBUG-9707 Task-number: QT-3013 Reviewed-By: Samuel Rødal
| * | | Fix antialiasing with transformed text in OpenGL2 paint engineEskil Abrahamsen Blomfeldt2010-04-123-1/+7
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the paint engine now transforms the prerendered glyphs instead of rendering transformed glyphs as paths, we need to turn on texture filtering to avoid antialiasing artifacts. In order to do this, we also need to pad the glyphs in the glyph cache, otherwise you will get artifacts when sampling the area around the glyph's bounding rect (where there might be other glyphs.) This done by adding a glyphPadding() function to the cache which returns the number of pixels to pad between each glyph. Task-number: QTBUG-9706 Reviewed-by: Tom