|
|
@ -142,24 +142,24 @@ namespace Avalonia.Win32.WinRT.Composition |
|
|
throw new RenderTargetCorruptedException(); |
|
|
throw new RenderTargetCorruptedException(); |
|
|
var transaction = _window.BeginTransaction(); |
|
|
var transaction = _window.BeginTransaction(); |
|
|
|
|
|
|
|
|
bool forceResize = false; |
|
|
bool needsEndDraw = false; |
|
|
var supportTransparency = _drawingSurface.AlphaMode == DirectXAlphaMode.Premultiplied; |
|
|
try |
|
|
if (_window.IsTransparency != supportTransparency) |
|
|
|
|
|
{ |
|
|
{ |
|
|
// Re-create the surface with correct alpha mode if the transparency support is not correct. This can happen when the transparency level is changed.
|
|
|
bool forceResize = false; |
|
|
_surface.Dispose(); |
|
|
var supportTransparency = _drawingSurface.AlphaMode == DirectXAlphaMode.Premultiplied; |
|
|
_surfaceInterop.Dispose(); |
|
|
if (_window.IsTransparency != supportTransparency) |
|
|
_drawingSurface.Dispose(); |
|
|
{ |
|
|
|
|
|
// Re-create the surface with correct alpha mode if the transparency support is not correct. This can happen when the transparency level is changed.
|
|
|
|
|
|
_surface.Dispose(); |
|
|
|
|
|
_surfaceInterop.Dispose(); |
|
|
|
|
|
_drawingSurface.Dispose(); |
|
|
|
|
|
|
|
|
CreateSurface(_window); |
|
|
CreateSurface(_window); |
|
|
|
|
|
|
|
|
// The _drawingSurface.Size != _size, so that require force resize to update the size of surface.
|
|
|
// The _drawingSurface.Size != _size, so that require force resize to update the size of surface.
|
|
|
forceResize = true; |
|
|
forceResize = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool needsEndDraw = false; |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
var size = _window.WindowInfo.Size; |
|
|
var size = _window.WindowInfo.Size; |
|
|
var scale = _window.WindowInfo.Scaling; |
|
|
var scale = _window.WindowInfo.Scaling; |
|
|
_window.ResizeIfNeeded(size); |
|
|
_window.ResizeIfNeeded(size); |
|
|
|