File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/GradientBrushTests Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 328
328
</Rectangle .Stroke>
329
329
</Rectangle >
330
330
</StackPanel >
331
- <TextBlock FontSize =" 15" >Text with Radial/Linear gradient as foreground brush (fallback=green )</TextBlock >
331
+ <TextBlock FontSize =" 15" >Text with Radial/Linear gradient as foreground brush (fallback=red )</TextBlock >
332
332
<StackPanel Orientation =" Horizontal" Spacing =" 10" >
333
333
<TextBlock Text =" UNO" FontSize =" 110" FontWeight =" Bold" >
334
334
<TextBlock .Foreground>
Original file line number Diff line number Diff line change @@ -514,6 +514,24 @@ internal void Draw(in Visual.PaintingSession session)
514
514
blue : scbColor . B ,
515
515
alpha : ( byte ) ( scbColor . A * scb . Opacity * session . Filters . Opacity ) ) ;
516
516
}
517
+ else if ( inline . Foreground is GradientBrush gb )
518
+ {
519
+ var gbColor = gb . FallbackColorWithOpacity ;
520
+ paint . Color = new SKColor (
521
+ red : gbColor . R ,
522
+ green : gbColor . G ,
523
+ blue : gbColor . B ,
524
+ alpha : ( byte ) ( gbColor . A * session . Filters . Opacity ) ) ;
525
+ }
526
+ else if ( inline . Foreground is XamlCompositionBrushBase xcbb )
527
+ {
528
+ var gbColor = xcbb . FallbackColorWithOpacity ;
529
+ paint . Color = new SKColor (
530
+ red : gbColor . R ,
531
+ green : gbColor . G ,
532
+ blue : gbColor . B ,
533
+ alpha : ( byte ) ( gbColor . A * session . Filters . Opacity ) ) ;
534
+ }
517
535
518
536
// TODO: Consider using a stackalloc for small values of GlyphsLength.
519
537
// Note that using a stackalloc will require refactoring this code to a separate method to avoid having a stackalloc in a loop.
You can’t perform that action at this time.
0 commit comments