Commit graph

27 commits

Author SHA1 Message Date
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
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
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
Olivier Goffart
1b91158b46 corelib: allow to use i32 for coordinate instead of f32 2022-04-11 17:46:50 +02:00
Simon Hausmann
afb59cba29 mcu: fix popups not visibly closing
When closing a popup, notify the platform window, so that the mcu
backend can remember that region and start the dirty region with it.

Also, free all the rendering cache items of deleted items, to avoid accidental re-use
when re-opening a popup.
2022-04-08 19:32:33 +02:00
Simon Hausmann
db54da2064 mcu: Don't panic when opening popups
Implement popups as inline components. The dirty region handling however
is still missing when closing a popup.
2022-04-08 16:46:12 +02:00
Lukas Jung
b6171530ab replace text_input_position_for_byte_offset with text_input_cursor_rect_for_byte_offset 2022-03-28 10:07:07 +02:00
Olivier Goffart
608211b0d6 MCU: Allow to use RGB565 for the draw buffer 2022-03-14 15:52:09 +01:00
Olivier Goffart
5eecdb1ae7 MCU simulator: don't return from the event loop 2022-03-09 20:49:46 +01:00
Simon Hausmann
e48e39bf61 Fix support for partial renderiung in the simulator
Keep a framebuffer around and re-create it if the size changes. Also
re-create the partial rendering cache then.
2022-03-07 21:14:50 +01:00
Simon Hausmann
7b721e15f7 Remove debug pixels from the simulator output 2022-03-07 21:14:50 +01:00
Olivier Goffart
b2caa757e7 Partial renderer: Initial work 2022-03-03 14:58:48 +01:00
Simon Hausmann
f1dae75d53 Fix interpreter ffi build
Commit 738ac0dc01 increased the size of the ImageInner::StaticTextures variant,
which breaks the size assertions in the interpreter ffi build.

This changes fixes that by reducing the size of the ImageInner variant again by
moving all the fields into a separate struct.
2022-03-03 14:04:45 +01:00
Simon Hausmann
738ac0dc01 mcu: scale images at compile time (#966)
Apply a scale factor to reduce the size of embedded images at compile
time.
2022-03-03 13:28:47 +01:00
Simon Hausmann
f912ec7e6b Fix scaling of glyphs and improve type safety in the MCU backend
The code was mixing logical and physical sizes, causing glyphs being
doubly scaled down. Instead, this patch introduces:

 * Physical* and Logical* euclid length/size/rect aliases
 * some extraction traits for getting the scalars in rects/sizes as lengths (until euclid has them
built-in)
 * wrapper traits/types for safely extracting the physical font metrics the
 compiler generates (i16)
 * Fix a bug in the text height calculation where we failed to take the
   descent into account
2022-02-17 15:07:57 +01:00
Simon Hausmann
3af7b6f323 Fix simulator build 2022-02-17 15:04:18 +01:00
Simon Hausmann
4424b0ecb5 Start stubbing out primitive glyph rendering in the mcu backend
This is still relatively heavy in terms of memory consumption, we
generate a scene item per glyph.
2022-02-15 15:52:24 +01:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Tobias Hunger
de4e195280
Rename internal crates and add a README.md to them
The README.md contains the warning that used to be in lib.rs.

Add README.md files to all internal crates

... pointing to the official public crate to use instead.

Rename internal crates

fixup: README files

fixup rename
2022-02-07 13:12:48 +01:00
Simon Hausmann
125b90a64b Merge remote-tracking branch 'origin/master' into wip/rename
Conflicts:
	api/cpp/cbindgen.rs
	api/cpp/include/slint.h
	examples/CMakeLists.txt
	examples/imagefilter/Cargo.toml
	examples/plotter/main.rs
	internal/backends/mcu/lib.rs
2022-02-04 16:47:20 +01:00
Simon Hausmann
8959eac3d0 Add rendering callbacks to sixtyfps::Window
This API allows specifying a callback that will be invoked when setting
up graphics (great for compiling shaders), before rendering a frame (but
after the clearning of the surface background), after rendering a frame
(before swapbuffers) and when releasing graphics resources.
2022-02-04 15:41:53 +01:00
Tobias Hunger
1a0a495bc5
Rename environment variables 2022-02-02 13:35:07 +01:00
Simon Hausmann
ad0c020aa4 Rename the sixtyfps-corelib crate 2022-02-01 18:04:30 +01:00
Simon Hausmann
e5bf6e01df janitor: Fix MCU backend build
Follow-up to commit f31f4201c6
2022-02-01 16:30:24 +01:00
Tobias Hunger
a3b86690ff [reorg]: Move the rendering backends into internal 2022-01-31 16:00:50 +01:00
Renamed from sixtyfps_runtime/rendering_backends/mcu/simulator.rs (Browse further)