зеркало из https://github.com/mono/SkiaSharp.git
[macOS] Use NeedsDisplay instead of Display (#1475)
This will prevent the double paint found in #1467
This commit is contained in:
Родитель
d0562fc3d7
Коммит
2e83c18263
|
@ -44,7 +44,11 @@ namespace SkiaSharp.Views.Forms
|
|||
if (oneShot)
|
||||
{
|
||||
var nativeView = Control;
|
||||
nativeView?.BeginInvokeOnMainThread(() => nativeView?.Display());
|
||||
nativeView?.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
if (nativeView != null)
|
||||
nativeView.NeedsDisplay = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -56,7 +60,11 @@ namespace SkiaSharp.Views.Forms
|
|||
var formsView = Element;
|
||||
|
||||
// redraw the view
|
||||
nativeView?.BeginInvokeOnMainThread(() => nativeView?.Display());
|
||||
nativeView?.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
if (nativeView != null)
|
||||
nativeView.NeedsDisplay = true;
|
||||
});
|
||||
|
||||
// stop the render loop if this was a one-shot, or the views are disposed
|
||||
if (nativeView == null || formsView == null || !formsView.HasRenderLoop)
|
||||
|
|
|
@ -69,7 +69,11 @@ namespace SkiaSharp.Views.UWP
|
|||
displayLink.SetOutputCallback(delegate
|
||||
{
|
||||
// redraw the view
|
||||
glView?.BeginInvokeOnMainThread(() => glView?.Display());
|
||||
glView?.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
if (glView != null)
|
||||
glView.NeedsDisplay = true;
|
||||
});
|
||||
|
||||
// stop the render loop if it has been disabled or the views are disposed
|
||||
if (glView == null || !EnableRenderLoop)
|
||||
|
|
Загрузка…
Ссылка в новой задаче