Hand Android's develop frame to the compositor as a texture again
With Skia drawing pre-rotated on wgpu's Vulkan swapchain, Android no longer needs to draw with Skia over OpenGL, which was the only reason the develop view read its frame back through memory (TD-1). So `unstable-wgpu-29` moves back to the common slint dependency. The android-activity backend then builds `SkiaRenderer::default_wgpu_29`, and `shared_gpu` loses its Android arm. The one wgpu device is handed to Slint through `BackendSelector::require_wgpu_29` on both platforms. `slint::android::init_with_event_listener` runs before `dr_ui::run`, so the selector reaches the Android adapter before its window exists. `renderer-femtovg-wgpu` stays desktop-only, since Android has no FemtoVG. The two `#[cfg(target_os = "android")]` readbacks in `develop::render` (the frame through `export_pixels` and the focus overlay through `read_overlay`) are gone. `read_overlay` stays for the tests that check what the overlay marks. Built for arm64 and release-signed. Not yet run on the tablet.
This commit is contained in:
+11
-13
@@ -87,14 +87,16 @@ rusqlite.workspace = true
|
||||
# Consequence worth stating plainly: the desktop app now needs a working wgpu
|
||||
# adapter to open a window at all. Slint refuses a CPU adapter for this
|
||||
# renderer unless `SLINT_WGPU_CPU` is set in the environment.
|
||||
# TEST BUILD: the wgpu renderer features have moved to the desktop-only
|
||||
# dependency below. On Android they made `AndroidWindowAdapter` choose
|
||||
# `SkiaRenderer::default_wgpu_29`, and so put the app on wgpu's Vulkan
|
||||
# swapchain — which hardcodes `preTransform = IDENTITY` (gfx-rs/wgpu#3345).
|
||||
# Without them the Android backend uses `SkiaRenderer::default`, which on
|
||||
# Android resolves to Skia over OpenGL, where the driver owns the display
|
||||
# rotation and there is no transform to get wrong.
|
||||
slint = { workspace = true, features = ["compat-1-2"] }
|
||||
#
|
||||
# On Android the renderer is Skia, not FemtoVG — the android-activity backend
|
||||
# has no other — so `renderer-femtovg-wgpu` stays with winit below, and only
|
||||
# `unstable-wgpu-29` is shared. With it, `AndroidWindowAdapter` builds
|
||||
# `SkiaRenderer::default_wgpu_29`: Skia drawing on wgpu's Vulkan swapchain,
|
||||
# which is what lets it sample our texture. That swapchain used to tear in
|
||||
# portrait on a landscape-mounted panel (gfx-rs/wgpu#3345), and Android drew
|
||||
# with Skia over OpenGL behind a readback instead; the patched wgpu-hal and
|
||||
# Skia renderer in third_party/ pre-rotate it, which closed TD-1.
|
||||
slint = { workspace = true, features = ["compat-1-2", "unstable-wgpu-29"] }
|
||||
wgpu.workspace = true
|
||||
anyhow.workspace = true
|
||||
# `SettingsError` distinguishes an io failure from a malformed file, which the
|
||||
@@ -110,11 +112,7 @@ serde_norway = { workspace = true, optional = true }
|
||||
# under `cfg(target_os = "android")`, so this only has to name the feature;
|
||||
# cargo resolves it away entirely on desktop.
|
||||
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||
slint = { workspace = true, features = [
|
||||
"backend-winit",
|
||||
"renderer-femtovg-wgpu",
|
||||
"unstable-wgpu-29",
|
||||
] }
|
||||
slint = { workspace = true, features = ["backend-winit", "renderer-femtovg-wgpu"] }
|
||||
# The manual's `file:` URL (`manual::desktop_open`): a Windows path and a
|
||||
# path with a space in it are both URLs only after encoding, and this is the
|
||||
# crate the workspace already encodes URLs with.
|
||||
|
||||
Reference in New Issue
Block a user