Browse Source

More implementations

flabbet 2 years ago
parent
commit
c076778a0f

+ 1 - 0
src/PixiEditor.DrawingApi.Core/Bridge/Operations/ICanvasImplementation.cs

@@ -32,5 +32,6 @@ namespace PixiEditor.DrawingApi.Core.Bridge.Operations
         public void RotateRadians(IntPtr objPtr, float radians, float centerX, float centerY);
         public void RotateRadians(IntPtr objPtr, float radians, float centerX, float centerY);
         public void DrawImage(IntPtr objPtr, Image image, RectD rect, Paint paint);
         public void DrawImage(IntPtr objPtr, Image image, RectD rect, Paint paint);
         public void DrawBitmap(IntPtr objPtr, Bitmap bitmap, int x, int y);
         public void DrawBitmap(IntPtr objPtr, Bitmap bitmap, int x, int y);
+        public void Dispose(IntPtr objectPointer);
     }
     }
 }
 }

+ 40 - 27
src/PixiEditor.DrawingApi.Core/Surface/Canvas.cs

@@ -1,4 +1,5 @@
-using PixiEditor.DrawingApi.Core.Bridge;
+using System;
+using PixiEditor.DrawingApi.Core.Bridge;
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface.ImageData;
 using PixiEditor.DrawingApi.Core.Surface.ImageData;
@@ -6,13 +7,19 @@ using PixiEditor.DrawingApi.Core.Surface.Vector;
 
 
 namespace PixiEditor.DrawingApi.Core.Surface
 namespace PixiEditor.DrawingApi.Core.Surface
 {
 {
-    public class Canvas
+    public class Canvas : NativeObject
     {
     {
+        
+        internal Canvas(IntPtr objPtr) : base(objPtr)
+        {
+        }
+        
         public void DrawPixel(VecI position, Paint drawingPaint) => DrawPixel(position.X, position.Y, drawingPaint);
         public void DrawPixel(VecI position, Paint drawingPaint) => DrawPixel(position.X, position.Y, drawingPaint);
-        public void DrawPixel(int posX, int posY, Paint drawingPaint) => DrawingBackendApi.Current.CanvasImplementation.DrawPixel(posX, posY, drawingPaint);
+        public void DrawPixel(int posX, int posY, Paint drawingPaint) => 
+            DrawingBackendApi.Current.CanvasImplementation.DrawPixel(ObjectPointer, posX, posY, drawingPaint);
 
 
         public void DrawSurface(DrawingSurface original, int x, int y, Paint? paint) 
         public void DrawSurface(DrawingSurface original, int x, int y, Paint? paint) 
-            => DrawingBackendApi.Current.CanvasImplementation.DrawSurface(original, x, y, paint);
+            => DrawingBackendApi.Current.CanvasImplementation.DrawSurface(ObjectPointer, original, x, y, paint);
         
         
         public void DrawSurface(DrawingSurface original, int x, int y) => DrawSurface(original, x, y, null);
         public void DrawSurface(DrawingSurface original, int x, int y) => DrawSurface(original, x, y, null);
         
         
@@ -21,30 +28,31 @@ namespace PixiEditor.DrawingApi.Core.Surface
             DrawSurface(surfaceToDraw, size.X, size.Y, paint);
             DrawSurface(surfaceToDraw, size.X, size.Y, paint);
         }
         }
 
 
-        public void DrawImage(Image image, int x, int y) => DrawingBackendApi.Current.CanvasImplementation.DrawImage(image, x, y);
+        public void DrawImage(Image image, int x, int y) => DrawingBackendApi.Current.CanvasImplementation.DrawImage(ObjectPointer, image, x, y);
         
         
-        public void DrawImage(Image image, RectD rect, Paint paint) => DrawingBackendApi.Current.CanvasImplementation.DrawImage(image, rect, paint);
+        public void DrawImage(Image image, RectD rect, Paint paint) => 
+            DrawingBackendApi.Current.CanvasImplementation.DrawImage(ObjectPointer, image, rect, paint);
 
 
         public int Save()
         public int Save()
         {
         {
-            return DrawingBackendApi.Current.CanvasImplementation.Save();
+            return DrawingBackendApi.Current.CanvasImplementation.Save(ObjectPointer);
         }
         }
 
 
         public void Restore()
         public void Restore()
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.Restore();
+            DrawingBackendApi.Current.CanvasImplementation.Restore(ObjectPointer);
         }
         }
         
         
-        public void Scale(float s) => DrawingBackendApi.Current.CanvasImplementation.Scale(s, s);
+        public void Scale(float s) => DrawingBackendApi.Current.CanvasImplementation.Scale(ObjectPointer, s, s);
 
 
         /// <param name="sx">The amount to scale in the x-direction.</param>
         /// <param name="sx">The amount to scale in the x-direction.</param>
         /// <param name="sy">The amount to scale in the y-direction.</param>
         /// <param name="sy">The amount to scale in the y-direction.</param>
         /// <summary>Pre-concatenates the current matrix with the specified scale.</summary>
         /// <summary>Pre-concatenates the current matrix with the specified scale.</summary>
-        public void Scale(float sx, float sy) => DrawingBackendApi.Current.CanvasImplementation.Scale(sx, sy);
+        public void Scale(float sx, float sy) => DrawingBackendApi.Current.CanvasImplementation.Scale(ObjectPointer, sx, sy);
 
 
         /// <param name="size">The amount to scale.</param>
         /// <param name="size">The amount to scale.</param>
         /// <summary>Pre-concatenates the current matrix with the specified scale.</summary>
         /// <summary>Pre-concatenates the current matrix with the specified scale.</summary>
-        public void Scale(Point size) => DrawingBackendApi.Current.CanvasImplementation.Scale(size.X, size.Y);
+        public void Scale(Point size) => DrawingBackendApi.Current.CanvasImplementation.Scale(ObjectPointer, size.X, size.Y);
 
 
         /// <param name="sx">The amount to scale in the x-direction.</param>
         /// <param name="sx">The amount to scale in the x-direction.</param>
         /// <param name="sy">The amount to scale in the y-direction.</param>
         /// <param name="sy">The amount to scale in the y-direction.</param>
@@ -60,29 +68,29 @@ namespace PixiEditor.DrawingApi.Core.Surface
 
 
         public void Translate(float translationX, float translationY)
         public void Translate(float translationX, float translationY)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.Translate(translationX, translationY);
+            DrawingBackendApi.Current.CanvasImplementation.Translate(ObjectPointer, translationX, translationY);
         }
         }
         
         
         public void Translate(VecD vector) => Translate((float)vector.X, (float)vector.Y);
         public void Translate(VecD vector) => Translate((float)vector.X, (float)vector.Y);
 
 
         public void DrawPath(VectorPath path, Paint paint)
         public void DrawPath(VectorPath path, Paint paint)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.DrawPath(path, paint);
+            DrawingBackendApi.Current.CanvasImplementation.DrawPath(ObjectPointer, path, paint);
         }
         }
         
         
         public void DrawPoint(VecI pos, Paint paint)
         public void DrawPoint(VecI pos, Paint paint)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.DrawPoint(pos, paint);
+            DrawingBackendApi.Current.CanvasImplementation.DrawPoint(ObjectPointer, pos, paint);
         }
         }
 
 
         public void DrawPoints(PointMode pointMode, Point[] points, Paint paint)
         public void DrawPoints(PointMode pointMode, Point[] points, Paint paint)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.DrawPoints(pointMode, points, paint);
+            DrawingBackendApi.Current.CanvasImplementation.DrawPoints(ObjectPointer, pointMode, points, paint);
         }
         }
 
 
         public void DrawRect(int x, int y, int width, int height, Paint paint)
         public void DrawRect(int x, int y, int width, int height, Paint paint)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.DrawRect(x, y, width, height, paint);
+            DrawingBackendApi.Current.CanvasImplementation.DrawRect(ObjectPointer, x, y, width, height, paint);
         }
         }
         
         
         public void DrawRect(RectI rect, Paint paint) => DrawRect(rect.X, rect.Y, rect.Width, rect.Height, paint);
         public void DrawRect(RectI rect, Paint paint) => DrawRect(rect.X, rect.Y, rect.Width, rect.Height, paint);
@@ -94,57 +102,62 @@ namespace PixiEditor.DrawingApi.Core.Surface
         
         
         public void ClipPath(VectorPath clipPath, ClipOperation clipOperation, bool antialias)
         public void ClipPath(VectorPath clipPath, ClipOperation clipOperation, bool antialias)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.ClipPath(clipPath, clipOperation, antialias);
+            DrawingBackendApi.Current.CanvasImplementation.ClipPath(ObjectPointer, clipPath, clipOperation, antialias);
         }
         }
 
 
         public void ClipRect(RectD rect, ClipOperation clipOperation = ClipOperation.Intersect)
         public void ClipRect(RectD rect, ClipOperation clipOperation = ClipOperation.Intersect)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.ClipRect(rect, clipOperation);
+            DrawingBackendApi.Current.CanvasImplementation.ClipRect(ObjectPointer, rect, clipOperation);
         }
         }
 
 
         public void Clear()
         public void Clear()
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.Clear();
+            DrawingBackendApi.Current.CanvasImplementation.Clear(ObjectPointer);
         }
         }
         
         
         public void Clear(Color color)
         public void Clear(Color color)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.Clear(color);
+            DrawingBackendApi.Current.CanvasImplementation.Clear(ObjectPointer, color);
         }
         }
 
 
         public void DrawLine(VecI from, VecI to, Paint paint)
         public void DrawLine(VecI from, VecI to, Paint paint)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.DrawLine(from, to, paint);
+            DrawingBackendApi.Current.CanvasImplementation.DrawLine(ObjectPointer, from, to, paint);
         }
         }
 
 
         public void Flush()
         public void Flush()
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.Flush();
+            DrawingBackendApi.Current.CanvasImplementation.Flush(ObjectPointer);
         }
         }
 
 
         public void SetMatrix(Matrix3X3 finalMatrix)
         public void SetMatrix(Matrix3X3 finalMatrix)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.SetMatrix(finalMatrix);
+            DrawingBackendApi.Current.CanvasImplementation.SetMatrix(ObjectPointer, finalMatrix);
         }
         }
 
 
         public void RestoreToCount(int count)
         public void RestoreToCount(int count)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.RestoreToCount(count);
+            DrawingBackendApi.Current.CanvasImplementation.RestoreToCount(ObjectPointer, count);
         }
         }
 
 
         public void DrawColor(Color color, BlendMode paintBlendMode)
         public void DrawColor(Color color, BlendMode paintBlendMode)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.DrawColor(color, paintBlendMode);
+            DrawingBackendApi.Current.CanvasImplementation.DrawColor(ObjectPointer, color, paintBlendMode);
         }
         }
 
 
         public void RotateRadians(float dataAngle, float centerX, float centerY)
         public void RotateRadians(float dataAngle, float centerX, float centerY)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.RotateRadians(dataAngle, centerX, centerY);
+            DrawingBackendApi.Current.CanvasImplementation.RotateRadians(ObjectPointer, dataAngle, centerX, centerY);
         }
         }
 
 
         public void DrawBitmap(Bitmap bitmap, int x, int y)
         public void DrawBitmap(Bitmap bitmap, int x, int y)
         {
         {
-            DrawingBackendApi.Current.CanvasImplementation.DrawBitmap(bitmap, x, y);
+            DrawingBackendApi.Current.CanvasImplementation.DrawBitmap(ObjectPointer, bitmap, x, y);
+        }
+
+        public override void Dispose()
+        {
+            DrawingBackendApi.Current.CanvasImplementation.Dispose(ObjectPointer);
         }
         }
     }
     }
 }
 }

+ 6 - 1
src/PixiEditor.DrawingApi.Core/Surface/Vector/VectorPath.cs

@@ -1,4 +1,5 @@
-using PixiEditor.DrawingApi.Core.Bridge;
+using System;
+using PixiEditor.DrawingApi.Core.Bridge;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Numerics;
 
 
 namespace PixiEditor.DrawingApi.Core.Surface.Vector;
 namespace PixiEditor.DrawingApi.Core.Surface.Vector;
@@ -46,6 +47,10 @@ public class VectorPath : NativeObject
 
 
     public bool IsEmpty => VerbCount == 0;
     public bool IsEmpty => VerbCount == 0;
     public RectD Bounds => DrawingBackendApi.Current.PathImplementation.GetBounds(this);
     public RectD Bounds => DrawingBackendApi.Current.PathImplementation.GetBounds(this);
+    
+    public VectorPath(IntPtr nativePointer) : base(nativePointer)
+    {
+    }
 
 
     public VectorPath() : base(DrawingBackendApi.Current.PathImplementation.Create())
     public VectorPath() : base(DrawingBackendApi.Current.PathImplementation.Create())
     {
     {

+ 3 - 1
src/PixiEditor.DrawingApi.Skia/CastUtility.cs

@@ -9,10 +9,12 @@ namespace PixiEditor.DrawingApi.Skia
             unsafe
             unsafe
             {
             {
                 T2[] target = new T2[source.Length];
                 T2[] target = new T2[source.Length];
-                fixed (int* p = &target)
+                fixed (void* p = &target)
                 {
                 {
                     Unsafe.Copy(p, ref source);
                     Unsafe.Copy(p, ref source);
                 }
                 }
+                
+                return target;
             }
             }
         }
         }
     }
     }

+ 22 - 0
src/PixiEditor.DrawingApi.Skia/ConversionExtensions.cs

@@ -1,5 +1,6 @@
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Numerics;
+using PixiEditor.DrawingApi.Core.Surface;
 using SkiaSharp;
 using SkiaSharp;
 
 
 namespace PixiEditor.DrawingApi.Skia
 namespace PixiEditor.DrawingApi.Skia
@@ -15,5 +16,26 @@ namespace PixiEditor.DrawingApi.Skia
         {
         {
             return new SKColor(color.R, color.G, color.B, color.A);
             return new SKColor(color.R, color.G, color.B, color.A);
         }
         }
+
+        public static SKMatrix ToSkMatrix(this Matrix3X3 matrix)
+        {
+            return new SKMatrix(matrix.ScaleX, matrix.SkewX, matrix.TransX, matrix.SkewY, 
+                matrix.ScaleY, matrix.TransY, matrix.Persp0, matrix.Persp1, matrix.Persp2);
+        }
+        
+        public static SKPoint ToSkPoint(this Point vector)
+        {
+            return new SKPoint(vector.X, vector.Y);
+        }
+        
+        public static SKRect ToSkRect(this RectD rect)
+        {
+            return new SKRect((float)rect.Left, (float)rect.Top, (float)rect.Right, (float)rect.Bottom);
+        }
+        
+        public static SKRect ToSkRect(this RectI rect)
+        {
+            return new SKRect(rect.Left, rect.Top, rect.Right, rect.Bottom);
+        }
     }
     }
 }
 }

+ 10 - 1
src/PixiEditor.DrawingApi.Skia/Implementations/SkiaCanvasImplementation.cs

@@ -17,9 +17,13 @@ namespace PixiEditor.DrawingApi.Skia.Implementations
         private readonly SkObjectImplementation<SKBitmap> _bitmapImpl;
         private readonly SkObjectImplementation<SKBitmap> _bitmapImpl;
         private readonly SkObjectImplementation<SKPath> _pathImpl;
         private readonly SkObjectImplementation<SKPath> _pathImpl;
 
 
-        public SkiaCanvasImplementation(SkObjectImplementation<SKPaint> paintImpl)
+        public SkiaCanvasImplementation(SkObjectImplementation<SKPaint> paintImpl, SkObjectImplementation<SKSurface> surfaceImpl, SkObjectImplementation<SKImage> imageImpl, SkObjectImplementation<SKBitmap> bitmapImpl, SkObjectImplementation<SKPath> pathImpl)
         {
         {
             _paintImpl = paintImpl;
             _paintImpl = paintImpl;
+            _surfaceImpl = surfaceImpl;
+            _imageImpl = imageImpl;
+            _bitmapImpl = bitmapImpl;
+            _pathImpl = pathImpl;
         }
         }
         
         
         public void DrawPixel(IntPtr objectPointer, int posX, int posY, Paint drawingPaint)
         public void DrawPixel(IntPtr objectPointer, int posX, int posY, Paint drawingPaint)
@@ -156,5 +160,10 @@ namespace PixiEditor.DrawingApi.Skia.Implementations
         {
         {
             ManagedInstances[objPtr].DrawBitmap(_bitmapImpl[bitmap.ObjectPointer], x, y);
             ManagedInstances[objPtr].DrawBitmap(_bitmapImpl[bitmap.ObjectPointer], x, y);
         }
         }
+
+        public void Dispose(IntPtr objectPointer)
+        {
+            ManagedInstances[objectPointer].Dispose();
+        }
     }
     }
 }
 }

+ 150 - 0
src/PixiEditor.DrawingApi.Skia/Implementations/SkiaPathImplementation.cs

@@ -0,0 +1,150 @@
+using System;
+using PixiEditor.DrawingApi.Core.Bridge.NativeObjectsImpl;
+using PixiEditor.DrawingApi.Core.Numerics;
+using PixiEditor.DrawingApi.Core.Surface;
+using PixiEditor.DrawingApi.Core.Surface.Vector;
+using SkiaSharp;
+
+namespace PixiEditor.DrawingApi.Skia.Implementations
+{
+    public class SkiaPathImplementation : SkObjectImplementation<SKPath>, IVectorPathImplementation
+    {
+        public PathFillType GetFillType(VectorPath path)
+        {
+            return (PathFillType)ManagedInstances[path.ObjectPointer].FillType;
+        }
+
+        public void SetFillType(VectorPath path, PathFillType fillType)
+        {
+            ManagedInstances[path.ObjectPointer].FillType = (SKPathFillType)fillType;
+        }
+
+        public PathConvexity GetConvexity(VectorPath path)
+        {
+            return (PathConvexity)ManagedInstances[path.ObjectPointer].Convexity;
+        }
+
+        public void SetConvexity(VectorPath path, PathConvexity convexity)
+        {
+            ManagedInstances[path.ObjectPointer].Convexity = (SKPathConvexity)convexity;
+        }
+
+        public void Dispose(VectorPath path)
+        {
+            ManagedInstances[path.ObjectPointer].Dispose();
+        }
+
+        public bool IsPathOval(VectorPath path)
+        {
+            return ManagedInstances[path.ObjectPointer].IsOval;
+        }
+
+        public bool IsRoundRect(VectorPath path)
+        {
+            return ManagedInstances[path.ObjectPointer].IsRoundRect;
+        }
+
+        public bool IsLine(VectorPath path)
+        {
+            return ManagedInstances[path.ObjectPointer].IsLine;
+        }
+
+        public bool IsRect(VectorPath path)
+        {
+            return ManagedInstances[path.ObjectPointer].IsRect;
+        }
+
+        public PathSegmentMask GetSegmentMasks(VectorPath path)
+        {
+            return (PathSegmentMask)ManagedInstances[path.ObjectPointer].SegmentMasks;
+        }
+
+        public int GetVerbCount(VectorPath path)
+        {
+            return ManagedInstances[path.ObjectPointer].VerbCount;
+        }
+
+        public int GetPointCount(VectorPath path)
+        {
+            return ManagedInstances[path.ObjectPointer].PointCount;
+        }
+
+        public IntPtr Create()
+        {
+            SKPath path = new SKPath();
+            ManagedInstances[path.Handle] = path;
+            return path.Handle;
+        }
+
+        public IntPtr Clone(VectorPath other)
+        {
+            SKPath path = new SKPath(ManagedInstances[other.ObjectPointer]);
+            ManagedInstances[path.Handle] = path;
+            return path.Handle;
+        }
+
+        public RectD GetTightBounds(VectorPath vectorPath)
+        {
+            SKRect rect = ManagedInstances[vectorPath.ObjectPointer].TightBounds;
+            return new RectD(rect.Left, rect.Top, rect.Right, rect.Bottom);
+        }
+
+        public void Transform(VectorPath vectorPath, Matrix3X3 matrix)
+        {
+            ManagedInstances[vectorPath.ObjectPointer].Transform(matrix.ToSkMatrix());
+        }
+
+        public RectD GetBounds(VectorPath vectorPath)
+        {
+            SKRect rect = ManagedInstances[vectorPath.ObjectPointer].Bounds;
+            return new RectD(rect.Left, rect.Top, rect.Right, rect.Bottom);
+        }
+
+        public void Reset(VectorPath vectorPath)
+        {
+            ManagedInstances[vectorPath.ObjectPointer].Reset();
+        }
+
+        public void MoveTo(VectorPath vectorPath, Point point)
+        {
+            ManagedInstances[vectorPath.ObjectPointer].MoveTo(point.ToSkPoint());
+        }
+
+        public void LineTo(VectorPath vectorPath, Point point)
+        {
+            ManagedInstances[vectorPath.ObjectPointer].LineTo(point.ToSkPoint());
+        }
+
+        public void QuadTo(VectorPath vectorPath, Point mid, Point point)
+        {
+            ManagedInstances[vectorPath.ObjectPointer].QuadTo(mid.ToSkPoint(), point.ToSkPoint());
+        }
+
+        public void CubicTo(VectorPath vectorPath, Point mid1, Point mid2, Point point)
+        {
+            ManagedInstances[vectorPath.ObjectPointer].CubicTo(mid1.ToSkPoint(), mid2.ToSkPoint(), point.ToSkPoint());
+        }
+
+        public void ArcTo(VectorPath vectorPath, RectI oval, int startAngle, int sweepAngle, bool forceMoveTo)
+        {
+            ManagedInstances[vectorPath.ObjectPointer].ArcTo(oval.ToSkRect(), startAngle, sweepAngle, forceMoveTo);
+        }
+
+        public void AddOval(VectorPath vectorPath, RectI borders)
+        {
+            ManagedInstances[vectorPath.ObjectPointer].AddOval(borders.ToSkRect());
+        }
+
+        public VectorPath Op(VectorPath vectorPath, VectorPath ellipsePath, VectorPathOp pathOp)
+        {
+            SKPath skPath = ManagedInstances[vectorPath.ObjectPointer].Op(ManagedInstances[ellipsePath.ObjectPointer], (SKPathOp)pathOp);
+            ManagedInstances[skPath.Handle] = skPath;
+            return new VectorPath(skPath.Handle);
+        }
+
+        public void Close(VectorPath vectorPath)
+        {
+            ManagedInstances[vectorPath.ObjectPointer].Close();
+        }
+    }
+}

+ 9 - 1
src/PixiEditor.DrawingApi.Skia/SkiaDrawingBackend.cs

@@ -24,7 +24,15 @@ namespace PixiEditor.DrawingApi.Skia
             ColorImplementation = new SkiaColorImplementation();
             ColorImplementation = new SkiaColorImplementation();
             SkiaImgDataImplementation dataImpl = new SkiaImgDataImplementation();
             SkiaImgDataImplementation dataImpl = new SkiaImgDataImplementation();
             ImgDataImplementation = dataImpl;
             ImgDataImplementation = dataImpl;
-            ImageImplementation = new SkiaImageImplementation(dataImpl);
+            SkiaImageImplementation imgImpl = new SkiaImageImplementation(dataImpl);
+            ImageImplementation = imgImpl;
+            SkiaPaintImplementation paintImpl = new SkiaPaintImplementation();
+            PaintImplementation = paintImpl;
+            
+            SkiaPathImplementation pathImpl = new SkiaPathImplementation();
+            PathImplementation = pathImpl;
+            
+            CanvasImplementation = new SkiaCanvasImplementation(paintImpl, imgImpl, pathImpl);
         }
         }
         
         
         public void Setup()
         public void Setup()