Windows 0.3.1 clean monitor source delta; no private history or other platform changes
This commit is contained in:
+17
-8
@@ -188,14 +188,23 @@ internal sealed class ScenicPanel : Panel
|
||||
if (_loginBackdrop is null || _loginBackdrop.Size != ClientSize
|
||||
|| _loginBackdropDpi != DeviceDpi || _loginBackdropFooter != FooterArtwork)
|
||||
{
|
||||
using var next = new Bitmap(Width, Height);
|
||||
using (var graphics = Graphics.FromImage(next))
|
||||
ScenicTheme.Backdrop(graphics, ClientSize, DeviceDpi, footer: FooterArtwork, login: true);
|
||||
var previous = _loginBackdrop;
|
||||
_loginBackdrop = new Bitmap(next);
|
||||
_loginBackdropDpi = DeviceDpi;
|
||||
_loginBackdropFooter = FooterArtwork;
|
||||
previous?.Dispose();
|
||||
Bitmap? next = null;
|
||||
try
|
||||
{
|
||||
next = new Bitmap(Width, Height);
|
||||
using (var graphics = Graphics.FromImage(next))
|
||||
ScenicTheme.Backdrop(graphics, ClientSize, DeviceDpi, footer: FooterArtwork, login: true);
|
||||
// Transfer the completed bitmap rather than copying the whole
|
||||
// canvas on the UI thread. A failed render leaves the previous
|
||||
// cache owned and intact; only the incomplete replacement dies.
|
||||
var previous = _loginBackdrop;
|
||||
_loginBackdrop = next;
|
||||
next = null;
|
||||
_loginBackdropDpi = DeviceDpi;
|
||||
_loginBackdropFooter = FooterArtwork;
|
||||
previous?.Dispose();
|
||||
}
|
||||
finally { next?.Dispose(); }
|
||||
}
|
||||
e.Graphics.DrawImageUnscaled(_loginBackdrop, Point.Empty);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user