Commit graph

19 commits

Author SHA1 Message Date
Olivier Goffart
b6636b2e94 swrender: Implement window rotation by 180° and 270°
(The tests are still failling)
2023-10-09 18:07:23 +02:00
Olivier Goffart
ec36d46740 WIP: experiment with screen rotation
TODO:
 - Polish the API
 - Most screenshot test are failling because the rotation don't draw the
   rounded rectangle exactly the same (that's because the border
   rectangle algo is not perfect), and also scaled image are not pixel
   perfect

The updated screenshot is because of a small change in the image
rendering algorithm that changes the rounding slightly.
2023-10-09 18:07:23 +02:00
Olivier Goffart
46ec7875ed Software renderer: partial rendering with winit and fix non-opaque background
Implement the partial rendering with winit and our software renderer.

When the background is not opaque, we must still initialize all the
pixel with 0 otherwise we blend over the previous frame.
(That wasn't visible before because the buffer was always empty)
2023-09-13 16:08:57 +02:00
Simon Hausmann
cd0056ca92 Make it easier to use the software renderer with PremultipliedRgbaColor and Rgb565 in "foreign" environments
Implement rgb::Pod/rgb::Zeroable for PremultipliedRgbaColor and Rgb565
Pixel. This allows for bytemuck::cast_slice(), making it easier to copy
software renderer output into another buffer that's the same format but
Vec<u8> for example.
2023-08-07 11:46:43 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Tobias Hunger
e02c360000 Clippy polish 2023-06-28 14:22:30 +02:00
Olivier Goffart
da83857a60 Remove embedded_graphics dependency from i-slint-core
This feature was never used.
2023-06-22 14:12:01 +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
Olivier Goffart
98747cd385 Winit software renderer: Fix transparent background
Despite the documentation of softbuffer claiming that the high bits
should be 0, it seems to be interpreted as an alpha value when the
window is actually transparent.
And the values are considered as premultiplied alpha

Also use a Premultiplied aplha for the buffer so we can even have
transparent window with the software renderer
2023-05-03 19:29:51 +02:00
Tobias Hunger
3ac01c3f07 clippy: Fix clippy warnings 2023-03-09 09:35:29 +01:00
Olivier Goffart
995d960a2a Comile with Rust < 1.66
wrapping_add_signed was added in Rust 1.66
2023-02-02 15:54:07 +01:00
Olivier Goffart
a4eb1ab287 swrenderer support for linear gradient
Only simple rectangle (no borders or radius)
2023-02-02 15:54:07 +01:00
Olivier Goffart
b620986e35 Fix 16bit blending
The comments were a bit off, and we were loosing one bit in the blue LSB

Reported in https://github.com/slint-ui/slint/pull/1576#pullrequestreview-1232577955
2023-01-05 12:08:21 +01:00
Olivier Goffart
830e33876f swrenderer: Fix drawing of images
There was some confusin on the meaning of the alpha and colorize and how
it is computed for AlphaMap images
2022-11-30 16:49:23 +01:00
Florian Blasius
00bd4909e1
SoftwareRenderer: render texture with opacity and color alpha channel (#1877)
* swr: add alpha field to texture
2022-11-21 15:26:35 +01:00
Simon Hausmann
d698af5326 Move physical length definitions into the software renderer
Their choice of i16 is specific to the software renderer. In say the Skia renderer
the physical coordinate space would still use Skia's Scalar (floating points).
2022-09-30 09:03:02 +02:00
Olivier Goffart
36845dcbab
Support drawing embedded textures with the non-software renderers 2022-09-07 18:44:14 +02:00
Tobias Hunger
639dcaf702 api: Rename module swrenderer to software_renderer
Also rename the `swrenderer` feature to `software-renderer`.
2022-09-07 10:11:11 +02:00
Renamed from internal/core/swrenderer/draw_functions.rs (Browse further)