[Skia] Hardware-accelerate RenderTargetBitmap rendering · Issue #23636 · unoplatform/uno · GitHub
Skip to content

[Skia] Hardware-accelerate RenderTargetBitmap rendering #23636

Description

@ramezgerges

What would you like to be added? 💡

On Skia targets, RenderTargetBitmap.RenderAsync currently always rasterizes the visual tree in software (SKSurface.Create(info) + Compositor.IsSoftwareRenderer = true), even when the window itself renders through a hardware GRContext (OpenGL/Vulkan/Metal/WebGL).

RenderTargetBitmap should render through the window's GRContext when one is available, so the offscreen render is hardware-accelerated and matches the on-screen output, falling back to the raster path when the target renders in software.

Why is this needed? 🤔

  • Performance: complex visual trees (effects, large surfaces) rasterize much faster on the GPU, and UITestHelper.ScreenShot-style tooling built on RenderTargetBitmap benefits directly.
  • Fidelity: GPU-rendered output matches what is actually presented on screen (e.g. effect brushes currently take software-only fallback paths during RenderTargetBitmap rendering).
  • Parity: WinUI's RenderTargetBitmap is hardware-accelerated.

Renderer 🎨

  • Skia
  • Native

For which platforms 📱💻🖥️

All platforms 🌍

Anything else we need to know? 💬

GPU rasterization can produce slightly different (equally valid) anti-aliasing than the software rasterizer, so RenderTargetBitmap output on GPU-rendered windows won't be bit-identical to the raster path — it will instead match what is presented on screen. Pixel-exact consumers (e.g. golden-image tests) should use perceptual or invariant-based comparisons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions