|
@@ -23,33 +23,45 @@ namespace PixiEditor.DrawingApi.Skia.Implementations
|
|
|
|
|
|
public DrawingSurface Create(ImageInfo imageInfo, IntPtr pixels, int rowBytes)
|
|
|
{
|
|
|
- throw new NotImplementedException();
|
|
|
+ SKSurface skSurface = SKSurface.Create(imageInfo.ToSkImageInfo(), pixels, rowBytes);
|
|
|
+ DrawingSurface surface = new DrawingSurface(skSurface.Handle);
|
|
|
+ ManagedInstances[skSurface.Handle] = skSurface;
|
|
|
+ return surface;
|
|
|
}
|
|
|
|
|
|
public bool ReadPixels(DrawingSurface drawingSurface, ImageInfo dstInfo, IntPtr dstPixels, int dstRowBytes, int srcX,
|
|
|
int srcY)
|
|
|
{
|
|
|
- throw new NotImplementedException();
|
|
|
+ return ManagedInstances[drawingSurface.ObjectPointer]
|
|
|
+ .ReadPixels(dstInfo.ToSkImageInfo(), dstPixels, dstRowBytes, srcX, srcY);
|
|
|
}
|
|
|
|
|
|
public void Draw(DrawingSurface drawingSurface, Canvas surfaceToDraw, int x, int y, Paint drawingPaint)
|
|
|
{
|
|
|
- throw new NotImplementedException();
|
|
|
+ ManagedInstances[drawingSurface.ObjectPointer].Draw(surfaceToDraw, x, y, drawingPaint);
|
|
|
}
|
|
|
|
|
|
public DrawingSurface Create(ImageInfo imageInfo, IntPtr pixelBuffer)
|
|
|
{
|
|
|
- throw new NotImplementedException();
|
|
|
+ SKSurface skSurface = SKSurface.Create(imageInfo.ToSkImageInfo(), pixelBuffer);
|
|
|
+ DrawingSurface surface = new DrawingSurface(skSurface.Handle);
|
|
|
+ ManagedInstances[skSurface.Handle] = skSurface;
|
|
|
+ return surface;
|
|
|
}
|
|
|
|
|
|
public DrawingSurface Create(Pixmap pixmap)
|
|
|
{
|
|
|
- throw new NotImplementedException();
|
|
|
+ SKSurface skSurface = SKSurface.Create(pixmap);
|
|
|
+ DrawingSurface surface = new DrawingSurface(skSurface.Handle);
|
|
|
+ ManagedInstances[skSurface.Handle] = skSurface;
|
|
|
}
|
|
|
|
|
|
public DrawingSurface Create(ImageInfo imageInfo)
|
|
|
{
|
|
|
- throw new NotImplementedException();
|
|
|
+ SKSurface skSurface = SKSurface.Create(imageInfo.ToSkImageInfo());
|
|
|
+ DrawingSurface surface = new DrawingSurface(skSurface.Handle);
|
|
|
+ ManagedInstances[skSurface.Handle] = skSurface;
|
|
|
+ return surface;
|
|
|
}
|
|
|
}
|
|
|
}
|