Browse Source

Merge branch 'master' into scenegraph

Conflicts:
	tests/Avalonia.RenderTests/Shapes/PathTests.cs
scenegraph-after-breakage
Steven Kirk 10 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); VerticalAlignmentProperty);
} }
/// <summary>
/// Occurs when a layout pass completes for the control.
/// </summary>
public event EventHandler LayoutUpdated;
/// <summary> /// <summary>
/// Gets or sets the width of the element. /// Gets or sets the width of the element.
/// </summary> /// </summary>
@ -357,6 +362,8 @@ namespace Avalonia.Layout
IsArrangeValid = true; IsArrangeValid = true;
ArrangeCore(rect); ArrangeCore(rect);
_previousArrange = 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(); var end = linearGradient.EndPoint.ToPixels(targetSize).ToSKPoint();
// would be nice to cache these shaders possibly? // would be nice to cache these shaders possibly?
var shader = SKShader.CreateLinearGradient(start, end, stopColors, stopOffsets, tileMode); using (var shader = SKShader.CreateLinearGradient(start, end, stopColors, stopOffsets, tileMode))
paint.Shader = shader; paint.Shader = shader;
shader.Dispose();
} }
else else
{ {
@ -198,9 +198,9 @@ namespace Avalonia.Skia
//paint.setAlpha(128); //paint.setAlpha(128);
// would be nice to cache these shaders possibly? // would be nice to cache these shaders possibly?
var shader = SKShader.CreateRadialGradient(center, radius, stopColors, stopOffsets, tileMode); using (var shader = SKShader.CreateRadialGradient(center, radius, stopColors, stopOffsets, tileMode))
paint.Shader = shader; paint.Shader = shader;
shader.Dispose();
} }
} }
@ -271,8 +271,8 @@ namespace Avalonia.Skia
: tileBrush.TileMode == TileMode.FlipY || tileBrush.TileMode == TileMode.FlipXY : tileBrush.TileMode == TileMode.FlipY || tileBrush.TileMode == TileMode.FlipXY
? SKShaderTileMode.Mirror ? SKShaderTileMode.Mirror
: SKShaderTileMode.Repeat; : SKShaderTileMode.Repeat;
paint.Shader = SKShader.CreateBitmap(bitmap.Bitmap, tileX, tileY, translation); using (var shader = SKShader.CreateBitmap(bitmap.Bitmap, tileX, tileY, translation))
paint.Shader.Dispose(); paint.Shader = shader;
} }
return rv; return rv;

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

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

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

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

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

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

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

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

Loading…
Cancel
Save