Browse Source

Merge branch 'relative-path-fixes' into binding-updates2

pull/691/head
Steven Kirk 10 years ago
parent
commit
c7c4eed53a
  1. 2
      samples/ControlCatalog/Pages/CanvasPage.xaml
  2. 17
      src/Windows/Avalonia.Direct2D1/Media/StreamGeometryContextImpl.cs
  3. 40
      tests/Avalonia.RenderTests/Shapes/PathTests.cs
  4. BIN
      tests/TestFiles/Cairo/Shapes/Path/Arc_Absolute.expected.png
  5. BIN
      tests/TestFiles/Cairo/Shapes/Path/Arc_Relative.expected.png
  6. BIN
      tests/TestFiles/Cairo/Shapes/Path/CubicBezier_Absolute.expected.png
  7. BIN
      tests/TestFiles/Cairo/Shapes/Path/CubicBezier_Relative.expected.png
  8. BIN
      tests/TestFiles/Cairo/Shapes/Path/HorizontalLine_Absolute.expected.png
  9. BIN
      tests/TestFiles/Cairo/Shapes/Path/HorizontalLine_Relative.expected.png
  10. BIN
      tests/TestFiles/Cairo/Shapes/Path/Line_Absolute.expected.png
  11. BIN
      tests/TestFiles/Cairo/Shapes/Path/VerticalLine_Absolute.expected.png
  12. BIN
      tests/TestFiles/Cairo/Shapes/Path/VerticalLine_Relative.expected.png
  13. BIN
      tests/TestFiles/Skia/Shapes/Path/Arc_Absolute.expected.png
  14. BIN
      tests/TestFiles/Skia/Shapes/Path/Arc_Relative.expected.png
  15. BIN
      tests/TestFiles/Skia/Shapes/Path/CubicBezier_Absolute.expected.png
  16. BIN
      tests/TestFiles/Skia/Shapes/Path/CubicBezier_Relative.expected.png
  17. BIN
      tests/TestFiles/Skia/Shapes/Path/HorizontalLine_Absolute.expected.png
  18. BIN
      tests/TestFiles/Skia/Shapes/Path/HorizontalLine_Relative.expected.png
  19. BIN
      tests/TestFiles/Skia/Shapes/Path/Line_Absolute.expected.png
  20. BIN
      tests/TestFiles/Skia/Shapes/Path/Line_Relative.expected.png
  21. BIN
      tests/TestFiles/Skia/Shapes/Path/VerticalLine_Absolute.expected.png
  22. BIN
      tests/TestFiles/Skia/Shapes/Path/VerticalLine_Relative.expected.png

2
samples/ControlCatalog/Pages/CanvasPage.xaml

@ -13,7 +13,7 @@
</LinearGradientBrush>
</Rectangle.OpacityMask> </Rectangle>
<Ellipse Fill="Green" Width="58" Height="58" Canvas.Left="88" Canvas.Top="100"/>
<Path Fill="Orange" Data="M 0,0 c 50,0 50,-50 c 50,0 50,50 h -50 v 50 l -50,-50 Z" Canvas.Left="30" Canvas.Top="250"/>
<Path Fill="Orange" Data="M 0,0 c 0,0 50,0 50,-50 c 0,0 50,0 50,50 h -50 v 50 l -50,-50 Z" Canvas.Left="30" Canvas.Top="250"/>
<Path Fill="OrangeRed" Canvas.Left="180" Canvas.Top="250">
<Path.Data>
<PathGeometry>

17
src/Windows/Avalonia.Direct2D1/Media/StreamGeometryContextImpl.cs

@ -6,6 +6,8 @@ using Avalonia.Platform;
using SharpDX.Direct2D1;
using SweepDirection = SharpDX.Direct2D1.SweepDirection;
using D2D = SharpDX.Direct2D1;
using Avalonia.Logging;
using System;
namespace Avalonia.Direct2D1.Media
{
@ -76,7 +78,20 @@ namespace Avalonia.Direct2D1.Media
public void Dispose()
{
_sink.Close();
// Put a catch around sink.Close as it may throw if there were an error e.g. parsing a path.
try
{
_sink.Close();
}
catch (Exception ex)
{
Logger.Error(
LogArea.Visual,
this,
"GeometrySink.Close exception: {Exception}",
ex);
}
_sink.Dispose();
}
}

40
tests/Avalonia.RenderTests/Shapes/PathTests.cs

@ -24,7 +24,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
{
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void Line_Absolute()
{
Decorator target = new Decorator
@ -45,7 +49,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void Line_Relative()
{
Decorator target = new Decorator
@ -66,7 +74,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void HorizontalLine_Absolute()
{
Decorator target = new Decorator
@ -87,7 +99,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void HorizontalLine_Relative()
{
Decorator target = new Decorator
@ -108,7 +124,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void VerticalLine_Absolute()
{
Decorator target = new Decorator
@ -129,7 +149,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void VerticalLine_Relative()
{
Decorator target = new Decorator
@ -150,7 +174,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void CubicBezier_Absolute()
{
Decorator target = new Decorator
@ -172,7 +200,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void CubicBezier_Relative()
{
Decorator target = new Decorator
@ -194,7 +226,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void Arc_Absolute()
{
Decorator target = new Decorator
@ -216,7 +252,11 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_CAIRO
[Fact(Skip = "Broken in Cairo: waiting for Skia")]
#else
[Fact]
#endif
public void Arc_Relative()
{
Decorator target = new Decorator

BIN
tests/TestFiles/Cairo/Shapes/Path/Arc_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
tests/TestFiles/Cairo/Shapes/Path/Arc_Relative.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
tests/TestFiles/Cairo/Shapes/Path/CubicBezier_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
tests/TestFiles/Cairo/Shapes/Path/CubicBezier_Relative.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
tests/TestFiles/Cairo/Shapes/Path/HorizontalLine_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
tests/TestFiles/Cairo/Shapes/Path/HorizontalLine_Relative.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
tests/TestFiles/Cairo/Shapes/Path/Line_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

BIN
tests/TestFiles/Cairo/Shapes/Path/VerticalLine_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

BIN
tests/TestFiles/Cairo/Shapes/Path/VerticalLine_Relative.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

BIN
tests/TestFiles/Skia/Shapes/Path/Arc_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
tests/TestFiles/Skia/Shapes/Path/Arc_Relative.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
tests/TestFiles/Skia/Shapes/Path/CubicBezier_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
tests/TestFiles/Skia/Shapes/Path/CubicBezier_Relative.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
tests/TestFiles/Skia/Shapes/Path/HorizontalLine_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
tests/TestFiles/Skia/Shapes/Path/HorizontalLine_Relative.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
tests/TestFiles/Skia/Shapes/Path/Line_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

BIN
tests/TestFiles/Skia/Shapes/Path/Line_Relative.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

BIN
tests/TestFiles/Skia/Shapes/Path/VerticalLine_Absolute.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

BIN
tests/TestFiles/Skia/Shapes/Path/VerticalLine_Relative.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Loading…
Cancel
Save