aboutsummaryrefslogtreecommitdiffstats
path: root/src/effects
Commit message (Collapse)AuthorAgeFilesLines
* RectangularShadow: Remove note about individual corner radiusKaj Grönholm2025-11-051-4/+3
| | | | | | | | Since Qt 6.11, individual corner radius are supported. Task-number: QTBUG-141110 Change-Id: I38382ff4c20e53ea1f380ac6ae103ddf0cf527e6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* RectangularShadow: Add support for individual corner radiusKaj Grönholm2025-10-235-11/+365
| | | | | | | | | | | | Add API for specifying individual corner radius values similar to Quick Rectangle. Try to keep the overhead minimum when not used, by storing data in lazily allocated extra and using separate shader. Use the API in the neumorphicpanel example. Task-number: QTBUG-141110 Change-Id: I90e558526dff01c88fb2d163a33704b8f73aa1fc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Docs: Fix doc warningsAlexei Cazacov2025-04-302-2/+0
| | | | | | | | This commit fixes several broken links in \nativetype. Pick-to: 6.9 6.8 Change-Id: I45c599eb165b062b2a9eddea3fd13b90d2d7fd74 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Docs: Improve RectangularShadow documentationAlexei Cazacov2025-01-171-53/+57
| | | | | | | Task-number: QTBUG-131012 Pick-to: 6.9 Change-Id: If2772b615cab303d018b0353ee7432596bff6c7c Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Add RectangularShadow elementKaj Grönholm2024-11-096-0/+792
| | | | | | | | | | | | | | | | | | | | | | | | Add a new element into QtQuick.Effects called RectangularShadow. This is a high performance shadow/glow for (rounded)rectangle shapes. Differences compared to QGE RectangularGlow: - Implemented in C++ and part of QtQuick.Effects module. - Different API, modelled based on CSS box-shadow. - Shader uses SDFs math for rounded rectangle. Reduced item size and properly rounding math (circle is a circle). - Allows offset and spread relative to item. - Default color is black (shadow) rather than white (glow). - Using "layer.enabled" for cache property rather than separate ShaderEffectSource. - Property "material" so shader effect can be customized. QQEM can contain RectangularShadow node for easier customization. Contains an example and lancelot tests. Task-number: QTBUG-128469 Change-Id: Ie3baa774a3294ba0c7fe11d1bee8cd7aae897505 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Turn Qt::QuickEffects into a regular Qt moduleUlf Hermann2024-11-061-30/+39
| | | | | | | | | | | | | | | We want find_package(Qt COMPONENTS QuickEffects) to do something useful. Otherwise people will have a hard time using the QuickEffects types with qmltc. [ChangeLog][Build System] QuickEffects is now an actual Qt module that you can findPackage() without further gymnastics. Fixes: QTBUG-130588 Change-Id: Ie0616a83124c3f1ee5145128acd95e8e4ebf3cd2 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
* Fix MultiEffect shadow opacityKaj Grönholm2024-10-282-7/+6
| | | | | | | | | | | | | MultiEffect shadow coloring was fixed in QTBUG-123396. Unfortunately that caused shadow opacity to be taken into account twice. First in multiplication and second in mix which takes shadowColor including the alpha. Instead, remove multiplication and make the shadowColor to have premultiplied alpha. Task-number: QTBUG-130582 Pick-to: 6.8 Change-Id: I14c95ef13009dada5f1125d98c019e9c5d7f8245 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add missing includesFabian Kosmale2024-10-242-0/+2
| | | | | | | | | | ...in preparation of trimming down includes in QQuickItem. As a drive-by, remove the superfluous qqml.h include from quick/items/qquicktextutil_p.h. Change-Id: I7ee0f459bcbfdfe07314d1f63433aaa8639870ac Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix conflicting QGfxSourceProxy meta object with the one in qt5compatAlexandru Croitor2024-10-184-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | There are two QGfxSourceProxy classes in the codebase, one in qt5compat/src/imports/graphicaleffects5/private and the other in qtdeclarative/src/effects. In a static build, if a project links and initializes both qml modules, it is undetermined which QGfxSourceProxy class' meta object will be loaded. This can lead to the multi effects object version being loaded when initializing a component from the graphical effects module. You then get a warning message saying "Missing QML.Element class info for QGfxSourceProxy" and then a failure to load the QML module. This happened for the sample qmake project attached to the bug report this change is fixing. Rename the multi effects QGfxSourceProxy class to QGfxSourceProxyME (where ME stands for Multi Effects) to avoid the meta object conflict. Pick-to: 6.8 Fixes: QTBUG-130080 Change-Id: I0001f36b19e36deeddd32897d23c8bfa52011e02 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Fix MultiEffect shadow coloringKaj Grönholm2024-09-091-3/+3
| | | | | | | | | | The algorithm for shadow didn't work correctly when the source item was dark and the shadow color wasn't black. Fix the shadow calculation. Task-number: QTBUG-123396 Pick-to: 6.8 Change-Id: Ib038bef4ebdd374cfb3c992c16173f8d8ddc5d13 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Docs: add recomendations for using MultiEffect with ShaderEffectSourceAlexei Cazacov2024-08-302-0/+14
| | | | | | | Task-number: QTBUG-127993 Pick-to: 6.8 Change-Id: Ib7b3c4b9c88b3453f6a121b0f8d4e2f792ff9ae9 Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
* Docs: improve the MultiEffect documentationAlexei Cazacov2024-08-291-3/+51
| | | | | | | | | | | | This commit adds: - an example on how to apply the MultiEffect to a layered item - an explanation on hiding a source item - an explanation on mask size behavior Task-number: QTBUG-127993 Pick-to: 6.8 6.7 Change-Id: I8d570021a38705deafcc95b87f7f6f3ee6b58124 Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
* Doc: Replace \instantiates with \nativetypePaul Wicking2024-08-201-1/+1
| | | | | | | | | | | Since the implementation of the `\nativetype`-command in QDoc, the `\instantiates`-command is deprecated. Replace the use of the deprecated command in favor of its replacement. Pick-to: 6.8 Task-number: QTBUG-128216 Change-Id: I23d9f66d3f6db2e5f827d7868497a432bb9b0626 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* effects: Straighten out some logging categoriesUlf Hermann2024-06-191-1/+1
| | | | | | | | | | | Either make them static or declare them in a header. We want them to be static wherever possible, in order to reduce the number of visible symbols. If they can't be static, however, they should at least be declared in only one place. Task-number: QTBUG-67692 Change-Id: Ice9ffb3b0334e4e1684aa812587ece787d31b865 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the use of GENERATE_CPP_EXPORTS argumentAlexey Edelev2024-06-111-1/+0
| | | | | | | | | The behavior that argument was enabling is the default one now. Pick-to: 6.8 Task-number: QTBUG-90492 Change-Id: I11711d4c794f0b22169abb595b8ffad2eeb1300d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix crash in MultiEffect with dynamic delegatesKaj Grönholm2024-04-252-2/+5
| | | | | | | | | | | | | Changing dummy QQuickShaderEffectSource to be private variable rather than static one fixes issue with dynamic delegates switching blurred items on/off. Pick-to: 6.7 6.7.1 6.5 Fixes: QTBUG-124730 Change-Id: Ibaebfd6cb228fe1b7fa91c8219c1355a93ceb19c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Mark MultiEffect itemRect properly as readonlyKaj Grönholm2024-03-261-0/+1
| | | | | | | Pick-to: 6.7 6.6 Change-Id: Id3a7031959f9b386b919d0a00c02e7bdcadf8a92 Reviewed-by: <peter.schneider@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Patially revert "Make some properties in the effects module FINAL"Fabian Kosmale2024-02-161-30/+30
| | | | | | | | | | | | Making properties FINAL is an API break not covered by any QUIP rule. However, this does not apply to types which can't be instantiated from QML, so the changes to QGfxSourceProxy can be kept. This partially reverts commit b7813fc5ea6591236d4035cfb5a94bfa6e9a2dcf. Pick-to: 6.6 6.7 Change-Id: Ia03a50d5db1e432ac24655369f3d51b3319235f0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* MultiEffect: Avoid crashing without QQmlEngineKaj Grönholm2024-02-141-1/+4
| | | | | | | Task-number: QTBUG-122256 Pick-to: 6.7 6.6 6.5 Change-Id: I116658ce3d454e72e854bd5cf4d31dd736cca10d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* scenegraph: Add plumbing for enabling multiviewLaszlo Agocs2024-01-151-0/+1
| | | | | | | | | 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 <andy.nichols@qt.io>
* Remove the use of GENERATE_PRIVATE_CPP_EXPORTSAlexey Edelev2024-01-111-2/+1
| | | | | | | Task-number: QTBUG-117983 Change-Id: I584116bfd4d47deca914910b712c2ea3295f3e7f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove the use of Q_QUICKEFFECTS_PRIVATE_EXPORTAlexey Edelev2024-01-092-2/+2
| | | | | | Task-number: QTBUG-117983 Change-Id: I49869da5165be46e38f9dd427a5d49ebabf645e4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add license headers to shader sourceEskil Abrahamsen Blomfeldt2023-10-302-0/+6
| | | | | | Pick-to: 5.15 6.2 6.5 6.6 Change-Id: I007eaddf0a3a9e7e6242d4e02b487fa0806c96a7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Avoid crashing with MultiEffectKaj Grönholm2023-10-051-1/+1
| | | | | | | | | | Seems that on some cases updateEffectShaders() can be reached before m_shaderEffect exists. So check this. Task-number: QTBUG-117830 Pick-to: 6.6 6.5 Change-Id: I55aff305eefa6150275032e859728bf62fdbeb28 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Use build time shader processing for multieffectLaszlo Agocs2023-08-0128-78/+320
| | | | | | | Pick-to: 6.6 Change-Id: I63864b622fe14b102e3a0267433e69f20689f320 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Make some properties in the effects module FINALOliver Eftevaag2023-06-052-35/+35
| | | | | | | | | | | | | | | | | | | Without setting the FINAL flag, properties can be shadowed by users. This can both cause confusion for non-experienced users, and it causes issues with qmlsc. [ChangeLog][Important Behavior Changes][Effects][MultiEffect] Properties for the type MultiEffect are now FINAL, meaning they can no longer be shadowed by declaring new properties with the same names in QML. A warning will be printed out to the console, when a FINAL property is being shadowed. We recommend that users rename those properties to avoid potential unexpected behavior changes. Pick-to: 6.6 Task-number: QTBUG-108739 Change-Id: Ibed4cdc596ef39cca502397887bca72ed8b1c5f4 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Doc: Use correct module identifiers in \qmlproperty commandsTopi Reinio2023-06-051-31/+31
| | | | | | | | | The correct QML module for MultiEffect type is QtQuick.Effects, and for BoundaryRule, Qt.labs.animation. Pick-to: 6.6 Change-Id: I2013079d5be656f19c10c497fb4474bd761b0b36 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Doc: Make 'Qt Quick Effects' and 'Qt Quick Particles' linkable targetsTopi Reinio2023-06-021-0/+1
| | | | | | | | | | | | | These modules have no separate landing pages within Qt Quick. Add \keyword commands to create linkable targets to their respective QML module pages. Link to Qt Quick Effects from the Qt Quick landing page. Pick-to: 6.5 Fixes: QTBUG-113454 Change-Id: I9376d9c946cc7a4d4728584a96ddf701deaeb4b5 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Remove obsolete Q_ENUMS usageFabian Kosmale2023-05-021-1/+1
| | | | | | | | | In qgfxsourceproxy_p.h, we can use the modern Q_ENUM. In QQuickStyleOption, he usage of Q_ENUMS did not make sense to begin with, as the class is neither a QObject nor a Q_GADGET (nor a Q_NAMESPACE). Change-Id: I5b85a46f57033442504a27bf2e1a05d7b0aaac48 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Promote the Multieffect QML type pageAndreas Eliasson2023-03-191-5/+7
| | | | | | | | | | | This QML module, part of the Qt Quick Effects submodule, is not very visible across the Qt Quick pages. Also, inform that this QML type is the successor to the Qt Graphical Effects from Qt 5. Fixes: QTBUG-111481 Pick-to: 6.5 6.5.0 Change-Id: I933bcc196a292a08135bcf77b397b5f7ff5d4827 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Add note about the source item usageKaj Grönholm2023-02-081-0/+5
| | | | | | | | | | Try to explain how the usage of SourceProxy may affect the appearance of the MultiEffect source item. Task-number: QTBUG-109555 Pick-to: 6.5 Change-Id: I5ec6fd686aa5c870c163e2ea7e6d56b82008c5ed Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Minor fixes to MultiEffectKaj Grönholm2023-02-081-8/+13
| | | | | | | | | | | Fix the blur items size to next divisible by 16 (like the comment says) instead of 32. Use QVector4D for colorizationColor and shadowColor so their alpha is set correctly. Pick-to: 6.5 Change-Id: I948bdd6c0a792c2fd90a58b69514478f2d965f41 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Improve MultiEffect API documentationKaj Grönholm2023-02-021-18/+141
| | | | | | | | | | Add some code examples and images. Task-number: QTBUG-110757 Pick-to: 6.5 Change-Id: I599bef3374c597e4ab2afa4478748100d3963d84 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Adjust the MultiEffect APIKaj Grönholm2023-01-2631-132/+132
| | | | | | | | | | | | Based on the API review, adjust the MultiEffect API. - Change mask threshold Low/Up to Min/Max and for spread AtMin/AtMax. - Change colorize to colorization so it is more symmetric with brightness, saturation etc. Task-number: QTBUG-109557 Pick-to: 6.5 Change-Id: I96ff2a13e20405998c5ed0cb38ad3b5911daf94c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* doc: Make sure QtQuick.Effects module shows in docsEskil Abrahamsen Blomfeldt2023-01-101-1/+14
| | | | | | | This was missing some infrastructure to be generated. Change-Id: I669193af2550bb6274b9f69fc3c852cf59e54f6d Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Improve blur items sizingKaj Grönholm2022-12-202-9/+24
| | | | | | | | | | | | | | | | MultiEffect uses max 5 blur items. So to be able to divide first one 4 times without rounding, first one needs to be rounded up to next 2^4 = 16 (16,8,4,2,1). Make the first blurred item size half of the source size (plus the rounding). This increases the blur amount and performance and decreases texture memory usage and quality. Based on testing it seemes like a good compromize. Also resize bluritems only when needed. Pick-to: 6.5 Task-number: QTBUG-109490 Change-Id: I907b48904d3f9b0414704026cc1f07c02c49a8c7 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Cleanup and fix initial shadowOpacityKaj Grönholm2022-12-202-27/+4
| | | | | | | | | | Cleanup unused properties from the effect. Also update initial shadow opacity correctly with the color. Task-number: QTBUG-109432 Pick-to: 6.5 Change-Id: I3615f17333ce63403d00b3df75794565b72768ed Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Improve and optimize MultiEffect maskKaj Grönholm2022-12-2029-12/+19
| | | | | | | | | | | Move mask calculations from fragment shader into C++ side, so that only need to be done once vs. each pixel. Adjust slightly so that smoothstep doesn't reach potentially undefined rangle (edge0 ≥ edge1). Task-number: QTBUG-109431 Pick-to: 6.5 Change-Id: If0ca10385c9bf41fb32b666f2b1c4dd38b7cc192 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Adjust the default values of shadow offsetsKaj Grönholm2022-12-202-5/+5
| | | | | | | | | | Default to 0 with shadow horizontal and vertical offsets. This way they match to GE DropShadow defaults and also the shadow fits inside the effect item area without any extra paddingRect. Pick-to: 6.5 Change-Id: Ib02763a15c088a390dfe65e0e9216ca0a10fc58c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix MultiEffect sizing with layer.effectKaj Grönholm2022-12-201-4/+8
| | | | | | | | | | | When using Item layer.effect, the effect source item doesn't get a size but instead the size is updated directly for the effect (see QQuickItemLayer::updateGeometry()). Task-number: QTBUG-109406 Pick-to: 6.5 Change-Id: I3ef7469b6286848791b9c844281c68c5988cfd01 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix MultiEffect memory leakKaj Grönholm2022-12-101-0/+1
| | | | | | | | Make sure bluritems get cleaned together with the MultiEffect item. Task-number: QTBUG-109276 Change-Id: I0a84d10b0436f9fcdb051914839626c6cf226a5f Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Improve MultiEffect source handlingKaj Grönholm2022-12-106-66/+325
| | | | | | | | | | | | | | | | Improve the way MultiEffect handles input source item. - Use modified QGfxSourceProxy from Graphical Effects, to be compatible with the source handling. Basically internal ShaderEffectSource is only created when the target source item can't be used directly. - Remove "hideSource" property as that isn't relevant anymore. - Add "hasProxySource" readonly property to see when the internal source is used. - Adjust documentation related to this change. Task-number: QTBUG-109137 Change-Id: I11fb317548c1a13442d6f241eca3917a4293f47d Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Yuhang Zhao <2546789017@qq.com>
* Add QtQuick.Effects & MultiEffectKaj Grönholm2022-12-0738-0/+2393
Add new QtQuick.Effects plugin for post-processing effects. The plan is to add essential effects directly into QtQuick, not to duplicate Qt Graphical Effects. Initially the plugin will contain MultiEffect which supports 7 different effects in a single ShaderEffect (brightness, contrast, saturation, colorize, blur, shadow, mask). Combining multiple effects into a single shader is more performant than chaining multiple effect items. Depending on used features, the most optimal shader gets selected. Includes two examples demonstrating the usage of MultiEffect. Task-number: QTBUG-106651 Change-Id: I35865030fd4b7a1f657146cee03b195451545bc6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>