summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
Commit message (Collapse)AuthorAgeFilesLines
...
| * The default wrap mode is REPEATLaszlo Agocs2015-04-161-4/+6
| | | | | | | | | | | | | | | | | | | | | | As per spec, both for OpenGL and OpenGL ES. No wrap mode is applied unless setWrapMode() is called so the default values should be initialized to match OpenGL's default. Correct the copy-paste mistake in the warning messages. Change-Id: I094cc511dc7de4a214da61faadb1fc362270b2d4 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-151-1/+1
| |\ | | | | | | | | | Change-Id: I004854a25ebbf12b1fda88900162fe7878716c58
| | * Add a cast to glTexImage2D to keep QNX happyLaszlo Agocs2015-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internalformat parameter seems to be GLenum (unsigned int) on QNX based on the error message in the linked bug report. The standard is GLint, though. To keep everyone happy, add a cast. Task-number: QTBUG-45346 Change-Id: I57fece7b381e0d02acc842a21b1edc5451ea0224 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* | | Replace <qhash.h> with <qhashfunctions.h> where applicableMarc Mutz2015-04-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: Ic3398f4f330e15a3b55065858add26b90fd70e6c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Solid and gradients in high color accuracyAllan Sandfeld Jensen2015-04-102-14/+32
|/ / | | | | | | | | | | | | | | | | | | | | | | | | This patch updates the internal color precisions of solids and gradients to 16bit per color. This makes it possible to render at higher precision on non-premultiplied ARGB32, the RGB30 formats and any other hi-color formats if more are added. [ChangeLog][QtGui][Painting] Internal precision of solids and gradients is now up to 16bit per color. Change-Id: Ieae5468bd6de1f56adfa4cb9fa966faf2ed824fd Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Use the default fbo in Qt sense in blitFramebufferLaszlo Agocs2015-04-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | QOpenGLFramebufferObject::blitFramebuffer() passes 0 when no FBO is specified. This goes against the rest of the framework where the default fbo is what QOpenGLContext::defaultFramebufferObject() returns. This becomes significant with QOpenGLWidget and on iOS. Task-number: QTBUG-45328 Change-Id: Iaeb82cd3786ad395116679c9626bdcb10e93b4e3 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix debug stream operators.Friedemann Kleint2015-04-011-8/+12
| | | | | | | | | | | | | | | | | | | | - Use QDebugStateSaver to restore space setting in stream operators instead of returning dbg.space() which breaks formatting on streams that already have nospace() set. - Fix some single character string constants. Change-Id: I0fe86bb1adbdd4a76ab6d2f8c19e063b45ddcf3b Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Fix qdoc warning in qopengltexture.cpp.Friedemann Kleint2015-03-301-1/+1
| | | | | | | | | | | | | | qtbase/src/gui/opengl/qopengltexture.cpp:3652: warning: Cannot find 'ComparisonFunction' specified with '\enum' in any header file Change-Id: I92e808310f2d775cda30c1f1b6aaf0ed739b02f1 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Make versioned OpenGL functions working with the subclass patternLaszlo Agocs2015-03-272-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLFunctions allows both deriving from it and getting an instance via QOpenGLContext::functions(). Unsurprisingly a large number of users attempt to use the versioned function wrappers in the same way. Unfortunately this approach was not that well supported. Besides some potential base class exporting issues the real blocker for QOpenGLWidget - or any versionfunction subclass whose associated context changes during its lifetime - is that the functions instances could only be initialized once. Unlike instances retrieved via QOpenGLContext::versionFunctions(), instances created "manually" were not deinitialized upon the destruction of the associated context because context did not know about them. A pattern like initializeOpenGLFunctions(); delete context; create new context and make it current initializeOpenGLFunctions(); is working fine in QOpenGLFunctions-derived classes but not with the versioned ones. To overcome this, start registering such instances to the context too. QOpenGLContext::destroy() can then reset the internal state so a subsequent initializeOpenGLFunctions() will reinitialize properly instead of bailing out mistakenly thinking that everything is ready to use. Task-number: QTBUG-45199 Change-Id: Ia1420bcccb33c51508698b7a1b036c7544a66e74 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Avoid crashing in the vao when not supportedLaszlo Agocs2015-03-251-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The stored context pointer has to be reset to null in destroy() even when no VAO was created (vao is null). Otherwise destroying the context that was stored in the VAO will not lead to resetting the stored pointer, and a subsequent destruction of the VAO object will try to dereference it. Task-number: QTBUG-44562 Change-Id: I438bb3954d4bbd8b8d8704f6087479804f0073a7 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Use glFinish() in QOpenGLWidget unless glFlush() is known to be enoughLaszlo Agocs2015-03-232-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver used on the Odroid-XU3 does not like doing just glFlush() before accessing the texture in another context. There is no guarantee that glFlush() is enough to sync access to resources between contexts, so start using glFinish() as the default, except on common desktop hw + iOS where flush is enough and presumably more efficient. To unify the code pathes, remove the separate flushes and do it only once, before the backingstore compositor indicates that it is about to access the textures. This should improve performance a bit, esp. when doing multisampling since we flush only once then. A helper function is added to the internal QOpenGLExtensions because it is highly likely that QQuickWidget will need the same. Task-number: QTBUG-45106 Change-Id: Ifb405c5723f29f2f6c04df8e15fb70280681755e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Disable usage of glTexStorage on Mali ES 3.0Laszlo Agocs2015-03-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though immutable storage is available and the glTexStorage2D seems to succeed, the subsequent glTexSubImage2D calls always fail with GL_INVALID_OPERATION. Falling back to mutable storage works just fine. This makes QOpenGLTexture and examples like qtbase's textures functional on Mali T628 (tested with Odroid XU-3). Task-number: QTBUG-45106 Change-Id: If1b4fe6673ba924cfa7cfd7af7d4f0bc3b6a0fe8 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Disable DSA on RadeonLaszlo Agocs2015-03-141-2/+10
| | | | | | | | | | | | | | | | | | Try to prevent crashes on Windows and broken textures on Linux. Task-number: QTBUG-40653 Task-number: QTBUG-44988 Change-Id: I1fd259ba5ca3980c3087411e1dae1ae56bb2c2e4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QtGui: Fix const correctness in old style castsThiago Macieira2015-03-121-1/+1
| | | | | | | | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c946844bc31eb8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | windows: Introduce a built-in GPU blacklistLaszlo Agocs2015-03-111-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a built-in JSON file in case the QT_OPENGL_BUGLIST environment variable is not set. When QT_OPENGL_BUGLIST is set, the built-in list is ignored. To make the implementation simpler and more readable, some of the code in QWindowsOpenGLTester is reshuffled a bit. It also caches the results now, so it is safe and fast to call supportedRenderers() and friends multiple times. The blacklist currently contains the Intel card from QTBUG-43263 (Intel GMA / HD3000 ?) and may also apply to QTBUG-42240. [ChangeLog][QtGui] Qt now contains a built-in GPU driver blacklist for Windows that disables the usage of desktop OpenGL with some older cards that are known to be unstable with opengl32.dll. Task-number: QTBUG-42240 Task-number: QTBUG-43263 Change-Id: I1ecd65b51fca77925317d52048e7ab01d9b8797c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Remove some uses of the private Q_PI constantAllan Sandfeld Jensen2015-02-261-4/+3
| | | | | | | | | | | | | | | | | | The patch removes several uses of the private Q_PI constant and removes the qmath_p.h from the includes. A few places are optimized to multiply with reciprocals instead of dividing by Q_PI. Change-Id: I097af6a929e0609d6935563064e81c856005f4bc Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QtGui: Fix some qdoc-warnings.Friedemann Kleint2015-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/gui/math3d/qquaternion.cpp:466: warning: Undocumented parameter 'eulerAngles' in QQuaternion::fromEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:466: warning: No such parameter 'eulerAngles.y()' in QQuaternion::fromEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:466: warning: No such parameter 'eulerAngles.x()' in QQuaternion::fromEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:466: warning: No such parameter 'eulerAngles.z()' in QQuaternion::fromEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:455: warning: No such parameter 'pitch' in QQuaternion::toEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:455: warning: No such parameter 'roll' in QQuaternion::toEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:455: warning: No such parameter 'yaw' in QQuaternion::toEulerAngles() qtbase/src/gui/opengl/qopenglshaderprogram.cpp:2757: warning: No such parameter 'value' in QOpenGLShaderProgram::setUniformValueArray() Change-Id: Ib825ecb0db798380d97414ca3c3eba8bee3ab6ea Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-1/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * Correct pixel type for depth textures on ESLaszlo Agocs2015-02-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | Byte is definitely wrong. GL_OES_depth_texture states that short or int are the only options, GL_UNSIGNED_BYTE is thus rejected. Let's ask for the highest (32 bits). There's no guarantee that the implementation honors this, but at least we tried. Change-Id: I14dd9d4ab56b0b69cdab341f95f47499786d174e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Restore binary compatibility in versioned OpenGL function classesDavid Morgan2015-02-212-71/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a partial revert of commit 18aae36a90c0753f1b1e615ba8437d8ebd1bd2fb that restores the removed *Backend classes and restores the ordering of members in other *Backend classes. This restores binary compatibility for QtGui. tst_bic now reports only that some of the *Backend classes have changed size. This is a false positive as all such cases have added new members at the end of the respective classes. Offsets to pre-existing members are still consistent with earlier versions. Change-Id: Ia7f651870c2dea7f1a8d3611e667151387506dc8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Use C++ <cmath> instead of <math.h>Allan Sandfeld Jensen2015-02-163-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Including math.h can pollute the default namespace, and break some compilers if cmath versions of the method are declared as using. Switching to C++ math functions also greatly simplifies handling of float qreal as C++ automatically chooses the right method. [ChangeLog][QtCore][QtMath] qmath.h no longer includes math.h, so any sources depending on that indirect inclusion may fail to build. Change-Id: I4d0e331dafba354ec05dc5052e61ef4ff8d387fe Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* | Add support for GPU bug list reading.Friedemann Kleint2015-02-142-0/+395
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add support for reading out feature lists from GPU bug lists in Chromium format (supporting OS + version, exceptions lists, device ids and vendor ids). Add a overloads allowing for passing file name, data or JSON documents. - Test reading in tst_qopenglconfig - Prototypically have the Windows plugin read the file from the environment variable "QT_OPENGL_BUGLIST" and turn off renderers depending on the standard keyword "disable_d3d11" and newly introduced keywords "disable_d3d9", "disable_desktopgl". - QT_OPENGL_BUGLIST can point to an absolute or relative path, in which case it is resolved via QLibraryInfo::SettingsPath and QStandardPaths::ConfigLocation. [ChangeLog][QtGui][Windows] Introduce experimental feature allowing the user to specify a GPU driver buglist with some additional keywords to chooose the GL renderer backend depending on GPU. Task-number: QTBUG-43263 Change-Id: I8c20b0e8ee3cf575b91d0672bf405c42d3e9fb64 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | QOpenGLTexture: enable build on Windows CEGiuseppe D'Angelo2015-02-121-13/+9
| | | | | | | | | | | | | | | | | | The various refactorings to this code allow it compile and work on Windows CE, so we can enable the build there. Change-Id: I8ac56e87dca13790a76f125330a5400e4b4f5d46 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
* | Prevent crashing on ES2 SDK - ES3 device scenarios with AndroidLaszlo Agocs2015-02-123-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Making a build with an older NDK having only gl2.h results in crashing QOpenGLTexture on devices that provide ES 3.0 or 3.1. This is because immutable storage is supported (based on runtime checks) but the function pointers are not there (due to ifdef checks). Fix this like we did in other places: get rid of the ifdef and dlsym the ES3-only symbols. Task-number: QTBUG-44397 Change-Id: Ief518ec8c7d532aeea0075ba166baf8d22e66ec5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Update copyright headersJani Heikkinen2015-02-11113-718/+718
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/devLaszlo Agocs2015-02-104-51/+124
|\ \
| * | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-104-51/+124
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| | * Resolve GLES3 functions from the shared libLaszlo Agocs2015-01-104-51/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately the few functions that are part of the OpenGL ES 3.0 standard and are used by QtGui have to have special handling after all. Just directly calling the functions causes issues when building on a GLES3 capable system and deploying somewhere where only GLES2 is available. Using eglGetProcAddress and such is not an option because the ES spec does not guarantee that standard functions are resolvable via that mechanism. Task-number: QTBUG-43318 Change-Id: I72f985d75ca669835839016573cbb8e4a3fb41db Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | | OpenGL: Add versioned functions support for opengl 4.4 and 4.5David Morgan2015-02-0942-1278/+23484
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous errors in versioned function classes for OpenGL versions prior to 4.4 have also been fixed to comply with the new OpenGL xml specification. Such mistakes were due to either bugs in the old plain text specification files or problems due to the difficulty in parsing the old spec files. In some cases this has meant adding in missing functions that were absent previously. The other class of problem was when functions were erroneously included in the versioned function classes when they should not have been present. That is, some core profile classes incorrectly had member functions for deprecated functions that should only be present in the compatibility profile classes. In these cases these incorrect functions will now trigger a qFatal if called. This is fine as any applications that called these by mistake in the past would have been dereferencing a null pointer as the function pointer resolution would have failed for these functions. [ChangeLog][QtGui] Add version function classes for OpenGL 4.4 and 4.5 and deprecate some erroneously classified functions. Task-Id: QTBUG-33671 Task-Id: QTBUG-44364 Change-Id: I224108dcaf4f8b4933bc121827511841e2a41590 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Add more notes regarding the uniform settersLaszlo Agocs2015-02-081-0/+9
| | | | | | | | | | | | | | | | | | | | Having overloads for GLuint that call glUniformNi was a mistake to begin with, and it has only been made worse when later OpenGL versions introduced unsigned int support and glUniformNui. Note this in the docs. Task-number: QTBUG-37012 Change-Id: Icc867221d0fbced8c4ff769deee66effa022f1b5 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | QtGui: use Q_ENUM instead of Q_ENUMSOlivier Goffart2015-02-082-2/+2
| | | | | | | | | | Change-Id: I92ac2ea218e9134aa36ecb179b8ae790a2dba56a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QOpenGLVertexArrayObject: remove a now unnecessary initialize callGiuseppe D'Angelo2015-02-081-2/+0
| | | | | | | | | | Change-Id: I03a14c52dd5a02de0c1cc1c2df5d4529acff9acd Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Make mipmap levels and texture comparison work with GLES 3.0+Laszlo Agocs2015-02-073-51/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | In ES-only builds (-opengl es2) we hit the QT_OPENGL_ES_2 path which disables all this. Not ideal since all the support is present in GLES 3.0. Therefore, stop relying on the ifdef and do runtime checks. This also needs defining the constants manually since they are not available in gl2.h and our own ES2 extension headers provide some of these with silly silly suffixes. Change-Id: I8ad7f5091a371bad1e3c6dc4898342a175016274 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Check for the proper extension for anisotropic filteringLaszlo Agocs2015-02-041-1/+1
| | | | | | | | | | Change-Id: I881fccea3af74ead14f523c7c54a405a15ea29ab Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | QOpenGLTexture: introduce texture comparison supportGiuseppe D'Angelo2015-01-173-1/+147
| | | | | | | | | | | | | | | | Shadow sampling is an old OpenGL feature (hello, OpenGL 1.3!), which was missing from QOpenGLTexture. This commit adds the relevant support. Change-Id: I9f6b552d806a356d24ee08121af6bc9ce684f2b5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QOpenGLTexture: better document the depth/stencil featuresGiuseppe D'Angelo2015-01-171-0/+12
| | | | | | | | | | | | | | For some reason these docs were missing, add them. Change-Id: If17cf429925ee849a0817e0294a7db7f6dace79b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-182-86/+172
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/platformsupport/platformcompositor/qopenglcompositor.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I5422868500be695584a496dbbbc719d146bc572d
| * Make GL2PaintEngine::drawCachedGlyphs use updateTextureTor Arne Vestbø2014-12-142-32/+13
| | | | | | | | | | | | | | | | | | | | Ensures that we have a consistent view of what the last used texture was, which is critical when deciding whether or not we need to re-bind the texture or update texture properties. Change-Id: Ib47eb00abde98d148fc6e569ce3e359b340328fb Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * Ensure that GL::updateBrushTexture() activates and binds properlyTor Arne Vestbø2014-12-131-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling QOpenGL2GradientCache::getBuffer() will generate the texture the first time, calling glBindTexture in the process. We did this without first ensuring that the right texture unit was active, resulting in the generated gradient texture binding onto the glyph cache mask unit. We now provide a specialization of bindTexture for a QGradient, which ensures that the right unit is active before calling getBuffer(). Unfortunately we have no way of knowing if the result of getBuffer() was a texture that was already bound, or if we need to bind the result, which means we have to do an unconditional bindTexture of the resulting texture ID. This means double-bind for the initial texture generation, but this was already an issue in the original code. Task-number: QTBUG-43039 Task-number: QTBUG-41244 Change-Id: I20c9b795c8c14f8d58be2b60a284c5a060705ec0 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * GL: Make updateTexture invalidate texture on change of texture unitTor Arne Vestbø2014-12-122-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Switching texture units means the value of lastTextureUsed could be invalid, meaning we need to unconditionally re-bind and update parameters. A future optimization would be to keep a per-texture-unit cache, so that we wouldn't have to re-bind and set parameters when switching units back and forth, but this complicates the current code somewhat, so it's left for another patch. Change-Id: Icb2a5d03457a907f3c25bbb437feeb7c5f155716 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * GL2PaintEngine: centralize logic for updating/preparing texturesTor Arne Vestbø2014-12-112-50/+78
| | | | | | | | | | | | | | | | | | | | | | | | Rewrite of updateTextureFilter to include activating and binding as well, so that we can maintain a single view of which texture was the last one to be used from within the engine itself. The behavior should be the same as before. Change-Id: I41781d00458b0176c614266f4360db3c68b120a1 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * GL2PaintEngine: Prevent fillInPendingGlyphs from breaking gradientsTor Arne Vestbø2014-12-101-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The glyph cache internally uses the image texture unit when blitting, but doesn't always activate the unit before binding its texture, resulting in sometimes binding the glyph cache texture to the wrong unit. The image texture unit is also the same as the brush texture unit, so any time we fill in pending glyphs we need to re-bind the brush texture, otherwise drawing text with eg. gradients will fail after the new glyphs have been filled. The new hasPendingGlyphs() member function of the glyph cache is an optimization so that we don't need to activate and rebind unless there are glyphs that need to be filled. Change-Id: Iac74130145d2d6d7bf95206b5e8a2fc760743cb5 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Fix corner case in preprocessor of QOpenGLShaderProgramSean Harmer2014-12-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The preprocessor used in QOpenGLShaderProgram to help with determining where it should add the #line and other #define directives is broken when parsing the standard Qt Project copyright header. In a multiline comment if the preprocessor encounters repeated '*' characters when in a multiline comment, it toggles the state between MultiLineComment and CommentEnding. This is wrong as every asterisk is potentially the one before the closing '/' of a multiline comment. This change fixes this by only going back to the MultiLineComment when in the CommentEnding state if the character is not another '*'. Task-number: QTBUG-43240 Change-Id: I114e933026ba5de1c23f3e0399613def59f44961 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | GLSL #version directive does not have to be at start of lineSean Harmer2014-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The #version directive detector of QOpenGLShaderProgram is using an incorrect regular expression to detect the #version directive in the preprocessed shader source code. It is allowed to have whitespace before the #version. Task-number: QTBUG-43240 Change-Id: If60670f49cb40148e5e7fbe6da6c798e8f636c3d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | [QStaticTextItem] Drop unused membersKonstantin Ritt2014-12-141-2/+0
| | | | | | | | | | | | | | | | | | The QStaticTextItem's `chars` and `numChars` members are never used, even when set. In fact, there is nothing useful we can do with the input string in the absence of clusters mapping. Change-Id: I81fcbce3e575f4d0dcfc2515286d512b858f592b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add GL_EXT_discard_framebuffer to QOpenGLExtensionsJørgen Lind2014-12-112-1/+22
| | | | | | | | | | Change-Id: I57e8dd2ea2e6f018a46eaabed2ca8b6d417358a3 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-103-31/+28
|\| | | | | | | | | | | | | | | Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
| * Merge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into ↵Simon Hausmann2014-12-051-3/+1
| |\ | | | | | | | | | refs/staging/5.4
| | * Merge remote-tracking branch 'origin/5.4.0' into 5.4Simon Hausmann2014-12-051-3/+1
| | |\ | | | | | | | | | | | | Change-Id: I0cd11cbe95693b78450ea81a0187760f4a6a8b5f
| | | * QOpenGLFramebufferObject: pass sized format also with dynamic GLAndrew Knight2014-12-011-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GL_RGBA8_OES define is not in scope for dynamic OpenGL builds, so pass in GL_RGBA8 instead (it is defined as the same value, 0x8058) when in ES mode. The functionality check already ensures the extension is available, so the ifdef guards can be removed. This fixes default multisampled FBO creation under ANGLE when using -opengl dynamic. Task-number: QTBUG-40921 Change-Id: Iac4b7e230a463c27b61af75c3307421f9deac856 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>