Skip to content

Commit

Permalink
perf: Access Color DP once in InlineCollection.Draw
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Jan 6, 2024
1 parent 2b7be5f commit 6162874
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Uno.UI/UI/Xaml/Documents/InlineCollection.skia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,12 @@ internal void Draw(in DrawingSession session)

if (inline.Foreground is SolidColorBrush scb)
{
var scbColor = scb.Color;
paint.Color = new SKColor(
red: scb.Color.R,
green: scb.Color.G,
blue: scb.Color.B,
alpha: (byte)(scb.Color.A * scb.Opacity * session.Filters.Opacity));
red: scbColor.R,
green: scbColor.G,
blue: scbColor.B,
alpha: (byte)(scbColor.A * scb.Opacity * session.Filters.Opacity));
}

var glyphs = new ushort[segmentSpan.GlyphsLength];
Expand Down

0 comments on commit 6162874

Please sign in to comment.