@@ -487,7 +487,6 @@ public void DrawText(
487487 Pen ? pen )
488488 {
489489 this . EnsureNotDisposed ( ) ;
490- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
491490
492491 if ( text . IsEmpty )
493492 {
@@ -584,7 +583,6 @@ public void DrawGlyphs(
584583 public RectangleF MeasureTextAdvance ( RichTextOptions textOptions , ReadOnlySpan < char > text )
585584 {
586585 this . EnsureNotDisposed ( ) ;
587- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
588586
589587 if ( text . IsEmpty )
590588 {
@@ -599,7 +597,6 @@ public RectangleF MeasureTextAdvance(RichTextOptions textOptions, ReadOnlySpan<c
599597 public RectangleF MeasureTextBounds ( RichTextOptions textOptions , ReadOnlySpan < char > text )
600598 {
601599 this . EnsureNotDisposed ( ) ;
602- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
603600
604601 if ( text . IsEmpty )
605602 {
@@ -614,7 +611,6 @@ public RectangleF MeasureTextBounds(RichTextOptions textOptions, ReadOnlySpan<ch
614611 public RectangleF MeasureTextRenderableBounds ( RichTextOptions textOptions , ReadOnlySpan < char > text )
615612 {
616613 this . EnsureNotDisposed ( ) ;
617- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
618614
619615 if ( text . IsEmpty )
620616 {
@@ -629,7 +625,6 @@ public RectangleF MeasureTextRenderableBounds(RichTextOptions textOptions, ReadO
629625 public RectangleF MeasureTextSize ( RichTextOptions textOptions , ReadOnlySpan < char > text )
630626 {
631627 this . EnsureNotDisposed ( ) ;
632- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
633628
634629 if ( text . IsEmpty )
635630 {
@@ -644,7 +639,6 @@ public RectangleF MeasureTextSize(RichTextOptions textOptions, ReadOnlySpan<char
644639 public bool TryMeasureCharacterAdvances ( RichTextOptions textOptions , ReadOnlySpan < char > text , out ReadOnlySpan < GlyphBounds > advances )
645640 {
646641 this . EnsureNotDisposed ( ) ;
647- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
648642
649643 if ( text . IsEmpty )
650644 {
@@ -659,7 +653,6 @@ public bool TryMeasureCharacterAdvances(RichTextOptions textOptions, ReadOnlySpa
659653 public bool TryMeasureCharacterBounds ( RichTextOptions textOptions , ReadOnlySpan < char > text , out ReadOnlySpan < GlyphBounds > bounds )
660654 {
661655 this . EnsureNotDisposed ( ) ;
662- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
663656
664657 if ( text . IsEmpty )
665658 {
@@ -674,7 +667,6 @@ public bool TryMeasureCharacterBounds(RichTextOptions textOptions, ReadOnlySpan<
674667 public bool TryMeasureCharacterRenderableBounds ( RichTextOptions textOptions , ReadOnlySpan < char > text , out ReadOnlySpan < GlyphBounds > bounds )
675668 {
676669 this . EnsureNotDisposed ( ) ;
677- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
678670
679671 if ( text . IsEmpty )
680672 {
@@ -689,7 +681,6 @@ public bool TryMeasureCharacterRenderableBounds(RichTextOptions textOptions, Rea
689681 public bool TryMeasureCharacterSizes ( RichTextOptions textOptions , ReadOnlySpan < char > text , out ReadOnlySpan < GlyphBounds > sizes )
690682 {
691683 this . EnsureNotDisposed ( ) ;
692- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
693684
694685 if ( text . IsEmpty )
695686 {
@@ -704,7 +695,6 @@ public bool TryMeasureCharacterSizes(RichTextOptions textOptions, ReadOnlySpan<c
704695 public int CountTextLines ( RichTextOptions textOptions , ReadOnlySpan < char > text )
705696 {
706697 this . EnsureNotDisposed ( ) ;
707- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
708698
709699 if ( text . IsEmpty )
710700 {
@@ -718,7 +708,6 @@ public int CountTextLines(RichTextOptions textOptions, ReadOnlySpan<char> text)
718708 public LineMetrics [ ] GetTextLineMetrics ( RichTextOptions textOptions , ReadOnlySpan < char > text )
719709 {
720710 this . EnsureNotDisposed ( ) ;
721- Guard . NotNull ( textOptions , nameof ( textOptions ) ) ;
722711
723712 if ( text . IsEmpty )
724713 {
@@ -754,7 +743,11 @@ public void DrawImage(
754743 Rectangle sourceRect ,
755744 RectangleF destinationRect ,
756745 IResampler ? sampler = null )
757- => this . DrawImageCore ( image , sourceRect , destinationRect , sampler , ownsSourceImage : false ) ;
746+ {
747+ this . EnsureNotDisposed ( ) ;
748+ Guard . NotNull ( image , nameof ( image ) ) ;
749+ this . DrawImageCore ( image , sourceRect , destinationRect , sampler , ownsSourceImage : false ) ;
750+ }
758751
759752 private void DrawImageCore (
760753 Image < TPixel > image ,
@@ -763,8 +756,6 @@ private void DrawImageCore(
763756 IResampler ? sampler ,
764757 bool ownsSourceImage )
765758 {
766- this . EnsureNotDisposed ( ) ;
767- Guard . NotNull ( image , nameof ( image ) ) ;
768759 bool disposeSourceImage = ownsSourceImage ;
769760
770761 DrawingCanvasState state = this . ResolveState ( ) ;
@@ -1075,10 +1066,6 @@ private Brush NormalizeBrush(Brush brush)
10751066 /// <param name="path">Path to fill.</param>
10761067 private void EnqueueFillPath ( Brush brush , IPath path )
10771068 {
1078- this . EnsureNotDisposed ( ) ;
1079- Guard . NotNull ( path , nameof ( path ) ) ;
1080- Guard . NotNull ( brush , nameof ( brush ) ) ;
1081-
10821069 DrawingCanvasState state = this . ResolveState ( ) ;
10831070 IPath closed = path . AsClosedPath ( ) ;
10841071
@@ -1101,8 +1088,6 @@ private void DrawTextOperations(
11011088 DrawingOptions drawingOptions ,
11021089 IReadOnlyList < IPath > clipPaths )
11031090 {
1104- this . EnsureNotDisposed ( ) ;
1105-
11061091 // Build composition commands and enforce render-pass ordering while preserving
11071092 // original emission order inside each pass. This preserves overlapping color-font
11081093 // layer compositing semantics (for example emoji mouth/teeth layers).
0 commit comments