public void FillOffCanvas() { var bounds = new Rectangle(-100, -10, 10, 10); var brush = new Mock <IBrush>(); var options = new GraphicsOptions(true); var processor = new FillRegionProcessor(brush.Object, new MockRegion1(), options); var img = new Image <Rgba32>(10, 10); processor.Execute(img, bounds); }
public void FillOffCanvas() { var bounds = new Rectangle(-100, -10, 10, 10); var brush = new Mock <IBrush>(); var options = new GraphicsOptions { Antialias = true }; var processor = new FillRegionProcessor(options, brush.Object, new MockRegion1()); var img = new Image <Rgba32>(10, 10); processor.Execute(img.GetConfiguration(), img, bounds); }
[InlineData(false, 16, 4)] // we always do 4 sub=pixels when antialiasing is off. public void MinimumAntialiasSubpixelDepth(bool antialias, int antialiasSubpixelDepth, int expectedAntialiasSubpixelDepth) { var bounds = new Rectangle(0, 0, 1, 1); var brush = new Mock <IBrush>(); var region = new MockRegion2(bounds); var options = new GraphicsOptions(antialias) { AntialiasSubpixelDepth = 1 }; var processor = new FillRegionProcessor(brush.Object, region, options); var img = new Image <Rgba32>(1, 1); processor.Execute(img, bounds); Assert.Equal(4, region.ScanInvocationCounter); }