Commit graph

86 commits

Author SHA1 Message Date
Olivier Goffart
23962b3e25
Upgrade cbindgen and use unsafe(no_mangle) attributes (#8539)
To be compatible with the 2024 edition, we need to wrap the
`no_mangle` attribute in `unsafe()`.

The parsing for that in cbindgen was only added in the version 0.28,
but we couldn't upgrade cbindgen before because of a regression in
cbindgen 0.27 that prevented us from upgrading.
Now that cbindgen 0.29 is released with a fix, we can prepare for the
2024 edition
2025-05-26 11:21:33 +02:00
Olivier Goffart
08aa021166 C++: expose the DrawRectangleArgs and DrawTextureArgs
This is still experimental API, but just have a copy of all arguments in
a plain struct that the C++ code can operate on.

(Because previous refactor of the interface had made it hidden from C++)
2025-05-23 17:10:26 +02:00
Olivier Goffart
e42c4b18c2
swrenderer: interface for hw rendering of rectangle with border or gradients (#8384) 2025-05-06 15:53:53 +02:00
Olivier Goffart
c8138ff1db
swrenderer: rewrite TargetPixelBuffer::draw_texture interface
Instead of using datastructure that are tailored to our line by line
renderer and draw functions, use more generic and future proof data that
are easier to handle by hardware accelerator, and may be easier to
stabilize.

The screenshots from the screenshots test have to be re-done
because the rounding is different

Note: the C++ API DrawTextureArgs is not exposed yet
2025-04-29 23:26:02 +02:00
Simon Hausmann
302926edfa
Skia: Improve multi-window rendering resource consumption (#8304)
Share Vulkan instance as well as Metal device and command queue across windows.
2025-04-29 18:58:09 +02:00
Simon Hausmann
6595aee73c
Replace use of Rc<winit:🪟:Window> with Arc (#8257)
In preparation for wgpu usage, where the wgpu API requires the window
handle to be send, i.e. Arc<dyn HasWindowHandle>.
2025-04-24 13:28:51 +02:00
Simon Hausmann
f114ff28dd Rename TargetPixelBuffer::Pixel to ::TargetPixel 2025-02-24 17:02:10 +01:00
Simon Hausmann
910d45a01f Fix window background fill
Don't blend the background but fill it when going through ProcessScene.
2025-02-24 17:02:10 +01:00
Simon Hausmann
247074b5e7 Simplify accelerated texture and rectangle fills
There's no need to split the areas to span lines.
2025-02-24 17:02:10 +01:00
Simon Hausmann
b896cc394b Fix the build with the experimental feature turned off 2025-02-24 17:02:10 +01:00
Simon Hausmann
9e515710ed Expose screen rotation in the TargetPixelBuffer's draw_texture as integral angle 2025-02-24 17:02:10 +01:00
Simon Hausmann
df6c99871d Change TargetPixelBuffer's draw_texture function to take a data structure instead of many arguments 2025-02-24 17:02:10 +01:00
Sam Cristall
491cb2f911 Add span_y to draw_texture to fix partial texture draws 2025-02-24 17:02:10 +01:00
Sam Cristall
3855cf6b9c Add draw_texture/process_texture and use accelerated fill_rectangle for background draw 2025-02-24 17:02:10 +01:00
Simon Hausmann
fbee7f9566 WIP: Start wrapping TargetPIxelBuffer in C++ 2025-02-24 17:02:10 +01:00
Olivier Goffart
290468fb55 C++: Stabilize line by line renderer
Fixes https://github.com/slint-ui/slint/issues/7505

ChangeLog: C++: Added `SoftwareRenderer::render_by_line`.
2025-02-21 16:24:03 +01:00
Olivier Goffart
07803ccd6c
C++: support for RGB8 in the line by line rendering
Note: this adds a mendatory template parametter to the
(experimental) `render_by_line` function.
I tried to get the PixelType auto-detected from the callback but i
didn't manage
2025-02-19 09:11:10 +01:00
Yuri Astrakhan
4ae2627ade A few more format arg inlining
Used these commands and some manual searching

```
cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --all-targets -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2025-02-07 06:43:19 +01:00
Olivier Goffart
c98d234b9e Janitor: Always use `#![no_std] for runtime lib
And call `extern crate std` when the feature is enabled.
I've read this is the good practice on how to do it.
So that the std prelude is no longer included automatically.
There is then less difference between std and and no-std build which
should avoid surprises in the CI when we use things from the prelude.

The downside is that there is a bit of churn in the tests
2025-01-27 19:22:00 +01:00
Olivier Goffart
42d7661ec6 C++: make the PhysicalRegion::rectangles non-overlapping 2024-07-10 10:58:27 +02:00
Simon Hausmann
4c888bf1ae Port the Skia renderer to rwh06 and the new softbuffer
... by accepting an Rc<dyn Has*Handle> in the interface. This is required for softbuffer use.
2024-06-18 17:48:17 +02:00
Olivier Goffart
2a5f093efc Janitor: C++: Fix warning about unused import 2024-06-13 17:34:57 +02:00
Simon Hausmann
88e1a366a3 Make rendering rotation a public feature of the software renderer
Fixes #5372
2024-06-10 05:24:48 -07:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Olivier Goffart
5955d19706 Expose the individual rectangle in the dirty region 2024-04-26 14:45:23 +02:00
Aurindam Jana
0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00
Olivier Goffart
36669e8df7 esp-idf: redirect debug_log! to esp-println 2024-04-05 15:24:52 +02:00
Olivier Goffart
80b59653a2 Janitor: Fix warnings with no_std and nightly rust 2024-04-04 14:03:36 +02:00
Olivier Goffart
31219223e5 C++: Gate the line by line rendering behind experimental flag 2024-04-04 10:23:00 +02:00
Simon Hausmann
042bde7883 esp-idf: Add support for line-by-line rendering
Rendering by line into a line buffer that's in IRAM can be faster than accessing framebuffers in slower PSRAM, so offer this by allowing users
to omit even the initial framebuffer.
2024-04-04 10:23:00 +02:00
Ralph Minderhoud
9cb1a4a4e0
Add API for minimize/maximize on Window component (#4581)
Closes #4400
2024-02-22 10:40:36 +01:00
Olivier Goffart
7b2ff89f1c Fix nightly warnings
eg:
```
warning: the item `Box` is imported redundantly
```
2024-02-21 10:52:04 +01:00
Simon Hausmann
438b9afeaa
Reduce WindowAdapter API slightly (#4304)
Move the set_fullscreen function added to the WindowAdapter trait in 779aff0b39
to be a function in WindowProperties instead.
That way it'll be easier in the future to extend this with other window states without
having to modify or break the WindowAdapter trait API.
2024-01-09 18:55:06 +01:00
Simon Hausmann
f5bf6e5dc0 Skia: Clean up pre present notify callback API
Move this back out of render() again and make it stateful in the renderer. Reduces the amount of book-keeping required and it's always the same callback anyway.
2024-01-04 10:35:09 +01:00
Simon Hausmann
3069e8e503 Add support for frame throttling on Wayland
Use winit's pre_present_notify() API to allow for the compositor to throttle rendering.

Fixes #4200
cc #1695
2024-01-04 09:21:53 +01:00
Simon Hausmann
95044c3a09
Rename WindowRotation to RenderingRotation in the software renderer (#4181)
Same term as we're going to use in the linuxkms backend.
2023-12-19 08:47:55 +01:00
Tobias Hunger
b12575a4c4 janitor: Go over our spell checking setup
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling
2023-10-16 09:01:51 +02:00
Olivier Goffart
b88a3caacd swrenderer: Put the rotation feature behind a freature gate
We're not ready to make the API public as we want to have the API as
part of the Window rather than part of the renderer
2023-10-09 18:07:23 +02:00
Olivier Goffart
414a9e85e7 Expose swrenderer screen rotation to C++ and esp-idf 2023-10-09 18:07:23 +02:00
Simon Hausmann
d160eb7a31
Add support for set_position(), position(), and set_physical_size() to the C++ WindowAdapter (#3367)
Closes #3349
2023-08-28 18:43:04 +02:00
Simon Hausmann
42721c1853 Fix no_std build 2023-08-28 15:20:17 +02:00
Olivier Goffart
ded66231d1 C++: polish the clipboard patch
- make sure the Platform::Clipboard type is properly documented
 - Use the actual enum in the interface (even though it is
   #[non_exhaustive] so we need to slience a warning)

CC: #3265
2023-08-28 14:34:23 +02:00
Ian McFarlane
1de7b1512c
Expose clipboard_text accessors to C++ (#3265) 2023-08-28 12:26:40 +02:00
Olivier Goffart
d23ba885ca
C++: add WindowAdaptor::update_window_properties 2023-08-25 13:58:55 +02:00
Olivier Goffart
7904493e1c C++: dispatch close request and activation change 2023-08-24 17:27:04 +02:00
Olivier Goffart
fd7fc5ab9b C++, remove the experimental flag
The platform namespace is now always enabled.
2023-07-28 10:36:08 +02:00
Olivier Goffart
3a807e46c1
Renderer feature refactor 2023-07-27 19:11:24 +02:00
Olivier Goffart
49485dbf7d SoftwareRenderer: add API to construct and change the buffer type 2023-07-27 14:44:28 +02:00
Simon Hausmann
af97435463 Replace show()/hide() in the WindowAdapter with set_visible(bool)
This makes for a smaller interface.
2023-07-26 13:53:45 +02:00