Commit graph

433 commits

Author SHA1 Message Date
Simon Hausmann
00e5f59d9c
Skia: Update to latest release of Rust Skia bindings (#9663)
Some checks are pending
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
For details, see https://github.com/rust-skia/rust-skia/releases/tag/0.89.0
2025-10-09 09:36:43 +02:00
Olivier Goffart
11208758f0 core: Refactor the partial renderer in its own module 2025-10-08 21:08:37 +02:00
Ashley
e5dd53b6c2
parley: make font_size a PhysicalLength (#9672) 2025-10-09 03:47:03 +13:00
Tobias Hunger
cd50b41965
internal: Cargo + typo fixes (#9665)
* internal: Cargo + typo fixes

No intended change of behavior :-)

* Update internal/core/item_tree.rs

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>

* Update internal/core/item_tree.rs

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>

---------

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2025-10-08 16:33:07 +02:00
Simon Hausmann
df47f0b4ef femtovg: Upgrade to wgpu 27
Also:
 - The newer version of femtovg permits disabling text layouting, so this means less dependencies
 - Skia is the only renderer left to support wgpu 26, so unstable-wgpu-26 now implies a dependency to renderer-skia

Closes #9605
2025-10-07 14:13:52 +02:00
Simon Hausmann
01f510f027 parley: Upgrade to parley and fontique 0.6 2025-10-07 12:47:26 +02:00
Ashley
3894c3f6bb
Parley: Be extra careful about physical<->linear conversions (#9643)
* Be extra careful about physical<->linear conversions in sharedparley

* Change a bunch of functions
2025-10-07 22:34:38 +13:00
Simon Hausmann
9a4924fbbb wgpu: Added support for wgpu 27 with Skia
cc #9605
2025-10-06 19:10:31 +02:00
Simon Hausmann
9d6799d6d4 CI: Fix build with newer objc2 crates
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, --exclude bevy-example, windows-2022, 1.85) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
Several APIs are now stable and produce warnings about unused unsafe blocks.
2025-10-06 09:47:53 +02:00
Simon Hausmann
0910024aeb qt: Use parley for text rendering
cc #9559
2025-10-06 09:10:21 +02:00
Simon Hausmann
d80438ce06
CI: prospective fix for mysterious ci failures
Some checks are pending
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
Don’t try to build Skia from source
2025-10-02 23:56:36 +02:00
Simon Hausmann
5ba8206edb Skia: Use parley for text layout
Some checks are pending
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
cc #9559
2025-10-02 16:50:16 +02:00
Simon Hausmann
d1ac15ac7e parley: Simplify stroke and brush interface towards the renderer
The renderer needs to provide a PlatformBrush type that encodes if it's a fill or a stroke. In exchange, the stroke style interpretation can be handled in renderer-independent code.
2025-10-01 11:48:26 +02:00
Simon Hausmann
993358dee4 parley: Fix passing the brush for stroking to the glyph rendering 2025-10-01 11:48:26 +02:00
Simon Hausmann
6529848954 parley: Move text_input_cursor_rect_for_byte_offset into the shared module
... and make the rest of sharedparley private.
2025-10-01 11:48:26 +02:00
Simon Hausmann
6848e4fd7b parley: Move implementation of text_input_byte_offset_for_position to shared module 2025-10-01 11:48:26 +02:00
Simon Hausmann
97235e6a42 parley: Move font-metrics computation function to shared module
For future sharing with the other renderers.
2025-10-01 11:48:26 +02:00
Simon Hausmann
6411bc3957 parley: Fix Text.font-metrics
The values from the truetype tables are in design metrics, but we need to scale to the requested pixel size.

Testcase: cargo run -p slint-viewer -- tests/manual/font-metrics.slint
2025-10-01 11:48:26 +02:00
Simon Hausmann
a977f34a0b parley: Centralize font_size function
The implementation is independent from the renderer, so forward.
2025-10-01 11:48:26 +02:00
Simon Hausmann
b7ff7fc482 parley: Move GlyphRenderer trait into parley module 2025-10-01 11:48:26 +02:00
Simon Hausmann
539e99aeca parley: Fix foreground text selection color
Use a range with a brush on the ranged builder to apply a different text color for the selection.

Fixes #9580
2025-10-01 11:48:26 +02:00
Simon Hausmann
850358697d parley: Move text input rendering out of the FemtoVG item renderer into the to-be-shared parley module 2025-10-01 11:48:26 +02:00
Simon Hausmann
7c55402f58 parley: Introduce abstraction in the item renderer to reduce text drawing to glyph drawing 2025-10-01 11:48:26 +02:00
Simon Hausmann
a6513ff794 FemtoVG: Simpilfy text layout drawing
Some checks are pending
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
As suggested by Ashley
2025-09-29 19:19:16 +02:00
Simon Hausmann
947827dac1 parley: Move more of the line and run rendering logic into sharedparley
This will allow for more code-reuse in the other renderers.
2025-09-29 19:19:16 +02:00
Simon Hausmann
280594680a parley: Apply elision only on the last line
When breaking multiples lines of text and the last line can't be broken anymore but exceeds the available width *and* overflow handling is set to elide, *then* apply the elision glyph substitution.

Also, centralize more of this inside just one glyph iterator, so that
re-use in the other renderers will be trivial. This also avoids one
extra vec allocation when collecting the glyphs.
2025-09-29 11:40:43 +02:00
Simon Hausmann
4f6399d9ed FemtoVG: Remove unused dependencies 2025-09-29 10:52:37 +02:00
Ashley
e9d9b873df
feature/fontique - text elision (#9537)
Some checks are pending
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
* Don't break when not wrapping

* Handle elipsis in draw_glyphs

* Add some nice QOL functions to sharedparley
2025-09-27 01:19:00 +12:00
Ashley
13623bc152
feature/fontique: switch femtovg to parley (#9466)
Some checks are pending
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
* Parlay init

* Start on femtovg

* Cargo fmt

* Decimate fonts.rs

* Use fill_glyphs

* [autofix.ci] apply automated fixes

* Use positioned_glyphs instead

* Clean up a little

* Format

* [autofix.ci] apply automated fixes

* Few fixes

* [autofix.ci] apply automated fixes

* More small changes

* Clean up

* [autofix.ci] apply automated fixes

* Display text cursor

* Handle text_input_cursor_rect_for_byte_offset

* stoke glyphs

* Handle text selections

* Stroke selection as well

* Fix wierd cargo.toml padding

* Move selection and stroking to brush settings

* Removed commented out code

* [autofix.ci] apply automated fixes

* Cursor sizing

* [autofix.ci] apply automated fixes

* Mark unused variables

* _scale -> scale

* Handle a lot more layout options

* Use the parley cursor

* Removed unused PhysicalPoint

* Start combining stuff WIP

* Move things into i_slint_core::textlayout::sharedparley

* [autofix.ci] apply automated fixes

* Go back to splitting paragraphs correctly

* Handle font_metrics via ttf_parser

* Move (lack of) overflow handling to sharedparley

* [autofix.ci] apply automated fixes

* impl Deref for Layout

* Be more explit about the width passed to layout being physical

* Cargo fmt, rename fonts to font_cache

* Use a thread local for layout context

* Use parley selection

* fix femtovg wgpu

* Switch femtovg branch

* max_physical_width -> max_width

* Box contexts

* [autofix.ci] apply automated fixes

* Fallback to GenericFamily::SansSerif if no font is set

* Add paint.set_font_size

* Use max_physical_height

* Fix text_size to return correct logical sizes

* Use femtovg from crates.io

* Fix C++ build

The `sharedparley` module declares a public `Layout` struct, which
clashes with the `Layout` struct we use in the C++ API. The former
however is entirely internal to Rust, so we can instruct cbindgen to
ignore the module.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2025-09-26 02:48:48 +12:00
Ashley
a4278e6c3a feature/fontique: Remove fontdb, adapt glyph embedding code (#9434) 2025-09-24 16:54:09 +02:00
Ashley
a3a3844cef feature/fontique - switch femtovg over and use a default fontdb for usvg (#9426)
* Use default fontdb for usvg

* Start adapting femtovg

* Use DesignFontMetrics from sharedfontique

* Restore fallback fonts

* [autofix.ci] apply automated fixes

* Add allow(dead_code) tag

* [autofix.ci] apply automated fixes

* Tiny comment change

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-24 16:54:09 +02:00
Ashley
8e2df006cd Add fontique as a font database alongside fontdb (#9379)
* Add fontique as a font database alongside fontdb

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-24 16:54:09 +02:00
Simon Hausmann
329461972e Skia/WGPU: Enable vsync by default
Apply commit ae204bda25 also to the wgpu
surface of the skia renderer.

cc #8693
2025-09-17 11:16:00 +02:00
Ashley
241964d567
Change the Rotate item to a Transform that supports scaling (#9387)
* Add scale method to backends

* Rename Rotate to Transform

* Add scaling to Transform

* Fix tests

* Insert Transform if any of scale-x, scale-y or rotation-angle are set

* Add scaling to child_transform and handle events as a result

* Cargo fmt

* Femtovg clipping

* Fix femotovg clipping

* Add newline to actual_render.scale

* Cargo fmt tools/lsp changes

* Modify docs

* Change type to a float instead of percent and fix defaults

* Add note about software renderer

* Add basic event scaling test
2025-09-15 21:14:33 +12:00
Simon Hausmann
768c895ad4 Upgrade to Rust Skia 0.88
For details, see https://github.com/rust-skia/rust-skia/releases/tag/0.88.0
2025-09-12 11:59:57 +02:00
Simon Hausmann
e5cf52d2ba Skia/WGPU/DX12: Fix crash when resizing window
Some checks are pending
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
Resizing the window may cause a panic in wgpu. DebugView with d3d debug layers enabled yields a more elaborate message:

    IDXGISwapChain::ResizeBuffers: Swapchain cannot be resized unless all outstanding buffer references have been released.

So before resizing, force Skia to submit and flush everything to the CPU level. This isn't optimal - especially since it's cross window - but it seems to work.

Fixes #9320
2025-09-11 19:34:21 +02:00
Ashley
0670cb1dc7
Handle rotating mouse events (#9317)
* Start on touch event rotation work

* [autofix.ci] apply automated fixes

* Use ItemTransform instead.

* [autofix.ci] apply automated fixes

* Use casts to deal with integer Coords on some platforms

* Remove rotation checks

* Transform the exit event as well

* Delete check_rotation pass

* Do casts around transform_point to handle i32 Coords

* Remove errors from rotation syntax test

* Basic event rotation test

Working changes

* Fix clicks on rotated objects

* Add RendererSealed::suppports_transformation for runtime checks

* [autofix.ci] apply automated fixes

* Add a few missing line breaks, only transform events if supported by
renderer

* Improve test

* Remove extra whitespace

* Get absolute-position working

* Ensure map_to_window does the coordinate cast thing.

* Manually test mouse-x and mouse-y, test absolute_position()

* Whitespace stuff again

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-12 00:13:14 +12:00
Simon Hausmann
03dabf983f FemtoVG: Fix panic when used with WebGL
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
In earlier refactorings, passing through the id of the HTML canvas element got "lost". Restore this by handling it in the place where we also have access to the element.

This restores rendering as part #9345 , but the size of the canvas is still wrong. But if resized manually you can see rendering now :)

cc #9345
2025-09-07 13:26:50 +02:00
Ashley
87e095d53a
Add conical gradients (#9334) 2025-09-06 03:34:14 +12:00
Simon Hausmann
0bb29cb5c2 wgpu: Improve backend avoidance
- For Skia, also opt out of the WGPU GL backend - we're not attempting to map it to Skia.
- For FemtoVG, avoid GL as well, because it produces artefacts.
2025-08-22 17:26:21 +02:00
Simon Hausmann
4f7bc76f1b skia-wgpu: Avoid the vulkan backend on Windows
... as we don't enable the Vulkan feature by default with skia on Windows, because it's not in the binaries and thus would force everyone to build skia (which is a PITA on Windows).
2025-08-22 17:26:21 +02:00
Simon Hausmann
06765f8214 Skia: Add support for rendering with WGPU
Set up the underlying graphics API with WGPU, render into the queue with
skia, present with WGPU. Opens path to importing wgpu textures, provided
that we synchronize them (i.e. pipeline barriers/transitions if needed).
2025-08-22 17:26:21 +02:00
Simon Hausmann
18740aa826 Fix rem support
After commit e04f028c91, the
default-font-size property on WindowItem isn't set anymore by default,
so BuiltinFunction::GetWindowDefaultFontSize, which reads it, would
return zero.

Instead, delegate to a run-time function where we can fall back to the
default from the renderer.

This patch changes rem.slint to use the newer syntax. The main change to
the test case though is to removal of the explicit default-font-size
property setting, so that we fall back to the value provided by the
renderer. This test relies on being run with the testing backend.

Fixes #8961
2025-08-21 14:29:55 +02:00
Simon Hausmann
fd28676ab6 wgpu: Fall back to software rendering if there are no GPU-backed WGPU adapters
Fixes #9164
2025-08-19 14:57:21 +02:00
Simon Hausmann
b0dae934ed FemtoVG: Support compiling without OpenGL
Building with --no-default-features --features compat-1-2,backend-winit,renderer-femtovg-wgpu
should not require glutin.
2025-08-15 14:04:13 +02:00
Simon Hausmann
933e604830 Skia: Fix text overflow elide handling
Some checks are pending
CI / build_and_test (--exclude bevy-example, ubuntu-22.04, 1.85) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, --exclude bevy-example, windows-2022, 1.85) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
With Overflow::Elide, handle two cases:
  - When word wrap is disabled, lay out with the given width, set the
    elipsis character on the style
  - When word wrap is enabled, lay out with the given width, don't set
    elipsis on the style, *then* compute the correct number of max
    lines, and re-do the layout - that way the elipsis appears on the
    last line of the multi-line text
2025-08-12 15:46:55 +02:00
Simon Hausmann
bb809f9bc9 Skia: Fix regression in text size calculation
When computing the implicit height of a Text, we call text_size() on the renderer with the previously computed width, which in turns creates a text layout and *should* wrap text according to the width and return the height.

Before #8138, text layouts created with NoWrap were still wrapped and produce a height as if it were wrapped.

After #8138, NoWrap would return a height as if the text were on a single line. Unfortunately, the text_size() call used TextWrap::default() as wrap mode, which is NoWrap. That was previously an accidental no-op, but now isn't. So we need to pass TextWrap::WordWrap to get a reasonable height.

Fixes #9053
2025-08-08 16:26:21 +02:00
Simon Hausmann
8ed0fd327e wgpu: Switch to WGPU 26
Some checks are pending
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
2025-08-05 17:27:00 +02:00
Simon Hausmann
351324ae29 wgpu: Centralize setup
Some checks are pending
CI / python_test (macos-14) (push) Blocked by required conditions
CI / files-changed (push) Waiting to run
CI / build_and_test (--exclude bevy-example, ubuntu-22.04, 1.85) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, --exclude bevy-example, windows-2022, 1.85) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
By moving the adapter/device/etc. selection code into the wgpu_25
module, the setup code can be shared between FemtoVG and Skia (in the
near future).
2025-08-03 13:23:47 +02:00
Tasuku Suzuki
3d7f616dee
Add conic gradient support for all backends (#9021)
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
- Implement @conic-gradient(color angle, ...) syntax
- Center is always at rectangle center (no center_x/center_y parameters)
- 0 degrees starts at north (12 o'clock position)
- Support Slint angle units: deg, rad, turn
- Software renderer: Full native implementation
- Qt backend: Native support with angle offset correction
- Skia backend: Native support with angle offset correction
- FemtoVG backend: Fallback to solid color (first gradient stop)


ChangeLog: Added support for `@conic-gradient`

Fixes #3957
2025-08-02 09:14:33 +02:00