An idle app takes no loop turn: a session's pump blocks until there is news for it, wakes and GPU results reach only their own session, and a hosted app builds no frame while its window has no free shared image. Each window paces at its own display; a texture pass paints only when its window can show the result and is exactly its render target at every scale. The direct compositor renders on the discrete GPU when there is one; Mirror and Extended switch without an output rebuild. Vulkan: a full GPU never makes an app fall back, fail or spin; upload arenas are pooled; pipeline variants a batch needs compile before it; a grab of a hosted window no longer loses the device; the WM's own device is replaceable and apps hear Event::GpuReset. Every process lifts its open-file limit. Cameras: retry after a failed open, rotation kept, a synthetic test camera, Cx::video_inputs. Android: standalone app APKs run on the HAL again, file video decoding, system back gestures, audio underruns grow the buffer. Frame tracing names who keeps an app awake; one main-lag meter for macOS and Linux. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
makepad-android-state
This crate is responsible for holding Makepad's Android-specific context states. It exists solely to allow external crates to access those Android states without depending on the entirety of Makepad.
These two states are:
- The JavaVM instance initialized by the JNI layer.
- This cannot be set by foreign code outside this crate, as it is only ever set once during the lifetime of the app process.
- The current Makepad Activity instance.
- This can be set by foreign code outside this crate, as the underlying Android platform may tear down and reconstruct the activity instance multiple times during the app's lifetime.
- However, for safety reasons, we only permit a single caller to obtain the private "set_activity" function, which ensures that only the internal Makepad framework can set the activity instance.
Usage
Note: you probably want to use the
robius-android-envcrate instead of using this crate directly, or an even higher-level crate that depends onrobius-android-env.
External users of this crate should only care about two functions:
get_java_vm(): returns a pointer to the JavaVM instance, through which you can obtain the JNI environment.get_activity(): returns a pointer to the current Makepad Activity instance.
All other functions are intended for Makepad-internal use only, and will not be useful for external users.