Browse Source

Merge branch 'master' into toplevels

pull/899/head
Nikita Tsukanov 9 years ago
parent
commit
75940e20d7
  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

@ -162,9 +162,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
{
@ -178,9 +178,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;
}
}
@ -209,8 +209,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

@ -181,8 +181,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
@ -338,8 +336,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
@ -371,8 +367,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

@ -299,11 +299,8 @@ namespace Avalonia.Direct2D1.RenderTests.Shapes
RenderToFile(target);
CompareImages();
}
#if AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "Waiting for https://github.com/mono/SkiaSharp/pull/63")]
#else
[Fact]
#endif
public void Path_Tick_Scaled()
{
Decorator target = new Decorator
@ -326,11 +323,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 void Path_Tick_Scaled_Stroke_8px()
{
Decorator target = new Decorator

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

@ -23,8 +23,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
@ -51,8 +49,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

@ -23,8 +23,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
@ -53,8 +51,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