Skip to content

Commit

Permalink
Merge branch 'main' into dev/path-iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow authored Mar 30, 2021
2 parents 6da8aa7 + dabbd70 commit 735bebf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
10 changes: 6 additions & 4 deletions native/uwp/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});

Expand Down
15 changes: 15 additions & 0 deletions source/SkiaSharp.Views/SkiaSharp.Views.UWP/AngleSwapChainPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class AngleSwapChainPanel : SwapChainPanel

private bool enableRenderLoop;

private bool pendingSizeChange = false;

public AngleSwapChainPanel()
{
glesContext = null;
Expand Down Expand Up @@ -148,6 +150,8 @@ private static void OnVisibilityChanged(DependencyObject d, DependencyPropertyCh

private void OnCompositionChanged(SwapChainPanel sender, object args)
{
pendingSizeChange = true;

ContentsScale = CompositionScaleX;

DestroyRenderSurface();
Expand All @@ -157,6 +161,8 @@ private void OnCompositionChanged(SwapChainPanel sender, object args)

private void OnSizeChanged(object sender, SizeChangedEventArgs e)
{
pendingSizeChange = true;

EnsureRenderSurface();
Invalidate();
}
Expand Down Expand Up @@ -189,6 +195,15 @@ private void RenderFrame()
return;

glesContext.MakeCurrent();

if (pendingSizeChange)
{
pendingSizeChange = false;

if (!EnableRenderLoop)
glesContext.SwapBuffers();
}

glesContext.GetSurfaceDimensions(out var panelWidth, out var panelHeight);
glesContext.SetViewportSize(panelWidth, panelHeight);

Expand Down

0 comments on commit 735bebf

Please sign in to comment.