فهرست منبع

explore: added skia cmd line example

mattias 9 ماه پیش
والد
کامیت
65bf3799ac

+ 2 - 0
tests/exploration/README.txt

@@ -0,0 +1,2 @@
+This folder contains small programs to test possible implementations
+on the various platforms.

+ 1 - 0
tests/exploration/skia/.gitignore

@@ -0,0 +1 @@
+SkiaCmdLine1

+ 71 - 0
tests/exploration/skia/SkiaCmdLine1.lpi

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <General>
+      <Flags>
+        <MainUnitHasCreateFormStatements Value="False"/>
+        <MainUnitHasTitleStatement Value="False"/>
+        <MainUnitHasScaledStatement Value="False"/>
+      </Flags>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="SkiaCmdLine1"/>
+      <UseAppBundle Value="False"/>
+      <ResourceType Value="res"/>
+    </General>
+    <BuildModes>
+      <Item Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+    </RunParams>
+    <RequiredPackages>
+      <Item>
+        <PackageName Value="LazUtils"/>
+      </Item>
+    </RequiredPackages>
+    <Units>
+      <Unit>
+        <Filename Value="SkiaCmdLine1.lpr"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+      <Unit>
+        <Filename Value="../../../../amat/skia/testx11/Skia.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="SkiaCmdLine1"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="../../../src/skia/skia4delphi"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <DebugInfoType Value="dsDwarf2"/>
+      </Debugging>
+    </Linking>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions>
+      <Item>
+        <Name Value="EAbort"/>
+      </Item>
+      <Item>
+        <Name Value="ECodetoolError"/>
+      </Item>
+      <Item>
+        <Name Value="EFOpenError"/>
+      </Item>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 31 - 0
tests/exploration/skia/SkiaCmdLine1.lpr

@@ -0,0 +1,31 @@
+program SkiaCmdLine1;
+
+{$IFDEF Windows}
+{$APPTYPE CONSOLE}
+{$ENDIF}
+
+{ $R *.res}
+
+uses
+  SysUtils, System.UITypes, System.Skia;
+
+procedure TestSkSurface;
+var
+  LSurface: ISkSurface;
+begin
+  // Creating a solid red png image using SkSurface
+  LSurface := TSkSurface.MakeRaster(200, 200);
+  LSurface.Canvas.Clear(TAlphaColors.Red); // $FFFF0000
+  LSurface.MakeImageSnapshot.EncodeToFile('test.png');
+end;
+
+begin
+  try
+    TestSkSurface;
+    WriteLn('Finished!');
+    ReadLn;
+  except
+    on E: Exception do
+      Writeln(E.ClassName, ': ', E.Message);
+  end;
+end.