Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize C++ line by line rendering in the software renderer #7505

Open
ogoffart opened this issue Jan 31, 2025 · 1 comment
Open

Stabilize C++ line by line rendering in the software renderer #7505

ogoffart opened this issue Jan 31, 2025 · 1 comment
Labels
a:language-c++ C++ API, codegen, CMake build system (mS,mO) a:renderer-software Software Renderer (mO,bF) api Changes or additions to APIs
Milestone

Comments

@ogoffart
Copy link
Member

The Line by Line rendering in C++ is gated by SLINT_FEATURE_EXPERIMENTAL
We should polish the API and make it available.
(Including in esp-idf)

@ogoffart ogoffart added a:language-c++ C++ API, codegen, CMake build system (mS,mO) a:renderer-software Software Renderer (mO,bF) api Changes or additions to APIs labels Jan 31, 2025
@ogoffart ogoffart added this to the 1.10 milestone Jan 31, 2025
@ogoffart
Copy link
Member Author

The API we are talking about is

# ifdef SLINT_FEATURE_EXPERIMENTAL
/// Render the window scene, line by line. The provided Callback will be invoked for each line
/// that needs to rendered.
///
/// The renderer uses a cache internally and will only render the part of the window
/// which are dirty.
///
/// This function returns the physical region that was rendered considering the rotation.
///
/// The callback must be an invocable with the signature (size_t line, size_t begin, size_t end,
/// auto render_fn). It is invoked with the line number as first parameter, and the start x and
/// end x coordinates of the line as second and third parameter. The implementation must provide
/// a line buffer (as std::span) and invoke the provided fourth parameter (render_fn) with it,
/// to fill it with pixels. After the line buffer is filled with pixels, your implementation is
/// free to flush that line to the screen for display.
template<typename Callback>
requires requires(Callback callback) {
callback(size_t(0), size_t(0), size_t(0), [&callback](std::span<Rgb565Pixel>) {});
}
PhysicalRegion render_by_line(Callback process_line_callback) const
{

And in esp-idf

* * Line-by-line rendering: Set neither `buffer1` nor `buffer2` to instruct Slint to allocate
* a buffer (with MALLOC_CAP_INTERNAL) big enough to hold one line,
* render into it, and send it to the display. This is an experimental
* feature that requires enabling the `SLINT_FEATURE_EXPERIMENTAL` CMake
* option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:language-c++ C++ API, codegen, CMake build system (mS,mO) a:renderer-software Software Renderer (mO,bF) api Changes or additions to APIs
Projects
None yet
Development

No branches or pull requests

1 participant