@@ -63,6 +63,48 @@ public void FillPath_WithWebGPUCoverageBackend_MatchesDefaultOutput<TPixel>(Test
6363 AssertBackendPairReferenceOutputs ( provider , "FillPath" , defaultImage , nativeSurfaceImage ) ;
6464 }
6565
66+ [ WebGPUTheory ]
67+ [ WithSolidFilledImages ( 256 , 256 , "White" , PixelTypes . Rgba32 ) ]
68+ public void FillPath_UncontainedGeometry_MatchesDefaultOutput < TPixel > ( TestImageProvider < TPixel > provider )
69+ where TPixel : unmanaged, IPixel < TPixel >
70+ {
71+ DrawingOptions drawingOptions = new ( )
72+ {
73+ GraphicsOptions = new GraphicsOptions { Antialias = true }
74+ } ;
75+
76+ PathBuilder pathBuilder = new ( ) ;
77+ pathBuilder . AddLines (
78+ [
79+ new PointF ( - 96 , 128.5F ) ,
80+ new PointF ( 128.5F , - 88 ) ,
81+ new PointF ( 352 , 128.5F ) ,
82+ new PointF ( 128.5F , 344 )
83+ ] ) ;
84+ pathBuilder . CloseFigure ( ) ;
85+
86+ IPath path = pathBuilder . Build ( ) ;
87+ Brush brush = Brushes . Solid ( Color . MediumPurple ) ;
88+ void DrawAction ( DrawingCanvas < TPixel > canvas ) => canvas . Fill ( brush , path ) ;
89+
90+ using Image < TPixel > defaultImage = provider . GetImage ( ) ;
91+ RenderWithDefaultBackend ( defaultImage , drawingOptions , DrawAction ) ;
92+
93+ using WebGPUDrawingBackend nativeSurfaceBackend = new ( ) ;
94+ using Image < TPixel > nativeSurfaceInitialImage = provider . GetImage ( ) ;
95+ using Image < TPixel > nativeSurfaceImage = RenderWithNativeSurfaceWebGpuBackend (
96+ defaultImage . Width ,
97+ defaultImage . Height ,
98+ nativeSurfaceBackend ,
99+ drawingOptions ,
100+ DrawAction ,
101+ nativeSurfaceInitialImage ) ;
102+
103+ DebugSaveBackendPair ( provider , "FillPath_UncontainedGeometry" , defaultImage , nativeSurfaceImage ) ;
104+ AssertBackendPairSimilarity ( defaultImage , nativeSurfaceImage , 0.3F ) ;
105+ AssertBackendPairReferenceOutputs ( provider , "FillPath_UncontainedGeometry" , defaultImage , nativeSurfaceImage ) ;
106+ }
107+
66108 [ WebGPUTheory ]
67109 [ WithSolidFilledImages ( 512 , 512 , "White" , PixelTypes . Rgba32 ) ]
68110 public void FillPath_AliasedWithThreshold_MatchesDefaultOutput < TPixel > ( TestImageProvider < TPixel > provider )
0 commit comments