Browse Source

Added tests data for Polyline and Polygon rendering.

pull/398/head
Ivan Kochurkin 10 years ago
parent
commit
d8bec31dd8
  1. 1
      src/Perspex.SceneGraph/Media/PolylineGeometry.cs
  2. 2
      src/Skia/Perspex.Skia/DrawingContextImpl.cs
  3. 8
      tests/Perspex.RenderTests/Shapes/PolygonTests.cs
  4. 8
      tests/Perspex.RenderTests/Shapes/PolylineTests.cs
  5. BIN
      tests/TestFiles/Cairo/Shapes/Polygon/Polygon_1px_Stroke.expected.png
  6. BIN
      tests/TestFiles/Cairo/Shapes/Polygon/Polygon_NonUniformFill.expected.png
  7. BIN
      tests/TestFiles/Cairo/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png
  8. BIN
      tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_1px_Stroke.expected.png
  9. BIN
      tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_NonUniformFill.expected.png
  10. BIN
      tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png
  11. BIN
      tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_1px_Stroke.expected.png
  12. BIN
      tests/TestFiles/Skia/Shapes/Polygon/Polygon_1px_Stroke.expected.png
  13. BIN
      tests/TestFiles/Skia/Shapes/Polygon/Polygon_NonUniformFill.expected.png
  14. BIN
      tests/TestFiles/Skia/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png
  15. BIN
      tests/TestFiles/Skia/Shapes/Polyline/Polyline_1px_Stroke.expected.png

1
src/Perspex.SceneGraph/Media/PolylineGeometry.cs

@ -69,7 +69,6 @@ namespace Perspex.Media
return new Rect(xMin, yMin, xMax - xMin, yMax - yMin);
}
}
public override Rect Bounds => PlatformImpl.Bounds;
/// <inheritdoc/>
public override Geometry Clone()

2
src/Skia/Perspex.Skia/DrawingContextImpl.cs

@ -111,7 +111,7 @@ namespace Perspex.Skia
{
var brush = CreateBrush(pen.Brush, targetSize);
brush.Brush->Stroke = true;
brush.Brush->StrokeThickness = (float)(pen.Thickness / ((Transform.M11 + Transform.M22) * 0.5));
brush.Brush->StrokeThickness = (float)pen.Thickness;
brush.Brush->StrokeLineCap = pen.StartLineCap;
brush.Brush->StrokeLineJoin = pen.LineJoin;
brush.Brush->StrokeMiterLimit = (float)pen.MiterLimit;

8
tests/Perspex.RenderTests/Shapes/PolygonTests.cs

@ -21,7 +21,11 @@ namespace Perspex.Direct2D1.RenderTests.Shapes
{
}
#if PERSPEX_CAIRO
[Fact(Skip = "Caused by cairo bug")]
#else
[Fact]
#endif
public void Polygon_1px_Stroke()
{
Decorator target = new Decorator
@ -43,7 +47,11 @@ namespace Perspex.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if PERSPEX_CAIRO
[Fact(Skip = "Caused by cairo bug")]
#else
[Fact]
#endif
public void Polygon_NonUniformFill()
{
Decorator target = new Decorator

8
tests/Perspex.RenderTests/Shapes/PolylineTests.cs

@ -21,7 +21,11 @@ namespace Perspex.Direct2D1.RenderTests.Shapes
{
}
#if PERSPEX_CAIRO
[Fact(Skip = "Caused by cairo bug")]
#else
[Fact]
#endif
public void Polyline_1px_Stroke()
{
var polylinePoints = new Point[] { new Point(0, 0), new Point(5, 0), new Point(6, -2), new Point(7, 3), new Point(8, -3),
@ -45,7 +49,11 @@ namespace Perspex.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if PERSPEX_CAIRO
[Fact(Skip = "Caused by cairo bug")]
#else
[Fact]
#endif
public void Polyline_10px_Stroke_PenLineJoin()
{
var polylinePoints = new Point[] { new Point(0, 0), new Point(5, 0), new Point(6, -2), new Point(7, 3), new Point(8, -3),

BIN
tests/TestFiles/Cairo/Shapes/Polygon/Polygon_1px_Stroke.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
tests/TestFiles/Cairo/Shapes/Polygon/Polygon_NonUniformFill.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
tests/TestFiles/Cairo/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_1px_Stroke.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_NonUniformFill.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_1px_Stroke.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
tests/TestFiles/Skia/Shapes/Polygon/Polygon_1px_Stroke.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
tests/TestFiles/Skia/Shapes/Polygon/Polygon_NonUniformFill.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
tests/TestFiles/Skia/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
tests/TestFiles/Skia/Shapes/Polyline/Polyline_1px_Stroke.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Loading…
Cancel
Save