From d7812f39dc785d55fc1403f7fd1775a02acb5b75 Mon Sep 17 00:00:00 2001 From: routersys Date: Thu, 2 Jul 2026 12:52:29 +0900 Subject: [PATCH] =?UTF-8?q?SoftwareCompositor=E3=82=92IBufferCompositor?= =?UTF-8?q?=E3=81=AE=E5=AE=9F=E8=A3=85=E3=81=B8=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript.Tests/LuaScript.Tests.csproj | 3 +++ LuaScript/SoftwareCompositor.cs | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/LuaScript.Tests/LuaScript.Tests.csproj b/LuaScript.Tests/LuaScript.Tests.csproj index 0e22044..80b2296 100644 --- a/LuaScript.Tests/LuaScript.Tests.csproj +++ b/LuaScript.Tests/LuaScript.Tests.csproj @@ -34,7 +34,10 @@ + + + diff --git a/LuaScript/SoftwareCompositor.cs b/LuaScript/SoftwareCompositor.cs index 69b7cf0..7092a29 100644 --- a/LuaScript/SoftwareCompositor.cs +++ b/LuaScript/SoftwareCompositor.cs @@ -3,8 +3,17 @@ using System.Numerics; namespace LuaScript { - internal static class SoftwareCompositor + internal sealed class SoftwareCompositor : IBufferCompositor { + public void Compose(byte[] dst, int dstW, int dstH, byte[] src, int srcW, int srcH, in DrawCommand command) + { + bool linear = command.Antialias != 0d; + if (command.Poly is { } poly) + DrawPolyInto(dst, dstW, dstH, src, srcW, srcH, poly, command.Alpha, linear); + else + DrawInto(dst, dstW, dstH, src, srcW, srcH, command.Ox, command.Oy, command.Zoom, command.Aspect, command.Alpha, linear); + } + public static void DrawInto( byte[] dst, int dstW, int dstH, byte[] src, int srcW, int srcH,