зеркало из https://github.com/mono/SkiaSharp.git
Swap the buffers after a resize (#1668)
Swap the buffers after a resize to get the current buffer to be the new, correct size. Fixes #1377, #914, #722
This commit is contained in:
Родитель
1a779558b3
Коммит
dabbd7089d
|
@ -114,14 +114,16 @@ Task("ANGLE")
|
|||
{
|
||||
if (Skip(arch)) return;
|
||||
|
||||
var d = CONFIGURATION.ToLower() == "release" ? "" : "debug/";
|
||||
|
||||
RunProcess (vcpkg, $"install angle:{arch}-uwp");
|
||||
|
||||
var outDir = OUTPUT_PATH.Combine(arch);
|
||||
EnsureDirectoryExists(outDir);
|
||||
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/bin/libEGL.dll"), outDir);
|
||||
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/bin/libEGL.pdb"), outDir);
|
||||
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/bin/libGLESv2.dll"), outDir);
|
||||
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/bin/libGLESv2.pdb"), outDir);
|
||||
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/{d}bin/libEGL.dll"), outDir);
|
||||
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/{d}bin/libEGL.pdb"), outDir);
|
||||
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/{d}bin/libGLESv2.dll"), outDir);
|
||||
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/{d}bin/libGLESv2.pdb"), outDir);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@ namespace SkiaSharp.Views.UWP
|
|||
|
||||
private bool enableRenderLoop;
|
||||
|
||||
private bool pendingSizeChange = false;
|
||||
|
||||
public AngleSwapChainPanel()
|
||||
{
|
||||
glesContext = null;
|
||||
|
@ -148,6 +150,8 @@ namespace SkiaSharp.Views.UWP
|
|||
|
||||
private void OnCompositionChanged(SwapChainPanel sender, object args)
|
||||
{
|
||||
pendingSizeChange = true;
|
||||
|
||||
ContentsScale = CompositionScaleX;
|
||||
|
||||
DestroyRenderSurface();
|
||||
|
@ -157,6 +161,8 @@ namespace SkiaSharp.Views.UWP
|
|||
|
||||
private void OnSizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
pendingSizeChange = true;
|
||||
|
||||
EnsureRenderSurface();
|
||||
Invalidate();
|
||||
}
|
||||
|
@ -189,6 +195,15 @@ namespace SkiaSharp.Views.UWP
|
|||
return;
|
||||
|
||||
glesContext.MakeCurrent();
|
||||
|
||||
if (pendingSizeChange)
|
||||
{
|
||||
pendingSizeChange = false;
|
||||
|
||||
if (!EnableRenderLoop)
|
||||
glesContext.SwapBuffers();
|
||||
}
|
||||
|
||||
glesContext.GetSurfaceDimensions(out var panelWidth, out var panelHeight);
|
||||
glesContext.SetViewportSize(panelWidth, panelHeight);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче