Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set alpha and pixel format for Direct2D WIC bitmap #15610

Merged
merged 3 commits into from
May 5, 2024

Conversation

hez2010
Copy link
Contributor

@hez2010 hez2010 commented May 4, 2024

What does the pull request do?

Set PixelFormat and AlphaFormat in Direct2D BitmapImpl.

What is the current behavior?

The rendering failed due to PixelFormat and AlphaFormat are null, and throws with a not supported exception.

What is the updated/expected behavior with this PR?

No exception thrown due to not supported.

@hez2010
Copy link
Contributor Author

hez2010 commented May 4, 2024

BTW I would like to switch to Vortice.Direct2D (https://github.com/amerkoleci/Vortice.Windows) in the future, as it is being actively maintained. But this package only supports .NET 7+, what do you think dropping the netstandard2.0 and net6.0 target from Avalonia.Direct2D?

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented May 4, 2024

  • All contributors have signed the CLA.

@hez2010
Copy link
Contributor Author

hez2010 commented May 4, 2024

@cla-avalonia agree

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048084-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6
Copy link
Member

maxkatz6 commented May 4, 2024

@hez2010 there were couple of attempts to use any other d2d integration: https://github.com/AvaloniaUI/Avalonia/pulls?q=is%3Apr+Vortice+is%3Aclosed
In general, there is very low interest from the core team to maintain any other rendering backend. And we keep sharpdx only to make sure that avalonia doesn't depend on skia way too much.

Saying this, it should be absolutely possible to implement an alternative rendering backend outside of the repo. With enabling private APIs access.

@hez2010
Copy link
Contributor Author

hez2010 commented May 5, 2024

And we keep sharpdx only to make sure that avalonia doesn't depend on skia way too much.

Yeah. I'm investigating D2D support as this can get rid of the dependency on Skia and Egl on Windows to save ~20 MB of binary size.

@jmacato jmacato enabled auto-merge May 5, 2024 08:24
@jmacato jmacato added this pull request to the merge queue May 5, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048086-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Merged via the queue into AvaloniaUI:master with commit 7db46af May 5, 2024
11 checks passed
@maxkatz6 maxkatz6 added area-direct2d backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels May 8, 2024
maxkatz6 pushed a commit that referenced this pull request May 8, 2024
* fix PixelFormat

* revert unnecessary changes

---------

Co-authored-by: Jumar Macato <[email protected]>
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants