Commit graph

162 commits

Author SHA1 Message Date
Lukas Jung
e4559f0ea6
Fix Bugs Introduced by GL Jitter on Resize Fix (#1397) 2022-07-15 10:03:03 +02:00
Simon Hausmann
937c37677e Add API for setting and getting the size of a Window in Rust and C++ 2022-07-08 18:37:01 +02:00
Simon Hausmann
3ce9977f0a Add slint::Window::(set_)position
Fixes #323
2022-07-08 18:37:01 +02:00
Olivier Goffart
ceb030a5f7 stm32h735g: be sure to wait until the the buffer is no longer shown before drawing onto it 2022-07-06 17:06:40 +02:00
Olivier Goffart
4ecc2cd1c0 swrenderer: add a renderer that operate dirrectly on the frame buffer 2022-07-06 17:06:40 +02:00
ogoffart
6b15d2e479 Bump version number to 0.2.6 2022-07-06 09:58:14 +00:00
Lukas Jung
4f5986167b
Add Tutorial to set up VSCode Debugging for RP Pico (#1390) 2022-07-05 17:24:39 +02:00
Tobias Hunger
dd59d41ee6 Rename init_*_items to register_component
I want to track component structure changes in the window without
generating more code. So use a more generic name for the init_*_items
functions, so that I can add the functionality I need in there.

Also add a register_component to PlatformWindow and call that.
2022-06-30 11:51:49 +02:00
Tobias Hunger
581533f302 Rename free_*_graphics_resources to unregister_component
I want a more generic name as I want to do to track component structure
changes in addition to resource freeing and I do not want to add another
call into the generated code.
2022-06-30 11:51:49 +02:00
Lukas Jung
63970dcced Implement size() and set_size() for SimulatorWindow 2022-06-30 10:59:33 +02:00
Olivier Goffart
50bd72c535 stm32h735h: copy assets from flash to ram so we can access them 2022-06-18 20:00:21 +02:00
Olivier Goffart
00583ade05 Add env variable to put data into a different section
This also makes sixtyfps::Slice Send and Sync
2022-06-18 20:00:21 +02:00
Olivier Goffart
e777cb0fea MCU simulator: fix partial rendering by not drawing the non-dirty rect
Fixes #1324
2022-06-17 10:34:11 +02:00
Olivier Goffart
b62132392d stm32h735g: Use a intermediate line vector in the RAM for rendring
It is much faster than blending on the frame buffer which is in hyperram
2022-06-17 09:30:09 +02:00
Olivier Goffart
711fa66ca3 rp2040 backend: use DMA to send pixels to the screen via SPI 2022-06-17 09:30:09 +02:00
Olivier Goffart
5494e4ec28 mcu pico: fix the screen artifacts by re-implementing display-interface-spi
The display-interface-spi crate the not flush the internal fifo between the write
and the changes of the CS and DC pins, which result of changing these pins before
the screen recieve all the data over the spi and causes artifacts on the screen.

So re-implement the logic in our crate and use `transfer` instead of `write`
which flushes the fifo correctly.
2022-06-16 21:36:15 +02:00
Olivier Goffart
87c10eea31 MCU pico: adjust the threshold for the key handling 2022-06-16 18:31:58 +02:00
Lukas Jung
45406ddef0
Make the Pico use Interrupts and WFE (#1337) 2022-06-15 17:15:58 +02:00
Simon Hausmann
1cac472f4e Enable panic-probe by default for stm32
The ft5336 crate enforced the panic-semihosting for no apparent reason,
but this is fixed upstream now.
2022-06-15 15:16:03 +02:00
Olivier Goffart
d5e598a5d6 Janitor: Update rp-pico 2022-06-15 13:44:07 +02:00
Simon Hausmann
0c97cb0fcc Enable the data cache for stm32h7
This requires us to flash the cache before swapping the frame buffer pointer.

With slide puzzle span drawing with image tiles goes from ~100ms down to ~50ms,
and theme switching between simple and berlin from ~140ms to ~72ms.

This is with the line renderer.
2022-06-15 13:15:19 +02:00
Simon Hausmann
b7b1101adb Bump system clock frequence on stm32h735
Up to 400 Mhz seems to work. Also fixed assert to match the octospi controller for the hyperram (1 instead of 2).
2022-06-14 19:08:42 +02:00
Simon Hausmann
2d2eb70b51 Fix panic about multiple mutable borrows with the software renderer
When using repeaters - like in the slide puzzle - and during renderer a component
gets deleted, we call free_graphics_resources and try to free
the dirty rectangle list in the partial renderer cache. At that point the cache is
already mutably borrowed, which causes a panic.

As remedy, apply the mutable borrow more fine grained and not right when calling
render().
2022-06-10 08:38:34 +02:00
Olivier Goffart
dc5d1e87cd Compile fix for the MCU simulator
The mcu simulator builds i-slint-core with the std feature, but debug_log maybe
used in #[no_std] contexts, so we need to use a re-export rather than rely on std
being present
2022-06-07 00:05:01 +02:00
Olivier Goffart
a72115518d Move the software renderer to core 2022-06-04 13:40:50 +02:00
Simon Hausmann
44f7bc1279 Fix rendering of source clipped images with the MCU renderer
The slide puzzle makes use of the source-clip-* properties and that unveiled three issues:

 * For the scale factor from image space to physical pixel space (sx/sy),
   use the source clip size, as we're only drawing those
   pixels. That means that the call sites of draw_image_impl need to pass the
  correct original image size if there is no source clip.
* Similarly, the scaled_clip is in image coordinates, but needs to be relative to the source-clip-x/y
* The geometry for the target rectangle on screen
  must originate at (0, 0) so that the apllication of
  sx/sy only changes the size.
2022-06-02 15:51:07 +02:00
Olivier Goffart
6cbf2c0609 Put the new cache in corelib and use it in the GL backend 2022-05-31 10:48:24 +02:00
Olivier Goffart
d2186593c0 Pass the ItemRc to each draw_function
So that it can be used as a key to the cache
2022-05-31 10:48:24 +02:00
Olivier Goffart
80830bbece MCU: Refactor the renderer in a LineRenderer
The LineRenderer is going to be a public type which can be used
by the MCU board support to draw.
Right now, it is used by the old code
2022-05-23 16:40:34 +02:00
Simon Hausmann
cf47d3919c Replace femtovg patch with new release 2022-05-23 09:32:25 +02:00
Simon Hausmann
08fb9a9336 Fix instructions on how to build the mcu printer demo for the simulator
With the simulator this still requires a regular main() entry point.
For some reason a feature test for i-slint-backend-mcu/simulator doesn't work,
but it works with the local feature.
2022-05-16 08:29:33 +02:00
Simon Hausmann
77445e9dc5 text handling: simplify text_size signature
We can calculate the line height in the common code, that doesn't need to be done in the backends.
2022-05-16 08:21:14 +02:00
Simon Hausmann
38abeaec41 text handling: clean up font traits
Separate the text shaping functionality from font metrics by having a
FontMetrics trait next to the TextShaper. AbstractFont is the combining
super trait. This allows eliminating the font height member from
TextParagraphLayout and improving the overall naming of fields and
types.

Finally, this prepares the API for composability of TextShaper for font
fallback handling.
2022-05-16 08:21:14 +02:00
Simon Hausmann
3ce142344a text handling: cleanup
Rename "byte_offset" in the Glyph structure to "text_byte_offset" to make
it clearer that this refers to the original text. Also added docs.
2022-05-16 08:21:14 +02:00
Simon Hausmann
93b5eda82e text handling: simplify glyph data structure handling
Replace the abstract glyph trait with a glyph struct. That way the text
layout code can operate properly on a struct with fields, instead of on
functions on a trait (some of which returning a mutable reference). The
input is a glyph with offset, advance, etc. - everything needed for the
layout and the output is a position along with the platform specific
glyph data.
2022-05-15 12:03:29 +02:00
Simon Hausmann
99ea6db9d4 text handling: simplify shaper <> glyph relation
Use the Glyph trait also for the byte offset handling, to avoid the use of
tuples.
2022-05-15 12:03:29 +02:00
Simon Hausmann
5f52f18df4 mcu text handling: Add support for letter spacing
This is implemented generically by adjusting the advances on the shape buffer, so that we can
use the same in the future in the GL backend.
2022-05-15 12:03:29 +02:00
Simon Hausmann
a7fb45365d text handling: remove unused advance getter on TextShaper
This is available via GlyphMetrics now.
2022-05-15 11:50:54 +02:00
Simon Hausmann
08e27fef4a text handling: move function from TextShaper to glyph trait
This will avoid the need to keep a reference to the TextShaper
around.
2022-05-15 11:50:14 +02:00
Simon Hausmann
b6e7db0221 Minor cleanup in the MCU text handling
Replace the use of Option for the associated glyph type with a
struct that can later implement a trait.
2022-05-15 11:50:00 +02:00
ogoffart
3709ded44d Bump version number to 0.2.5 2022-05-09 16:16:00 +00:00
ogoffart
c160ec2aef Bump version number to 0.2.4 2022-05-09 13:49:25 +00:00
ogoffart
6395cdfc09 Bump version number to 0.2.3 2022-05-04 12:32:58 +00:00
Olivier Goffart
1104ab73a0 Fix compilation with integer coordinate 2022-04-28 18:58:11 +02:00
Olivier Goffart
5a9c70307a MCU: properly round the image source rect
to avoid artifacts with different (frational) clipping
2022-04-28 17:45:47 +02:00
Olivier Goffart
ad1936d2d2 Remove new_scene_rectangle indirection 2022-04-27 09:23:10 +02:00
Olivier Goffart
fc65809b9d stm32h735: cleanup after review 2022-04-27 09:00:52 +02:00
Olivier Goffart
c658792c1e stm32h735g: cleanup 2022-04-27 09:00:52 +02:00
Olivier Goffart
846ae7cd43 stm32h735g: Instructions in readme 2022-04-27 09:00:52 +02:00
Olivier Goffart
5c507ab86c stm32h735g: Touch support 2022-04-27 09:00:52 +02:00