Files
kryon/tests/android_present_damage_test.sh
T
waoziandClaude Opus 5.5 4923381c88 Load the pictures an Android app ships from its APK on first use
Android Frame apps draw through Pixmap, which found only pictures already
registered, so every file picture showed "Missing image". Pixmap now asks
an optional picture source the first time it measures or draws an
unregistered path, once per missing path until invalidation or host
cleanup. pixmap_assets_android registers a source that reads the APK asset
through AAssetManager and decodes it, and the Frame host imports it, as
desktop Cairo loads pictures on first use.

Tests: the Android image services test covers lazy loading, caching, the
single lookup per missing path, retry after invalidation and cleanup. A
new device suite decodes a framework PNG through Android's real
AssetManager inside its VM and compares it with an independent decode;
tests/android_vm_device_test.py now runs it and the typeface suite. Frame
host tests link the codecs that apps link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 17:23:44 -03:00

24 lines
1.4 KiB
Bash

#!/bin/sh
set -eu
repo=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
. "$repo/tests/toolchain.sh"
out="$repo/build/scratch/android-present-damage"
mkdir -p "$out"
unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS SESSION_MANAGER
export HARMONY_DESKTOP_RECOVERY=0 YUE_DESKTOP_RECOVERY=0
"$ziran" ir $kryon_project_args --root "$repo/tests" --define ANDROID_BUILD --entry android_present_damage_test:main -o "$out/ir" "$repo/tests/android_present_damage_test.zi"
for form in source saved; do
input="$repo/tests/android_present_damage_test.zi"; root="$repo/tests"
if test "$form" = saved; then input="$out/ir/android_present_damage_test.zir"; root="$out/ir"; fi
output="$out/$form"
"$ziran" build $kryon_project_args --target=c --root "$root" --define ANDROID_BUILD --entry android_present_damage_test:main --prune-stale -o "$output" "$input"
includes=$(find "$output" -type d -printf ' -iquote %p')
# The Frame host decodes the pictures an app ships with the app's codecs.
# shellcheck disable=SC2046,SC2086
"${CC:-cc}" -std=c11 -O1 -ffunction-sections -fdata-sections -I"$ziran_root/include" $includes \
$(find "$output" -name '*.c') "$repo/build/webp-ziran/libkryonwebp.a" \
"$repo/build/avif-ziran/avif/libavif.a" "$repo/build/avif-ziran/aom/libaom.a" \
"$ziran_root/build/libziran.a" -Wl,--gc-sections -lz -ldl -lm -lpthread -o "$output/test"
"$output/test"
done