Browse Source

Merge branch 'master' into scenegraph

Conflicts:
	tests/Avalonia.RenderTests/Shapes/PathTests.cs
scenegraph-after-breakage
Steven Kirk 9 years ago
parent
commit
7e4f7cf11d
  1. 7
      src/Avalonia.Layout/Layoutable.cs
  2. 16
      src/Skia/Avalonia.Skia/DrawingContextImpl.cs
  3. 6
      tests/Avalonia.RenderTests/Controls/BorderTests.cs
  4. 9
      tests/Avalonia.RenderTests/Shapes/PathTests.cs
  5. 4
      tests/Avalonia.RenderTests/Shapes/PolygonTests.cs
  6. 4
      tests/Avalonia.RenderTests/Shapes/PolylineTests.cs

7
src/Avalonia.Layout/Layoutable.cs

@ -154,6 +154,11 @@ namespace Avalonia.Layout
VerticalAlignmentProperty);
}
/// <summary>
/// Occurs when a layout pass completes for the control.
/// </summary>
public event EventHandler LayoutUpdated;
/// <summary>
/// Gets or sets the width of the element.
/// </summary>
@ -357,6 +362,8 @@ namespace Avalonia.Layout
IsArrangeValid = true;
ArrangeCore(rect);
_previousArrange = rect;
LayoutUpdated?.Invoke(this, EventArgs.Empty);
}
}

16
src/Skia/Avalonia.Skia/DrawingContextImpl.cs

@ -182,9 +182,9 @@ namespace Avalonia.Skia
var end = linearGradient.EndPoint.ToPixels(targetSize).ToSKPoint();
// would be nice to cache these shaders possibly?
var shader = SKShader.CreateLinearGradient(start, end, stopColors, stopOffsets, tileMode);
paint.Shader = shader;
shader.Dispose();
using (var shader = SKShader.CreateLinearGradient(start, end, stopColors, stopOffsets, tileMode))
paint.Shader = shader;
}
else
{
@ -198,9 +198,9 @@ namespace Avalonia.Skia
//paint.setAlpha(128);
// would be nice to cache these shaders possibly?
var shader = SKShader.CreateRadialGradient(center, radius, stopColors, stopOffsets, tileMode);
paint.Shader = shader;
shader.Dispose();
using (var shader = SKShader.CreateRadialGradient(center, radius, stopColors, stopOffsets, tileMode))
paint.Shader = shader;
}
}
@ -271,8 +271,8 @@ namespace Avalonia.Skia
: tileBrush.TileMode == TileMode.FlipY || tileBrush.TileMode == TileMode.FlipXY
? SKShaderTileMode.Mirror
: SKShaderTileMode.Repeat;
paint.Shader = SKShader.CreateBitmap(bitmap.Bitmap, tileX, tileY, translation);
paint.Shader.Dispose();
using (var shader = SKShader.CreateBitmap(bitmap.Bitmap, tileX, tileY, translation))
paint.Shader = shader;
}
return rv;

6
tests/Avalonia.RenderTests/Controls/BorderTests.cs

@ -182,8 +182,6 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
#if AVALONIA_CAIRO
[Fact(Skip = "Font scaling currently broken on cairo")]
#elif AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for new FormattedText")]
#else
[Fact]
#endif
@ -339,8 +337,6 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
#if AVALONIA_CAIRO
[Fact(Skip = "Font scaling currently broken on cairo")]
#elif AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for new FormattedText")]
#else
[Fact]
#endif
@ -372,8 +368,6 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
#if AVALONIA_CAIRO
[Fact(Skip = "Font scaling currently broken on cairo")]
#elif AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for new FormattedText")]
#else
[Fact]
#endif

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

@ -300,11 +300,8 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
await RenderToFile(target);
CompareImages();
}
#if AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for https://github.com/mono/SkiaSharp/pull/63")]
#else
[Fact]
#endif
public async Task Path_Tick_Scaled()
{
Decorator target = new Decorator
@ -327,11 +324,7 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
CompareImages();
}
#if AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for https://github.com/mono/SkiaSharp/pull/63")]
#else
[Fact]
#endif
public async Task Path_Tick_Scaled_Stroke_8px()
{
Decorator target = new Decorator

4
tests/Avalonia.RenderTests/Shapes/PolygonTests.cs

@ -24,8 +24,6 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
#if AVALONIA_CAIRO
[Fact(Skip = "Caused by cairo bug")]
#elif AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for https://github.com/mono/SkiaSharp/pull/63")]
#else
[Fact]
#endif
@ -52,8 +50,6 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
#if AVALONIA_CAIRO
[Fact(Skip = "Caused by cairo bug")]
#elif AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for https://github.com/mono/SkiaSharp/pull/63")]
#else
[Fact]
#endif

4
tests/Avalonia.RenderTests/Shapes/PolylineTests.cs

@ -24,8 +24,6 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
#if AVALONIA_CAIRO
[Fact(Skip = "Caused by cairo bug")]
#elif AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for https://github.com/mono/SkiaSharp/pull/63")]
#else
[Fact]
#endif
@ -54,8 +52,6 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
#if AVALONIA_CAIRO
[Fact(Skip = "Caused by cairo bug")]
#elif AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for https://github.com/mono/SkiaSharp/pull/63")]
#else
[Fact]
#endif

Loading…
Cancel
Save