Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacato committed Mar 22, 2021
1 parent 94dcb31 commit 604a81d
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions AvaloniaGif/GifInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@
namespace AvaloniaGif
{
public class GifInstance : IDisposable
{
public Image TargetControl { get; set; }
{
public Stream Stream { get; private set; }
public IterationCount IterationCount { get; private set; }
public bool AutoStart { get; private set; } = true;
public Progress<int> Progress { get; private set; }

bool _streamCanDispose;
private GifDecoder _gifDecoder;
private GifBackgroundWorker _bgWorker;
private WriteableBitmap _targetBitmap;
private bool _hasNewFrame;
private bool _isDisposed;
private readonly object _bitmapSync = new object();
private static readonly object _globalUIThreadUpdateLock = new object();


public void SetSource(object newValue)
{
var sourceUri = newValue as Uri;
Expand Down Expand Up @@ -70,17 +68,7 @@ public void SetSource(object newValue)
}

public PixelSize GifPixelSize { get; private set; }

private void RenderTick(TimeSpan time)
{
if (_isDisposed | !_hasNewFrame) return;
lock (_globalUIThreadUpdateLock)
lock (_bitmapSync)
{
TargetControl?.InvalidateVisual();
}
}


public WriteableBitmap GetBitmap()
{
WriteableBitmap ret = null;
Expand Down

0 comments on commit 604a81d

Please sign in to comment.