Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Equbuxu committed Sep 29, 2021
1 parent 9b10d6f commit 4298c3a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 38 deletions.
18 changes: 0 additions & 18 deletions PixiEditor/Models/DataHolders/Surface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,6 @@ public SKColor GetSRGBPixel(int x, int y)
SkiaSurface.ReadPixels(imageInfo, dstpixels, imageInfo.RowBytes, x, y);
return bitmap.GetPixel(0, 0);
}
/*
public FloatColor GetFloatPixel(int x, int y)
{
var imageInfo = new SKImageInfo(1, 1, SKColorType.RgbaF32, SKAlphaType.Unpremul);
var buffer = Marshal.AllocHGlobal(16);
try
{
using SKSurface dstSurface = SKSurface.Create(imageInfo, buffer, 16);
SkiaSurface.Draw(dstSurface.Canvas, -x, -y, ReplacingPaint);
float[] output = new float[4];
Marshal.Copy(buffer, output, 0, 4);
return new FloatColor(output[0], output[1], output[2], output[3]);
}
finally
{
Marshal.FreeHGlobal(buffer);
}
}*/

public void SetSRGBPixel(int x, int y, SKColor color)
{
Expand Down
10 changes: 0 additions & 10 deletions PixiEditor/Models/Layers/Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -597,19 +597,9 @@ private void ResetOffset(BitmapPixelChanges pixels)
/// </summary>
private void ResizeCanvas(int offsetX, int offsetY, int offsetXSrc, int offsetYSrc, int newWidth, int newHeight)
{
int iteratorHeight = Height > newHeight ? newHeight : Height;
int count = Width > newWidth ? newWidth : Width;

Surface result = new Surface(newWidth, newHeight);

LayerBitmap.SkiaSurface.Draw(result.SkiaSurface.Canvas, offsetX - offsetXSrc, offsetY - offsetYSrc, Surface.ReplacingPaint);
/*for (int line = 0; line < iteratorHeight; line++)
{
int srcOff = (((offsetYSrc + line) * Width) + offsetXSrc) * SizeOfArgb;
int dstOff = (((offsetY + line) * newWidth) + offsetX) * SizeOfArgb;
BitmapContext.BlockCopy(srcContext, srcOff, destContext, dstOff, count * SizeOfArgb);
}*/

LayerBitmap = result;
Width = newWidth;
Height = newHeight;
Expand Down
10 changes: 0 additions & 10 deletions PixiEditor/Views/UserControls/PlainLayerView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public PlainLayerView()
{
InitializeComponent();
SizeChanged += OnControlSizeChanged;
Unloaded += OnControlUnloaded;
}

private static void OnLayerChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
Expand Down Expand Up @@ -51,15 +50,6 @@ private void Update()
renderer.Draw(TargetLayer.LayerBitmap, (byte)(TargetLayer.Opacity * 255));
}

private void OnControlUnloaded(object sender, RoutedEventArgs e)
{
/*
if (LogicalTreeHelper.GetParent(this) != null)
return;
renderer?.Dispose();
TargetLayer.LayerBitmapChanged -= OnLayerBitmapChanged;*/
}

private void OnControlSizeChanged(object sender, SizeChangedEventArgs e)
{
if (TargetLayer == null)
Expand Down

0 comments on commit 4298c3a

Please sign in to comment.