aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
Commit message (Collapse)AuthorAgeFilesLines
* scenegraph: Add plumbing for enabling multiviewLaszlo Agocs2024-01-151-68/+67
| | | | | | | | | This will be used in RenderMode3D only in practice, where Qt Quick 3D is going to pass in multiple matrices to the QSGRenderer. Task-number: QTBUG-114871 Change-Id: Icae7f05958729d9e51948e1f38621ec4a541192d Reviewed-by: Andy Nichols <[email protected]>
* Fix translucent NativeRendering text on transparent windowEskil Abrahamsen Blomfeldt2023-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | We cannot pass the color alpha to the source color scale factor, since when we blend we will end up with a resulting output color that has alpha. The color's alpha is premultiplied into the subpixel alpha values we fetch in the fragment shader, together with the state's opacity. Note: While not strictly necessary, this also changes the text shader to match the standard premultiplication in other shaders, since it has caused some confusion. [ChangeLog][Text] Fixed an issue where NativeRendering text with a translucent color combined with a transparent window would cause unexpected translucency effects on opaque parts of the scene. Pick-to: 6.5 6.6 Fixes: QTBUG-118052 Change-Id: I1f06a503c48355863784fc18a849fb539b9384ef Reviewed-by: Laszlo Agocs <[email protected]>
* Fix memory leak when invalidating NativeRendering fontsEskil Abrahamsen Blomfeldt2023-06-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When NativeRendering is used, we keep a reference to all the font engines currently in use to make sure they stay alive, and then dereference them when the scenegraph is invalidated, typically when the window closes. There was always a controlled leak here: If you loaded new font assets continuously, then we would retain the old ones in memory. Due to the bug in QTBUG-100697, we would keep them even if they were application fonts that were removed. However, when QTBUG-100697 was fixed, a side effect was that the memory leak became more visible: It no longer only happens when loading new fonts, but just loading and unloading the same two application fonts and setting them on a text item in a loop would cause us to continuously create new font engines, give them a font cache and then add them to the m_fontEnginesToClean list. The fix is to match the registerFontEngineToClean() with an unregister function and then clean up the font engines that no longer have any references during the synchronization step, similar to how we clean up distance field caches that are no longer in use. Note that this removes a bogus qDeleteAll() from the software backend: This was added blindly by f1b188df132c42da62197055725e5f7eebcc4249. Since the set will be empty, it doesn't cause a crash, but is not the correct way to delete font engines, so to avoid future confusion or cargo-culting, we just replace it with an assert that the set is empty. [ChangeLog][Text] Fixed a controlled memory leak with Text.NativeRendering where loading and unloading the same application fonts could cause memory usage to increase indefinitely and not be regained until the window was closed. Pick-to: 6.5 6.6 Fixes: QTBUG-113714 Change-Id: I34c60e647bf63a0d203f752066f1cbfaeb049bcf Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Andy Nichols <[email protected]>
* Match fontEngine glyph cache key to lifespan of ownerDavid Edmundson2023-06-091-1/+2
| | | | | | | | | | | | | | | The glyph cache key is based on the RHI instance. We clean up the font cache when the QSGRenderContext is deleted. For a regular QQuickWindow this is effectively the same. For a QQuickWidget the RHI instance has a lifespan of the parent widget, but the render context changes. Task-number: QTBUG-113426 Task-number: QTBUG-112306 Pick-to: 6.6 6.5 Change-Id: Ifd901ace6caaff9a08352901956865f5f58e06ef Reviewed-by: Laszlo Agocs <[email protected]>
* scenegraph: Remove dead code from Qt 5->6 porting timeLaszlo Agocs2023-03-151-39/+0
| | | | | | | | | | Remove some #if 0 and commented code that was there since the Qt 5.14 days of porting to QRhi. Given that nobody missed it so far, it is unlikely to be relevant. Fixes: QTBUG-86234 Change-Id: I12fed241395cef267f9a0fefcd5e25091cec2f4e Reviewed-by: Christian Strømme <[email protected]>
* Fix missing glyphs when using NativeRenderingEskil Abrahamsen Blomfeldt2022-12-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we look up glyphs with subpixel positions in the glyph cache, we use the calculated subpixel position (from a set of predefined subpixel positions) as key. In some very rare cases, we could end up with different subpixel positions when looking up an on-screen position than when we entered it into the cache, due to numerical differences when doing the calculation. The reason for this was that when entering the glyph into the cache, we used the 16.6 fixed point representation, whereas when looking up, we used the unmodified float. In some cases, the converted fixed point approximation might snap to a different predefined subpixel position than the floating point equivalent. To avoid this, we reuse the converted fixed point positions when looking up the glyphs in the cache. [ChangeLog][Text] Fixed an issue where text using NativeRendering would sometimes be missing glyphs. Pick-to: 5.15 6.2 6.4 6.5 Fixes: QTBUG-108713 Change-Id: Iecc264eb3d27e875c24257eaefcfb18a1a5fb5be Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* Fix fractional scaling of text in Qt QuickEskil Abrahamsen Blomfeldt2022-07-121-3/+7
| | | | | | | | | | | | | | | | | | | | | | | As opposed to the raster engine, in Qt Quick we are using unscaled positions for the glyphs and using the vertex shader to scale these after the fact. However, when picking the correct subpixel rendering for each glyph, we would use the unscaled position's fractional part, meaning that we essentially rendered the glyphs at the wrong subpixel position. This was especially visible when doing fractional scaling, e.g. 125%. Instead, we need to ensure that we pick the rendering at the on-screen subpixel position. [ChangeLog][QtQuick][Text] Fixed a kerning issue with native-rendered text when there is a fractional system scale factor set. Pick-to: 5.15 6.2 6.3 6.4 Fixes: QTBUG-101008 Change-Id: Ic0f94d8b4ca5998dca638bdf7e2a16306d92a926 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Fix alpha with native text renderingLaszlo Agocs2022-06-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | The immediate problem with incorrect semi-transparent Text with NativeRendering is a porting error from 5.14 times, comparing with https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp?h=5.15#n292 shows that the constant color used for blending does not have alpha premultiplied into the color in 5.15. In the rhi-based code updateUniformData does the premultiplication when setting the data for the uniform, like in Qt 5, but then in upgradeGraphicsPipelineState it also multiplies whereas Qt 5 did not. In fact that there's a Q_UNUSED(state) at the top of the function shows that accessing state.opacity() was not meant to be there in the first place and got added later for reasons unknown. Fixes: QTBUG-100820 Pick-to: 6.4 6.3 6.2 Change-Id: I3acb839676c00e7aa1e2ff2f93eefcaa87b7d0de Reviewed-by: Andy Nichols <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-06-111-38/+2
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <[email protected]>
* Prevent glyph nodes from draining the update batch poolLaszlo Agocs2021-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of letting each glyph cache instance to borrow its own resource update batch, have a single resource update batch pointer in the rendercontext (so per-thread and per-rhi with the threaded render loop) and reference that in all glyph caches with that rendercontext. This tries to eliminate the problem that occurs when one manages to make more than 64 (texture and/or distance field) glyph caches within the same window. The original mistake was to assume that the glyph cache objects are per-QRhi. This is not the case, the cache key consists of more than that (e.g. with native text: rhi+format+transform+color) While we do not have an actual example, some users have apparently managed to construct scenes where the number of simultaneous glyph caches exceed 64. Note that this might mean that the texture uploads from a glyph caches are not actually merged into the renderer-provided update batch by that cache instance, but by another one (depending on the order of commit calls during sync, the first one gets to submit all enqueued uploads). This should be ok because all that matters it that the upload requests end up in the renderer's update batch in one way or another. Pick-to: 6.2 Fixes: QTBUG-98017 Change-Id: I988d568377aa9766457ab02e070220e8a76ddbaf Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* Fix distorted text with subpixel matrix translationEskil Abrahamsen Blomfeldt2021-10-131-17/+29
| | | | | | | | | | | | | | | | | | | | | | | We would pixel-align native text *before* applying the model-view matrix, which would cause GL_NEAREST artifacts to show up when the text was positioned at a subpixel offset in some cases. Instead, we pixel-align the coordinates after mapping them to the view frustum, but before applying the projection to the screen. To make it easier to modify the buffer layout for the shaders the next time, this also adds some constants for offsets. [ChangeLog][Text] Fixed an issue where text using NativeRendering would look slightly skewed if it was inside a parent that had been positioned at a subpixel offset. Pick-to: 5.15 6.2 Fixes: QTBUG-96112 Fixes: QTBUG-83626 Task-number: QTBUG-55638 Change-Id: Ifb785ad5830093df94afc75a7bc288e24ca7aa38 Reviewed-by: Eirik Aavitsland <[email protected]>
* Fix compilation after subpixel handling changes in qtbaseFabian Kosmale2021-01-271-2/+3
| | | | | | | Change-Id: Ife394e660274dd9dbe17207e18c5024f90628a00 Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]> Reviewed-by: Allan Sandfeld Jensen <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* Fix a bunch of compiler warningsLars Knoll2020-08-281-0/+2
| | | | | | Taks-number: QTBUG-86234 Change-Id: I4c945edecdbe55bc5587c18599d49dfb82ade1eb Reviewed-by: Fabian Kosmale <[email protected]>
* Clean up QT_CONFIG(opengl)Paul Olav Tvete2020-06-171-1/+1
| | | | | | | | | | Accelerated graphics is now possible without OpenGL support. With this change, a Qt build with -no-opengl can still run Qt Quick with a Vulkan, Metal, or Direct3D backend. Fixes: QTBUG-84027 Change-Id: Ib63c733d28cfdf7de16b138df136fa7628e1747b Reviewed-by: Laszlo Agocs <[email protected]>
* Anisotropic antialiasing for distance field textEskil Abrahamsen Blomfeldt2020-06-151-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* Remove OpenGL dependency from QSGTextMaskMaterial & friendsEirik Aavitsland2020-06-101-42/+7
| | | | | | Task-number: QTBUG-84623 Change-Id: Ia665b789bbc875c26672abd7e0f8b0d9fe45d22b Reviewed-by: Paul Olav Tvete <[email protected]>
* Remove OpenGL dependency from QSGTextureLaszlo Agocs2020-06-081-28/+12
| | | | | | | | | | | | | | | | | The QSGTexture API is now clean, the OpenGL-specific functions are removed. Docs are to be updated in a separate patch. QSGPlainTexture, and a number of texture related places have to follow suit. The OpenGL atlas texture implementation is now removed. Task-number: QTBUG-84717 Task-number: QTBUG-84623 Change-Id: I1aab3b8b9145bb74ad39ef836ce540fc851292c5 Reviewed-by: Andy Nichols <[email protected]>
* Make QSGMaterialRhiShader become QSGMaterialShaderLaszlo Agocs2020-06-021-336/+15
| | | | | | | | | | | | | | | | After a symbiotic relationship in Qt 5.14 and 5.15, it is time for QSGMaterialRhiShader to devour its older sibling and take its place. This makes the direct OpenGL rendering path disfunctional. All QSGMaterial Qt 6 TODOs are solved, the API is clean and straightforward again: a QSGMaterial creates a QSGMaterialShader, no special flags and options needed. (it's just that QSGMaterialShader now has a slightly different API) Task-number: QTBUG-79268 Task-number: QTBUG-82997 Change-Id: I545ca8d796c5535e81957c706e7832133be15b7d Reviewed-by: Eirik Aavitsland <[email protected]>
* Fix offset on native text rendering with high-dpi scalingEskil Abrahamsen Blomfeldt2020-05-291-3/+4
| | | | | | | | | | | | | | | | | | | The glyph positions are scaled *after* they have been positioned, so when we subtracted the margin unmodified, we would actually offset by the scaled margin (so for scale factor=2 it would be 2 pixels off, and for scale factor=4 it would be 6 pixels off, etc.) We have to also prescale the margin by the inverse of the scale we will apply later. [ChangeLog][Text] Fixed an offset on text position when combining NativeRendering with high-dpi scaling. Task-number: QTBUG-84454 Pick-to: 5.15 Change-Id: I703aeb7fbd717bee5d88cc61e9a56c6422558889 Reviewed-by: Lars Knoll <[email protected]>
* Fix subpixel positioned text with Text.NativeRenderingEskil Abrahamsen Blomfeldt2020-05-051-5/+4
| | | | | | | | | | | | | | | | | We would be generating subpixel positioned glyphs based on the relative positions of the glyphs, ignoring the fractional part contributed by the origin of the text. So if the text origin was inside a pixel, the subpixel antialiasing would be wrong and we would see kerning errors. This was especially visible when using AlignHCenter on text with hinting disabled and resizing the item it was aligning to. Pick-to: 5.15 Task-number: QTBUG-49646 Change-Id: I0e709ba2b5d2440e34c94c6f819befe0a65a113a Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Konstantin Ritt <[email protected]>
* Move updateRhiTexture and co. to QSGTextureLaszlo Agocs2020-04-281-2/+2
| | | | | | | | | | | | | | | | | | | Use a more descriptive name, commitTextureOperations() in order to avoid confusion with QSGDynamicTexture::updateTexture() which has nothing to do with this. With this the QSGTexture interface has all 5.14 pending changes done (changes that were plumbed via ugly hacks due to having had to deal with binary compatibility). The awful enforcing of subclassing QSGTexturePrivate for each and every QSGTexture subclass is now eliminated. Purging the direct OpenGL code path will involve removing QSGTexture functions like textureId(), bind(), updateBindOptions(). With this patch we now we have all the equivalents (or, in some cases, spiritual successors) in place. Task-number: QTBUG-82997 Change-Id: I7a831f982070c52abc7a36604130a1110d14ff9c Reviewed-by: Andy Nichols <[email protected]>
* Fix device pixel ratio with QRhi for native textLaszlo Agocs2019-10-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calculating values based on the dpr is not possible in the sync phase, because the strictly correct dpr (that takes redirections into textures into account) is not known until QQuickWindowPrivate::renderSceneGraph(). The text material implementation attempts to dig out something directly from the context's associated surface, but this does not match the way QQuickWindow calculates the value (although it would work without causing any trouble in many cases). This is of course incompatible with the QRhi-based abstraction since neither the context nor the associated window (if there is one even) is known to materials. To solve this, create a proper solution that makes the QQuickWindow-calculated dpr available already in the sync phase (so in updatePaintNode() implementations): have QQuickWindow calculate calculate the dpr in syncSceneGraph(), and pass it down via the rendercontext. Only the rhi-based code path is touched in this patch. The direct OpenGL path could be fixed in a similar manner (by migrating to rc->devicePixelRatio() in the sync phase and state.devicePixelRatio() in the render phase), but that is left as a future exercise. Task-number: QTBUG-78610 Change-Id: Id9d9d4b1fd5b9730a64834fbbf61c74af4a8ed07 Reviewed-by: Paul Olav Tvete <[email protected]>
* Change const ref to ref in QSGMaterialRhiShader as per API reviewLaszlo Agocs2019-09-231-14/+14
| | | | | | Change-Id: I7783ed26a66f03ebe3b26bcba2f42f9fff45a417 Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Christian Strømme <[email protected]>
* Avoid introducing rhiTexture() in the public API of QSGTextureLaszlo Agocs2019-08-291-1/+3
| | | | | | | | | | | | | | | | There is no need for this. The few internal users can get it via QSGTexturePrivate. The original thinking was based on QRhi* being a public API, but that is not the case in the near future. So avoid introducing a public API relying on QRhiTexture. This of course makes it impossible to retrieve the native object under a QSGTexture (as textureId() is not used anymore when rendering with the RHI). For that, an alternative approach will be introduced later on. Change-Id: I0099b23424cafa4958f78c03300b0c934b60d92c Reviewed-by: Christian Strømme <[email protected]>
* Re-enable colors with both gl and rhi glyph cachesLaszlo Agocs2019-07-311-4/+4
| | | | | | | | | | | Follow up to the 5.13->dev merge where the lack of the qt5 submodule update made it impossible to use the new color argument. Also implements the color argument for the rhi variant of the glyph cache. Change-Id: Ie6c6ba3d647335eb6173d0c9f7fbe3a4ed6b1f24 Reviewed-by: Andy Nichols <[email protected]>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-261-6/+25
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/handlers/qquickpointerdevicehandler.cpp src/quick/scenegraph/qsgdefaultglyphnode.cpp src/quick/scenegraph/qsgdefaultglyphnode_p.cpp src/quick/scenegraph/qsgdefaultglyphnode_p_p.h tests/auto/qml/qjsengine/tst_qjsengine.cpp Done-With: Jan Arve Sæther <[email protected]> Done-With: Laszlo Agocs <[email protected]> Change-Id: I35749152f8dce44b9af8d52b1283629879010f11
| * Support text color for color fontsEskil Abrahamsen Blomfeldt2019-07-191-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support pen color for color fonts, we have to bake the color into the cache (since the cache contains actual color data and not alpha values). This is equivalent of 78caba7ae637bf4b33631c3425eb92ec3946c99e in Qt Base. [ChangeLog][Text] Added support for text color when using color fonts. Task-number: QTBUG-74761 Change-Id: I5910636c240bd4c0ec3f0b13db4e2f78d4b062ff Reviewed-by: Tor Arne Vestbø <[email protected]>
* | Add the graphics api independent scenegraph portLaszlo Agocs2019-07-041-73/+417
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt in via environment variables: QSG_RHI=1 -> enable using QRhi instead of GL QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default (the default is d3d11 on Windows, metal on Mac, gl elsewhere) Or force a given rhi backend via the existing QQuickWindow::setSceneGraphBackend(). Otherwise the default behavior is the same as before, the rhi code path is never active by default. -no-opengl builds are supported in the sense that they work and default to the software backend. However, the rhi code path cannot currently be used in such builds, even though QRhi from qtbase is fully functional with Vulkan, D3D, or Metal even when qtbase was configured with -no-opengl. This cannot be utilized by Quick atm due to OpenGL usage being all over the place in the sources corresponding to the default backend, and those host the rhi code path as well. This will be cleaned up hopefully in Qt 6, with the removal all direct OpenGL usage. Other env.vars.: QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer (assuming the system is set up for this) QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too) QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both merged/unmerged, convert when needed - with some rhi backends this is implicit) QSG_RENDER_LOOP -> to override the render loop as usual. The default with RHI is threaded for Metal, threaded for Vulkan on Windows, basic for Vulkan on Linux and Android (to be checked later), while the existing rules apply for OpenGL. Not supported when running with QRhi: - particles - compressed atlases (though this is transparent to the apps) - QSGRenderNode - QQuickRenderControl - QQuickFramebufferObject - certain QQuickWindow functionality that depends directly on OpenGL - anisotropic filtering for textures - native text may lack some gamma correction - QSGEngine applicability unclear - some QML profiler logs may be incorrect or irrelevant Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521 Reviewed-by: Lars Knoll <[email protected]>
* Fix non-integer scale factors with Text native renderingDavid Edmundson2018-03-131-2/+2
| | | | | | Task-number: QTBUG-67007 Change-Id: Id32cc14ea1bc258cfc139a859ccae014f5893563 Reviewed-by: Morten Johan Sørvig <[email protected]>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-15/+15
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <[email protected]>
* Replace Q_NULLPTR with nullptrKevin Funk2017-09-271-1/+1
| | | | | Change-Id: I0c01862dbb475494c84e39c695cb563df8cbcfa8 Reviewed-by: Lars Knoll <[email protected]>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-251-1/+1
| | | | | Change-Id: I176f91a8c51e81a2df3fe91733118261491223ee Reviewed-by: Lars Knoll <[email protected]>
* sources: Add missing override and remove redundant virtualAlexander Volkov2017-02-231-10/+10
| | | | | | | Change-Id: I48e26b1491024d41ebf75d40f0d1a7e9a1b20f22 Reviewed-by: Anton Kudryavtsev <[email protected]> Reviewed-by: Marc Mutz <[email protected]> Reviewed-by: Shawn Rutledge <[email protected]>
* Merge remote-tracking branch 'origin/5.7' into 5.8v5.8.0-beta1Liang Qi2016-10-271-1/+2
|\ | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: I0b9e5bea5da5d2666887c202e62d889b4aa56900
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-271-1/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickwindow.cpp tests/auto/quick/qquicktext/BLACKLIST tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: I8bd68b0b5e853b7908791d2cbddd18dd527c76ae
| | * Check qgl_current_fbo_invalid before using qgl_current_fboAlexandru Croitor2016-10-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSG24BitTextMaskShader::useSRGB() on macOS accesses the current context qgl_current_fbo member without first checking if it is valid. Make sure it also checks qgl_current_fbo_invalid, thus not accidentally dereferencing a dangling pointer. Change-Id: I56a77de23ee3b4b271bd848506ff26e14d7b6d15 Reviewed-by: Laszlo Agocs <[email protected]>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Simon Hausmann2016-08-261-3/+20
|\| | | | | | | | | | | Change-Id: If6750f5a11a24c535a2b3c4923bd8dc6a6b818f2
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Simon Hausmann2016-08-251-3/+20
| |\| | | | | | | | | | Change-Id: I12efb77e812364052eca12ea35219ceff64d7cc3
| | * macOS: Check if sRGB is supported before activating the shaderSérgio Martins2016-08-241-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing it in QSG24BitTextMaskShader::initialize() assumed that the FBO didn't change afterwards, but FBO can change (due to ShaderEffectSource or item.grabToImage()), resulting in qt_sRGB_to_linear_RGB() getting called for the case of the FBO not supporting sRGB. The work done in 1e18a4f985f6ec is still a good idea (enabling sRGB for all FBOs), and needed for exact rendering but this patch fixes an orthogonal issue. Change-Id: I98b12347e9ef60f46d8bcb20ac5d0d2d7b0c6f57 Task-Id: QTBUG-52906 Reviewed-by: Laszlo Agocs <[email protected]>
* | | Merge remote-tracking branch 'origin/dev' into wip/scenegraphngLaszlo Agocs2016-04-131-9/+9
|\| | | | | | | | | | | Change-Id: If33197b616de3476811f0161d4ecd8e7d004756c
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-081-9/+9
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change also fixes the build of two benchmarks, tst_affectors and tst_emission. Conflicts: src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro src/qml/qml/ftw/qhashfield_p.h tests/benchmarks/particles/affectors/tst_affectors.cpp tests/benchmarks/particles/emission/tst_emission.cpp tests/benchmarks/qml/pointers/pointers.pro tests/benchmarks/qml/pointers/tst_pointers.cpp tests/benchmarks/qml/qmltime/qmltime.pro tests/benchmarks/qml/qquickwindow/qquickwindow.pro Change-Id: I595309d1e183c18371cb9b07af6e4681059de3b2
| | * Move Qt Quick scenegraph resources under the :/qt-project.org/ directoryGiuseppe D'Angelo2016-04-011-9/+9
| | | | | | | | | | | | | | | | | | Change-Id: Ib1c2695f86837b02ba4aaf49184421cd464f7c20 Reviewed-by: Robin Burchell <[email protected]> Reviewed-by: Laszlo Agocs <[email protected]>
* | | Enable building Qt Quick module with QT_NO_OPENGL definedAndy Nichols2016-03-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the Qt Quick module depends on either the OpenGL or OpenGLES headers being available at build time. Since we are adding support for adaptations that do not depend on OpenGL, it should be possible to build Qt Quick in environments that do not have OpenGL development headers. This does present many challenges though because in some cases GL types, and classes that require OpenGL are part of the public APIs. However since these classes were never available when QT_NO_OPENGL was defined, it should be possible to redefine the function signatures under this scenario, since it's not possible to break binary compatibility if there never were any binaries to break compatibility with. One of the bigger changes that was necessary to facilitate this change is creating interfaces out of QSGContext and QSGRenderContext. Here the default behavior was usage of OpenGL directly, even though subclasses could override all OpenGL usage. Making them interfaces should bring QSGContext and QSGRenderContext more in line with the other classes present in the adaptation layer. Change-Id: Iaa54dc0f6cfd18d2da1d059548abf509bd71f200 Reviewed-by: Laszlo Agocs <[email protected]>
* | | Revert "Build (and fail) Quick with -no-opengl"Laszlo Agocs2016-02-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 707e6f528fc79db236d282e7ea41eb952c825433. We will not pursue this route for the time being. Change-Id: Idd1fce362440f6bf1b58901a289843fdfb39a5b7 Reviewed-by: Laszlo Agocs <[email protected]>
* | | Build (and fail) Quick with -no-openglLaszlo Agocs2016-02-051-0/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Disable qmltest, particles, Quick examples and tests. Also guard private QOpenGL header includes because, unlike the public QOpenGL* headers, this is not done in the private headers. This allows build attempts against a -no-opengl qtbase. It will of course fail when encontering the GL symbols and QOpenGL class usage in Quick/SG. Change-Id: I323f7a8b8854cc6e486e264517df30be3e5f8d3c Reviewed-by: Andy Nichols <[email protected]>
* / Updated license headersJani Heikkinen2016-01-191-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <[email protected]>
* Avoid crashing when not having a screen for the contextLaszlo Agocs2015-09-081-1/+1
| | | | | | | | | | | | | | | | Disconnecting the screen to which the context belongs results in a null QOpenGLContext::screen(). Fall back to qguiapp's devicePixelRatio() in this case (giving the highest dpi in the system) due to the lack of any other option. This will fix the crashes when rendering offscreen (QQuickWidget) and using native text rendering. Without this the render attempt after disconnecting the screen with which the context was created would crash due to accessing the already destroyed screen instance. Task-number: QTBUG-42803 Change-Id: Ie5889f59e5d66d09329b3d5fb8e1365d14d5b8fc Reviewed-by: Gunnar Sletta <[email protected]>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-301-6/+43
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/qml/qqmlengine.cpp src/quick/items/qquickitemsmodule.cpp tools/qml/main.cpp Change-Id: Ida8daf6b4d7e675385f2f5514c446e52dedaf136
| * Support 32-bit color bitmap glyphs in native text rendering.Eli Fidler2015-06-231-6/+43
| | | | | | | | | | | | | | | | | | | | | | We had been accidentally using the 8-bit alpha glyph shader, which resulted in rendering solid black outlines of the glyphs. Task-number: QTBUG-37986 Task-number: QTBUG-45514 Change-Id: Ie8728d50068f58d659e24bc5db2d73e01ca8db75 Reviewed-by: Konstantin Ritt <[email protected]> Reviewed-by: Tor Arne Vestbø <[email protected]>
* | Add missing QVector::reserve() callsSérgio Martins2015-06-051-1/+3
| | | | | | | | | | Change-Id: Iab7c9949941559b4773e5d4a0406dc58cfc70adb Reviewed-by: Simon Hausmann <[email protected]>