gallery/Cargo.toml
Greg Pomerantz 93b27d724b Root-cause and fix the Mali scroll jank; strip jank-hunt instrumentation
The 19-26 ms mid-scroll stalls (Mali-only, fixed content offsets) were
the Skia renderer's final synchronous GrDirectContext::flush() blocking
the UI thread on Mali driver back-pressure — proven by per-stage
timestamps in the vendored renderer (stall frames: flush 19-24 ms,
walk 1-3 ms, 1 binding re-eval, image imports 0.1 ms each).

- vendor/i-slint-renderer-skia (pinned 1.18.1, [patch.crates-io]):
  remove that one flush. Redundant on the wgpu backend: the surface
  already calls flush_and_submit before queue.present, same Vulkan
  queue, in-order. Phone: 0 stalls across 4 runs (max 3.6-7.4 ms vs
  the 8.3 ms budget), display verified clean.
- docs/BUGS/slint-skia-final-flush-jank.md: full evidence, prior art
  (slint-ui/slint#12030 closest), open question for a future
  upstream filing (not filed yet).
- Profiling also retired the O(n)-walk theory: Slint 1.18 prunes the
  item walk to ~133-152 items; the windowed Flickable built on that
  theory was already reverted (ListView is smooth with the fix).
- Strip all jank-hunt instrumentation: FR/SCR/TICK/APLYD/STG logging,
  stg markers, .gallery_* file knobs, jsamp thread sampler,
  DbgScroll programmatic scroll, nblog perf-file mirroring.
  Also fixes the 'launches into unstoppable fast scroll' bug: a
  leftover .gallery_cmd was re-read on every launch (file never
  deleted) and overrode user swipes — the hook is gone.
- Keep: nblog (logd backpressure is real), zero-dimension decode
  guards, keep-alive (default-off).
- HANDOFF: replace stale windowed-Flickable section with the actual
  root cause/fix; 15 unit tests pass.

Verified on phone (aarch64, 8580 photos) and emulator (x86_64).
2026-10-28 18:23:50 -04:00

79 lines
2.6 KiB
TOML

[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<wgpu::Texture>` +
# 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"
[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"
[[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" }