If we want to enable partial rendering by default in the future, then we need to do this instead of disabling rendering notifiers. We don't know where the application renders to.
This regressed with commit 3cb4bd174d, which introduced the draw_rect() hook in ItemRenderer, but unfortunately
it wasn't in the `impl ItemRenderer` section
in the FemtoVG and Skia renderers.
ChangeLog: Fix panic when using gradient backgrounds with `Window`.
The use of the rotation-* properties creates a hidden Rotate item,
which applyes a rotation to the renderer. This rotation (and translation
by rotation origin) is now also applied when the partial renderer
computes the dirty regions.
This makes it possible to debug partial rendering with macOS easily.
Also, disable triple buffering when partial rendering is enabled,
as the partial renderer only supports two buffers.
This enables working around bugs in GPU drivers. Especially the GC7000UL
plus its driver on imx8mp has been observed to sometimes horribly degrade in
performance when Skia renders anti-aliased paths (when a function like
`gcoSURF_BlitCPU` shows up at the top of `perf` that's a bad sign).
If the effectively drop shadow size would be zero, the FemtoVG and Skia item renderers would panic. The following test-case reproduces this:
```slint
export component Test inherits Window {
Rectangle {
drop-shadow-color: black;
drop-shadow-offset-x: 1px;
drop-shadow-blur: -0.5px;
width: 0.5px;
height: 0.5px;
background: blue;
}
}
```
ChangeLog: [Renderers] Fix panic with FemtoVG and Skia renderers for certain drop shadows.
On macOS we should default to the Meta renderer, similar `renderer-skia` defaults to D3D on Windows. Unfortunately commit 0d36f88152 broke this by forgetting
that None with the requested graphics API means: Go for with what we have, nothing special requested.
This also fixes the terminal output "Failed to initialize Skia GPU renderer: Requested non-Metal rendering with Metal renderer . Falling back to software rendering" (and similar on Windows).
Based on API review, PlatformBuilder becomes BackendSelector with
a slightly smaller API surface but more options, such as selecting
Metal or Vulkan rendering.
The struct held provides access to the design metrics of the font scaled
to the font pixel size used by the element.
ChangeLog: Slint Language: Added font-metrics property to `Text` and `TextInput`.
Closes#6047
When a box shadow is the only child of an opacity item, we don't create an intermediate opacity layer (good). Without the opacity layer, it's mandatory to apply the current opacity though, which commit b5c61fb2f5 did, except
it missed this one draw_image call for the box shadow itself.
Fixes#6359
Commit 3cb636169506262d96ec2bc53a617714d5ab068d in femtovg switched to
using WeblGL to (needed for tiling). This means the GraphicsAPI::WebGL
context type needs to be updated, too. Also, the canvas_id was always
empty, but needs to be initialized from the id of the element we're
using.
`draw_text_input` handled the empty case with alignment correctly, but text_input_cursor_rect_for_byte_offset, as called for the ime update, did not.
This patch moves the logic into layout_text_lines() for sharing.
This replaces #6006 (which also has a manual test case in the comments).