Skip to content

Commit 1eccfb8

Browse files
committed
simplify PolygonScanner factory method
1 parent 7bbb5af commit 1eccfb8

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

src/ImageSharp.Drawing/Processing/Processors/Drawing/FillRegionProcessor{TPixel}.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Buffers;
6+
using SixLabors.ImageSharp.Drawing.Shapes;
67
using SixLabors.ImageSharp.Drawing.Shapes.Rasterization;
78
using SixLabors.ImageSharp.Memory;
89
using SixLabors.ImageSharp.PixelFormats;
@@ -71,12 +72,12 @@ protected override void OnFrameApply(ImageFrame<TPixel> source)
7172
bool scanlineDirty = true;
7273

7374
var scanner = PolygonScanner.Create(
74-
region,
75+
region.Shape,
7576
minY,
7677
maxY,
7778
subpixelCount,
7879
shapeOptions.IntersectionRule,
79-
configuration,
80+
configuration.MemoryAllocator,
8081
shapeOptions.OrientationHandling);
8182

8283
try

src/ImageSharp.Drawing/Shapes/Rasterization/PolygonScanner.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static PolygonScanner Create(
9797
int subsampling,
9898
IntersectionRule intersectionRule,
9999
MemoryAllocator allocator,
100-
OrientationHandling orientationHandling = OrientationHandling.FirstRingIsContourFollowedByHoles)
100+
OrientationHandling orientationHandling)
101101
{
102102
TessellatedMultipolygon multipolygon = TessellatedMultipolygon.Create(polygon, allocator, orientationHandling);
103103
ScanEdgeCollection edges = ScanEdgeCollection.Create(multipolygon, allocator, subsampling);
@@ -106,16 +106,6 @@ public static PolygonScanner Create(
106106
return scanner;
107107
}
108108

109-
public static PolygonScanner Create(
110-
Region region,
111-
int minY,
112-
int maxY,
113-
int subsampling,
114-
IntersectionRule intersectionRule,
115-
Configuration configuration,
116-
OrientationHandling orientationHandling = OrientationHandling.FirstRingIsContourFollowedByHoles)
117-
=> Create(region.Shape, minY, maxY, subsampling, intersectionRule, configuration.MemoryAllocator, orientationHandling);
118-
119109
private void Init()
120110
{
121111
// Reuse memory buffers of 'intersections' and 'activeEdges' for key-value sorting,

0 commit comments

Comments
 (0)