diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 2d46b7c..b4c5d8f 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -1,5 +1,7 @@
- 11.3.12-cibuild0004211-alpha
+ [12.1.1-cibuild0004449-alpha]
+ true
+ true
\ No newline at end of file
diff --git a/src/DrawiEngine.Browser/BrowserDrawingEngine.cs b/src/DrawiEngine.Browser/BrowserDrawingEngine.cs
index 3b10e54..f559414 100644
--- a/src/DrawiEngine.Browser/BrowserDrawingEngine.cs
+++ b/src/DrawiEngine.Browser/BrowserDrawingEngine.cs
@@ -1,7 +1,7 @@
using Drawie.JSInterop;
using Drawie.RenderApi.WebGl;
using Drawie.Skia;
-using Drawie.Windowing.Browser;
+using Drawie.Host.Browser;
namespace DrawiEngine.Browser;
diff --git a/src/DrawiEngine.Browser/DrawiEngine.Browser.csproj b/src/DrawiEngine.Browser/DrawiEngine.Browser.csproj
index ce76d37..b0f1193 100644
--- a/src/DrawiEngine.Browser/DrawiEngine.Browser.csproj
+++ b/src/DrawiEngine.Browser/DrawiEngine.Browser.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
enable
enable
@@ -9,7 +9,7 @@
-
+
diff --git a/src/DrawiEngine.Desktop/DesktopDrawingEngine.cs b/src/DrawiEngine.Desktop/DesktopDrawingEngine.cs
index 58fed86..2c855b0 100644
--- a/src/DrawiEngine.Desktop/DesktopDrawingEngine.cs
+++ b/src/DrawiEngine.Desktop/DesktopDrawingEngine.cs
@@ -8,9 +8,9 @@ namespace DrawiEngine.Desktop;
public static class DesktopDrawingEngine
{
- public static DrawingEngine CreateDefaultDesktop()
+ public static DrawingEngine CreateDefaultDesktop(bool preferVulkan = true)
{
- IRenderApi renderApi = new VulkanRenderApi();
+ IRenderApi renderApi = preferVulkan ? new VulkanRenderApi() : new OpenGlRenderApi();
if (OperatingSystem.IsMacOS())
{
diff --git a/src/DrawiEngine.Desktop/DrawiEngine.Desktop.csproj b/src/DrawiEngine.Desktop/DrawiEngine.Desktop.csproj
index 9bd2407..f81c29c 100644
--- a/src/DrawiEngine.Desktop/DrawiEngine.Desktop.csproj
+++ b/src/DrawiEngine.Desktop/DrawiEngine.Desktop.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
enable
enable
@@ -9,7 +9,7 @@
-
+
diff --git a/src/DrawiEngine/DrawiEngine.csproj b/src/DrawiEngine/DrawiEngine.csproj
index b131288..fb05b47 100644
--- a/src/DrawiEngine/DrawiEngine.csproj
+++ b/src/DrawiEngine/DrawiEngine.csproj
@@ -1,13 +1,13 @@
- net8.0
+ net10.0
enable
enable
-
+
diff --git a/src/DrawiEngine/DrawieApp.cs b/src/DrawiEngine/DrawieApp.cs
index 1777b8f..bd6cf27 100644
--- a/src/DrawiEngine/DrawieApp.cs
+++ b/src/DrawiEngine/DrawieApp.cs
@@ -1,5 +1,5 @@
using Drawie.Backend.Core.Bridge;
-using Drawie.Windowing;
+using Drawie.Host;
namespace DrawiEngine;
@@ -17,11 +17,11 @@ public void Initialize(DrawingEngine engine)
Engine = engine;
}
- public abstract IWindow CreateMainWindow();
+ public abstract IHost CreateMainWindow();
public void Run()
{
- if (DrawingBackendApi.HasBackend)
+ if (DrawingBackendApi.Initialized)
{
OnInitialize();
}
diff --git a/src/DrawiEngine/DrawieRenderingDispatcher.cs b/src/DrawiEngine/DrawieRenderingDispatcher.cs
index 77391da..62c0f40 100644
--- a/src/DrawiEngine/DrawieRenderingDispatcher.cs
+++ b/src/DrawiEngine/DrawieRenderingDispatcher.cs
@@ -4,7 +4,40 @@ namespace DrawiEngine;
public class DrawieRenderingDispatcher : IRenderingDispatcher
{
- public Action Invoke { get; } = action => action();
+ private bool renderApiReady = false;
+
+ private List queuedActions = new List();
+
+ public Action Invoke { get; }
+
+ public DrawieRenderingDispatcher()
+ {
+ Invoke = OnInvoke;
+ }
+
+ private void OnInvoke(Action action)
+ {
+ if (renderApiReady)
+ {
+ action();
+ }
+ else
+ {
+ queuedActions.Add(action);
+ }
+ }
+
+ void IRenderingDispatcher.RenderApiReady()
+ {
+ renderApiReady = true;
+
+ foreach (var action in queuedActions)
+ {
+ action();
+ }
+
+ queuedActions.Clear();
+ }
public async Task InvokeAsync(Func func)
{
@@ -32,4 +65,4 @@ public class EmptyDisposable : IDisposable
public void Dispose()
{
}
-}
+}
\ No newline at end of file
diff --git a/src/DrawiEngine/DrawingEngine.cs b/src/DrawiEngine/DrawingEngine.cs
index 35a88d0..eefcefa 100644
--- a/src/DrawiEngine/DrawingEngine.cs
+++ b/src/DrawiEngine/DrawingEngine.cs
@@ -1,7 +1,7 @@
using Drawie.Backend.Core;
using Drawie.Backend.Core.Bridge;
using Drawie.RenderApi;
-using Drawie.Windowing;
+using Drawie.Host;
namespace DrawiEngine;
@@ -32,14 +32,14 @@ public void RunWithApp(DrawieApp app)
Console.WriteLine($"\t- DrawingBackend: {DrawingBackend}");
app.Initialize(this);
- IWindow window = app.CreateMainWindow();
+ IHost host = app.CreateMainWindow();
- window.Initialize();
+ host.Initialize();
DrawingBackendApi.InitializeBackend(RenderApi);
app.Run();
- window.Show();
+ host.Show();
}
public void Run()
@@ -55,5 +55,6 @@ public void Run()
public async ValueTask Dispose()
{
await DrawingBackend.DisposeAsync();
+ RenderApi.Dispose();
}
}
diff --git a/src/Drawie.AvaloniaInterop/Drawie.AvaloniaInterop.csproj b/src/Drawie.AvaloniaInterop/Drawie.AvaloniaInterop.csproj
index 3baba41..2155765 100644
--- a/src/Drawie.AvaloniaInterop/Drawie.AvaloniaInterop.csproj
+++ b/src/Drawie.AvaloniaInterop/Drawie.AvaloniaInterop.csproj
@@ -1,7 +1,7 @@
WinExe
- net8.0
+ net10.0
enable
true
app.manifest
@@ -11,12 +11,12 @@
-
-
-
-
+
+
+
+
-
+
diff --git a/src/Drawie.AvaloniaInterop/MainWindow.axaml.cs b/src/Drawie.AvaloniaInterop/MainWindow.axaml.cs
index 2a987e8..08e2423 100644
--- a/src/Drawie.AvaloniaInterop/MainWindow.axaml.cs
+++ b/src/Drawie.AvaloniaInterop/MainWindow.axaml.cs
@@ -23,15 +23,15 @@ public MainWindow()
protected override void OnLoaded(RoutedEventArgs e)
{
- Texture texture = new Texture(new VecI(128, 128));
+ NativeTexture nativeTexture = new NativeTexture(new VecI(128, 128));
using Paint paint = new Paint();
paint.Color = Colors.Red;
- texture.DrawingSurface.Canvas.DrawRect(0, 0, 128, 128, paint);
+ nativeTexture.DrawingSurface.Canvas.DrawRect(0, 0, 128, 128, paint);
paint.Color = Colors.Blue;
- texture.DrawingSurface.Canvas.DrawCircle(64, 64, 64, paint);
+ nativeTexture.DrawingSurface.Canvas.DrawCircle(64, 64, 64, paint);
- DrawieControl.Texture = texture;
+ DrawieControl.NativeTexture = nativeTexture;
base.OnLoaded(e);
}
@@ -45,7 +45,7 @@ public override void Render(DrawingContext context)
byte green = (byte)(Math.Sin(time / 1000.0 + 2) * 127 + 128);
byte blue = (byte)(Math.Sin(time / 1000.0 + 4) * 127 + 128);
- DrawieControl.Texture?.DrawingSurface.Canvas.DrawRect(0, 0, 128, 128, new Paint()
+ DrawieControl.NativeTexture?.DrawingSurface.Canvas.DrawRect(0, 0, 128, 128, new Paint()
{
Color = new Color(red, green, blue, 255),
Style = PaintStyle.StrokeAndFill
@@ -53,7 +53,7 @@ public override void Render(DrawingContext context)
// test transparency
- DrawieControl.Texture?.DrawingSurface.Canvas.DrawCircle(64, 64, 64, new Paint()
+ DrawieControl.NativeTexture?.DrawingSurface.Canvas.DrawCircle(64, 64, 64, new Paint()
{
Color = new Color(255, 255, 255, 128),
Style = PaintStyle.Fill
diff --git a/src/Drawie.AvaloniaInterop/Program.cs b/src/Drawie.AvaloniaInterop/Program.cs
index bc78b0c..aeba86a 100644
--- a/src/Drawie.AvaloniaInterop/Program.cs
+++ b/src/Drawie.AvaloniaInterop/Program.cs
@@ -2,6 +2,7 @@
using System;
using System.Threading.Tasks;
using Avalonia.Logging;
+using Avalonia.OpenGL.Egl;
using Avalonia.Vulkan;
using Drawie.Interop.Avalonia.Vulkan;
using Drawie.Interop.VulkanAvalonia;
@@ -32,7 +33,7 @@ public static AppBuilder BuildAvaloniaApp()
Win32RenderingMode.Vulkan
},
})
- .With(new X11PlatformOptions() { RenderingMode = new[] { X11RenderingMode.Vulkan, X11RenderingMode.Glx } })
+ .With(new X11PlatformOptions() { RenderingMode = new[] { X11RenderingMode.Egl, X11RenderingMode.Glx } })
.WithDrawie()
.LogToTrace(LogEventLevel.Debug, "Vulkan");
}
\ No newline at end of file
diff --git a/src/Drawie.Backend.Core/Bridge/DrawingBackendApi.cs b/src/Drawie.Backend.Core/Bridge/DrawingBackendApi.cs
index dccf998..a78ce3b 100644
--- a/src/Drawie.Backend.Core/Bridge/DrawingBackendApi.cs
+++ b/src/Drawie.Backend.Core/Bridge/DrawingBackendApi.cs
@@ -22,6 +22,7 @@ public static IDrawingBackend Current
}
public static bool HasBackend => _current != null;
+ public static bool Initialized { get; private set; }
public static void SetupBackend(IDrawingBackend backend, IRenderingDispatcher dispatcher)
{
@@ -32,8 +33,6 @@ public static void SetupBackend(IDrawingBackend backend, IRenderingDispatcher di
_current = backend;
_current.RenderingDispatcher = dispatcher;
-
- OnBackendInitialized?.Invoke();
}
public static void InitializeBackend(IRenderApi renderApi)
@@ -44,6 +43,9 @@ public static void InitializeBackend(IRenderApi renderApi)
}
_current.Setup(renderApi);
+ _current.RenderingDispatcher.RenderApiReady();
+ OnBackendInitialized?.Invoke();
+ Initialized = true;
}
}
}
diff --git a/src/Drawie.Backend.Core/Bridge/IDrawingBackend.cs b/src/Drawie.Backend.Core/Bridge/IDrawingBackend.cs
index e874dd8..e3f5cc4 100644
--- a/src/Drawie.Backend.Core/Bridge/IDrawingBackend.cs
+++ b/src/Drawie.Backend.Core/Bridge/IDrawingBackend.cs
@@ -3,11 +3,13 @@
using Drawie.Backend.Core.Surfaces;
using Drawie.Numerics;
using Drawie.RenderApi;
+using Drawie.RenderApi.Abstraction.Textures;
namespace Drawie.Backend.Core.Bridge
{
public interface IDrawingBackend : IAsyncDisposable
{
+ public IRenderApi ActiveRenderApi { get; }
public void Setup(IRenderApi renderApi);
public IColorImplementation ColorImplementation { get; }
public IImageImplementation ImageImplementation { get; }
@@ -31,8 +33,9 @@ public interface IDrawingBackend : IAsyncDisposable
public IPictureImplementation PictureImplementation { get; }
public IBlenderImplementation BlenderImplementation { get; }
public IMeshImplementation MeshImplementation { get; }
- public DrawingSurface CreateRenderSurface(VecI size, ITexture renderTexture, SurfaceOrigin origin);
+ public DrawingSurface? CreateRenderSurface(VecI size, ITexture renderTexture, SurfaceOrigin origin);
public int GetNativeInstancesTotalCount();
public void Flush();
+ void ResetContext();
}
}
diff --git a/src/Drawie.Backend.Core/Bridge/NativeObjectsImpl/IPaintImplementation.cs b/src/Drawie.Backend.Core/Bridge/NativeObjectsImpl/IPaintImplementation.cs
index 5465156..5f0dd3a 100644
--- a/src/Drawie.Backend.Core/Bridge/NativeObjectsImpl/IPaintImplementation.cs
+++ b/src/Drawie.Backend.Core/Bridge/NativeObjectsImpl/IPaintImplementation.cs
@@ -15,8 +15,6 @@ public interface IPaintImplementation
public void SetColor(Paint paint, Color value);
public BlendMode GetBlendMode(Paint paint);
public void SetBlendMode(Paint paint, BlendMode value);
- public FilterQuality GetFilterQuality(Paint paint);
- public void SetFilterQuality(Paint paint, FilterQuality value);
public bool GetIsAntiAliased(Paint paint);
public void SetIsAntiAliased(Paint paint, bool value);
public PaintStyle GetStyle(Paint paint);
diff --git a/src/Drawie.Backend.Core/Bridge/Operations/IImageImplementation.cs b/src/Drawie.Backend.Core/Bridge/Operations/IImageImplementation.cs
index 056b7bb..1f4b0de 100644
--- a/src/Drawie.Backend.Core/Bridge/Operations/IImageImplementation.cs
+++ b/src/Drawie.Backend.Core/Bridge/Operations/IImageImplementation.cs
@@ -29,5 +29,9 @@ public Shader ToShader(IntPtr objectPointer, TileMode tileX, TileMode tileY, Sam
Matrix3X3 localMatrix);
public Shader ToRawShader(IntPtr objectPointer);
public Shader? ToShader(IntPtr objectPointer, TileMode clamp, TileMode tileMode, Matrix3X3 fillMatrixValue);
+ public uint GetUniqueId(IntPtr objectPointer);
+ /*
+ public ulong? GetTextureId(IntPtr objectPointer);
+ */
}
}
diff --git a/src/Drawie.Backend.Core/Bridge/Operations/ISurfaceImplementation.cs b/src/Drawie.Backend.Core/Bridge/Operations/ISurfaceImplementation.cs
index 996f8e8..49dcfd4 100644
--- a/src/Drawie.Backend.Core/Bridge/Operations/ISurfaceImplementation.cs
+++ b/src/Drawie.Backend.Core/Bridge/Operations/ISurfaceImplementation.cs
@@ -21,5 +21,7 @@ public interface ISurfaceImplementation
public RectI GetDeviceClipBounds(IntPtr drawingSurface);
public void Unmanage(DrawingSurface surface);
public RectD GetLocalClipBounds(IntPtr objectPointer);
+ INativeSurfaceInfo? GetNativeSurfaceInfo(IntPtr objectPointer);
+ INativeSurfaceInfo? ToExternallyAccessibleSurface(IntPtr objectPointer);
}
diff --git a/src/Drawie.Backend.Core/ColorsImpl/Paintables/TexturePaintable.cs b/src/Drawie.Backend.Core/ColorsImpl/Paintables/TexturePaintable.cs
index 20cf17d..3f418b0 100644
--- a/src/Drawie.Backend.Core/ColorsImpl/Paintables/TexturePaintable.cs
+++ b/src/Drawie.Backend.Core/ColorsImpl/Paintables/TexturePaintable.cs
@@ -15,7 +15,7 @@ public class TexturePaintable : Paintable
public override RectD LocalBounds => new RectD(0, 0, Image.Size.X, Image.Size.Y);
- private Image lastSnapshot;
+ private Image? lastSnapshot;
private bool disposeAfterUse;
diff --git a/src/Drawie.Backend.Core/Drawie.Backend.Core.csproj b/src/Drawie.Backend.Core/Drawie.Backend.Core.csproj
index be3b2d5..a0f8478 100644
--- a/src/Drawie.Backend.Core/Drawie.Backend.Core.csproj
+++ b/src/Drawie.Backend.Core/Drawie.Backend.Core.csproj
@@ -1,10 +1,11 @@
- net8.0
+ net10.0
enable
enable
true
+
diff --git a/src/Drawie.Backend.Core/IRenderable.cs b/src/Drawie.Backend.Core/IRenderable.cs
new file mode 100644
index 0000000..3a53eab
--- /dev/null
+++ b/src/Drawie.Backend.Core/IRenderable.cs
@@ -0,0 +1,8 @@
+using Drawie.Backend.Core.Surfaces;
+
+namespace Drawie.Backend.Core;
+
+public interface IRenderable
+{
+ public void Draw(Canvas canvas);
+}
\ No newline at end of file
diff --git a/src/Drawie.Backend.Core/IRenderingDispatcher.cs b/src/Drawie.Backend.Core/IRenderingDispatcher.cs
index 0a05624..8f540b1 100644
--- a/src/Drawie.Backend.Core/IRenderingDispatcher.cs
+++ b/src/Drawie.Backend.Core/IRenderingDispatcher.cs
@@ -3,6 +3,7 @@
public interface IRenderingDispatcher
{
public Action Invoke { get; }
+ protected internal void RenderApiReady();
public Task InvokeAsync(Func func);
public Task InvokeInBackgroundAsync(Func function);
public Task InvokeInBackgroundAsync(Action function);
diff --git a/src/Drawie.Backend.Core/Surface.cs b/src/Drawie.Backend.Core/Surface.cs
index ca70337..3170452 100644
--- a/src/Drawie.Backend.Core/Surface.cs
+++ b/src/Drawie.Backend.Core/Surface.cs
@@ -26,7 +26,7 @@ public class Surface : IDisposable, ICloneable, IPixelsMap
private Paint drawingPaint = new Paint() { BlendMode = BlendMode.Src };
private Paint nearestNeighborReplacingPaint =
- new() { BlendMode = BlendMode.Src, FilterQuality = FilterQuality.None };
+ new() { BlendMode = BlendMode.Src };
public ImageInfo ImageInfo { get; }
@@ -136,8 +136,6 @@ public Surface Resize(VecI newSize, ResizeMethod resizeMethod)
_ => FilterQuality.None
};
- paint.FilterQuality = filterQuality;
-
newSurface.DrawingSurface.Canvas.DrawImage(image, new RectD(0, 0, newSize.X, newSize.Y), paint);
return newSurface;
}
diff --git a/src/Drawie.Backend.Core/Surfaces/DrawingSurface.cs b/src/Drawie.Backend.Core/Surfaces/DrawingSurface.cs
index ebc67d1..2c0ea51 100644
--- a/src/Drawie.Backend.Core/Surfaces/DrawingSurface.cs
+++ b/src/Drawie.Backend.Core/Surfaces/DrawingSurface.cs
@@ -2,10 +2,11 @@
using Drawie.Backend.Core.Surfaces.ImageData;
using Drawie.Backend.Core.Surfaces.PaintImpl;
using Drawie.Numerics;
+using Drawie.RenderApi.Abstraction.RenderTargets;
namespace Drawie.Backend.Core.Surfaces
{
- public class DrawingSurface : NativeObject, IPixelsMap
+ public class DrawingSurface : NativeObject, IPixelsMap, IRenderTarget
{
public override object Native =>
DrawingBackendApi.Current.SurfaceImplementation.GetNativeSurface(ObjectPointer);
@@ -18,6 +19,9 @@ public class DrawingSurface : NativeObject, IPixelsMap
public RectD LocalClipBounds =>
DrawingBackendApi.Current.SurfaceImplementation.GetLocalClipBounds(ObjectPointer);
+ VecI IRenderTarget.Size => DeviceClipBounds.Size;
+ public ulong SurfaceId => DrawingBackendApi.Current.SurfaceImplementation.GetNativeSurfaceInfo(ObjectPointer).SurfaceId;
+
public bool IsDisposed => isDisposed || Canvas.IsDisposed;
public event SurfaceChangedEventHandler? Changed;
@@ -45,7 +49,7 @@ public Image Snapshot()
{
return DrawingBackendApi.Current.ImageImplementation.Snapshot(this);
}
-
+
public Image Snapshot(RectI bounds)
{
return DrawingBackendApi.Current.ImageImplementation.Snapshot(this, bounds);
diff --git a/src/Drawie.Backend.Core/Surfaces/INativeSurfaceInfo.cs b/src/Drawie.Backend.Core/Surfaces/INativeSurfaceInfo.cs
new file mode 100644
index 0000000..df6b41a
--- /dev/null
+++ b/src/Drawie.Backend.Core/Surfaces/INativeSurfaceInfo.cs
@@ -0,0 +1,6 @@
+namespace Drawie.Backend.Core.Surfaces;
+
+public interface INativeSurfaceInfo
+{
+ public ulong SurfaceId { get; }
+}
\ No newline at end of file
diff --git a/src/Drawie.Backend.Core/Surfaces/ImageData/Image.cs b/src/Drawie.Backend.Core/Surfaces/ImageData/Image.cs
index 378f8ca..4f47b74 100644
--- a/src/Drawie.Backend.Core/Surfaces/ImageData/Image.cs
+++ b/src/Drawie.Backend.Core/Surfaces/ImageData/Image.cs
@@ -2,6 +2,8 @@
using Drawie.Backend.Core.Numerics;
using Drawie.Backend.Core.Shaders;
using Drawie.Numerics;
+using Drawie.RenderApi;
+using Drawie.RenderApi.Abstraction.Textures;
namespace Drawie.Backend.Core.Surfaces.ImageData
{
@@ -25,6 +27,9 @@ public class Image : NativeObject, ICloneable, IPixelsMap
public VecI Size => new VecI(Width, Height);
public bool IsDisposed => isDisposed;
+ /*
+ public ulong TextureId => DrawingBackendApi.Current.ImageImplementation.GetTextureId(ObjectPointer).Value;
+ */
private bool isDisposed;
@@ -100,5 +105,6 @@ public Shader ToRawShader()
{
return DrawingBackendApi.Current.ImageImplementation.ToShader(ObjectPointer, clamp, tileMode, fillMatrixValue);
}
+
}
}
diff --git a/src/Drawie.Backend.Core/Surfaces/PaintImpl/Paint.cs b/src/Drawie.Backend.Core/Surfaces/PaintImpl/Paint.cs
index 41a49db..ec136c9 100644
--- a/src/Drawie.Backend.Core/Surfaces/PaintImpl/Paint.cs
+++ b/src/Drawie.Backend.Core/Surfaces/PaintImpl/Paint.cs
@@ -47,12 +47,6 @@ public StrokeJoin StrokeJoin
set => DrawingBackendApi.Current.PaintImplementation.SetStrokeJoin(this, value);
}
- public FilterQuality FilterQuality
- {
- get => DrawingBackendApi.Current.PaintImplementation.GetFilterQuality(this);
- set => DrawingBackendApi.Current.PaintImplementation.SetFilterQuality(this, value);
- }
-
public bool IsAntiAliased
{
get => DrawingBackendApi.Current.PaintImplementation.GetIsAntiAliased(this);
diff --git a/src/Drawie.Backend.Core/Surfaces/Pixmap.cs b/src/Drawie.Backend.Core/Surfaces/Pixmap.cs
index ac4ce80..9dcbf69 100644
--- a/src/Drawie.Backend.Core/Surfaces/Pixmap.cs
+++ b/src/Drawie.Backend.Core/Surfaces/Pixmap.cs
@@ -9,15 +9,10 @@ public class Pixmap : NativeObject
{
public override object Native => DrawingBackendApi.Current.PixmapImplementation.GetNativePixmap(ObjectPointer);
- internal Pixmap(IntPtr objPtr) : base(objPtr)
+ public Pixmap(IntPtr objPtr) : base(objPtr)
{
}
- public static Pixmap InternalCreateFromExistingPointer(IntPtr objPointer)
- {
- return new Pixmap(objPointer);
- }
-
public Pixmap(ImageInfo imgInfo, IntPtr dataPtr) : base(dataPtr)
{
ObjectPointer = DrawingBackendApi.Current.PixmapImplementation.Construct(dataPtr, imgInfo);
diff --git a/src/Drawie.Backend.Core/Text/RichText.cs b/src/Drawie.Backend.Core/Text/RichText.cs
index 26ecd2b..df11431 100644
--- a/src/Drawie.Backend.Core/Text/RichText.cs
+++ b/src/Drawie.Backend.Core/Text/RichText.cs
@@ -36,7 +36,7 @@ public RichText(string text, double maxWidth = double.MaxValue)
FormattedText = text.Replace('\n', ' ');
Lines = text.Split('\n');
}
-
+
public void Paint(Canvas canvas, VecD position, Font font, Paint paint, VectorPath? onPath, VecD? pathOffset = null)
{
if (pathOffset == null)
diff --git a/src/Drawie.Backend.Core/Texture.cs b/src/Drawie.Backend.Core/Texture.cs
index 7ed123f..caf21fb 100644
--- a/src/Drawie.Backend.Core/Texture.cs
+++ b/src/Drawie.Backend.Core/Texture.cs
@@ -1,14 +1,14 @@
using Drawie.Backend.Core.Bridge;
using Drawie.Backend.Core.ColorsImpl;
-using Drawie.Backend.Core.ColorsImpl.Paintables;
using Drawie.Backend.Core.Surfaces;
using Drawie.Backend.Core.Surfaces.ImageData;
using Drawie.Backend.Core.Surfaces.PaintImpl;
using Drawie.Numerics;
+using Drawie.RenderApi.Abstraction.Textures;
namespace Drawie.Backend.Core;
-public class Texture : IDisposable, ICloneable, IPixelsMap
+public class Texture : IDisposable, ICloneable, IPixelsMap, INativeSurfaceInfo, ILazyExternallyAccessibleTexture
{
public VecI Size { get; }
public DrawingSurface DrawingSurface { get; private set; }
@@ -21,6 +21,7 @@ public class Texture : IDisposable, ICloneable, IPixelsMap
public ColorSpace ColorSpace { get; }
public ImageInfo ImageInfo { get; }
+ public ulong TextureId => SurfaceId;
private DrawingSurface? cpuSurface;
private Pixmap? cpuPixmap;
@@ -32,7 +33,7 @@ public class Texture : IDisposable, ICloneable, IPixelsMap
private HashSet