You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Impeller] Expose a single-header C API to Impellers Display-List layer. (flutter#55238)
This (`impeller.h`) is a versioned, single-header, dependency-free, C API that exposes Display-Lists in almost their entirety.
The anticipated users of this API do not expect ABI or API stability guarantees at this time but those can be added between specific versions as the API matures.
Testing this API can be done via a playgrounds harness. One has been setup with rudimentary tests that will be filled out.
A simple C example (`example.c`) using GLFW with OpenGL ES has been setup. Only OpenGL ES has been exposed at this time but additional backend will be added.
This API is meant to be easy to bind to using automated tools for access in different languages and runtimes. Consequently, the API follows a strict convention for object naming, creating, and reference-counting.
* All typedefs and method names have the �Impeller� prefix.
* Most objects are reference counted. Methods ending with �New� return a new instance of the object with reference count of 1.
* Each object has a �Retain� and �Release� method to modify reference counts.
For instance, with Rust `bindgen`, the following invocation generates usable bindings:
```sh
bindgen impeller.h -o impeller.rs
--no-layout-tests
--rustified-enum �Impeller.*�
--allowlist-item �Impeller.*�
```
It is expected that wrapped over these generated bindings will be written to make the usage more idiomatic. The C API itself is fairly verbose as well.
<img width="1107" alt="Screenshot 2024-09-12 at 2 55 14�PM" src="https://github.com/user-attachments/assets/e1532dba-487e-4af1-9442-1005a8f52d8d">
0 commit comments