Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
The design philosophy of `MultiEffect` aims to process materials more comprehensively within a single rendering process rather than splitting it across multiple rendering passes. Cropping a material to a rounded rectangle is a common requirement, and I noticed that `ShapePath` has added relevant functionality: [ShapePath documentation](https://doc.qt.io/qt-6/qml-qtquick-shapes-shapepath.html#fillItem-prop).
If you want to apply a blur effect to an `Image` and crop it into a rounded rectangle, there are two approaches: either enable a layer for `MultiEffect` and then fill it into the `ShapePath`, or do the reverse. In either case, achieving this effect requires two rendering passes. You might think that using `MultiEffect`'s mask could accomplish the same thing, but when the `Image` is large, using a mask is not an ideal choice (perhaps it could be improved by supporting stretching the mask like `BorderImage`?).
So, can we leverage the `CurveRenderer` of `ShapePath` to maximize code reuse and add a `shapePathClip` feature to `MultiEffect`? The usage could look something like this:
MultiEffect { source: Image {...} blurEnabled: true shapePathClipEnabled: true shapePathClip: ShapePath { PathRectangle { topRightRadius: 10 topLeftRadius: 0 } } }
This approach would allow `MultiEffect` to incorporate the clipping functionality directly, thus potentially eliminating the need for an additional rendering pass and improving performance, especially for larger images. This could also provide a more flexible and streamlined way to apply complex shapes and effects without excessive processing overhead.
Attachments
Issue Links
- relates to
-
QTBUG-130893 ShapePath.fillItem doesn't work with all items; doesn't scale correctly with QT_SCALE_FACTOR
- Reported
-
QTBUG-98334 Support rounded corners on QtQuick Image
- Closed
-
QTBUG-61857 Potential Qt Quick Shape improvements
- Closed