Skip to content

Conversation

@olilarkin
Copy link
Member

This new backend mode combines CPU-based Skia rendering with Metal for
efficient display. It's enabled when both IGRAPHICS_CPU and IGRAPHICS_METAL
are defined.

Key implementation details:

  • CPU raster surface for Skia rendering (kBGRA_8888_SkColorType)
  • Metal texture created for blitting to drawable
  • EndFrame uploads pixels via replaceRegion and blits using MTLBlitCommandEncoder
  • Platform views (macOS/iOS) updated to set up CAMetalLayer for this mode

This approach provides software rendering reliability while leveraging Metal
for hardware-accelerated display, similar to SWELL's Metal blitting approach.

…tting

This new backend mode combines CPU-based Skia rendering with Metal for
efficient display. It's enabled when both IGRAPHICS_CPU and IGRAPHICS_METAL
are defined.

Key implementation details:
- CPU raster surface for Skia rendering (kBGRA_8888_SkColorType)
- Metal texture created for blitting to drawable
- EndFrame uploads pixels via replaceRegion and blits using MTLBlitCommandEncoder
- Platform views (macOS/iOS) updated to set up CAMetalLayer for this mode

This approach provides software rendering reliability while leveraging Metal
for hardware-accelerated display, similar to SWELL's Metal blitting approach.
…ing on Windows

This new backend mode combines CPU-based Skia rendering with Direct3D 11 for
efficient display on Windows. It's enabled when IGRAPHICS_CPU, IGRAPHICS_D3D,
and OS_WIN are all defined.

Key implementation details:
- CPU raster surface for Skia rendering (kBGRA_8888_SkColorType)
- D3D11 device, swap chain, and staging texture created for blitting
- EndFrame maps staging texture, copies pixels, then copies to back buffer
- Uses IDXGISwapChain::Present() for hardware-accelerated display

This mirrors the IGRAPHICS_CPU_METAL approach for macOS/iOS, providing
software rendering reliability with GPU-accelerated display output.
@olilarkin olilarkin marked this pull request as draft January 3, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants