aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix memory leaks in QQuickWindow testUlf Hermann2020-06-151-40/+49
| | | | | Change-Id: I045814dbb78234e7f885eb28ce839c1dc2f66924 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Revise OpenGL references in QQuickItem docsLaszlo Agocs2020-06-151-29/+31
| | | | | Change-Id: Ifaff06e3854cbb27749282b66c9709a168a966df Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Do a small doc update for GraphicsInfoLaszlo Agocs2020-06-151-2/+10
| | | | | Change-Id: I1e42e9e1ba08c37d7177ff5ca77410d9d6ecc612 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix typo in QQuickFbo docsLaszlo Agocs2020-06-151-1/+1
| | | | | Change-Id: Ia7afbee2d9f6fdf7cc41b89d293666003a351ed9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Update QQuickPaintedItem docs to reflect realityLaszlo Agocs2020-06-151-34/+16
| | | | | Change-Id: I99dc68e2f5fb7dbc83a5e441e246f837ce8eca01 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Do a small OpenGL-related revision of Image docsLaszlo Agocs2020-06-151-11/+11
| | | | | | Change-Id: I47fe1826080269bcbca84f64c628c57df84534f8 Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix QQmlPropertyBinding::evaluateFabian Kosmale2020-06-151-1/+6
| | | | | | | | | | | | When a class is in a semi-deleted state (QQmlData::wasDeletet returns true, but the QQmlElement has not been removed yet), we can still end up calling evaluate under some circumstance. This can be observed in qqc2's tests, for instance tst_palette. In those cases either ctxt or ctxt->engine() might be nullptr. We handle this by returning an error; as the object is about to be gone, the result does not matter anyway. Change-Id: I8a42263a9b44012822f5a827da8eae97d3160165 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Anisotropic antialiasing for distance field textEskil Abrahamsen Blomfeldt2020-06-1546-80/+378
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For perspective transforms, we need to find the sample range in the glyph cache per pixel. We can do this by getting the gradient of the distance field at the specific pixel. This will ensure proper antialiasing with any projection, but has the limitation that when glyph contours become thinner than a pixel, they may disappear or become too emphasized, because the hardware-gradient - based on neighbouring fragments - is not reliable at that scale. So we should only default to this when we detect that the text is child of a 3D scene. To make this smooth, we need to know the mode of the renderer when creating the shader. So QSGMaterial::createShader() now takes a render mode that we can use to customize behavior based on whether it is rendering into a 2D or 3D scene. [ChangeLog][QtQuick] The QSGMaterial::createShader() virtual function has been extended to take a render mode argument, which can be used for any customizations needed in the case where the shader will be used in combination with 3D perspective transformations. Fixes: QTBUG-84695 Change-Id: I5a18a4edbdfa07e8f9d506c42bb20e8eb580927d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Speed up rendering huge static scenesEskil Abrahamsen Blomfeldt2020-06-152-0/+11
| | | | | | | | | | | | | | | | With really big, static scenes, traversal of the geometry list is expensive enough that it becomes a limitation on the frame rate if we do it in the inner loop of every frame. And going through the whole list of geometry every frame just to verify that nothing has been removed is a waste of time. In a test with two million opaque items in a single draw call, I can hit 144 fps with this small optimization versus 50 fps on the same machine without the patch. Pick-to: 5.15 Change-Id: Id11c1d96456e79a62c33b89e5f115bdaacceeacd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of preprocess in QQuickTextEskil Abrahamsen Blomfeldt2020-06-156-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preprocessing in the scene graph is actually pretty expensive, so we want to avoid using it for something like text, where you can often have a lot of nodes in a UI. For text it was previously used for two purposes: 1. To make sure the distance field glyph cache was updated with potential new glyphs before the frame was rendered, but *after* all new glyph nodes had been created (this is an optimization to avoid having to resize the cache multiple times in one frame, but rather wait until we know the exact amount of new glyphs that need to be added) 2. Update the coordinates of the glyph based on their position in the glyph cache if the glyph cache says they have moved (or if they have just been added for the first time). Point #1 can actually be handled a lot simpler, by having a separate loop for the existing glyph caches where we ask them to preprocess. There is typically only a few glyph caches, but can be hundreds of glyph nodes in a scene, so in the previous code we would be calling the update() functions on the same glyph cache over and over again every frame. Point #2 does not need preprocessing every frame, but can be reduced to only preprocess when the geometry is marked as dirty. We then do a pass on the glyph node in question to update its geometry and turn the flag off again so that we don't pay the cost every frame. Pick-to: 5.15 Fixes: QTBUG-84351 Change-Id: If8c492acaef9c512c2db61b64bcab2103db2d997 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Update dependencies on 'dev' in qt/qtdeclarativeQt Submodule Update Bot2020-06-151-2/+2
| | | | | Change-Id: I659b771c1572f2806617a195039b9f5624c59e6e Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Port type registrar test to cmakeFabian Kosmale2020-06-144-1/+68
| | | | | | | | | | | Unfortunately, the type registrar simply does not work with manually moced files, and headers without any extension are not picked up by automoc. Task-number: QTBUG-84869 Task-number: QTBUG-84906 Change-Id: If1adbb9bfb3f793f3ee90f5b27cece233e354443 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update dependencies on 'dev' in qt/qtdeclarativeQt Submodule Update Bot2020-06-121-2/+2
| | | | | Change-Id: Ie4ad3ab4f6ebea98686d783d004ce2cf678aa2a4 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Fix up QQuickRenderControl class docsLaszlo Agocs2020-06-121-17/+20
| | | | | | | | This was not updated together with the Qt 6 changes (the function docs are up-to-date already), do it now. Change-Id: I93c59df141a69d9943d1a3d88fe3a56fe6c096df Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QQuickTextInputPrivate: refactor getImplicitWidth() to calculateImplicitWidth()Mitch Curtis2020-06-122-23/+28
| | | | | | | | | | | | This patch moves the implicit width calculation in getImplicitWidth() into calculateImplicitWidth(const QString &text). This allows QQuickComboBox in qtquickcontrols2 to get the implicit width of a TextInput (TextField) item, as QQuickTextInput does some extra layouting and accounting for padding that QFontMetrics does not. Change-Id: I81e6c2627e21ca4d89ea9502abbb6aec79068793 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Doc: Improve documentation for DateKai Koehne2020-06-121-12/+36
| | | | | | | | | | | | | | | Structure the overview more by adding section titles. Also be more elaborate on what the enum's mean for the different parts/methods. Finally, make it explicit that NarrowFormat for date and time is the same as ShortFormat. Pick-to: 5.15 Fixes: QTBUG-83841 Change-Id: I0a93361fcc8e30f1080938976d8e0b2d5a55e563 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move resetOpenGLState() to QQuickFboLaszlo Agocs2020-06-126-123/+83
| | | | | | | | | | | | | | | | | | | | | | | | | QQuickWindow should not have OpenGL specifics in its API in Qt 6. However, resetOpenGLState() is used by applications commonly in combination with QQuickFramebufferObject (not the least because the documentation recommends it!). This is no problem in practice because QQuickFramebufferObject remains an OpenGL-only feature. So to minimize the breaks, move the function into QQuickFramebufferObject::Renderer so any application that calls the function can continue to do so by just calling it on 'this' instead. The rendercontrol_opengl example used to call this function as well, but unnecessarily, it will still function the same way without it. Note that there is a chance that there are applications that call resetOpenGLState() in other contexts, for example in slots connected to before or afterRendering(). For these it will need to be determined if the call is necessary at all, and if it is, should be replaced by (re)setting the appropriate OpenGL state manually instead. Task-number: QTBUG-84523 Change-Id: I335599f77e8a84e347a44427eb1a1bf917796ee8 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* fboitem example: Request OpenGL explicitlyLaszlo Agocs2020-06-121-0/+2
| | | | | | | It wouldn't render otherwise. Change-Id: I185459f2eccdffac4f7d7968e48aab4141e0908c Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Port distancefield debugging code from OpenGL to RHIEirik Aavitsland2020-06-124-159/+42
| | | | | | Task-number: QTBUG-84623 Change-Id: I26941eacf5ad97ed3c7c6e7d7ad3beec7f0c6fa3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: Add documentation for zScalePaul Wicking2020-06-121-0/+8
| | | | | | | Pick-to: 5.15 Fixes: QTBUG-84750 Change-Id: I2a2480abf3c6d81e103869975d68c69adbe5b81e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Prevent items from being deleted while removingElvis Lee2020-06-121-0/+7
| | | | | | | | | | | Delegate items can be deleted when remove them from cache list. That may cause a crash. So call referenceObject to keep the item from being deleted. Task-number: QTBUG-83352 Pick-to: 5.15 Change-Id: Id5d7ab6dbf21682940f5393ea4e843c2448f7d81 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix QQuickKeyNavigationAttached issueValery Volgutov2020-06-123-6/+60
| | | | | | | | | | | | | | | | | | | | When Repeater used for Item creation, we have following issue: When Repeater creates a new item and this item tries to set keyboard.left or keyboard.right to another Repeater-created sibling, these items haven't been created yet, and we have issue with navigation keys. Set rightSet to true if right really changed. When object calls KeyboardNavigation::setRight(null), rightSet = true, but right field did not change (null). After that, navigation keys work incorrectly. The same for other cases. Task-number: QTBUG-83356 Pick-to: 5.15 Change-Id: I9ea6d6a7d13ff989aac3d9e2d22467b48080de13 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Adapt to metaobject changesFabian Kosmale2020-06-123-48/+8
| | | | | Change-Id: I31dd544e80b8b2f8745463450a05fa7effafa8cd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update dependencies on 'dev' in qt/qtdeclarativeQt Submodule Update Bot2020-06-121-2/+2
| | | | | Change-Id: I346d5f7c2123a6c37fd40275f3b6a053e5c1d7e2 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Fix lexer line number if code contains continuation stringsChristian Stenger2020-06-122-2/+113
| | | | | | | | | | | Follow-up lines of continuations strings that directly end with an unescaped line feed still broke the line numbers of code following the string. Fix by explicitly handling the first character inside a string differently. Amends 126ee5c901a9675a9ab61d4c6f2961c95b8bceac. Change-Id: Ia945546d35db844114064ae34d6189704ceefe3b Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* Doc: Update example of QML int valueYuya Nishihara2020-06-121-1/+1
| | | | | | | | | Item width and height are real numbers. Let's pick other property of int type. Pick-to: 5.15 Change-Id: I43e74e4005681d570047648e2c141994a075150e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Clarify exact range of QML int valueYuya Nishihara2020-06-121-1/+1
| | | | | | | | | The original definition "around -2000000000 to around 2000000000" was unscientific and would make a false impression that full 32bit integer range wouldn't be supported. Change-Id: I712eb35dee05410f50572a12af98365013efeb62 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Make openglContext getter in QQuickWindow privateLaszlo Agocs2020-06-119-76/+35
| | | | | | | | | | | | Fix up the scenegraph and qquickwindow autotests as well. (direct OpenGL specifics are now completely removed from both, i.e. the remaning OpenGL specific tests are now run (and not skipped) with OpenGL-on-RHI) [ChangeLog][Qt Quick][QQuickWindow] openglContext() has been removed from QQuickWindow. Use QSGRendererInterface to query the QOpenGLContext. Change-Id: If5c9802b71ac5f9cffc695827e286eb2a2d03580 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Move QSGRenderContext::RenderMode to QSGRendererInterfaceEskil Abrahamsen Blomfeldt2020-06-1111-27/+37
| | | | | | | | | We want to be able to use this enum from the public API, so we move it out to a suitable public class. Task-number: QTBUG-84695 Change-Id: I8a3860ecfd0da7990941540bcf39fb0c2bf0ff83 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove FBO path from painternode/context2dPaul Olav Tvete2020-06-119-759/+22
| | | | | | Task-number: QTBUG-84623 Change-Id: Icef7ab7460799b989f4e122be3f8d5cab98382e4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-1123-196/+196
| | | | | | | | | | | | | | | | | | | | Several event accessors were deprecated in qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5. Replacements were generated by clazy using the new qevent-accessors check: $ export CLAZY_CHECKS=qevent-accessors $ export CLAZY_EXPORT_FIXES=1 $ ../qt6/configure -platform linux-clang -developer-build -debug -no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy $ make $ cd ../../qt6/qtdeclarative $ find . -name "*.clazy.yaml" $ clang-apply-replacements . Task-number: QTBUG-20885 Task-number: QTBUG-84775 Change-Id: I1be5819506fd5039e86b4494223acbe193e6b0c9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* CMake: Fix failing linux static buildAlexandru Croitor2020-06-112-0/+2
| | | | | | | | | | | Use workaround to fix failing static builds due to wrong ordering of static libraries on the link line. This involves specifying some of the libraries in an explicitly correct order. See the bug report for more details. Task-number: QTBUG-83498 Change-Id: I2238a049bd315845df8ad8995d47dfe7e351a2c5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Modernize QSGMaterialShader class docsLaszlo Agocs2020-06-111-81/+121
| | | | | | Task-number: QTBUG-84623 Change-Id: I7577c2da02936295793bac23f7cb66107a65c462 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* openglunderqml example: remove unnecessary resetOpenGLState callLaszlo Agocs2020-06-112-4/+2
| | | | | | | | | | | | | | | Also request the OpenGL RHI backend explicitly, like all the other similar examples (d3d11underqml, and so on) do. Calling resetOpenGLState() in this example is pointless because it happens before returning from the custom rendering function, and the endExternalCommands() call achieves the same internally, i.e. the rhi will know that cached state cannot be used anymore. There are other valid uses cases for resetOpenGLState() but this example does not have those. Change-Id: Ifa7861b80c29c174d02cfe37fe8ef8eed7344195 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Revert accidental downgrade of test262Ulf Hermann2020-06-111-0/+0
| | | | | Change-Id: I93a1ae4309ba01e92e43a4ba2d3b0ece4a5104f9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Fix precedence of module importsUlf Hermann2020-06-1112-39/+114
| | | | | | | | Types imported transitively via a qmldir import statement should not shadow types available from the module itself. Change-Id: Id34edc5c5e2fff4ba37009f4bab9039b7ed18dff Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Update dependencies on 'dev' in qt/qtdeclarativeQt Submodule Update Bot2020-06-113-8/+6
| | | | | | | | And workaround hash issue for now by using qHashMulti Also, fix test build failure Change-Id: Ia6b696b2531149206c73e7a5a958d7fba74a0f19 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove remaining OpenGL dependency in QSGDefaultInternalImageNodeEirik Aavitsland2020-06-113-19/+2
| | | | | | | | | As a driveby, remove an unused opengl #include from qsgdefaultspritenode.cpp Task-number: QTBUG-84623 Change-Id: I6e901a0ac0a23a2d21029b5337c204835e29026a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add missing renaming in tst_examplesLaszlo Agocs2020-06-111-1/+1
| | | | | | Change-Id: Ib7e470e9e4a79b039f8f836144108581cc0bf5dd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Rename setPersistentOpenGLContext and revise related docsLaszlo Agocs2020-06-116-97/+67
| | | | | | | | | | | | | | | | | | These persistent hints are still taken into account by the threaded render loop, so keep them, but get rid of "OpenGL Context" from the function names. The qquickwindow autotest has been updated accordingly, and with a few OpenGL-related cleanups it now runs without any warnings or skips with OpenGL-on-RHI, while it skips only 1 case when running with some other API, and 2 with the software backend. [ChangeLog][Qt Quick][QQuickWindow] The setPersistentOpenGLContext() and isPersistentOpenGLContext() functions are renamed to setPersistentGraphics() and isPersistentGraphics(). Change-Id: Ifc4cc7c4b94fe9f7e402b39ca4f28952dcafd588 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QQuickFbo: remove direct GL checkLaszlo Agocs2020-06-101-7/+3
| | | | | | | | This is always used in combination with OpenGL-on-RHI now, no point in checking for direct OpenGL anymore. Change-Id: I0f137d7c5f6248d9d9790949186e4830ffd7dc7f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove the unused shadersourcebuilderLaszlo Agocs2020-06-104-497/+0
| | | | | | Task-number: QTBUG-84623 Change-Id: I994f1078399788566108e8605213f18e0ba722f5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* cmake: enable previously disabled testFabian Kosmale2020-06-101-4/+2
| | | | | | | | | And remove a few superfluous "disable" entries, which are enabled in another place. Task-number: QTBUG-84869 Change-Id: I1d4008c5e18563a36d129cef4813f20d776ef1e6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Enable tests for pointerhandlersFabian Kosmale2020-06-102-1/+48
| | | | | | | | Also add the missing cmake file for mousearea_interop Task-number: QTBUG-84869 Change-Id: I7e48653c815aaaa3e23824783f6a0ff390c0907a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: add qqmldelegatemodel testFabian Kosmale2020-06-102-0/+43
| | | | | | | | | I'm not sure how that one is added in qmake, but now it's at least available in cmake. Task-number: QTBUG-84869 Change-Id: Icc0c02beef03bb858767f9f584f53169a3ab3ebb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Modernize tst_QQuickPathView::treeModel()Shawn Rutledge2020-06-102-8/+12
| | | | | | | | - Don't use context properties: a singleton is better - Use required properties to declare dependendencies Change-Id: I10a0a301e0a397b1d4fc9edf804eea3499c79025 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Modernize tst_QQuickListView::QTBUG_39492Shawn Rutledge2020-06-102-12/+14
| | | | | | | | | | | | - Don't use context properties: a singleton is better - Use required properties to declare dependendencies - Rename to treeDelegateModelLayoutChange() to describe what it's testing rather than just a bug number, and because it's somewhat analogous to tst_QQuickPathView::treeModel() Task-number: QTBUG-39492 Change-Id: I753bbdf625b8d8c82774b6a2b1754fe3c8895823 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix some warnings in tst_qquickpathviewShawn Rutledge2020-06-101-9/+9
| | | | | Change-Id: I5c3c6d418fb9f35ee684d6d7c548ba468b7f262c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Skip all clipping when render mode is 3DLaszlo Agocs2020-06-101-10/+13
| | | | | | | | The current assumption is that setting clip: true will have no effect in a scene rendered with RenderMode3D. (2D item tree under a 3D node) Change-Id: I81ca1fcc04c7f4af37a03fd48dc95ea307989e98 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Clarify QQuickWindow::releaseResources docsLaszlo Agocs2020-06-101-6/+10
| | | | | | | | | It sort of has a double purpose for some time now, make the docs reflect both (a simple release-cached-resources request vs. or a full-blown scene graph + QRhi invalidation) Change-Id: I38ab560a4c2f7d3e7ae5427af4d1fb26d8c036d3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>