Avalonia
Avalonia copied to clipboard
Remove unnecessary SKImage wrappers in ImmutableBitmap
What does the pull request do?
Currently, in ImmutableBitmap's implementation, there is an unnecessary conversion from SKBitmap to SKImage. Most of the properties and data can be directly extracted from SKImage.
You can test this PR using the following package version. 11.1.999-cibuild0043875-beta
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
By moving to SKBitmap all bitmaps are always CPU bound
By moving to SKBitmap all bitmaps are always CPU bound
I see, so this is the reason we need to keep the instance of the SKImage?
Possibly we can have two different implementations, one SKBitmap backed and another SKimage backed. Updating all the usage. But does it have any benefit of avoiding SKImage? I don’t expect it copy all the memory, unless I am wrong.
You can test this PR using the following package version. 11.1.999-cibuild0043897-beta
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
SKImage internally references the same bitmap data, IIRC.
SKImage internally references the same bitmap data, IIRC.
So it is safe to remove those fields?
You can test this PR using the following package version. 11.1.999-cibuild0044677-beta
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.2.999-cibuild0046525-alpha
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.2.999-cibuild0046817-alpha
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]