Commit graph

26 commits

Author SHA1 Message Date
Simon Hausmann
3101104f5c Switch from WGPU 24 to WGPU 25
- Use a version of FemtoVG that uses WGPU 25
- Rename the unstable-wgpu-24 feature and wgpu_24 module
- Fetch bevy from a revision on master branch that switches to WGPU 25
- Move the bevy example out of the common workspace: That way users of the repo don't get bevy pulled from git, unless they want to build the bevy example.
2025-07-09 11:30:05 +02:00
Simon Hausmann
94b257bdd4 Skia: Delegate texture import to the surface trait
This makes it easier to keep cfg'ed code in the cfg' surfaces than cfg'ing in cached_image.rs :)
2025-05-05 15:34:52 +02:00
Simon Hausmann
da5e7d5b22 WGPU: Add support for using WGPU textures in Slint
This adds a `unstable-wgpu-24` feature that exposes WGPU types in the
GraphicsAPI enum, adds `require_wgpu_24()` to the backend selector,
and adds a conversion from `wgpu::Texture` to `slint::Image`.

The `require_wgpu_24()` function in the selector will be extended in the
future (before the next release) to permit specifying additional aspects
of the WGPU configuration.

Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2025-04-29 17:46:57 +02: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
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
06174c16d3 Femtovg&Skia: fix drawing of tiled svg image
We will render them with the final size in the buffer, so account for
that difference when rendering
2024-02-27 19:08:16 +01:00
Olivier Goffart
5e7ddf3a19 Image Tiling
(Doesn't work yet with 9slice)
2024-02-26 12:16:41 +01:00
Olivier Goffart
97067c3d65 Add 9slice information at runtime 2024-02-13 14:46:27 +01:00
Olivier Goffart
ce6c7f5527 Image: add horizontal and vertical alignment 2024-02-08 18:59:26 +01:00
Olivier Goffart
cb92ba1132 Add ImageFit.preserve and de-duplicate the fitting code 2024-02-08 10:10:56 +01:00
Olivier Goffart
b23c605ac1
Refactoring: Use a trait for Item being Images 2024-02-07 13:28:47 +01:00
Olivier Goffart
1864257f29 Silence error when rendering SVG in an 0x0 size
Make the size argument to svg::render optional to mean that it is the
default size of the image.
Otherwise, passing None as the size to ImageInner::render_to_buffer
would not render the image which is possible in some backend (eg: the
button image icon with the qt backend)

And if the image is really rendered on an empty because of layouting or
so, we don't need to show a warning anyway.

Fix #3790
2023-11-02 11:09:20 +01:00
Simon Hausmann
bdd275811e Bump skia-safe version
This updates to m118. See
https://github.com/rust-skia/rust-skia/releases/tag/0.67.0 for more
details.
2023-10-26 10:45:36 +02:00
Simon Hausmann
e73ad733fc API fixes to the OpenGL texture borrowing API
- Make BorrowedOpenGLTextureOrigin non_exhaustive
- Mark BorrowedOpenGLTextureBuilder::new_gl_2d_rgba_texture as unsafe instead of build(). The former takes the arguments that may be garbage, not the latter.
2023-08-30 16:18:42 +02:00
Simon Hausmann
91d0747d06 Make use of the ItemCache more robust when the window scale factor changes
Previously, all the closures passed to `get_or_update_cache_entry` would
have to make sure that the scale factor is an included dependency. This
is error prone, as the parent commits show.

Instead, this change adds a property tracker to each ItemCache and lets
the renderer clear the cache if the scale factor changes.

Strictly speaking this may delete too many entries from the cache (not
all depend on the scale factor), but on the other hand this doesn't
happen very often so we trade robustness over efficiency.
2023-08-16 16:37:07 +02:00
Simon Hausmann
5f48dca2c0 Skia: Fix re-rendering quality of SVGs when the scale factor changes
Make sure that the scale factor to compute the target size for an SVG is
a property dependency.
2023-08-15 15:46:09 +02:00
Simon Hausmann
0c9199b17f
Add support for flipping borrowed OpenGL textures vertically (#3205)
Closes #2986

Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
2023-08-02 13:11:13 +02:00
Simon Hausmann
84ddfc6c2f Add support for rendering the mouse cursor with linuxkms
The cursor is loaded by the window adapter from the cache. When it's
loaded the first time, its format will be Svg, so we convert it to a
pixel buffer. That way the skia backend can convert it on first draw
into a skia_safe::Image and replace the cache entry with the backend
storage variant.
2023-07-31 13:06:28 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Simon Hausmann
6bdddd94f8 janitor: Update to skia-safe 0.63 2023-06-07 13:58:20 +02:00
Simon Hausmann
eadfec64a3 Add support for importing OpenGL textures into Slint
This is the initial API for Slint to borrow OpenGL textures from the
application for rendering.
2023-06-01 15:56:55 +02:00
Simon Hausmann
8c807cb1da
Remove slint::Image::stride() (#2147)
cc #2138
2023-01-30 13:59:31 +01:00
Simon Hausmann
01d2efce4e Move the Skia renderer into a separate crate
The crate is an internal crate until the API has been polished and
documented, after which we can call slint-renderer-skia for example.

This also duplicates a little bit of the glutin setup code, because
that would otherwise have to go into another shared crate.
2022-12-09 17:04:54 +01:00
Renamed from internal/backends/winit/renderer/skia/cached_image.rs (Browse further)