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>
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
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"
Only the hand-picked sensible things, not all of it ;-)
Also fix a few typos that cspell complained about when I
tried to commit and some formatting changes that cargo fmt
insisted on when commiting.
It would incoditionally try to load the FONTDB that can't load any font
from the system using libloading
Instead, hardcode the path to the font to a known android font
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
Commit c8f1f4354b accidentally inverted
the target size computation logic when porting away from FitTo, scaling
to the tree width instead of scaling the tree width to the image element
width but preserving aspect ratio.
Fixes rendering of AboutSlint in gallery.
For .slint files that are included, we canonicalize the path before
adding it into the import stack, to avoid duplicates. We didn't do that
for images in the global_embedded_resources.
Ensure this by canonicalizing as early as possible.
Fixes#2608
- On the web, to return the image size, we need to use the natural size
of the image, and not its dom size, as the later get modified since
commit b727aba4a0
- The target size did not take in account the image fit, that's because
former version of resvg could only render by respecting the aspect
ratio. But since the web don't have this limitation, we now need to
take it into account. And new version of resvg can also scale with
any aspect ratio
SVGs are rendered using HTML image elements, that are converted to textures.
The size of the texture defaults to the SVGs viewbox, which may be small - despite
it being possible to render the SVG at a higher resolution with great quality.
Similar to the native code path, this patch also uses the target image size
and propagates it to the DOM HTML image element to instruct the browser to
render the SVG at a higher resolution.
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
This avoids accidental use of logical pixels, esp. for SVG, elimiates
one call to `to_untyped()` as well as an untyped scale factor in the
femtovg renderer.
Because re-generating the Skia image is slow and there is no point
storing both the image buffer and the SkiaImage in the cache as it
is basically the same information.
For embedded images the path is empty but we unconditionally used it to create a TextureCacheKey,
which clashes.
Instead, preserve and store the ImageCacheKey in the ImageInner variants.
This includes the cache of decoded images, the HTMLImage element support
and the SVG rendering adapter.
The objective is that Image holds an ImageInner, which is not a path
anymore that the backend has to process, but instead always either
decoded image data, a pointer to a static texture or an SVG tree that
can be rendered to the desired size.