-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Added the Render surfaces and their XAML brushes. (Ported from CompositionProToolkit) #4115
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
base: main
Are you sure you want to change the base?
Added the Render surfaces and their XAML brushes. (Ported from CompositionProToolkit) #4115
Conversation
…sing headers to files.
Thanks @ratishphilip! Not sure if you saw but I had created a There's also the FYI @Sergio0694 would love your expertise on and assistance on possibility of integration here for all this goodness. |
Hi @michael-hawker , thanks for your comments. Yes I had seen the WinUI already has Yes, even I am eagerly waiting to hear @Sergio0694's comments on how to move ahead with integrating these brushes to PipelineBrush. |
Microsoft.Toolkit.Uwp.UI.Media/Geometry/CanvasDrawingSessionExtensions.cs
Outdated
Show resolved
Hide resolved
Waiting for @Sergio0694 to return and provide some insights here. Since we're wrapping up 7.1 now, moving this to next milestone. @ratishphilip hope you don't mind? |
@michael-hawker that should be fine. Hopefully I can finish off documentation by then. 😀 |
@michael-hawker @Sergio0694 I have completed and uploaded the documentation. 😅 The PR can be found here. |
@michael-hawker @Sergio0694 Any updates on this PR? |
Hey @ratishphilip, sorry for silence here. 8.0 is a long cycle as we've been revamping our whole infrastructure of how we build the toolkit to support UWP and WinUI 3, see 2022 plans here. I've also been waiting for @Sergio0694 to help instruct us how to integrate this into the Pipeline brushes somehow, but I know he's been pretty busy with the MVVM Toolkit work he's been doing as well. In the meantime we'll be launching Labs soon, which will be the new entry point for things and allow us to better test this across UWP and WinUI 3 as well as write documentation/samples alongside it much easier. That could be a good place to at least unblock moving forward with this. (That's part of the reason why we're creating Labs too, so we don't get stuck in PR limbos like this.) I'll be giving a talk about Labs as well at the .NET Foundation Summit. |
Fixes #3442
PR Type
What kind of change does this PR introduce?
Feature
What is the current behavior?
CompositionProToolkit library provides five types of rendering surface interfaces.
IRenderSurface
- This interface acts as the base interface for interfaces which render to theICompositionSurface
. It mainly contains references to anICompositionGenerator
object and anICompositionSurface
object which are the core objects required for rendering any geometry or image onto aICompositionSurface
.IMaskSurface
- This interface is used for rendering custom shaped geometries ontoICompositionSurface
so that they can be useds as masks on Composition Visuals.IGaussianMaskSurface
- This interface derives fromIMaskSurface
and is used for rendering custom shaped geometries ontoICompositionSurface
so that they can be useds as masks on Composition Visuals. You can apply a Gaussian Blur to the mask.IGeometrySurface
- This interface is used for rendering custom shaped geometries ontoICompositionSurface
.IImageSurface
- This interface is used for rendering images ontoICompositionSurface
.IImageMaskSurface
- This interface is used for creating a mask using the alpha values of the image pixels.Here is the interface hierarchy
These render surfaces can be a useful addition to the WindowsCommunityToolkit.
What is the new behavior?
This PR achieves the following
It ports the above RenderSurfaces to Windows Community Toolkit. These surfaces can be used at the visual layer to create custom shaped visuals.
It introduces various Geometric shape classes
CanvasCircleGeometry
CanvasEllipseGeometry
CanvasRectangleGeometry
CanvasRoundedRectangleGeometry
CanvasSquircleGeometry
CanvasPathGeometry
CanvasCombinedGeometry
It also introduces XAML equivalent of Win2d brushes
SolidColorCanvasBrush
LinearGradientCanvasBrush
RadialGradientCanvasBrush
It also introduces the following XAML brushes
GeometrySurfaceBrush
GeometryMaskSurfaceBrush
ImageSurfaceBrush
ImageMaskSurfaceBrush
PR Checklist
Please check if your PR fulfills the following requirements:
Other information