Root cause of scroll jank: first-present of each Image uploaded pixels
inside the render frame (~11-30 ms per 400px texture, 1.3 visible
hitches/s at 120 Hz; grey-image A/B: 20 -> 1). Slint has no render
thread and no pre-upload API.
Fix: decode worker creates the Rgba8Unorm texture on Slint's own wgpu
device (captured from GraphicsAPI::WGPU30 at RenderingSetup) and submits
the async upload; UI wraps it in Image::try_from(tex). Zero pixel work
in the render frame. CPU from_rgba8 fallback retained.
Measured (Pixel 9 Pro 120 Hz, 400 px, per-frame FR hook):
before: >10ms renders 20 in 15s (max 30 ms), 3 borderline 8-9 ms
after: 0 mid-scroll renders > 4.4 ms (median 1.9, p95 2.9);
only post-idle first-frames expensive (invisible)
Also: FR per-frame logging via set_rendering_notifier; APLY timestamp.
71 lines
2.2 KiB
TOML
71 lines
2.2 KiB
TOML
[package]
|
|
name = "gallery"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "lib"]
|
|
|
|
[dependencies]
|
|
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"
|