Uno: Add WriteableBitmap support for Skia

Created on 16 Sep 2020  路  5Comments  路  Source: unoplatform/uno

What would you like to be added:

Add support for WriteableBitmap on Skia.

For which Platform:

  • [ ] iOS
  • [ ] Android
  • [ ] WebAssembly
  • [ ] WebAssembly renderers for Xamarin.Forms
  • [ ] macOS
  • [x] Skia

    • [x] WPF

    • [x] GTK (Linux)

    • [x] Tizen

  • [ ] Windows
  • [ ] Build tasks
  • [ ] Solution Templates

Anything else we need to know?

Posted originally here: https://stackoverflow.com/questions/63923809/writeablebitmap-doesnt-render-on-linux-but-works-on-uwp-and-wasm/63923898#63923898

kinenhancement projeccore-tools

All 5 comments

Hi,

Is there any easy replacement for WriteableBitmap that is now supported on Skia.GTK (Linux)?

The goal is to efficiently take an array of byte representing the pixel colors (raw data) and display it on screen.
The image needs to be refreshed from raw data many times a second, with low CPU usage, if possible.

Not at this point, but we're looking at implementing this pretty soon.

I didn't realize this wasn't implemented in Skia. The ColorPicker depends on WriteableBitmap although you probably know that already.

Avalonia already implemented this in Skia. It looks fairly straightforward and code is MIT.

https://github.com/AvaloniaUI/Avalonia/blob/master/src/Skia/Avalonia.Skia/WriteableBitmapImpl.cs
https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Visuals/Media/Imaging/WriteableBitmap.cs

GitHub
Avalonia is a cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows via .NET Framework and .NET Core, Linux via...
GitHub
Avalonia is a cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows via .NET Framework and .NET Core, Linux via...

Yes this is a fairly easy implementation, not much interactions to do with Skia. The rest is mostly about interacting with Image and other parts of WinUI.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulovila picture paulovila  路  3Comments

MatFillion picture MatFillion  路  4Comments

MartinZikmund picture MartinZikmund  路  3Comments

PylotLight picture PylotLight  路  3Comments

Ali-YousefiTelori picture Ali-YousefiTelori  路  4Comments