fix(android): Avoid white flash on first frame by MartinZikmund · Pull Request #23593 · unoplatform/uno · GitHub
Skip to content

fix(android): Avoid white flash on first frame#23593

Open
MartinZikmund wants to merge 1 commit into
masterfrom
dev/mazi/render-android-whiteflash
Open

fix(android): Avoid white flash on first frame#23593
MartinZikmund wants to merge 1 commit into
masterfrom
dev/mazi/render-android-whiteflash

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

Avoids the white flash between Android splash-screen dismissal and the first Skia paint.

The splash is held (OnPreDraw keeps returning false) until the GL thread has flushed the first Skia frame. A volatile bool FirstFrameRendered is set on the GL thread after the first _context.Flush(), which posts an invalidation so OnPreDraw re-evaluates and dismisses the splash only once pixels are actually ready.

Validation

  • Compile: Uno.UI.Runtime.Skia.Android.csproj (net10.0-android) builds clean — 0 errors (pre-existing XA0101 @(Content) warning only).
  • Runtime: pending device / CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KBAigLEAf3csGwnWE22Yr5

Hold the splash screen (OnPreDraw) until the GL thread has flushed the first Skia frame, so it is dismissed only once pixels are ready.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KBAigLEAf3csGwnWE22Yr5
@github-actions github-actions Bot added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia labels Jun 29, 2026
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor


_context!.Flush();

if (!ApplicationActivity.Instance.FirstFrameRendered)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The equivalent signaling is missing from UnoSKVulkanView.RenderFrame(). When FeatureConfiguration.Rendering.UseVulkanOnSkiaAndroid = true, the Vulkan renderer renders frames but never sets FirstFrameRendered = true, so OnPreDraw() keeps returning false and the splash screen is held forever.

The same block (set flag → post Invalidate) should be placed after _vulkanContext.RenderFrame(...) in UnoSKVulkanView.RenderFrame().

Fix this →

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23593/wasm-skia-net9/index.html

@nventive-devops

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants