Commit graph

12 commits

Author SHA1 Message Date
Simon Hausmann
bdae506fd6 Fixed Fixed multiplication to work with u16 2025-03-31 14:46:21 +02:00
Simon Hausmann
0841c71776 Implement Fixed multiplication via intermediate i64 2025-03-31 14:46:21 +02:00
Olivier Goffart
84261ee01c Avoid overflow in Fixed::mul 2025-03-31 14:46:21 +02:00
Simon Hausmann
54b188b0d7 Fix texture src offset precisions for TargetPIxelBuffer::Draw_texture
Implement Mul<Fixed> for Fixed instead of truncation.
2025-03-31 14:46:21 +02:00
Olivier Goffart
754a6bfdef swrenderer: make sure small functions in fixed point are inlined
`cargo bench -p printerdemo_mcu`

Before
```
bench                fastest       │ slowest       │ median        │ mean          │ samples │ iters
├─ full                            │               │               │               │         │
│  ├─ Rgb565Pixel    2.919 ms      │ 8.155 ms      │ 4.279 ms      │ 4.326 ms      │ 100     │ 100
│  ╰─ Rgb<u8>        6.139 ms      │ 10.49 ms      │ 7.729 ms      │ 7.826 ms      │ 100     │ 100
╰─ render_only                     │               │               │               │         │
   ├─ Rgb565Pixel                  │               │               │               │         │
   │  ├─ FullBuffer  1.439 ms      │ 4.138 ms      │ 1.597 ms      │ 1.635 ms      │ 100     │ 100
   │  ╰─ LineByLine  1.576 ms      │ 1.765 ms      │ 1.636 ms      │ 1.642 ms      │ 100     │ 100
   ╰─ Rgb<u8>                      │               │               │               │         │
      ├─ FullBuffer  2.016 ms      │ 2.872 ms      │ 2.111 ms      │ 2.128 ms      │ 100     │ 100
      ╰─ LineByLine  2.122 ms      │ 2.995 ms      │ 2.21 ms       │ 2.245 ms      │ 100     │ 100
```

After
```
bench                fastest       │ slowest       │ median        │ mean          │ samples │ iters
├─ full                            │               │               │               │         │
│  ├─ Rgb565Pixel    2.187 ms      │ 4.913 ms      │ 3.48 ms       │ 3.505 ms      │ 100     │ 100
│  ╰─ Rgb<u8>        5.489 ms      │ 8.193 ms      │ 6.713 ms      │ 6.723 ms      │ 100     │ 100
╰─ render_only                     │               │               │               │         │
   ├─ Rgb565Pixel                  │               │               │               │         │
   │  ├─ FullBuffer  1.105 ms      │ 1.932 ms      │ 1.225 ms      │ 1.278 ms      │ 100     │ 100
   │  ╰─ LineByLine  1.188 ms      │ 2.052 ms      │ 1.289 ms      │ 1.352 ms      │ 100     │ 100
   ╰─ Rgb<u8>                      │               │               │               │         │
      ├─ FullBuffer  1.505 ms      │ 2.643 ms      │ 1.599 ms      │ 1.669 ms      │ 100     │ 100
      ╰─ LineByLine  1.539 ms      │ 2.058 ms      │ 1.641 ms      │ 1.652 ms      │ 100     │ 100
```
2025-03-06 12:24:54 +01:00
Olivier Goffart
4e7bbcf2ba
Try to improve rendering (positioning) of signed field distance font. (#6868)
* WIP: swrenderer: use fixed point for the pixmap font coordinate

* swrenderer: signed distance field: move the glyph to the middle

* swrenderer: round the advance instead of truncating it in distance field

* swrenderer: actually align the gplyph on the sub-pixel precision

sub-pixel within the source.

* swrenderer: adapt the threshold for signed distance field

sqrt(2) is the distance to the diagonal, seems like this gives sharper fonts

* Fix bug in the elision, and re-upload the screenshort

the screenshot changed because the afvanced is now rounded intead of
truncated
2024-11-30 23:03:31 +01:00
Olivier Goffart
d8ab4e4600 Signed DistanceField font rendering in swrenderer
Note that this is still disabled in the compiler with no way to enable
it with public API
2024-10-23 09:12:30 +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
5e7ddf3a19 Image Tiling
(Doesn't work yet with 9slice)
2024-02-26 12:16:41 +01:00
Olivier Goffart
424f046416 swrenderer: refactor image drawing algorithm
For tiling, we will need to know the actual source size in addition to
the scaling factor that can be different. So store the scaling factors
in the scene command, as well as an offset where to start.

This is more accurate in case of clipping and rotation.
For rotation that doesn't matter (appart from the fact that the testing
can now be more strict)
But for clipping this prevent glitches with partial rendering where it
would seem like the image are moving a bit by a pixel when it is redrawn
with a different clip
2024-02-15 18:25:47 +01:00