Olivier Goffart
4446a17b24
Skia renderer: reset the surface when the app is resumed on android
...
Part of #3430
2023-09-21 17:23:08 +02:00
Simon Hausmann
fd123b27bd
Default to vsync for OpenGL rendering
...
Fixes #3516
2023-09-20 12:00:04 +02:00
J-P Nurmi
78cb4c07f4
Add clarifying comment and make the code easier to read
2023-09-19 09:28:49 +02:00
J-P Nurmi
f7900f1614
FemtoVG: fix vertical alignment of elided text
2023-09-19 09:28:49 +02:00
J-P Nurmi
ddf1038ea7
Skia: fix eliding of multiline text
2023-09-19 08:50:01 +02:00
J-P Nurmi
792e639e18
FemtoVG: fix eliding empty lines
2023-09-18 10:16:25 +02:00
Simon Hausmann
84f120bcd1
Don't panic when the windowing system tries to assign a zero size to a GL surface
...
Apply https://github.com/slint-ui/slint/pull/3179 also to the Skia OpenGL surface.
A zero size is permitted with Metal for example, but
we panic'ed.
Fixes #3472
2023-09-14 17:38:28 +02:00
Guilhem Vallat
5cf1a45e41
Remove duplicated geometry properties from items
2023-09-13 16:08:37 +02:00
Olivier Goffart
06fc251729
Remove the geometry on ItemVTable
2023-09-13 16:08:37 +02:00
Simon Hausmann
5cdb279c1f
Remove workaround for issue with trailing slash in VCINSTALLDIR when building Skia on Windows
2023-09-13 11:44:49 +02:00
Simon Hausmann
779e216b2a
Update to skia-safe 0.66.1 (skia 116/117)
...
This new version compiles with LLVM 16 that's now in the GH action
runner windows images.
cc #3365
2023-09-13 10:11:39 +02:00
tronical
b8b9db4e42
Bump version number to 1.3.0
2023-09-05 15:46:36 +02:00
Olivier Goffart
95b6eda10b
Make sure PLatformError is Send+Sync as it is needed for anyhow
2023-08-31 20:52:10 +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
Olivier Goffart
1721b2d1be
Hide impl RendererSealed for SkiaRenderer
...
This is implementation details but it'd show in the docs
2023-08-30 12:45:09 +02:00
Simon Hausmann
efb619b08a
Revert "Make the SkiaRenderer public in the Rust API"
...
This reverts commit 9d27f0cc96 .
This was not intended for the master branch. Ooops.
2023-08-29 08:55:26 +02:00
Simon Hausmann
9d27f0cc96
Make the SkiaRenderer public in the Rust API
...
It's also public in the C++ API and this is the equivalent change on the Rust API side.
2023-08-29 08:54:11 +02:00
Simon Hausmann
65f9e6f1eb
Move the OpenGLInterface back to the FemtoVG renderer
...
At the moment it's only needed there, so let's
have it there and move it to core later if the need arises.
2023-08-28 13:33:15 +02:00
Simon Hausmann
a2d72f75bb
Minor build fix for Android
...
We always enable the x11 feature when selecting `backend-winit`
2023-08-23 09:18:53 +02:00
Simon Hausmann
6dd60113f1
Add some information about the display handle when glutin::display::Display::new() fails
...
The error from glutin is just a string.
cc #3312
2023-08-21 17:16:55 +02:00
Simon Hausmann
96d7bb132c
reuse: remove glob for markdown files
...
Instead, place the copyright and license right into the source.
To satisfy reuse, this also removes the unnecessary MIT.txt
symlinks.
2023-08-17 08:55:28 +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
bd08cb47b5
Skia: Fix paths not being re-rendered when the scale factor changes
...
Include the scale factor in the property dependency chain.
2023-08-16 16:37:07 +02:00
Simon Hausmann
562a5e42df
Fix cached femtovg layers not being re-rendered when the scale factor changes
...
Include the scale factor in the property dependency chain.
2023-08-16 16:37:07 +02:00
Simon Hausmann
4881bd1a87
Fix box-shadow cache not being invalidate when the scale factor changes
...
Include the scale factor in the dependency tracker of the item cache used for box shadows.
2023-08-16 16:37:07 +02:00
Tobias Hunger
09d3eaf00a
Update license symlinks
...
run `cargo xtask check_reuse_compliance --fix-symlinks`
2023-08-16 11:46:15 +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
868173cc20
Disambiguate the type name SkiaRenderer
...
- Use WinitSkiaRenderer for the adapter in the winit backend (similar to WinitSoftwareRenderer)
- Use SkiaItemRenderer for the impl of the ItemRenderer trait
2023-07-31 17:11:43 +02:00
Simon Hausmann
b503733d03
Update to a new release of the Rust Skia bindings
2023-07-31 16:18:42 +02:00
Simon Hausmann
6b044ae078
Rename extension trait to use Ext as suffix
2023-07-31 13:06:28 +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
Simon Hausmann
5c9eed62f1
Add a new backend that supports rendering fullscreen with Vulkan
...
This doesn't require a windowing system, just Linux and Vulkan drivers
that supports the display extensions.
It's called linuxkms as soon this will go beyond Vulkan and also support
EGL and perhaps dumb buffers for software rendering.
2023-07-28 13:40:37 +02:00
Simon Hausmann
de75892841
Vulkan: Add API to create the Skia rendering surface from vulkano surfaces
2023-07-28 13:40:37 +02:00
Simon Hausmann
9d73a05c35
Add a constructor that accepts a surface impl
2023-07-28 13:40:37 +02:00
Simon Hausmann
a71e73b549
Make the surfaces part of the Skia renderer API
2023-07-28 13:40:37 +02:00
Simon Hausmann
49fe2b1bb4
Skia: Make the surface type a dyn
...
This will allow falling back to different surfaces/renderers.
2023-07-28 13:40:37 +02:00
Simon Hausmann
bd6cec0f10
Some doc fixes for FemtoVG
2023-07-27 16:48:57 +02:00
Simon Hausmann
f60b2ebde9
Add slint::platform::OpenGLInterface
...
This allows for the use of the FemtoVG renderer but delegate the GL implementation to the user.
2023-07-27 16:48:57 +02:00
Simon Hausmann
3b29bfe2f6
Change OpenGLContextWrapper to return a generic Error
...
This is in preparation for making the trait public.
2023-07-27 16:48:57 +02:00
Simon Hausmann
4e7ebdceba
Improve zero-size OpenGL surface handling
...
- Use NonZeroU32 in the OpenGLContextWrapper interface (correct API for the future)
- Don't render zero sized windows with the software renderer and FemtoVG
2023-07-27 16:48:57 +02:00
Simon Hausmann
f15bc6147e
Simplify FemtoVG and Skia renderer APIs: remove resize()
...
We can convey the new physical window size from the run-time
through the private renderer API
when a window resize event is dispatched.
2023-07-25 19:33:26 +02:00
Simon Hausmann
5a9f8a4c90
Clear caches in the renderers when "changing" the window adapter
...
This helps to keep the allocation peak low.
2023-07-25 17:28:08 +02:00
Simon Hausmann
7d136b6568
Remove the window parameter from the render() function of all the renderers
...
This makes for a slimmer API and instead we can create the renderer <-> window association
behind the scenes ourselves,
in set_component.
2023-07-25 17:28:08 +02:00
Simon Hausmann
507428b03e
Simplify FemtoVG and Skia renderer API ( #3153 )
...
Fold show() into the first time render() is invoked,
and hide() into the Drop implementation.
2023-07-25 17:17:40 +02:00
ogoffart
aebaa7d6c9
Bump version number to 1.2.0
2023-07-25 10:44:53 +00:00
Simon Hausmann
3565023a15
Improve error handling in C++ Skia Renderer API
...
- Don't try to create a GLX context when we only have an XCB window handle,
XLib is required for that.
- Make it possible to create a NativeWindowHandle from Xlib data types.
Fixes #2978
2023-07-14 15:33:03 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 ( #2994 )
2023-07-10 10:12:11 +02:00
Simon Hausmann
1d5dcec2e4
Print a warning to stderr in the event of unclean Skia GL renderer
...
destruction
Amends 488f34dcd7 as advised by Olivier.
2023-06-30 09:54:43 +02:00
Simon Hausmann
cb6ba2f028
Improve robustness of SkiaRenderer::hide() with OpenGL
...
Only attempt to make the GL context current if we have a rendering notifier callback.
The activation may still fail, and the API will still report it though.
2023-06-30 08:21:46 +02:00