[package] name = "gallery" version = "0.1.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] [dependencies] libc = "0.2" slint = { version = "1.18.1", features = [ "backend-android-activity-06", # Exposes `slint::wgpu_30` + `Image: TryFrom` + # GraphicsAPI::WGPU30 — used by gputex to upload thumbnail textures # off the UI thread (auto-enabled on Android already; explicit for # host builds). "unstable-wgpu-30", ] } log = "0.4" rusqlite = { version = "0.41.0", features = ["bundled"] } sha1 = "0.11.0" turbojpeg = { version = "1.5.1", features = ["cmake"] } image = { version = "0.25.10", default-features = false, features = ["png"] } kamadak-exif = "0.6.1" # STG event-loop stage timestamps, read by the jank-hunt `perf` feature # (docs/BUGS/scroll-jank-120hz.md); and the 120Hz scroll-fix flags # (stg::VSYNC_LOCKED_RENDER). Already in the graph transitively via slint; # direct so the app can set the fix flags unconditionally. i-slint-backend-android-activity = { version = "1.18.1" } [features] # Jank-hunt instrumentation: per-frame frame-gap + render cost (FR), # event-loop stage costs (STG), and per-job decode cost (DECODE), mirrored # to a file on Android. OFF by default — dead-code-eliminated, zero runtime # overhead. To capture, build with `--features perf` (format + analysis: # docs/BUGS/scroll-jank-120hz.md). # Pure code flag: gates the FR/STG/DECODE file-mirror instrumentation # (no dependencies — the backend dep is now unconditional for the fix). perf = [] [build-dependencies] slint-build = "1.18.1" [dev-dependencies] tempfile = "3.27.0" # --- Android packaging (cargo-apk2 1.5) --- # NOTE: uses_permission is a TOP-LEVEL android key (ndk-build2 manifest layer), # not under [package.metadata.android.application]. max_sdk_version supported. [package.metadata.android] package = "wow.gmp.gallery" build_targets = ["x86_64-linux-android", "aarch64-linux-android"] [package.metadata.android.sdk] min_sdk_version = 26 target_sdk_version = 35 [package.metadata.android.application] label = "Gallery" # JANK-HUNT ONLY: debuggable so `adb shell simpleperf`/run-as can attach to # the process (off-CPU profiling of the UI thread). REMOVE before shipping. debuggable = true [[package.metadata.android.application.activity]] name = "android.app.NativeActivity" [[package.metadata.android.application.activity.meta_data]] name = "android.app.lib_name" value = "gallery" [[package.metadata.android.application.activity.intent_filter]] actions = ["android.intent.action.MAIN"] categories = ["android.intent.category.LAUNCHER"] # --- Permissions (runtime flow: HANDOFF.md §7) --- # NOTE: the Permission schema supports only `name` + `max_sdk_version`. # READ_MEDIA_IMAGES is a no-op on API < 33 (unknown perms are ignored). [[package.metadata.android.uses_permission]] name = "android.permission.READ_MEDIA_IMAGES" # API <= 32: legacy external storage read. [[package.metadata.android.uses_permission]] name = "android.permission.READ_EXTERNAL_STORAGE" max_sdk_version = 32 # "All files access" — same special-access pattern as passgo; needed to browse # arbitrary directories outside the media collection. [[package.metadata.android.uses_permission]] name = "android.permission.MANAGE_EXTERNAL_STORAGE" [patch.crates-io] # Vendored Slint Skia renderer: removes a redundant per-frame synchronous # flush that caused 19-24 ms scroll stalls on Mali (see # docs/BUGS/slint-skia-final-flush-jank.md). Pinned to the 1.18.1 source; # re-apply the one hunk when bumping Slint. i-slint-renderer-skia = { path = "vendor/i-slint-renderer-skia" } # STG (jank-hunt): event-loop stage timestamps, read by the `perf` feature # (docs/BUGS/scroll-jank-120hz.md). Pinned to the 1.18.1 source. i-slint-backend-android-activity = { path = "vendor/i-slint-backend-android-activity-1.18.1" } # Vendored Slint Core: for layout engine / scrolling optimization. i-slint-core = { path = "vendor/i-slint-core" } # Jank-hunt (VK_LIBRARY): zygote preloads the system libvulkan.so into every # app, so dlopen-by-name can't be shadowed; an absolute path (the app's own # shim, see shim/vkshim.c) is the only reliable intercept. One hunk in # vulkan/instance.rs; re-apply when bumping wgpu. wgpu-hal = { path = "vendor/wgpu-hal-30.0.1" }