Browse Source

remove pen argument from DrawOperation and BrushDrawOperation

pull/3909/head
Dan Walmsley 6 years ago
parent
commit
f270a1eafd
  1. 4
      src/Avalonia.Visuals/Rendering/SceneGraph/BrushDrawOperation.cs
  2. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/CustomDrawOperation.cs
  3. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/DrawOperation.cs
  4. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/GeometryNode.cs
  5. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/GlyphRunNode.cs
  6. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/ImageNode.cs
  7. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/LineNode.cs
  8. 4
      src/Avalonia.Visuals/Rendering/SceneGraph/OpacityMaskNode.cs
  9. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/RectangleNode.cs
  10. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/TextNode.cs
  11. 4
      tests/Avalonia.Visuals.UnitTests/Rendering/SceneGraph/DrawOperationTests.cs

4
src/Avalonia.Visuals/Rendering/SceneGraph/BrushDrawOperation.cs

@ -9,8 +9,8 @@ namespace Avalonia.Rendering.SceneGraph
/// </summary>
internal abstract class BrushDrawOperation : DrawOperation
{
public BrushDrawOperation(Rect bounds, Matrix transform, IPen pen)
: base(bounds, transform, pen)
public BrushDrawOperation(Rect bounds, Matrix transform)
: base(bounds, transform)
{
}

2
src/Avalonia.Visuals/Rendering/SceneGraph/CustomDrawOperation.cs

@ -9,7 +9,7 @@ namespace Avalonia.Rendering.SceneGraph
public Matrix Transform { get; }
public ICustomDrawOperation Custom { get; }
public CustomDrawOperation(ICustomDrawOperation custom, Matrix transform)
: base(custom.Bounds, transform, null)
: base(custom.Bounds, transform)
{
Transform = transform;
Custom = custom;

2
src/Avalonia.Visuals/Rendering/SceneGraph/DrawOperation.cs

@ -9,7 +9,7 @@ namespace Avalonia.Rendering.SceneGraph
/// </summary>
internal abstract class DrawOperation : IDrawOperation
{
public DrawOperation(Rect bounds, Matrix transform, IPen pen)
public DrawOperation(Rect bounds, Matrix transform)
{
bounds = bounds.TransformToAABB(transform);
Bounds = new Rect(

2
src/Avalonia.Visuals/Rendering/SceneGraph/GeometryNode.cs

@ -24,7 +24,7 @@ namespace Avalonia.Rendering.SceneGraph
IPen pen,
IGeometryImpl geometry,
IDictionary<IVisual, Scene> childScenes = null)
: base(geometry.GetRenderBounds(pen), transform, null)
: base(geometry.GetRenderBounds(pen), transform)
{
Transform = transform;
Brush = brush?.ToImmutable();

2
src/Avalonia.Visuals/Rendering/SceneGraph/GlyphRunNode.cs

@ -25,7 +25,7 @@ namespace Avalonia.Rendering.SceneGraph
GlyphRun glyphRun,
Point baselineOrigin,
IDictionary<IVisual, Scene> childScenes = null)
: base(glyphRun.Bounds, transform, null)
: base(glyphRun.Bounds, transform)
{
Transform = transform;
Foreground = foreground?.ToImmutable();

2
src/Avalonia.Visuals/Rendering/SceneGraph/ImageNode.cs

@ -19,7 +19,7 @@ namespace Avalonia.Rendering.SceneGraph
/// <param name="destRect">The destination rect.</param>
/// <param name="bitmapInterpolationMode">The bitmap interpolation mode.</param>
public ImageNode(Matrix transform, IRef<IBitmapImpl> source, double opacity, Rect sourceRect, Rect destRect, BitmapInterpolationMode bitmapInterpolationMode)
: base(destRect, transform, null)
: base(destRect, transform)
{
Transform = transform;
Source = source.Clone();

2
src/Avalonia.Visuals/Rendering/SceneGraph/LineNode.cs

@ -25,7 +25,7 @@ namespace Avalonia.Rendering.SceneGraph
Point p1,
Point p2,
IDictionary<IVisual, Scene> childScenes = null)
: base(LineBoundsHelper.CalculateBounds(p1, p2, pen), transform, pen)
: base(LineBoundsHelper.CalculateBounds(p1, p2, pen), transform)
{
Transform = transform;
Pen = pen?.ToImmutable();

4
src/Avalonia.Visuals/Rendering/SceneGraph/OpacityMaskNode.cs

@ -18,7 +18,7 @@ namespace Avalonia.Rendering.SceneGraph
/// <param name="bounds">The bounds of the mask.</param>
/// <param name="childScenes">Child scenes for drawing visual brushes.</param>
public OpacityMaskNode(IBrush mask, Rect bounds, IDictionary<IVisual, Scene> childScenes = null)
: base(Rect.Empty, Matrix.Identity, null)
: base(Rect.Empty, Matrix.Identity)
{
Mask = mask?.ToImmutable();
MaskBounds = bounds;
@ -30,7 +30,7 @@ namespace Avalonia.Rendering.SceneGraph
/// opacity mask pop.
/// </summary>
public OpacityMaskNode()
: base(Rect.Empty, Matrix.Identity, null)
: base(Rect.Empty, Matrix.Identity)
{
}

2
src/Avalonia.Visuals/Rendering/SceneGraph/RectangleNode.cs

@ -28,7 +28,7 @@ namespace Avalonia.Rendering.SceneGraph
RoundedRect rect,
BoxShadows boxShadows,
IDictionary<IVisual, Scene> childScenes = null)
: base(boxShadows.TransformBounds(rect.Rect).Inflate((pen?.Thickness ?? 0) / 2), transform, pen)
: base(boxShadows.TransformBounds(rect.Rect).Inflate((pen?.Thickness ?? 0) / 2), transform)
{
Transform = transform;
Brush = brush?.ToImmutable();

2
src/Avalonia.Visuals/Rendering/SceneGraph/TextNode.cs

@ -24,7 +24,7 @@ namespace Avalonia.Rendering.SceneGraph
Point origin,
IFormattedTextImpl text,
IDictionary<IVisual, Scene> childScenes = null)
: base(text.Bounds.Translate(origin), transform, null)
: base(text.Bounds.Translate(origin), transform)
{
Transform = transform;
Foreground = foreground?.ToImmutable();

4
tests/Avalonia.Visuals.UnitTests/Rendering/SceneGraph/DrawOperationTests.cs

@ -77,7 +77,7 @@ namespace Avalonia.Visuals.UnitTests.Rendering.SceneGraph
private class TestRectangleDrawOperation : RectangleNode
{
public TestRectangleDrawOperation(Rect bounds, Matrix transform, Pen pen)
: base(transform, pen.Brush, pen, bounds, 0, 0)
: base(transform, pen.Brush, pen, bounds, new BoxShadows())
{
}
@ -90,7 +90,7 @@ namespace Avalonia.Visuals.UnitTests.Rendering.SceneGraph
private class TestDrawOperation : DrawOperation
{
public TestDrawOperation(Rect bounds, Matrix transform, Pen pen)
:base(bounds, transform, pen)
:base(bounds, transform)
{
}

Loading…
Cancel
Save