Skip to content

[Skia] Hardware-accelerate RenderTargetBitmap rendering #23636

Closed

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.

Activity

  1. added
    kind/enhancement
    on Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions