Browse Source

Merge branch 'master' into refactor/remove-interfaces

pull/9553/head
Max Katz 3 years ago
committed by GitHub
parent
commit
9825e51d73
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/Browser/Avalonia.Browser/Skia/BrowserSkiaGpuRenderSession.cs
  2. 5
      src/Skia/Avalonia.Skia/FramebufferRenderTarget.cs
  3. 2
      src/Skia/Avalonia.Skia/Gpu/OpenGl/FboSkiaSurface.cs
  4. 2
      src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs
  5. 2
      src/Skia/Avalonia.Skia/Gpu/OpenGl/OpenGlBitmapImpl.cs
  6. 4
      src/Skia/Avalonia.Skia/SurfaceRenderTarget.cs
  7. BIN
      tests/TestFiles/Skia/Controls/TextBlock/RestrictedHeight_VerticalAlign.expected.png

3
src/Browser/Avalonia.Browser/Skia/BrowserSkiaGpuRenderSession.cs

@ -9,7 +9,8 @@ namespace Avalonia.Browser.Skia
public BrowserSkiaGpuRenderSession(BrowserSkiaSurface browserSkiaSurface, GRBackendRenderTarget renderTarget)
{
_surface = SKSurface.Create(browserSkiaSurface.Context, renderTarget, browserSkiaSurface.Origin, browserSkiaSurface.ColorType);
_surface = SKSurface.Create(browserSkiaSurface.Context, renderTarget, browserSkiaSurface.Origin,
browserSkiaSurface.ColorType, new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal));
GrContext = browserSkiaSurface.Context;

5
src/Skia/Avalonia.Skia/FramebufferRenderTarget.cs

@ -90,7 +90,8 @@ namespace Avalonia.Skia
_currentFramebufferAddress = framebuffer.Address;
var surface = SKSurface.Create(desiredImageInfo, _currentFramebufferAddress, framebuffer.RowBytes);
var surface = SKSurface.Create(desiredImageInfo, _currentFramebufferAddress,
framebuffer.RowBytes, new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal));
// If surface cannot be created - try to create a compatibility shim first
if (surface == null)
@ -148,7 +149,7 @@ namespace Avalonia.Skia
$"Unable to create pixel format shim for conversion from {bitmapColorType} to {destinationInfo.ColorType}");
}
Surface = SKSurface.Create(_bitmap.Info, _bitmap.GetPixels(), _bitmap.RowBytes);
Surface = SKSurface.Create(_bitmap.Info, _bitmap.GetPixels(), _bitmap.RowBytes, new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal));
if (Surface == null)
{

2
src/Skia/Avalonia.Skia/Gpu/OpenGl/FboSkiaSurface.cs

@ -87,7 +87,7 @@ namespace Avalonia.Skia
var target = new GRBackendRenderTarget(pixelSize.Width, pixelSize.Height, 0, 8,
new GRGlFramebufferInfo((uint)_fbo, SKColorType.Rgba8888.ToGlSizedFormat()));
Surface = SKSurface.Create(_grContext, target,
surfaceOrigin, SKColorType.Rgba8888);
surfaceOrigin, SKColorType.Rgba8888, new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal));
CanBlit = gl.IsBlitFramebufferAvailable;
}

2
src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs

@ -91,7 +91,7 @@ namespace Avalonia.Skia
var renderTarget = new GRBackendRenderTarget(size.Width, size.Height, samples, disp.StencilSize, glInfo);
var surface = SKSurface.Create(_grContext, renderTarget,
glSession.IsYFlipped ? GRSurfaceOrigin.TopLeft : GRSurfaceOrigin.BottomLeft,
colorType);
colorType, new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal));
success = true;

2
src/Skia/Avalonia.Skia/Gpu/OpenGl/OpenGlBitmapImpl.cs

@ -42,7 +42,7 @@ namespace Avalonia.Skia
GlConsts.GL_TEXTURE_2D, (uint)_surface.GetTextureId(),
(uint)_surface.InternalFormat)))
using (var surface = SKSurface.Create(context.GrContext, backendTexture, GRSurfaceOrigin.BottomLeft,
SKColorType.Rgba8888))
SKColorType.Rgba8888, new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal)))
{
// Again, silently ignore, if something went wrong it's not our fault
if (surface == null)

4
src/Skia/Avalonia.Skia/SurfaceRenderTarget.cs

@ -77,8 +77,8 @@ namespace Avalonia.Skia
{
var imageInfo = MakeImageInfo(width, height, format);
if (gpu != null)
return SKSurface.Create(gpu, false, imageInfo);
return SKSurface.Create(imageInfo);
return SKSurface.Create(gpu, false, imageInfo, new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal));
return SKSurface.Create(imageInfo, new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal));
}
/// <inheritdoc />

BIN
tests/TestFiles/Skia/Controls/TextBlock/RestrictedHeight_VerticalAlign.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

After

Width:  |  Height:  |  Size: 518 B

Loading…
Cancel
Save