summaryrefslogtreecommitdiffstats
path: root/src/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-031-1/+1
|\ | | | | | | | | | | | | Manually fixed up: isES -> isOpenGLES src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp Change-Id: I57d2ef26c3d4a7b40ace09f4e8560b7686650ea5
* | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-0110-40/+40
|\| | | | | | | | | | | This merge adds the opengl rename. Change-Id: I84ea0b6abee9780ebb2cf3f64ab9e3fdf2acab3e
| * Rename new QOpenGLContext APIsLaszlo Agocs2014-04-2510-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | isES() becomes isOpenGLES(). The library type enums are changed DesktopGL -> LibGL and GLES2 -> LibGLES. This removes the now unnecessary version number, the confusing "desktop" term and provides better readability. The old function/values are kept until the related qtdeclarative changes are integrated. Task-number: QTBUG-38564 Change-Id: Ibb0a1209985f1ce4bb9451f9b7b093c2b68a6505 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Avoid a double memory copy during bindTextureAllan Sandfeld Jensen2014-04-251-1/+13
| | | | | | | | | | | | | | | | | | | | | | If a painter is active on a QPixmap being uploaded, it will be copied twice, first to create a QImage and then from QImage into a texture. The first copy is unnecessary since the QImage is only temporary, so we can force it to be created as a reference instead of a copy. Change-Id: Iabcfb514a634446a01f1c4031349c185ec09290b Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Don't use GL_REPEAT for image-brush drawing on OpenGL ES2Allan Sandfeld Jensen2014-04-251-1/+9
|/ | | | | | | | | | | | | | | | | Backport of commit 8dfeb1c374972f06759a92b4edc5d6a18b96ccec in QtGui to the same class in the QtOpenGL module. OpenGL ES2 doesn't support NPOT textures in combination with GL_REPEAT, so for OpenGL ES2 we use a custom program that emulates repeat by taking the fractional part of the texture coordinates. This is not enough though, as merely setting GL_TEXTURE_WRAP_x to GL_REPEAT with a NPOT texture is an error in some implementations, so we have to guard the call to updateTextureFilter() in updateBrushTexture() with a check for OpenGL ES2 and use GL_CLAMP_TO_EDGE instead. Change-Id: Icbdd784c2c6d562849679f87da18b20d5441f389 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* purge vestiges of opengl es 1 supportOswald Buddenhagen2014-04-043-31/+8
| | | | | | | | amends 0d5170256c1. Change-Id: Ifa178d38f602bb7c66ef13334673ff47e332af5b Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Avoid recreating the underlying context in QGLContext wrappersLaszlo Agocs2014-04-031-2/+3
| | | | | | | | | | | QGLContexts created from a QOpenGLContext get their valid flag reset, resulting in creating a totally new underlying context. This is wrong and becomes visible when sharing is expected between contexts (since the QGLContext's underlying QOpenGLContext will not have sharing). Task-number: QTBUG-37893 Change-Id: I8cb37c11dfb400a77e510bf4c8219bedc742309e Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* QNX: Fix OpenGL autotestFabian Bumberger2014-04-012-0/+8
| | | | | | | | | | | | On QNX grabbing the frame buffer returns the content of the back buffer. In order to execute the OpenGL tests properly a swapBuffers is executed before in order to be able to retrieve the content of the front buffer. The patch also documents this platform behavior. Change-Id: I7a501818ec6eea061f2f54f95854f68cb72e0534 Reviewed-by: James McDonnell <jmcdonnell@qnx.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Do not set fwdcompat bit for a compatibility profile QGLFormatLaszlo Agocs2014-04-011-0/+5
| | | | | | | | AMD drivers do weird things. Provide a workaround. Task-number: QTBUG-37909 Change-Id: Idabd6ebb6e1447cb9bd92c7711a50aaa8575b9d6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: Fix typosJonathan Liu2014-03-271-1/+1
| | | | | Change-Id: I720813b126f02d4813c88811316a0fa99961c6d8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix some documentation errors.Friedemann Kleint2014-03-242-48/+3
| | | | | | | | Correct links and fix typos, remove obsolete documentation, fix some snippets, mark some classes as internal. Change-Id: I9a3266605f060783413d32740057a57a820c8929 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix crash: make sure functions pointer is initialized.BogDan Vatra2014-03-221-1/+1
| | | | | Change-Id: I42fd3933f33370612290e8ba252349acfae72381 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Docs: Correct OpenGL ES namingLaszlo Agocs2014-03-201-169/+169
| | | | | | | | Not sure where "OpenGL/ES" is coming from but there is no such thing. The correct name is OpenGL ES. Change-Id: If071ee5bd928fea1a2f1aebc11155344df1efe2d Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Add note to docs about normalization in setAttributeBufferLaszlo Agocs2014-03-171-0/+6
| | | | | | Task-number: QTBUG-37103 Change-Id: I0b1716b76e10c65871c6a96dab5d8d81c95095d7 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Resurrect QGLWidget::renderText()Laszlo Agocs2014-03-156-15/+40
| | | | | | | | | | The variant taking x, y, z has been broken in all Qt 5.x releases. This is now corrected by making the GL2 paint engine capable of applying a Z translation. Task-number: QTBUG-31156 Change-Id: I119566e9e9577f6cdf7e8bae56cac1e34995e622 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Make QGLFunctions wrap QOpenGLFunctionsLaszlo Agocs2014-03-062-3067/+115
| | | | | | | | | | | | Remove the duplicated implementation. When moving to support also dynamic GL builds, having a standalone QGLFunctions is not feasible anymore since the changes made to QOpenGLFunctions will not be backported to QGLFunctions. Change-Id: Iaf742e496d3c92d6d915baee93283180259e27a6 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix compileBogDan Vatra2014-03-061-2/+1
| | | | | | | | Move Q_Q(QGLContext); inside #ifndef block, otherwise q varialble remains unused and it breaks the compilation. Change-Id: Iebef9a45930fd4f7783eb983b55bf6b5e0b94cf4 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Dynamic GL: remove exporting symbolsLaszlo Agocs2014-03-0411-70/+77
| | | | | | | | | | | | | | | | | | | | | Remove the opengl proxy for now. Later it will either be moved into a separate library or replaced by a QOpenGLFunctions-based approach. This means that the -opengl dynamic configuration is not usable for the time being. The rest of the enablers remain in place. The convenience function QOpenGLFunctions::isES() is now moved to QOpenGLContext and is changed to check the renderable type. This is extremely useful since besides supporting dynamic GL it solves also the problem of GL_ARB_ES2_compatibility (i.e. it triggers the real ES path when creating an ES-compatible context with a desktop OpenGL implementation). Task-number: QTBUG-36483 Task-number: QTBUG-37172 Change-Id: I045be3fc16e9043e1528cf48e6bf0903da4fa7ca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix some typosSergio Ahumada2014-03-031-1/+1
| | | | | | Change-Id: I7dbe938bff5ac3ab50a0197f94bdb2f6c22fbd16 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Fix texture glyph cache setup in old OpenGL paint engineTor Arne Vestbø2014-02-241-7/+6
| | | | | | | | Caused assert-crash reported on Windows. Task-number: QTBUG-37027 Change-Id: If84b970a153570115afb344797728a0b1a04db5b Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Unify glyph format between QFontEngine and QFontEngineGlyphCacheTor Arne Vestbø2014-02-194-29/+29
| | | | | | | | | | | | Instead of the glyph cache having its own cache type that always mapped one to one to a font engine glyph format, causing confusion and needless conversions, the glyph caches now use QFontEngine's glyph format enum. This also removes the iffy use of an int for the glyphFormat in the font engines. Change-Id: I529bad5c179e004f63e152f7dcc311d298c3db98 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Dynamic GL switch on WindowsLaszlo Agocs2014-02-1414-436/+518
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch introduces a new build configuration on Windows which can be requested by passing -opengl dynamic to configure. Platforms other than Windows (including WinRT) are not affected. The existing Angle and desktop configurations are not affected. These continue to function as before and Angle remains the default. In the future, when all modules have added support for the dynamic path, as described below, the default configuration could be changed to be the dynamic one. This would allow providing a single set of binaries in the official builds instead of the current two. When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are never defined. Instead, the code path that has traditionally been desktop GL only becomes the dynamic path that has to do runtime checks. Qt modules and applications are not linked to opengl32.dll or libegl/glesv2.dll in this case. Instead, QtGui exports all necessary egl/egl/gl functions which will, under the hood, forward all requests to a dynamically loaded EGL/WGL/GL implementation. Porting guide (better said, changes needed to prepare your code to work with dynamic GL builds when the fallback to Angle is utilized): 1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to differentiate between desktop and ES where needed. Keep in mind that it is the desktop GL header (plus qopenglext.h) that is included, not the GLES one. QtGui's proxy will handle some differences, for example calling glClearDepth will route to glClearDepthf when needed. The built-in eglGetProcAddress is able to retrieve pointers for standard GLES2 functions too so code resolving OpenGL 2 functions will function in any case. 2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds, but never "angle" or "opengles2". 3. The preprocessor define QT_OPENGL_DYNAMIC is also available in dynamic builds. The usage of this is strongly discouraged and should not be needed anywhere except for QtGui and the platform plugin. 4. Code in need of the library handle can use QOpenGLFunctions::platformGLHandle(). The decision on which library to load is currently based on a simple test that creates a dummy window/context and tries to resolve an OpenGL 2 function. If this fails, it goes for Angle. This seems to work well on Win7 PCs for example that do not have proper graphics drivers providing OpenGL installed but are D3D9 capable using the default drivers. Setting QT_OPENGL to desktop or angle skips the test and forces usage of the given GL. There are also two new application attributes that could be used for the same purpose. If Angle is requested but the libraries are not present, desktop is tried. If desktop is requested, or if angle is requested but nothing works, the EGL/WGL functions will still be callable but will return 0. This conveniently means that eglInitialize() and such will report a failure. Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will tell which implementation is chosen. The textures example application is ported to OpenGL 2, the GL 1 code path is removed. [ChangeLog][QtGui] Qt builds on Windows can now be configured for dynamic loading of the OpenGL implementation. This can be requested by passing -opengl dynamic to configure. In this mode no modules will link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will dynamically choose between desktop and Angle during the first GL/EGL/WGL call. This allows deploying applications with a single set of Qt libraries with the ability of transparently falling back to Angle in case the opengl32.dll is not suitable, due to missing graphics drivers for example. Task-number: QTBUG-36483 Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-122-0/+10
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qimage.cpp src/gui/text/qtextengine.cpp src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/printsupport/kernel/qprintengine_win.cpp Change-Id: I09ce991a57f39bc7b1ad6978d0e0d858df0cd444
| * Fix build with QT_NO_GRAPHICSEFFECTSérgio Martins2014-02-122-0/+10
| | | | | | | | | | Change-Id: Iadc78c270f541067dbbebcf77748077cc3a8be13 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-02-113-8/+4
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-073-8/+4
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| | * Do not check for !IsRenderBufferLaszlo Agocs2014-02-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike the newer QOpenGLFramebufferObject, QGLFramebufferObject still contains some unfortunate tests for !IsRenderBuffer when creating renderbuffers. Removing these tests avoids asserting in debug builds on drivers that are not conformant to the GL spec in this respect. This means that the qgl autotest is now passing on such drivers too. The tests do not make much sense in the first place since Qt is not a conformance test suite. Change-Id: I21d6272cd5cef9dd71eab57e46771d3ce7dacbfb Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| | * Doc: Fix broken linksSze Howe Koh2014-02-043-5/+4
| | | | | | | | | | | | | | | Change-Id: Ic275dfbf0b332fc34ea0fac1c31c4935ad961527 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| | * Doc: corrected link/example errorsNico Vertriest2014-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update pro files after move gestures folder Update snippet statements Corrected path in imagegestures.pro Task-number: QTBUG-34749 Change-Id: Icc19908914e36507e412ab63bf0cc2809aa48e17 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | Export optimized premultiply and unpremultiply methodsAllan Sandfeld Jensen2014-02-101-5/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch optimizes the unpremultiply method further by using a lookup table to avoid any divisions at all. The opportunity is taken to export both premultiply and unpremultiply since they are commonly used methods relevant to the exported QRgb type that can be both premultiplied and unpremultipled ARGB. [ChangeLog][QtGui][QColor] Exported highly optimized methods for premultiply and unpremultiply of QRgb values. Change-Id: I658bcf57b0bc73c34c1765b64617d43b63ae820b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Support multiple native surfaces on Android.BogDan Vatra2014-01-171-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for multiple native surfaces is needed by applications that need to mix raster windows with GL windows. Rework the raster and opengl implementation, get rid of eglfs and fbconvenience dependencies. Create a single android platform plugin. [ChangeLog][Android] Rework the raster and opengl implementation. [ChangeLog][Android] Create a single android platform plugin. Task-number: QTBUG-34650 Change-Id: I9b1ab51554823329dda8cfbf8fef27c38f917c7b Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-2/+2
|/ | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Resurrect QGLWidget::renderPixmap()Laszlo Agocs2014-01-063-46/+61
| | | | | | | | | | | | | | | | This function has been completely broken since Qt 5.0. Unfortunately the autotest's verification steps were somewhat faulty so returning a null pixmap from renderPixmap() did not trigger a failure. The implementation is now done with framebuffer objects and pixel readback. This is not ideal performance-wise, but is the only option. In Qt 4 pixmaps were often backed by platform dependent native pixmaps that could be used as rendering targets for OpenGL content. This is not an option anymore since pixmaps are raster backed on all the major platforms. Task-number: QTBUG-33186 Change-Id: I8f558e33bf7967ac3be439fd5a3eac07b6444be5 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix radial gradient shader compilation for OpenGL ES 2.0.Carsten Munk2013-12-051-2/+2
| | | | | | | | | Change highp to mediump. This qualifier is ignored on desktop, and mediump should be sufficient elsewhere. Task-number: QTBUG-35353 Change-Id: I79f0ed88717d45dada5dcb781e75b10e72db4bd0 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Doc: Fix broken linksSze Howe Koh2013-11-051-1/+1
| | | | | | | | Task-number: QTBUG-33360 Change-Id: Ic944cb2f575c35ebad64852ef5fc44a50ac03571 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Do not byteswap RGBA8888 formatsAllan Sandfeld Jensen2013-10-251-4/+32
| | | | | | | | | | | | | The three RGBA8888 formats was introduced to make it possible to have QImages and QPixmaps in native OpenGL formats, but uploaded textures of these types are still converted to ARGB first and then swapped back. This patch detects the formats and ensures the unneeded back-and-forth conversion does not take place. It also replaces a seemingly unused private API meant for the same goal. Change-Id: Id69d6973bb9c13d1052f2a1b0c516183f63421c2 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Avoid calling convertFromGLImage on a null image.Gunnar Sletta2013-10-141-0/+5
| | | | | | | Task-number: QTBUG-34017 Change-Id: If51ef4b1f906677e26d14b5a92799097d18ac437 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-088-87/+87
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove code that doesn't do anything.Gunnar Sletta2013-09-261-12/+0
| | | | | Change-Id: Id2528167f21e1ab81b998ceb808a9fc4a24b239a Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Fix a memory leak in QGLWidget::renderTextLaszlo Agocs2013-09-201-0/+2
| | | | | | | Task-number: QTBUG-32792 Change-Id: Ie9293a1919c1bdf13a5c357a8d2eac303a83d4d4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix QtOpenGL module build with -WerrorKonstantin Ritt2013-09-091-4/+4
| | | | | | | | | | Build failed with error "array subscript is above array bounds [-Werror=array-bounds]" because GCC optimizes three inline calls and sees A[4][4] != A[16]. According to Thiago this may lead to an undefined behavior after all. Change-Id: I31ec01377d856890f6072369b3acd1f37e4118ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-141-2/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| * Fix upload of glyphs when using RGB32 masks on OpenGL ESGunnar Sletta2013-07-301-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | OpenGL ES doesn't allow internal format to be different from external format, so always do the conversion from BGRA -> RGBA. We are anyway iterating over all the pixels so the performance impact of this should be minimal. Change-Id: Ie891665ad66e31692b69db02d34be8d303a7d631 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Doc: Setting module pages' \qtvariable.Jerome Pasion2013-08-021-0/+1
| | | | | | | | | | | | | | | | | | Argument to \qtvariable is the QT variable needed for linking to the module. Task-number: QTBUG-32172 Change-Id: I181c0cfaf9529f3aea741cdaee0f20d6cd0e2d2f Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Merge branch 'stable' into devSergio Ahumada2013-07-111-12/+38
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/json/qjsonwriter.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm Change-Id: I24df576c4cbd18fa51b03122f71e32bb83b9028f
| * Restore smooth-scaled drawing of 0.5x-2.0x scaled glyphs in the GL engineTor Arne Vestbø2013-07-081-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b5922c89ba942 (Add support for retina glyph-based text drawing in the GL engine), and commit 155a20628b91 (Use QPaintEngineEx to decide if font is too big for using the glyph cache) together changed the behavior of drawing scaled cached glyphs in the GL engine, producing blocky text drawing when using the FreeType font engine. Whereas before we would cache all glyphs without any transform, and let the paint engine take care of the transform, commit b5922c added support for a scaled GL glyph cache, resulting in a 2x cache, drawn at 1x for example. The problem was that the FreeType engine claimed to support producing glyphs at 2x, but did that using the QFontEngine baseclass implementations, which use a simple fast-transform to scale up the glyphs. The result was a 2x cache with horrible looking glyphs. The first step in fixing this issue was to have the FreeType engine claim to only support translations. This would then make the paint engine choose path-based drawing for all scaled text, which is slow. To restore the optimization that we would draw 0.5x-2.0x scaled text using a smooth-scale in the GL engine (which was removed in 155a206), we then needed to extend shouldDrawCachedGlyphs() and add a special condition for this, coupled with a bit of logic in drawCachedGlyphs() that ensures we don't propagate the painter scale to the glyph cache if the engine is not able to produce scaled glyphs for it. This means we get the old behavior of the GL engine doing a smooth scale of the 1x glyph in the cache. Finally, since the raster engine also checks if the font engine supports the current transform, but for FreeType then ends up in a separate code path when actually drawing the glyphs (as the FreeType font engine supports internal glyph caching), we need to add a corresponding check for hasInternalCaching() in the shouldDrawCachedGlyphs() function, now that the FreeType engine only reports that it supports translations. Change-Id: Id03de896dec5f29535b281fb235332ef018045d8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| * Set projection matrix for systems with OpenGL 3.1Wouter Huysentruit2013-07-031-0/+2
| | | | | | | | | | | | | | | | | | | | The projection matrix should also be set for systems running OpenGL 3.1 with GL_ARB_compatibility extension. Task-number: QTBUG-28284 Change-Id: I756155a6064dcbff29fd817e676d31f24f559e8c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Doc: Adding navigation configs in the module qdocconf files.Jerome Pasion2013-06-251-1/+4
|/ | | | | | | | -The navigation bar requires the titles of the landing page and relevant pages. Change-Id: I5d5986b2bf74205cd49957b63fd6ac4e32cbb36b Reviewed-by: Martin Smith <martin.smith@digia.com>
* qdoc: QGLFrameBufferObject::bindDefault() was marked \internalMartin Smith2013-06-101-1/+0
| | | | | | | | | The \internal is removed. Task-number: QTBUG-31638 Change-Id: Ib1b65783599fe50e907373e3223a0774f17ac65e Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fixed crashes in QGLTextureDestroyer.Samuel Rødal2013-05-292-19/+7
| | | | | | | | | | | QGLTextureDestroyer will try to make the context current on the GUI thread, regardless of whether it is owned by another thread. Use QOpenGLSharedResourceGuard instead which does the right thing and takes shared contexts into account. Task-number: QTBUG-31403 Change-Id: I1377f9284995a7ba5af32c85296eef152fc035c8 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>