Commit graph

65 commits

Author SHA1 Message Date
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Simon Hausmann
fb1d37286f Clean up the Skia renderer API
Accept display and window handles with life time, instead of &dyn
HasRaw*Handle.
2023-06-07 12:20:57 +02:00
Simon Hausmann
7144b75adf Fix support for transparent windows on macOS when using OpenGL
CGL supports it as-is but with glutin this is only propagated onto the context
when it's set to true in the config template builder.
2023-04-27 17:11:41 +02:00
Simon Hausmann
278d650d7d Fix error messages when supplying invalid sizes to Skia and FemtoVG
Apply the same error message as for
https://github.com/slint-ui/slint/pull/2402#discussion_r1146657846
2023-03-27 12:47:31 +02:00
Simon Hausmann
8ffb5131c7
Introduce error handling in the FemtoVG and Skia renderers (#2402)
Avoid unwrap() and expect() and instead propagate errors all the way
down to run_event_loop(), show(), and hide() in the Slint AIP.
2023-03-24 14:18:11 +01:00
Simon Hausmann
ef07da4893 Add comment about resizing tweak on macOS 2023-03-23 15:36:42 +01:00
Simon Hausmann
c14ec0fb9c Update Skia
- This allows creating the Skia GL interface without string allocations
- Port the item renderer to use SkImageFilters::Shader instead of
  SkImageFilter::Paint
2023-03-21 09:36:39 +01:00
Simon Hausmann
59e0723793 Improved fix for panic when using OpenGL with the winit backend on Linux
Replace the patch with use of the glutin API as advised upstream (and
also implemented in glutin-winit).

Closes #2215
2023-02-09 16:16:36 +01:00
Simon Hausmann
476300ded7 Prospective fix for preview panicing on Linux v2
Avoid unwrap in the display/context selection try function.
2023-02-09 14:24:20 +01:00
Simon Hausmann
e8439061e8 Prospective fix for vscode extension preview not working on Linux
The CI build vsix panics on line 84 in glcontext.rs. There's no unwrap()
there but there's one nearby. I wasn't able to reproduce this with a
local build, so this is a prospective attempt, assuming that this is due
to the attempt of glx-over-egl display configuration finding.
2023-02-09 09:45:54 +01:00
Simon Hausmann
ed8ea3c85c Prospective fix for Linux systems that don't support EGL with X11
As the surface creation may fail with Egl later, then display preference
EglThenGlx is not sufficient and we need to completely re-do the glutin
initialization and try with GLX.

cc #2162
2023-02-03 17:12:59 +01:00
Simon Hausmann
52fb1ab9fe Fix signature of get_proc_address in Rust GraphicsAPI
Use a CStr instead of str, to avoid an extra CString allocation. The underlying operating system API for
this expects a zero terminated C String.

Fixes #1943
2023-01-26 11:55:10 +01:00
Simon Hausmann
d5ca021485 janitor: Update glow dependency 2023-01-24 09:35:18 +01:00
Simon Hausmann
a124f4b8fe Fix opengl underlay example not running with Skia OpenGL renderer
Commit 01d2efce4e ended up creating our
OpenGLSurface type with the GL context not current, and right after that
SkiaRenderer would invoke the RenderingSetup callback, which expects a
current context.

Solve this by simplifying the context handling in the OpenGLSurface in
the Skia renderer: The main purpose of glutin's NotCurrentContext
appears to be the ability to send it across threads, which we don't
need. Therefore always store a PossiblyCurrent and use the context's own
interior mutability to make it current if needed.
2022-12-21 11:53:59 +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