Browse Source

Added tests data for Polyline and Polygon rendering.

Ivan Kochurkin 9 years ago
parent
commit
d8bec31dd8

+ 0 - 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()

+ 1 - 1
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 - 0
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 - 0
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


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


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


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


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


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


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


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


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


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


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