diff --git a/Demo/D11/SVGIconImageDemoFMX.dproj b/Demo/D11/SVGIconImageDemoFMX.dproj index 3c41aaf..12af30d 100644 --- a/Demo/D11/SVGIconImageDemoFMX.dproj +++ b/Demo/D11/SVGIconImageDemoFMX.dproj @@ -1,7 +1,7 @@  {A73832A0-141F-4F88-95FD-3D4CEA5479BD} - 19.4 + 19.5 FMX SVGIconImageDemoFMX.dpr True @@ -28,6 +28,11 @@ Base true + + true + Base + true + true Base @@ -151,6 +156,31 @@ $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png + + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + iPhoneAndiPad + true + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers Debug @@ -254,10 +284,9 @@ SVGIconImageDemoFMX.dpr - - + - + true @@ -273,12 +302,7 @@ true - - - SVGIconImageDemoFMX.exe - true - - + 1 @@ -301,16 +325,6 @@ 64 - - - classes - 1 - - - classes - 1 - - res\xml @@ -620,7 +634,7 @@ 1 .dylib - + 1 .dylib @@ -653,7 +667,7 @@ 1 .dylib - + 1 .dylib @@ -690,7 +704,7 @@ 0 - + 0 @@ -714,13 +728,17 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -730,137 +748,27 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -870,7 +778,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -880,7 +788,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -890,7 +798,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -900,7 +808,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -910,191 +818,37 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -1104,7 +858,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -1114,7 +868,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1124,7 +878,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1134,7 +888,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1144,7 +898,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1154,7 +908,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1164,7 +918,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1186,12 +940,8 @@ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 - - - - 1 - - + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 @@ -1204,6 +954,10 @@ ..\ 1 + + ..\ + 1 + @@ -1212,7 +966,7 @@ 1 - + 1 @@ -1221,7 +975,7 @@ ..\$(PROJECTNAME).launchscreen 64 - + ..\$(PROJECTNAME).launchscreen 64 @@ -1233,7 +987,7 @@ 1 - + 1 @@ -1304,7 +1058,7 @@ 1 - + 1 @@ -1364,6 +1118,7 @@ + @@ -1376,6 +1131,7 @@ True True False + False False False True diff --git a/Demo/D11/SVGIconImageListDemo.dproj b/Demo/D11/SVGIconImageListDemo.dproj index e7a0398..29ab9c6 100644 --- a/Demo/D11/SVGIconImageListDemo.dproj +++ b/Demo/D11/SVGIconImageListDemo.dproj @@ -35,12 +35,6 @@ true true - - true - Cfg_1 - true - true - true Base @@ -174,8 +168,7 @@ 1.0.0.0 - - + True diff --git a/Demo/SVGExplorer/FExplorerSVG.pas b/Demo/SVGExplorer/FExplorerSVG.pas index 132ff47..050cb8a 100644 --- a/Demo/SVGExplorer/FExplorerSVG.pas +++ b/Demo/SVGExplorer/FExplorerSVG.pas @@ -3,7 +3,7 @@ { SVG Explorer: Utility to explore SVG Icons on disk } { to simplify use of Icons (resize, colors and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Nicola Tambascia } { Contributors: } { Carlo Barazzetta } diff --git a/Demo/Source/UDataModule.pas b/Demo/Source/UDataModule.pas index 00b2836..e0e9f73 100644 --- a/Demo/Source/UDataModule.pas +++ b/Demo/Source/UDataModule.pas @@ -3,7 +3,7 @@ { SVG Icon ImageList: An extended ImageList for Delphi/VCL } { to simplify use of Icons (resize, colors and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { Nicola Tambascia, Vincent Parrett } diff --git a/Demo/Source/UIconPickerFMX.pas b/Demo/Source/UIconPickerFMX.pas index dbea1e2..61e1ffe 100644 --- a/Demo/Source/UIconPickerFMX.pas +++ b/Demo/Source/UIconPickerFMX.pas @@ -3,7 +3,7 @@ { Icon Fonts ImageList: An extended ImageList for Delphi/FireMonkey } { to simplify use of Icons (resize, colors and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { } { https://github.com/EtheaDev/IconFontsImageList } diff --git a/Demo/Source/UMain.pas b/Demo/Source/UMain.pas index f6c07be..3e5a9d1 100644 --- a/Demo/Source/UMain.pas +++ b/Demo/Source/UMain.pas @@ -3,7 +3,7 @@ { SVG Icon ImageList: An extended ImageList for Delphi/VCL } { to simplify use of Icons (resize, colors and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { Nicola Tambascia, Vincent Parrett } diff --git a/Demo/Source/UMainNew.dfm b/Demo/Source/UMainNew.dfm index 44524ac..2b1857b 100644 --- a/Demo/Source/UMainNew.dfm +++ b/Demo/Source/UMainNew.dfm @@ -15,11 +15,9 @@ object MainForm: TMainForm Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] - OldCreateOrder = False ShowHint = True OnAfterMonitorDpiChanged = FormAfterMonitorDpiChanged OnCreate = FormCreate - PixelsPerInch = 96 TextHeight = 13 object Splitter: TSplitter Left = 626 @@ -39,6 +37,7 @@ object MainForm: TMainForm Height = 509 Align = alLeft TabOrder = 0 + ExplicitHeight = 508 object SelectThemeRadioGroup: TRadioGroup Left = 1 Top = 1 @@ -48,6 +47,7 @@ object MainForm: TMainForm Caption = 'Select Theme/Color' TabOrder = 0 OnClick = SelectThemeRadioGroupClick + ExplicitHeight = 209 end object LoadGroupBox: TGroupBox Left = 1 @@ -57,6 +57,7 @@ object MainForm: TMainForm Align = alBottom Caption = 'Load SVG from disk' TabOrder = 1 + ExplicitTop = 210 object BuildFromFilesButton: TButton Left = 3 Top = 23 @@ -75,6 +76,7 @@ object MainForm: TMainForm Align = alBottom BevelOuter = bvNone TabOrder = 3 + ExplicitTop = 372 object IconSizeLabel: TLabel Left = 8 Top = 3 @@ -105,6 +107,7 @@ object MainForm: TMainForm Align = alBottom BevelOuter = bvNone TabOrder = 2 + ExplicitTop = 269 object ClearButton: TButton Left = 5 Top = 5 @@ -132,6 +135,7 @@ object MainForm: TMainForm Align = alBottom Caption = 'Fixed color' TabOrder = 4 + ExplicitTop = 434 object FixedColorComboBox: TColorBox Left = 10 Top = 19 @@ -171,6 +175,7 @@ object MainForm: TMainForm Align = alBottom BevelOuter = bvNone TabOrder = 5 + ExplicitTop = 310 object IconOpacityLabel: TLabel Left = 8 Top = 3 @@ -205,6 +210,7 @@ object MainForm: TMainForm Images = VirtualImageList TabOrder = 1 Transparent = False + ExplicitWidth = 705 object ToolButton1: TToolButton Left = 0 Top = 0 @@ -256,6 +262,8 @@ object MainForm: TMainForm Align = alRight TabOrder = 2 OnResize = paButtonsResize + ExplicitLeft = 625 + ExplicitHeight = 508 object SVGIconImage: TSVGIconImage Left = 1 Top = 428 @@ -311,6 +319,8 @@ object MainForm: TMainForm Height = 509 Align = alClient TabOrder = 3 + ExplicitWidth = 420 + ExplicitHeight = 508 object ImageListLabel: TLabel Left = 1 Top = 209 @@ -340,6 +350,7 @@ object MainForm: TMainForm 0000000000FFFFFFFF0000000000000000000000000107740077006F00200074 0077006F00280000000300000003000000FFFFFFFFFFFFFFFF00000000000000 0000000000010574006800720065006500} + ExplicitWidth = 418 end object ImageView: TListView Left = 1 @@ -361,6 +372,8 @@ object MainForm: TMainForm SmallImages = VirtualImageList TabOrder = 1 OnSelectItem = ImageViewSelectItem + ExplicitWidth = 418 + ExplicitHeight = 285 end end object ActionList: TActionList @@ -401,1717 +414,1430 @@ object MainForm: TMainForm Top = 136 end object VirtualImageList: TVirtualImageList - DisabledGrayscale = False - DisabledSuffix = '_Disabled' Images = < item CollectionIndex = 0 CollectionName = 'Business\businessman' - Disabled = False Name = 'business\businessman' end item CollectionIndex = 1 CollectionName = 'Business\businesswoman' - Disabled = False Name = 'business\businesswoman' end item CollectionIndex = 2 CollectionName = 'calendar' - Disabled = False Name = 'calendar' end item CollectionIndex = 3 CollectionName = 'about' - Disabled = False Name = 'about' end item CollectionIndex = 4 CollectionName = 'calculator' - Disabled = False Name = 'calculator' end item CollectionIndex = 5 CollectionName = 'cell_phone' - Disabled = False Name = 'cell_phone' end item CollectionIndex = 6 CollectionName = 'contacts' - Disabled = False Name = 'contacts' end item CollectionIndex = 7 CollectionName = 'advertising' - Disabled = False Name = 'advertising' end item CollectionIndex = 8 CollectionName = 'alphabetical_sorting_az' - Disabled = False Name = 'alphabetical_sorting_az' end item CollectionIndex = 9 CollectionName = 'alphabetical_sorting_za' - Disabled = False Name = 'alphabetical_sorting_za' end item CollectionIndex = 10 CollectionName = 'android_os' - Disabled = False Name = 'android_os' end item CollectionIndex = 11 CollectionName = 'answers' - Disabled = False Name = 'answers' end item CollectionIndex = 12 CollectionName = 'approval' - Disabled = False Name = 'approval' end item CollectionIndex = 13 CollectionName = 'approve' - Disabled = False Name = 'approve' end item CollectionIndex = 14 CollectionName = 'area_chart' - Disabled = False Name = 'area_chart' end item CollectionIndex = 15 CollectionName = 'assistant' - Disabled = False Name = 'assistant' end item CollectionIndex = 16 CollectionName = 'audio_file' - Disabled = False Name = 'audio_file' end item CollectionIndex = 17 CollectionName = 'automatic' - Disabled = False Name = 'automatic' end item CollectionIndex = 18 CollectionName = 'automotive' - Disabled = False Name = 'automotive' end item CollectionIndex = 19 CollectionName = 'bad_decision' - Disabled = False Name = 'bad_decision' end item CollectionIndex = 20 CollectionName = 'bar_chart' - Disabled = False Name = 'bar_chart' end item CollectionIndex = 21 CollectionName = 'bearish' - Disabled = False Name = 'bearish' end item CollectionIndex = 22 CollectionName = 'binoculars' - Disabled = False Name = 'binoculars' end item CollectionIndex = 23 CollectionName = 'biohazard' - Disabled = False Name = 'biohazard' end item CollectionIndex = 24 CollectionName = 'biomass' - Disabled = False Name = 'biomass' end item CollectionIndex = 25 CollectionName = 'biotech' - Disabled = False Name = 'biotech' end item CollectionIndex = 26 CollectionName = 'bookmark' - Disabled = False Name = 'bookmark' end item CollectionIndex = 27 CollectionName = 'briefcase' - Disabled = False Name = 'briefcase' end item CollectionIndex = 28 CollectionName = 'bullish' - Disabled = False Name = 'bullish' end item CollectionIndex = 29 CollectionName = 'Business\business' - Disabled = False Name = 'business\business' end item CollectionIndex = 30 CollectionName = 'Business\business_contact' - Disabled = False Name = 'business\business_contact' end item CollectionIndex = 31 CollectionName = 'butting_in' - Disabled = False Name = 'butting_in' end item CollectionIndex = 32 CollectionName = 'cable_release' - Disabled = False Name = 'cable_release' end item CollectionIndex = 33 CollectionName = 'call_transfer' - Disabled = False Name = 'call_transfer' end item CollectionIndex = 34 CollectionName = 'callback' - Disabled = False Name = 'callback' end item CollectionIndex = 35 CollectionName = 'camcorder' - Disabled = False Name = 'camcorder' end item CollectionIndex = 36 CollectionName = 'camcorder_pro' - Disabled = False Name = 'camcorder_pro' end item CollectionIndex = 37 CollectionName = 'camera' - Disabled = False Name = 'camera' end item CollectionIndex = 38 CollectionName = 'camera_addon' - Disabled = False Name = 'camera_addon' end item CollectionIndex = 39 CollectionName = 'cancel' - Disabled = False Name = 'cancel' end item CollectionIndex = 40 CollectionName = 'candle_sticks' - Disabled = False Name = 'candle_sticks' end item CollectionIndex = 41 CollectionName = 'capacitor' - Disabled = False Name = 'capacitor' end item CollectionIndex = 42 CollectionName = 'cd_logo' - Disabled = False Name = 'cd_logo' end item CollectionIndex = 43 CollectionName = 'charge_battery' - Disabled = False Name = 'charge_battery' end item CollectionIndex = 44 CollectionName = 'checkmark' - Disabled = False Name = 'checkmark' end item CollectionIndex = 45 CollectionName = 'circuit' - Disabled = False Name = 'circuit' end item CollectionIndex = 46 CollectionName = 'clapperboard' - Disabled = False Name = 'clapperboard' end item CollectionIndex = 47 CollectionName = 'clear_filters' - Disabled = False Name = 'clear_filters' end item CollectionIndex = 48 CollectionName = 'close_up_mode' - Disabled = False Name = 'close_up_mode' end item CollectionIndex = 49 CollectionName = 'cloth' - Disabled = False Name = 'cloth' end item CollectionIndex = 50 CollectionName = 'collaboration' - Disabled = False Name = 'collaboration' end item CollectionIndex = 51 CollectionName = 'collect' - Disabled = False Name = 'collect' end item CollectionIndex = 52 CollectionName = 'combo_chart' - Disabled = False Name = 'combo_chart' end item CollectionIndex = 53 CollectionName = 'command_line' - Disabled = False Name = 'command_line' end item CollectionIndex = 54 CollectionName = 'comments' - Disabled = False Name = 'comments' end item CollectionIndex = 55 CollectionName = 'compact_camera' - Disabled = False Name = 'compact_camera' end item CollectionIndex = 56 CollectionName = 'conference_call' - Disabled = False Name = 'conference_call' end item CollectionIndex = 57 CollectionName = 'crystal_oscillator' - Disabled = False Name = 'crystal_oscillator' end item CollectionIndex = 58 CollectionName = 'currency_exchange' - Disabled = False Name = 'currency_exchange' end item CollectionIndex = 59 CollectionName = 'cursor' - Disabled = False Name = 'cursor' end item CollectionIndex = 60 CollectionName = 'customer_support' - Disabled = False Name = 'customer_support' end item CollectionIndex = 61 CollectionName = 'dam' - Disabled = False Name = 'dam' end item CollectionIndex = 62 CollectionName = 'data_sheet' - Disabled = False Name = 'data_sheet' end item CollectionIndex = 63 CollectionName = 'debt' - Disabled = False Name = 'debt' end item CollectionIndex = 64 CollectionName = 'department' - Disabled = False Name = 'department' end item CollectionIndex = 65 CollectionName = 'deployment' - Disabled = False Name = 'deployment' end item CollectionIndex = 66 CollectionName = 'diploma_1' - Disabled = False Name = 'diploma_1' end item CollectionIndex = 67 CollectionName = 'diploma_2' - Disabled = False Name = 'diploma_2' end item CollectionIndex = 68 CollectionName = 'display' - Disabled = False Name = 'display' end item CollectionIndex = 69 CollectionName = 'document' - Disabled = False Name = 'document' end item CollectionIndex = 70 CollectionName = 'donate' - Disabled = False Name = 'donate' end item CollectionIndex = 71 CollectionName = 'doughnut_chart' - Disabled = False Name = 'doughnut_chart' end item CollectionIndex = 72 CollectionName = 'down' - Disabled = False Name = 'down' end item CollectionIndex = 73 CollectionName = 'down_left' - Disabled = False Name = 'down_left' end item CollectionIndex = 74 CollectionName = 'down_right' - Disabled = False Name = 'down_right' end item CollectionIndex = 75 CollectionName = 'download' - Disabled = False Name = 'download' end item CollectionIndex = 76 CollectionName = 'dribbble' - Disabled = False Name = 'dribbble' end item CollectionIndex = 77 CollectionName = 'dvd_logo' - Disabled = False Name = 'dvd_logo' end item CollectionIndex = 78 CollectionName = 'electrical_sensor' - Disabled = False Name = 'electrical_sensor' end item CollectionIndex = 79 CollectionName = 'electrical_threshold' - Disabled = False Name = 'electrical_threshold' end item CollectionIndex = 80 CollectionName = 'electricity' - Disabled = False Name = 'electricity' end item CollectionIndex = 81 CollectionName = 'electro_devices' - Disabled = False Name = 'electro_devices' end item CollectionIndex = 82 CollectionName = 'electronics' - Disabled = False Name = 'electronics' end item CollectionIndex = 83 CollectionName = 'empty_battery' - Disabled = False Name = 'empty_battery' end item CollectionIndex = 84 CollectionName = 'empty_filter' - Disabled = False Name = 'empty_filter' end item CollectionIndex = 85 CollectionName = 'empty_trash' - Disabled = False Name = 'empty_trash' end item CollectionIndex = 86 CollectionName = 'end_call' - Disabled = False Name = 'end_call' end item CollectionIndex = 87 CollectionName = 'engineering' - Disabled = False Name = 'engineering' end item CollectionIndex = 88 CollectionName = 'entering_heaven_alive' - Disabled = False Name = 'entering_heaven_alive' end item CollectionIndex = 89 CollectionName = 'expand' - Disabled = False Name = 'expand' end item CollectionIndex = 90 CollectionName = 'export' - Disabled = False Name = 'export' end item CollectionIndex = 91 CollectionName = 'external' - Disabled = False Name = 'external' end item CollectionIndex = 92 CollectionName = 'factory' - Disabled = False Name = 'factory' end item CollectionIndex = 93 CollectionName = 'factory_breakdown' - Disabled = False Name = 'factory_breakdown' end item CollectionIndex = 94 CollectionName = 'faq' - Disabled = False Name = 'faq' end item CollectionIndex = 95 CollectionName = 'feed_in' - Disabled = False Name = 'feed_in' end item CollectionIndex = 96 CollectionName = 'feedback' - Disabled = False Name = 'feedback' end item CollectionIndex = 97 CollectionName = 'file' - Disabled = False Name = 'file' end item CollectionIndex = 98 CollectionName = 'filing_cabinet' - Disabled = False Name = 'filing_cabinet' end item CollectionIndex = 99 CollectionName = 'filled_filter' - Disabled = False Name = 'filled_filter' end item CollectionIndex = 100 CollectionName = 'Delphi_Product icon' - Disabled = False Name = 'Delphi_Product icon' end item CollectionIndex = 101 CollectionName = 'film' - Disabled = False Name = 'film' end item CollectionIndex = 102 CollectionName = 'film_reel' - Disabled = False Name = 'film_reel' end item CollectionIndex = 103 CollectionName = 'flash_auto' - Disabled = False Name = 'flash_auto' end item CollectionIndex = 104 CollectionName = 'flash_on' - Disabled = False Name = 'flash_on' end item CollectionIndex = 105 CollectionName = 'flow_chart' - Disabled = False Name = 'flow_chart' end item CollectionIndex = 106 CollectionName = 'folder' - Disabled = False Name = 'folder' end item CollectionIndex = 107 CollectionName = 'frame' - Disabled = False Name = 'frame' end item CollectionIndex = 108 CollectionName = 'full_battery' - Disabled = False Name = 'full_battery' end item CollectionIndex = 109 CollectionName = 'full_trash' - Disabled = False Name = 'full_trash' end item CollectionIndex = 110 CollectionName = 'gallery' - Disabled = False Name = 'gallery' end item CollectionIndex = 111 CollectionName = 'genealogy' - Disabled = False Name = 'genealogy' end item CollectionIndex = 112 CollectionName = 'generic_sorting_asc' - Disabled = False Name = 'generic_sorting_asc' end item CollectionIndex = 113 CollectionName = 'generic_sorting_desc' - Disabled = False Name = 'generic_sorting_desc' end item CollectionIndex = 114 CollectionName = 'globe' - Disabled = False Name = 'globe' end item CollectionIndex = 115 CollectionName = 'good_decision' - Disabled = False Name = 'good_decision' end item CollectionIndex = 116 CollectionName = 'google' - Disabled = False Name = 'google' end item CollectionIndex = 117 CollectionName = 'graduation_cap' - Disabled = False Name = 'graduation_cap' end item CollectionIndex = 118 CollectionName = 'grid' - Disabled = False Name = 'grid' end item CollectionIndex = 119 CollectionName = 'headset' - Disabled = False Name = 'headset' end item CollectionIndex = 120 CollectionName = 'heat_map' - Disabled = False Name = 'heat_map' end item CollectionIndex = 121 CollectionName = 'high_battery' - Disabled = False Name = 'high_battery' end item CollectionIndex = 122 CollectionName = 'high_priority' - Disabled = False Name = 'high_priority' end item CollectionIndex = 123 CollectionName = 'home' - Disabled = False Name = 'home' end item CollectionIndex = 124 CollectionName = 'icons8_cup' - Disabled = False Name = 'icons8_cup' end item CollectionIndex = 125 CollectionName = 'idea' - Disabled = False Name = 'idea' end item CollectionIndex = 126 CollectionName = 'image_file' - Disabled = False Name = 'image_file' end item CollectionIndex = 127 CollectionName = 'import' - Disabled = False Name = 'import' end item CollectionIndex = 128 CollectionName = 'in_transit' - Disabled = False Name = 'in_transit' end item CollectionIndex = 129 CollectionName = 'info' - Disabled = False Name = 'info' end item CollectionIndex = 130 CollectionName = 'inspection' - Disabled = False Name = 'inspection' end item CollectionIndex = 131 CollectionName = 'integrated_webcam' - Disabled = False Name = 'integrated_webcam' end item CollectionIndex = 132 CollectionName = 'internal' - Disabled = False Name = 'internal' end item CollectionIndex = 133 CollectionName = 'invite' - Disabled = False Name = 'invite' end item CollectionIndex = 134 CollectionName = 'ipad' - Disabled = False Name = 'ipad' end item CollectionIndex = 135 CollectionName = 'iphone' - Disabled = False Name = 'iphone' end item CollectionIndex = 136 CollectionName = 'key' - Disabled = False Name = 'key' end item CollectionIndex = 137 CollectionName = 'kindle' - Disabled = False Name = 'kindle' end item CollectionIndex = 138 CollectionName = 'landscape' - Disabled = False Name = 'landscape' end item CollectionIndex = 139 CollectionName = 'leave' - Disabled = False Name = 'leave' end item CollectionIndex = 140 CollectionName = 'left' - Disabled = False Name = 'left' end item CollectionIndex = 141 CollectionName = 'left_down2' - Disabled = False Name = 'left_down2' end item CollectionIndex = 142 CollectionName = 'left_up2' - Disabled = False Name = 'left_up2' end item CollectionIndex = 143 CollectionName = 'library' - Disabled = False Name = 'library' end item CollectionIndex = 144 CollectionName = 'light_at_the_end_of_tunnel' - Disabled = False Name = 'light_at_the_end_of_tunnel' end item CollectionIndex = 145 CollectionName = 'like' - Disabled = False Name = 'like' end item CollectionIndex = 146 CollectionName = 'like_placeholder' - Disabled = False Name = 'like_placeholder' end item CollectionIndex = 147 CollectionName = 'line_chart' - Disabled = False Name = 'line_chart' end item CollectionIndex = 148 CollectionName = 'link' - Disabled = False Name = 'link' end item CollectionIndex = 149 CollectionName = 'linux' - Disabled = False Name = 'linux' end item CollectionIndex = 150 CollectionName = 'list' - Disabled = False Name = 'list' end item CollectionIndex = 151 CollectionName = 'lock' - Disabled = False Name = 'lock' end item CollectionIndex = 152 CollectionName = 'lock_landscape' - Disabled = False Name = 'lock_landscape' end item CollectionIndex = 153 CollectionName = 'lock_portrait' - Disabled = False Name = 'lock_portrait' end item CollectionIndex = 154 CollectionName = 'low_battery' - Disabled = False Name = 'low_battery' end item CollectionIndex = 155 CollectionName = 'low_priority' - Disabled = False Name = 'low_priority' end item CollectionIndex = 156 CollectionName = 'make_decision' - Disabled = False Name = 'make_decision' end item CollectionIndex = 157 CollectionName = 'manager' - Disabled = False Name = 'manager' end item CollectionIndex = 158 CollectionName = 'medium_priority' - Disabled = False Name = 'medium_priority' end item CollectionIndex = 159 CollectionName = 'menu' - Disabled = False Name = 'menu' end item CollectionIndex = 160 CollectionName = 'middle_battery' - Disabled = False Name = 'middle_battery' end item CollectionIndex = 161 CollectionName = 'mind_map' - Disabled = False Name = 'mind_map' end item CollectionIndex = 162 CollectionName = 'missed_call' - Disabled = False Name = 'missed_call' end item CollectionIndex = 163 CollectionName = 'mms' - Disabled = False Name = 'mms' end item CollectionIndex = 164 CollectionName = 'money_transfer' - Disabled = False Name = 'money_transfer' end item CollectionIndex = 165 CollectionName = 'multiple_cameras' - Disabled = False Name = 'multiple_cameras' end item CollectionIndex = 166 CollectionName = 'multiple_devices' - Disabled = False Name = 'multiple_devices' end item CollectionIndex = 167 CollectionName = 'multiple_inputs' - Disabled = False Name = 'multiple_inputs' end item CollectionIndex = 168 CollectionName = 'multiple_smartphones' - Disabled = False Name = 'multiple_smartphones' end item CollectionIndex = 169 CollectionName = 'music' - Disabled = False Name = 'music' end item CollectionIndex = 170 CollectionName = 'neutral_decision' - Disabled = False Name = 'neutral_decision' end item CollectionIndex = 171 CollectionName = 'neutral_trading' - Disabled = False Name = 'neutral_trading' end item CollectionIndex = 172 CollectionName = 'news' - Disabled = False Name = 'news' end item CollectionIndex = 173 CollectionName = 'next' - Disabled = False Name = 'next' end item CollectionIndex = 174 CollectionName = 'nfc_sign' - Disabled = False Name = 'nfc_sign' end item CollectionIndex = 175 CollectionName = 'night_landscape' - Disabled = False Name = 'night_landscape' end item CollectionIndex = 176 CollectionName = 'night_portrait' - Disabled = False Name = 'night_portrait' end item CollectionIndex = 177 CollectionName = 'no_idea' - Disabled = False Name = 'no_idea' end item CollectionIndex = 178 CollectionName = 'no_video' - Disabled = False Name = 'no_video' end item CollectionIndex = 179 CollectionName = 'nook' - Disabled = False Name = 'nook' end item CollectionIndex = 180 CollectionName = 'numerical_sorting_12' - Disabled = False Name = 'numerical_sorting_12' end item CollectionIndex = 181 CollectionName = 'numerical_sorting_21' - Disabled = False Name = 'numerical_sorting_21' end item CollectionIndex = 182 CollectionName = 'ok' - Disabled = False Name = 'ok' end item CollectionIndex = 183 CollectionName = 'old_time_camera' - Disabled = False Name = 'old_time_camera' end item CollectionIndex = 184 CollectionName = 'online_support' - Disabled = False Name = 'online_support' end item CollectionIndex = 185 CollectionName = 'opened_folder' - Disabled = False Name = 'opened_folder' end item CollectionIndex = 186 CollectionName = 'org_unit' - Disabled = False Name = 'org_unit' end item CollectionIndex = 187 CollectionName = 'organization' - Disabled = False Name = 'organization' end item CollectionIndex = 188 CollectionName = 'package' - Disabled = False Name = 'package' end item CollectionIndex = 189 CollectionName = 'paid' - Disabled = False Name = 'paid' end item CollectionIndex = 190 CollectionName = 'panorama' - Disabled = False Name = 'panorama' end item CollectionIndex = 191 CollectionName = 'parallel_tasks' - Disabled = False Name = 'parallel_tasks' end item CollectionIndex = 192 CollectionName = 'phone' - Disabled = False Name = 'phone' end item CollectionIndex = 193 CollectionName = 'phone_android' - Disabled = False Name = 'phone_android' end item CollectionIndex = 194 CollectionName = 'photo_reel' - Disabled = False Name = 'photo_reel' end item CollectionIndex = 195 CollectionName = 'picture' - Disabled = False Name = 'picture' end item CollectionIndex = 196 CollectionName = 'pie_chart' - Disabled = False Name = 'pie_chart' end item CollectionIndex = 197 CollectionName = 'planner' - Disabled = False Name = 'planner' end item CollectionIndex = 198 CollectionName = 'plus' - Disabled = False Name = 'plus' end item CollectionIndex = 199 CollectionName = 'podium_with_audience' - Disabled = False Name = 'podium_with_audience' end item CollectionIndex = 200 CollectionName = 'podium_with_speaker' - Disabled = False Name = 'podium_with_speaker' end item CollectionIndex = 201 CollectionName = 'podium_without_speaker' - Disabled = False Name = 'podium_without_speaker' end item CollectionIndex = 202 CollectionName = 'portrait_mode' - Disabled = False Name = 'portrait_mode' end item CollectionIndex = 203 CollectionName = 'previous' - Disabled = False Name = 'previous' end item CollectionIndex = 204 CollectionName = 'print' - Disabled = False Name = 'print' end item CollectionIndex = 205 CollectionName = 'privacy' - Disabled = False Name = 'privacy' end item CollectionIndex = 206 CollectionName = 'process' - Disabled = False Name = 'process' end item CollectionIndex = 207 CollectionName = 'puzzle' - Disabled = False Name = 'puzzle' end item CollectionIndex = 208 CollectionName = 'questions' - Disabled = False Name = 'questions' end item CollectionIndex = 209 CollectionName = 'radar_plot' - Disabled = False Name = 'radar_plot' end item CollectionIndex = 210 CollectionName = 'rating' - Disabled = False Name = 'rating' end item CollectionIndex = 211 CollectionName = 'ratings' - Disabled = False Name = 'ratings' end item CollectionIndex = 212 CollectionName = 'reading' - Disabled = False Name = 'reading' end item CollectionIndex = 213 CollectionName = 'reading_ebook' - Disabled = False Name = 'reading_ebook' end item CollectionIndex = 214 CollectionName = 'reddit' - Disabled = False Name = 'reddit' end item CollectionIndex = 215 CollectionName = 'redo' - Disabled = False Name = 'redo' end item CollectionIndex = 216 CollectionName = 'refresh' - Disabled = False Name = 'refresh' end item CollectionIndex = 217 CollectionName = 'registered_trademark' - Disabled = False Name = 'registered_trademark' end item CollectionIndex = 218 CollectionName = 'remove_image' - Disabled = False Name = 'remove_image' end item CollectionIndex = 219 CollectionName = 'reuse' - Disabled = False Name = 'reuse' end item CollectionIndex = 220 CollectionName = 'right' - Disabled = False Name = 'right' end item CollectionIndex = 221 CollectionName = 'right_down2' - Disabled = False Name = 'right_down2' end item CollectionIndex = 222 CollectionName = 'right_up2' - Disabled = False Name = 'right_up2' end item CollectionIndex = 223 CollectionName = 'rotate_camera' - Disabled = False Name = 'rotate_camera' end item CollectionIndex = 224 CollectionName = 'rotate_to_landscape' - Disabled = False Name = 'rotate_to_landscape' end item CollectionIndex = 225 CollectionName = 'rotate_to_portrait' - Disabled = False Name = 'rotate_to_portrait' end item CollectionIndex = 226 CollectionName = 'rules' - Disabled = False Name = 'rules' end item CollectionIndex = 227 CollectionName = 'safe' - Disabled = False Name = 'safe' end item CollectionIndex = 228 CollectionName = 'sales_performance' - Disabled = False Name = 'sales_performance' end item CollectionIndex = 229 CollectionName = 'scatter_plot' - Disabled = False Name = 'scatter_plot' end item CollectionIndex = 230 CollectionName = 'search' - Disabled = False Name = 'search' end item CollectionIndex = 231 CollectionName = 'self_service_kiosk' - Disabled = False Name = 'self_service_kiosk' end item CollectionIndex = 232 CollectionName = 'selfie' - Disabled = False Name = 'selfie' end item CollectionIndex = 233 CollectionName = 'serial_tasks' - Disabled = False Name = 'serial_tasks' end item CollectionIndex = 234 CollectionName = 'service_mark' - Disabled = False Name = 'service_mark' end item CollectionIndex = 235 CollectionName = 'services' - Disabled = False Name = 'services' end item CollectionIndex = 236 CollectionName = 'settings' - Disabled = False Name = 'settings' end item CollectionIndex = 237 CollectionName = 'share' - Disabled = False Name = 'share' end item CollectionIndex = 238 CollectionName = 'shipped' - Disabled = False Name = 'shipped' end item CollectionIndex = 239 CollectionName = 'shop' - Disabled = False Name = 'shop' end item CollectionIndex = 240 CollectionName = 'sim_card' - Disabled = False Name = 'sim_card' end item CollectionIndex = 241 CollectionName = 'sim_card_chip' - Disabled = False Name = 'sim_card_chip' end item CollectionIndex = 242 CollectionName = 'slr_back_side' - Disabled = False Name = 'slr_back_side' end item CollectionIndex = 243 CollectionName = 'smartphone_tablet' - Disabled = False Name = 'smartphone_tablet' end item CollectionIndex = 244 CollectionName = 'sms' - Disabled = False Name = 'sms' end item CollectionIndex = 245 CollectionName = 'sound_recording_copyright' - Disabled = False Name = 'sound_recording_copyright' end item CollectionIndex = 246 CollectionName = 'speaker' - Disabled = False Name = 'speaker' end item CollectionIndex = 247 CollectionName = 'sports_mode' - Disabled = False Name = 'sports_mode' end item CollectionIndex = 248 CollectionName = 'stack_of_photos' - Disabled = False Name = 'stack_of_photos' end item CollectionIndex = 249 CollectionName = 'start' - Disabled = False Name = 'start' end item CollectionIndex = 250 CollectionName = 'steam' - Disabled = False Name = 'steam' end item CollectionIndex = 251 CollectionName = 'stumbleupon' - Disabled = False Name = 'stumbleupon' end item CollectionIndex = 252 CollectionName = 'support' - Disabled = False Name = 'support' end item CollectionIndex = 253 CollectionName = 'survey' - Disabled = False Name = 'survey' end item CollectionIndex = 254 CollectionName = 'switch_camera' - Disabled = False Name = 'switch_camera' end item CollectionIndex = 255 CollectionName = 'synchronize' - Disabled = False Name = 'synchronize' end item CollectionIndex = 256 CollectionName = 'tablet_android' - Disabled = False Name = 'tablet_android' end item CollectionIndex = 257 CollectionName = 'template' - Disabled = False Name = 'template' end item CollectionIndex = 258 CollectionName = 'timeline' - Disabled = False Name = 'timeline' end item CollectionIndex = 259 CollectionName = 'todo_list' - Disabled = False Name = 'todo_list' end item CollectionIndex = 260 CollectionName = 'touchscreen_smartphone' - Disabled = False Name = 'touchscreen_smartphone' end item CollectionIndex = 261 CollectionName = 'trademark' - Disabled = False Name = 'trademark' end item CollectionIndex = 262 CollectionName = 'tree_structure' - Disabled = False Name = 'tree_structure' end item CollectionIndex = 263 CollectionName = 'two_smartphones' - Disabled = False Name = 'two_smartphones' end item CollectionIndex = 264 CollectionName = 'undo' - Disabled = False Name = 'undo' end item CollectionIndex = 265 CollectionName = 'unlock' - Disabled = False Name = 'unlock' end item CollectionIndex = 266 CollectionName = 'up' - Disabled = False Name = 'up' end item CollectionIndex = 267 CollectionName = 'up_left' - Disabled = False Name = 'up_left' end item CollectionIndex = 268 CollectionName = 'up_right' - Disabled = False Name = 'up_right' end item CollectionIndex = 269 CollectionName = 'upload' - Disabled = False Name = 'upload' end item CollectionIndex = 270 CollectionName = 'usb' - Disabled = False Name = 'usb' end item CollectionIndex = 271 CollectionName = 'video_call' - Disabled = False Name = 'video_call' end item CollectionIndex = 272 CollectionName = 'video_file' - Disabled = False Name = 'video_file' end item CollectionIndex = 273 CollectionName = 'video_projector' - Disabled = False Name = 'video_projector' end item CollectionIndex = 274 CollectionName = 'view_details' - Disabled = False Name = 'view_details' end item CollectionIndex = 275 CollectionName = 'vip' - Disabled = False Name = 'vip' end item CollectionIndex = 276 CollectionName = 'vlc' - Disabled = False Name = 'vlc' end item CollectionIndex = 277 CollectionName = 'voice_presentation' - Disabled = False Name = 'voice_presentation' end item CollectionIndex = 278 CollectionName = 'voicemail' - Disabled = False Name = 'voicemail' end item CollectionIndex = 279 CollectionName = 'webcam' - Disabled = False Name = 'webcam' end item CollectionIndex = 280 CollectionName = 'wi-fi_logo' - Disabled = False Name = 'wi-fi_logo' end item CollectionIndex = 281 CollectionName = 'wikipedia' - Disabled = False Name = 'wikipedia' end item CollectionIndex = 282 CollectionName = 'workflow' - Disabled = False Name = 'workflow' end item CollectionIndex = 283 CollectionName = 'Pyton' - Disabled = False Name = 'Pyton' end item CollectionIndex = 284 CollectionName = 'monochrome' - Disabled = False Name = 'monochrome' end> ImageCollection = ImageDataModule.SVGIconImageCollection diff --git a/Demo/Source/UMainNew.pas b/Demo/Source/UMainNew.pas index b6e0c9a..d8e67f5 100644 --- a/Demo/Source/UMainNew.pas +++ b/Demo/Source/UMainNew.pas @@ -3,7 +3,7 @@ { SVG Icon ImageList: An extended ImageList for Delphi/VCL } { to simplify use of Icons (resize, colors and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { Nicola Tambascia, Vincent Parrett } diff --git a/Demo/Source/UMainTest.pas b/Demo/Source/UMainTest.pas index 8fd952e..8945f9e 100644 --- a/Demo/Source/UMainTest.pas +++ b/Demo/Source/UMainTest.pas @@ -3,7 +3,7 @@ { SVG Icon ImageList: An extended ImageList for Delphi/VCL } { to simplify use of Icons (resize, colors and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { Nicola Tambascia } diff --git a/Image32/source/Img32.Extra.pas b/Image32/source/Img32.Extra.pas index 2818fb1..6768c33 100644 --- a/Image32/source/Img32.Extra.pas +++ b/Image32/source/Img32.Extra.pas @@ -1211,6 +1211,7 @@ TFloodFillRec = record next : PFloodFillRec; end; TFloodFillStack = class + private first : PFloodFillRec; maxY : integer; constructor Create(maxY: integer); @@ -1535,6 +1536,7 @@ procedure Emboss(img: TImage32; radius: Integer; type TPt2Container = class; TPt2 = class + private pt : TPointD; owner : TPt2Container; isStart : Boolean; @@ -1550,6 +1552,7 @@ TPt2 = class property IsAscending: Boolean read isStart; end; TPt2Container = class + private prevRight: integer; leftMostPt, rightMost: TPt2; solution: TPathsD; diff --git a/Image32/source/Img32.Text.pas b/Image32/source/Img32.Text.pas index b7a1cd0..8f9dae5 100644 --- a/Image32/source/Img32.Text.pas +++ b/Image32/source/Img32.Text.pas @@ -394,6 +394,7 @@ TTextPageMetrics = record TWordInfoList = class; TWordInfo = class + private index : integer; aWord : UnicodeString; width : double; diff --git a/Image32/source/Img32.pas b/Image32/source/Img32.pas index a57e916..e33f5e2 100644 --- a/Image32/source/Img32.pas +++ b/Image32/source/Img32.pas @@ -597,6 +597,7 @@ TImgFmtRec = record PImgFmtRec = ^TImgFmtRec; TResamplerObj = class + private id: integer; name: string; func: TResamplerFunction; diff --git a/Packages/FMX.SVGIconImageListEditorUnit.pas b/Packages/FMX.SVGIconImageListEditorUnit.pas index 5f71869..3b65ae7 100644 --- a/Packages/FMX.SVGIconImageListEditorUnit.pas +++ b/Packages/FMX.SVGIconImageListEditorUnit.pas @@ -3,7 +3,7 @@ { SVG Icon ImageList: An extended ImageList for Delphi/VLC+FMX } { to simplify use of Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: Volodymyr B. } { } diff --git a/Packages/FMX.SVGIconImageRegister.pas b/Packages/FMX.SVGIconImageRegister.pas index 0f8a0fa..7c2416b 100644 --- a/Packages/FMX.SVGIconImageRegister.pas +++ b/Packages/FMX.SVGIconImageRegister.pas @@ -3,7 +3,7 @@ { SVG Icon ImageList: An extended ImageList for Delphi } { to simplify use of Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Contributors: } { Carlo Barazzetta } { } diff --git a/Packages/FMX.SVGTextPropertyEditorUnit.pas b/Packages/FMX.SVGTextPropertyEditorUnit.pas index 49b77c1..1163fef 100644 --- a/Packages/FMX.SVGTextPropertyEditorUnit.pas +++ b/Packages/FMX.SVGTextPropertyEditorUnit.pas @@ -3,7 +3,7 @@ { SVGTextPropertyEditorUnit: A property editor for SVGText } { to simplify use of setting SVGText value } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { } diff --git a/Packages/SVGIconImageListEditorUnit.pas b/Packages/SVGIconImageListEditorUnit.pas index fabfe6c..9911556 100644 --- a/Packages/SVGIconImageListEditorUnit.pas +++ b/Packages/SVGIconImageListEditorUnit.pas @@ -2,7 +2,7 @@ { } { SVGIconImageList Component Editor } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: Vincent Parrett, Kiriakos Vlahos } { } diff --git a/Packages/SVGIconImageRegister.pas b/Packages/SVGIconImageRegister.pas index 571387a..4760ff6 100644 --- a/Packages/SVGIconImageRegister.pas +++ b/Packages/SVGIconImageRegister.pas @@ -2,7 +2,7 @@ { } { SVGIconImage Registration for Components and Editors } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: Vincent Parrett, Kiriakos Vlahos } { } @@ -252,8 +252,8 @@ procedure Register; RegisterPropertyEditor(TypeInfo(TSVGIconItems), TSVGIconImageCollection, 'SVGIconItems', TSVGIconCollectionListProperty); RegisterPropertyEditor(TypeInfo(string), TSVGIconItem, 'SVGText', TSVGTextProperty); RegisterPropertyEditor(TypeInfo(string), TSVGIconImage, 'SVGText', TSVGTextProperty); - RegisterPropertyEditor(TypeInfo(System.UITypes.TImageIndex), TSVGIconImage, 'ImageIndex', - TSVGImageIndexPropertyEditor); + RegisterPropertyEditor(TypeInfo(System.UITypes.TImageIndex), TSVGIconImage, 'ImageIndex', TSVGImageIndexPropertyEditor); + //RegisterPropertyEditor(TypeInfo(System.UITypes.TImageName), TSVGIconImage, 'ImageName', TSVGImageIndexPropertyEditor); end; { TSVGIconImageCollectionCompEditor } diff --git a/Packages/SVGTextPropertyEditorUnit.pas b/Packages/SVGTextPropertyEditorUnit.pas index 5f0d5e0..e4f5d39 100644 --- a/Packages/SVGTextPropertyEditorUnit.pas +++ b/Packages/SVGTextPropertyEditorUnit.pas @@ -3,7 +3,7 @@ { SVGTextPropertyEditorUnit: A property editor for SVGText } { to simplify use of setting SVGText value } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { } { https://github.com/EtheaDev/SVGIconImageList } diff --git a/README.md b/README.md index a05a7a1..858e3ec 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Four engines to render SVG (Delphi Image32, Delphi TSVG, SKIA4Delphi, Direct2D wrapper) and four components to simplify use of SVG images (resize, fixedcolor, grayscale...) -### Actual official version 3.9.4 (VCL+FMX) +### Actual official version 3.9.5 (VCL+FMX) | Component | Description | | - | - | @@ -83,6 +83,11 @@ Follow the [guide in Wiki section](https://github.com/EtheaDev/SVGIconImageList/ ### RELEASE NOTES +13 Jan 2023: version 3.9.5 (VCL+FMX) +- Updated Copyright 2023 +- Updated to Image32 ver. 4.3 (27 Sep 2022) +- Updated to Skia4Delphi ver. 4.0.2 + 23 Oct 2022: version 3.9.4 (VCL+FMX) - FMX Component editor: changed selection for fixed color - Updated to Image32 ver. 4.3 (27 Sep 2022) diff --git a/Source/FMX.Image32SVG.pas b/Source/FMX.Image32SVG.pas index 3d6fd99..27dfc02 100644 --- a/Source/FMX.Image32SVG.pas +++ b/Source/FMX.Image32SVG.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/FMX } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { } diff --git a/Source/FMX.ImageSVG.pas b/Source/FMX.ImageSVG.pas index 1a64303..176676a 100644 --- a/Source/FMX.ImageSVG.pas +++ b/Source/FMX.ImageSVG.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/FMX } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { } @@ -49,15 +49,11 @@ interface TFmxImageSVG = class(TObject) private FSource: String; - FWidth: Single; - FHeight: Single; FFixedColor: TAlphaColor; FApplyFixedColorToRootOnly: Boolean; FGrayScale: Boolean; FOpacity: Single; // property access methods - function GetWidth: Single; - function GetHeight: Single; function GetOpacity: Single; procedure SetOpacity(const Opacity: Single); function GetGrayScale: Boolean; @@ -69,8 +65,6 @@ TFmxImageSVG = class(TObject) function GetSource: string; // procedures and functions procedure Clear; - procedure SetHeight(const Value: Single); - procedure SetWidth(const Value: Single); {$IFDEF CheckForUnsupportedSvg} procedure CheckForUnsupportedSvg; {$ENDIF} @@ -94,8 +88,6 @@ TFmxImageSVG = class(TObject) property Opacity: Single read GetOpacity write SetOpacity; property FixedColor: TAlphaColor read GetFixedColor write SetFixedColor; property GrayScale: Boolean read GetGrayScale write SetGrayScale; - property Width: Single read GetWidth write SetWidth; - property Height: Single read GetHeight write SetHeight; property Source: string read GetSource; property ApplyFixedColorToRootOnly: Boolean read GetApplyFixedColorToRootOnly write SetApplyFixedColorToRootOnly; end; @@ -148,12 +140,6 @@ function TFmxImageSVG.GetGrayScale: Boolean; begin Result := FGrayScale; end; - -function TFmxImageSVG.GetHeight: Single; -begin - Result := FHeight; -end; - function TFmxImageSVG.GetOpacity: Single; begin Result := FOpacity; @@ -163,12 +149,6 @@ function TFmxImageSVG.GetSource: string; begin Result := FSource; end; - -function TFmxImageSVG.GetWidth: Single; -begin - Result := FWidth; -end; - procedure TFmxImageSVG.LoadFromText(const ASVGText: string); var LOldText: string; @@ -244,12 +224,6 @@ procedure TFmxImageSVG.SetGrayScale(const IsGrayScale: Boolean); FGrayScale := IsGrayScale; FFixedColor := TAlphaColorRec.Null; end; - -procedure TFmxImageSVG.SetHeight(const Value: Single); -begin - FHeight := Value; -end; - procedure TFmxImageSVG.SetOpacity(const Opacity: Single); begin FOpacity := Opacity; @@ -264,9 +238,4 @@ procedure TFmxImageSVG.SetSource(const ASource: string); end; end; -procedure TFmxImageSVG.SetWidth(const Value: Single); -begin - FWidth := Value; -end; - end. diff --git a/Source/FMX.ImageSkiaSVG.pas b/Source/FMX.ImageSkiaSVG.pas index b2bc0cd..9c36e79 100644 --- a/Source/FMX.ImageSkiaSVG.pas +++ b/Source/FMX.ImageSkiaSVG.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/FMX } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { } diff --git a/Source/FMX.SVGIconImage.pas b/Source/FMX.SVGIconImage.pas index edb107f..984dd19 100644 --- a/Source/FMX.SVGIconImage.pas +++ b/Source/FMX.SVGIconImage.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/FMX } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { } diff --git a/Source/FMX.SVGIconImageList.pas b/Source/FMX.SVGIconImageList.pas index b4104b0..ebc45e0 100644 --- a/Source/FMX.SVGIconImageList.pas +++ b/Source/FMX.SVGIconImageList.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/FMX } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { } @@ -47,7 +47,7 @@ interface ; const - SVGIconImageListVersion = '3.9.4'; + SVGIconImageListVersion = '3.9.5'; DEFAULT_SIZE = 32; ZOOM_DEFAULT = 100; SVG_INHERIT_COLOR = TAlphaColors.Null; diff --git a/Source/SVGIconImage.pas b/Source/SVGIconImage.pas index 996309d..952c352 100644 --- a/Source/SVGIconImage.pas +++ b/Source/SVGIconImage.pas @@ -2,7 +2,7 @@ { } { SVG Image in TPicture: useful to show a Scalable Vector Graphic } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: } { } @@ -41,14 +41,32 @@ interface , System.SysUtils , System.Types , System.Classes - , System.UITypes , Vcl.Controls , Vcl.Graphics , Vcl.ImgList + , System.UITypes , SVGIconItems - , SVGInterfaces; + , SVGInterfaces + , SVGIconImageListBase + {$IFDEF D10_3+} + , Vcl.VirtualImageList + {$ENDIF} + , SVGIconImageCollection; type + TSVGIconImage = class; + + TSVGIconImageActionLink = class(TControlActionLink) + protected + FClient: TSVGIconImage; + function IsImageIndexLinked: Boolean; override; + {$IFDEF D10_4+} + function IsImageNameLinked: Boolean; override; + {$ENDIF} + procedure SetImageIndex(Value: Integer); override; + procedure AssignClient(AClient: TObject); override; + end; + TSVGIconImage = class(TGraphicControl) strict private FSVG: ISVG; @@ -60,6 +78,9 @@ TSVGIconImage = class(TGraphicControl) FFileName: TFileName; FImageList: TCustomImageList; FImageIndex: System.UITypes.TImageIndex; + {$IFDEF D10_4+} + FImageName: System.UITypes.TImageName; + {$ENDIF} FImageChangeLink: TChangeLink; FFixedColor: TColor; FGrayScale: Boolean; @@ -68,7 +89,6 @@ TSVGIconImage = class(TGraphicControl) procedure SetProportional(Value: Boolean); procedure SetOpacity(Value: Byte); procedure SetFileName(const Value: TFileName); - procedure SetImageIndex(const Value: System.UITypes.TImageIndex); procedure SetStretch(const Value: Boolean); procedure SetImageList(const Value: TCustomImageList); procedure SetAutoSizeImage(const Value: Boolean); @@ -81,12 +101,29 @@ TSVGIconImage = class(TGraphicControl) procedure ReadDummyBool(Reader: TReader); procedure ReadDummyFloat(Reader: TReader); procedure WriteDummy(Writer: TWriter); + function IsImageIndexAvail: Boolean; private function GetSVGText: string; procedure SetSVGText(const AValue: string); function UsingSVGText: Boolean; function GetSVG: ISVG; + function GetIconImageList: TSVGIconImageListBase; + function GetIconImageCollection: TSVGIconImageCollection; + {$IFDEF D10_3+} + function GetVirtualImageList: TVirtualImageList; + {$ENDIF} + + procedure SetImageIndex(const Value: TImageIndex); + {$IFDEF D10_4+} + procedure SetImageName(const Value: TImageName); + function IsImageNameStored: Boolean; + {$ENDIF} + function IsImageIndexStored: Boolean; protected + procedure UpdateImage; virtual; + {$IFDEF D10_4+} + procedure CheckImageIndexes; + {$ENDIF} procedure DefineProperties(Filer: TFiler); override; procedure Paint; override; @@ -104,12 +141,20 @@ TSVGIconImage = class(TGraphicControl) procedure SaveToFile(const FileName: string); procedure Assign(Source: TPersistent); override; property SVG: ISVG read GetSVG; + property SVGIconImageList: TSVGIconImageListBase read GetIconImageList; + property SVGIconImageCollection: TSVGIconImageCollection read GetIconImageCollection; + {$IFDEF D10_3+} + property SVGVirtualImageList: TVirtualImageList read GetVirtualImageList; + {$ENDIF} published property AutoSize: Boolean read FAutoSize write SetAutoSizeImage; property Center: Boolean read FCenter write SetCenter default True; property Opacity: Byte read FOpacity write SetOpacity default 255; property ImageList: TCustomImageList read FImageList write SetImageList; - property ImageIndex: System.UITypes.TImageIndex read FImageIndex write SetImageIndex default -1; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex stored IsImageIndexStored default -1; + {$IFDEF D10_4+} + property ImageName: TImageName read FImageName write SetImageName stored IsImageNameStored; + {$ENDIF} property FileName: TFileName read FFileName write SetFileName; property SVGText: string read GetSVGText write SetSVGText stored UsingSVGText; property FixedColor: TColor read FFixedColor write SetFixedColor default SVG_INHERIT_COLOR; @@ -194,21 +239,17 @@ TSVGGraphic = class(TGraphic) implementation -uses - SVGIconImageListBase - {$IFDEF D10_3+} - , Vcl.VirtualImageList - {$ENDIF} - , SVGIconImageCollection; - procedure TSVGIconImage.UpdateSVGFactory; var LOldSVGText: string; begin - LOldSVGText := fsvg.Source; - FSVG := GlobalSVGFactory.NewSvg; - FSVG.Source := LOldSVGText; - Invalidate; + if UsingSVGText then + begin + LOldSVGText := FSVG.Source; + FSVG := GlobalSVGFactory.NewSvg; + FSVG.Source := LOldSVGText; + Invalidate; + end; end; constructor TSVGIconImage.Create(AOwner: TComponent); @@ -220,6 +261,9 @@ constructor TSVGIconImage.Create(AOwner: TComponent); FStretch := True; FOpacity := 255; FImageIndex := -1; + {$IFDEF D10_4+} + FImageName := ''; + {$ENDIF} FFixedColor := SVG_INHERIT_COLOR; FGrayScale := False; //ParentBackground := True; @@ -253,7 +297,8 @@ procedure TSVGIconImage.DefineProperties(Filer: TFiler); destructor TSVGIconImage.Destroy; begin - FImageChangeLink.Free; + ImageList := nil; + FreeAndNil(FImageChangeLink); inherited; end; @@ -265,6 +310,15 @@ procedure TSVGIconImage.CheckAutoSize; end; end; +{$IFDEF D10_4+} +procedure TSVGIconImage.CheckImageIndexes; +begin + if (ImageList = nil) or not ImageList.IsImageNameAvailable then + Exit; + ImageList.CheckIndexAndName(FImageIndex, FImageName); +end; +{$ENDIF} + procedure TSVGIconImage.Clear; begin FSVG.Clear; @@ -277,38 +331,38 @@ function TSVGIconImage.Empty: Boolean; Empty := FSVG.IsEmpty; end; +function TSVGIconImage.IsImageIndexAvail: Boolean; +begin + Result := False; + if (FImageIndex >= 0) and Assigned(FImageList) then + Result := FImageIndex <= FImageList.Count; +end; + function TSVGIconImage.GetInheritedApplyToRootOnly: Boolean; +var + LSVGIconItem: TSVGIconItem; begin Result := False; - if not Assigned(FImageList) then - Exit; + LSVGIconItem := SVGIconItem; + if Assigned(LSVGIconItem) then + Result := SVGIconItem.ApplyFixedColorToRootOnly; if FImageList is TSVGIconImageListBase then - begin - if FImageIndex >= 0 then - begin - if FImageIndex < FImageList.Count then - Result := SVGIconItem.ApplyFixedColorToRootOnly; - end; - Result := Result or TSVGIconImageListBase(FImageList).ApplyFixedColorToRootOnly; - end; + Result := Result or TSVGIconImageListBase(FImageList).ApplyFixedColorToRootOnly + {$IFDEF D10_3+} + else if FImageList is TVirtualImageList and + (TVirtualImageList(FImageList).ImageCollection is TSVGIconImageCollection) then + Result := Result or TSVGIconImageCollection(TVirtualImageList(FImageList).ImageCollection).ApplyFixedColorToRootOnly; + {$ENDIF} end; function TSVGIconImage.GetInheritedFixedColor: TColor; +var + LSVGIconItem: TSVGIconItem; begin Result := SVG_INHERIT_COLOR; - if not Assigned(FImageList) then - Exit; - if FImageList is TSVGIconImageListBase then - begin - if FImageIndex >= 0 then - begin - if FImageIndex < FImageList.Count then - Result := SVGIconItem.FixedColor; - if Result <> SVG_INHERIT_COLOR then - exit; - end; - Result := TSVGIconImageListBase(FImageList).FixedColor; - end; + LSVGIconItem := SVGIconItem; + if Assigned(LSVGIconItem) then + Result := LSVGIconItem.FixedColor; end; function TSVGIconImage.GetSVG: ISVG; @@ -326,37 +380,109 @@ function TSVGIconImage.GetSVGText: string; procedure TSVGIconImage.ImageListChange(Sender: TObject); begin - if Sender = FImageList then + UpdateImage; + Invalidate; +end; + +function TSVGIconImage.GetIconImageList: TSVGIconImageListBase; +begin + if FImageList is TSVGIconImageListBase then + Result := TSVGIconImageListBase(FImageList) + else + Result := nil; +end; + +{$IFDEF D10_3+} +function TSVGIconImage.GetVirtualImageList: TVirtualImageList; +begin + Result := nil; + if (FImageList is TVirtualImageList) and + (TVirtualImageList(FImageList).ImageCollection is TSVGIconImageCollection) then + Result := TVirtualImageList(FImageList); +end; +{$ENDIF} + +function TSVGIconImage.IsImageIndexStored: Boolean; +begin + Result := (ActionLink = nil) or + not TSVGIconImageActionLink(ActionLink).IsImageIndexLinked; +end; + +{$IFDEF D10_4+} +function TSVGIconImage.IsImageNameStored: Boolean; +begin + Result := (ActionLink = nil) or + not TSVGIconImageActionLink(ActionLink).IsImageNameLinked; +end; + +procedure TSVGIconImage.SetImageName(const Value: TImageName); +begin + if Value <> FImageName then + begin + FImageName := Value; + if (FImageList <> nil) and FImageList.IsImageNameAvailable then + FImageIndex := FImageList.GetIndexByName(FImageName); + UpdateImage; Invalidate; + end; end; +{$ENDIF} -function TSVGIconImage.SVGIconItem: TSVGIconItem; +procedure TSVGIconImage.UpdateImage; +begin +{$IFDEF D10_4+} + if (FImageList <> nil) and FImageList.IsImageNameAvailable then + begin + if (FImageName <> '') and (FImageIndex = -1) then + FImageIndex := FImageList.GetIndexByName(FImageName) + else if (FImageName = '') and (FImageIndex <> -1) then + FImageName := FImageList.GetNameByIndex(FImageIndex); + end; +{$ENDIF} +end; + +function TSVGIconImage.GetIconImageCollection: TSVGIconImageCollection; +{$IFDEF D10_3+} var - {$IFDEF D10_3+} LVirtualImageList: TVirtualImageList; - LItem: TVirtualImageListItem; - {$ENDIF} - LSVGIconItems: TSVGIconItems; +{$ENDIF} begin Result := nil; - if FImageList is TSVGIconImageListBase then - begin - LSVGIconItems := TSVGIconImageListBase(FImageList).SVGIconItems; - Result := LSVGIconItems[FImageIndex]; - end; {$IFDEF D10_3+} if (FImageList is TVirtualImageList) then begin LVirtualImageList := TVirtualImageList(FImageList); if LVirtualImageList.ImageCollection is TSVGIconImageCollection then + Result := TSVGIconImageCollection(LVirtualImageList.ImageCollection); + end; + {$ENDIF} +end; + +function TSVGIconImage.SVGIconItem: TSVGIconItem; +var + {$IFDEF D10_3+} + LItem: TVirtualImageListItem; + {$ENDIF} + LSVGIconItems: TSVGIconItems; +begin + Result := nil; + if IsImageIndexAvail then + begin + if SVGIconImageList <> nil then begin - LSVGIconItems := TSVGIconImageCollection(LVirtualImageList.ImageCollection).SVGIconItems; - LItem := LVirtualImageList.Images[FImageIndex]; + LSVGIconItems := SVGIconImageList.SVGIconItems; + Result := LSVGIconItems[FImageIndex]; + end + {$IFDEF D10_3+} + else if SVGVirtualImageList <> nil then + begin + LSVGIconItems := SVGIconImageCollection.SVGIconItems; + LItem := SVGVirtualImageList.Images[FImageIndex]; if Assigned(LItem) then Result := LSVGIconItems[LItem.Collectionindex]; - end; + end + {$ENDIF} end; - {$ENDIF} end; function TSVGIconImage.UsingSVGText: Boolean; @@ -562,24 +688,38 @@ procedure TSVGIconImage.SetGrayScale(const Value: Boolean); end; end; -procedure TSVGIconImage.SetImageIndex(const Value: System.UITypes.TImageIndex); +procedure TSVGIconImage.SetImageIndex(const Value: TImageIndex); begin - if FImageIndex = Value then - Exit; - FImageIndex := Value; - CheckAutoSize; - Repaint; + if FImageIndex <> Value then + begin + FImageIndex := Value; + {$IFDEF D10_4+} + if (FImageList <> nil) and FImageList.IsImageNameAvailable then + FImageName := FImageList.GetNameByIndex(FImageIndex); + {$ENDIF} + CheckAutoSize; + UpdateImage; + Invalidate; + end; end; procedure TSVGIconImage.SetImageList(const Value: TCustomImageList); begin - if FImageList <> nil then FImageList.UnRegisterChanges(FImageChangeLink); - FImageList := Value; - if FImageList <> nil then + if Value <> FImageList then begin - FImageList.RegisterChanges(FImageChangeLink); - FImageList.FreeNotification(Self); - SVGText := ''; + if FImageList <> nil then + begin + FImageList.RemoveFreeNotification(Self); + FImageList.UnRegisterChanges(FImageChangeLink); + end; + FImageList := Value; + if FImageList <> nil then + begin + FImageList.RegisterChanges(FImageChangeLink); + FImageList.FreeNotification(Self); + end; + UpdateImage; + Invalidate; end; end; @@ -743,6 +883,34 @@ procedure TSVGGraphic.SaveToStream(Stream: TStream); FSVG.SaveToStream(Stream); end; +{ TSVGIconImageActionLink } + +procedure TSVGIconImageActionLink.AssignClient(AClient: TObject); +begin + inherited AssignClient(AClient); + FClient := AClient as TSVGIconImage; +end; + +function TSVGIconImageActionLink.IsImageIndexLinked: Boolean; +begin + Result := inherited IsImageIndexLinked and + (TSVGIconImage(FClient).ImageIndex = TSVGIconImage(Action).ImageIndex); +end; + +{$IFDEF D10_4+} +function TSVGIconImageActionLink.IsImageNameLinked: Boolean; +begin + Result := inherited IsImageIndexLinked and + (TSVGIconImage(FClient).ImageName = TSVGIconImage(Action).ImageName); +end; +{$ENDIF} + +procedure TSVGIconImageActionLink.SetImageIndex(Value: Integer); +begin + inherited; + if IsImageIndexLinked then + TSVGIconImage(FClient).ImageIndex := Value; +end; initialization TPicture.RegisterFileFormat('SVG', 'Scalable Vector Graphics', TSVGGraphic); diff --git a/Source/SVGIconImageCollection.pas b/Source/SVGIconImageCollection.pas index bf81b38..2918754 100644 --- a/Source/SVGIconImageCollection.pas +++ b/Source/SVGIconImageCollection.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/VCL } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Vincent Parrett } { Contributors: Carlo Barazzetta, Kiriakos Vlahos } { } diff --git a/Source/SVGIconImageList.pas b/Source/SVGIconImageList.pas index 075bb59..3a4676b 100644 --- a/Source/SVGIconImageList.pas +++ b/Source/SVGIconImageList.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/VCL } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: Vincent Parrett, Kiriakos Vlahos } { } diff --git a/Source/SVGIconImageListBase.pas b/Source/SVGIconImageListBase.pas index 78c77bf..0ff380b 100644 --- a/Source/SVGIconImageListBase.pas +++ b/Source/SVGIconImageListBase.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/VCL } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: Vincent Parrett, Kiriakos Vlahos } { } @@ -48,7 +48,7 @@ interface SvgInterfaces; const - SVGIconImageListVersion = '3.9.4'; + SVGIconImageListVersion = '3.9.5'; DEFAULT_SIZE = 16; type diff --git a/Source/SVGIconItems.pas b/Source/SVGIconItems.pas index 38fca32..58919b8 100644 --- a/Source/SVGIconItems.pas +++ b/Source/SVGIconItems.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/VCL } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: Vincent Parrett, Kiriakos Vlahos } { } diff --git a/Source/SVGIconUtils.pas b/Source/SVGIconUtils.pas index 7b6763f..d02d399 100644 --- a/Source/SVGIconUtils.pas +++ b/Source/SVGIconUtils.pas @@ -1,9 +1,9 @@ {******************************************************************************} { } -{ Icon SVG ImageList: An extended ImageList for Delphi/VCL } +{ SVGIconImageList: An extended ImageList for Delphi/VCL } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { Contributors: Vincent Parrett, Kiriakos Vlahos } { } diff --git a/Source/SVGIconVirtualImageList.pas b/Source/SVGIconVirtualImageList.pas index 9d8b381..c1d874a 100644 --- a/Source/SVGIconVirtualImageList.pas +++ b/Source/SVGIconVirtualImageList.pas @@ -3,7 +3,7 @@ { SVGIconImageList: An extended ImageList for Delphi/VCL } { to simplify use of SVG Icons (resize, opacity and more...) } { } -{ Copyright (c) 2019-2022 (Ethea S.r.l.) } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } { Author: Vincent Parrett } { Contributors: Carlo Barazzetta, Kiriakos Vlahos } { } diff --git a/Source/SVGMessaging.pas b/Source/SVGMessaging.pas index 8253858..72ffa87 100644 --- a/Source/SVGMessaging.pas +++ b/Source/SVGMessaging.pas @@ -2,7 +2,7 @@ { } { SVGMessaging: Messaging unit for older Delphi version } { } -{ Copyright (c) 2021-2022 (Ethea S.r.l.) } +{ Copyright (c) 2021-2023 (Ethea S.r.l.) } { Author: Carlo Barazzetta } { } { https://github.com/EtheaDev/SVGIconImageList } diff --git a/Source/dlgExportPNG.pas b/Source/dlgExportPNG.pas index d74362e..86cb539 100644 --- a/Source/dlgExportPNG.pas +++ b/Source/dlgExportPNG.pas @@ -1,3 +1,35 @@ +{******************************************************************************} +{ } +{ SVGIconImageList: An extended ImageList for Delphi/VCL } +{ to simplify use of SVG Icons (resize, opacity and more...) } +{ } +{ Copyright (c) 2019-2023 (Ethea S.r.l.) } +{ Author: Vincent Parrett } +{ Contributors: Carlo Barazzetta, Kiriakos Vlahos } +{ } +{ https://github.com/EtheaDev/SVGIconImageList } +{ } +{******************************************************************************} +{ Original version (c) 2005, 2008 Martin Walter with license: } +{ Use of this file is permitted for commercial and non-commercial } +{ use, as long as the author is credited. } +{ home page: http://www.mwcs.de } +{ email : martin.walter@mwcs.de } +{******************************************************************************} +{ } +{ Licensed under the Apache License, Version 2.0 (the "License"); } +{ you may not use this file except in compliance with the License. } +{ You may obtain a copy of the License at } +{ } +{ http://www.apache.org/licenses/LICENSE-2.0 } +{ } +{ Unless required by applicable law or agreed to in writing, software } +{ distributed under the License is distributed on an "AS IS" BASIS, } +{ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. } +{ See the License for the specific language governing permissions and } +{ limitations under the License. } +{ } +{******************************************************************************} unit dlgExportPNG; interface diff --git a/skia4delphi/Binary/Android/Release/Build.txt b/skia4delphi/Binary/Android/Release/Build.txt deleted file mode 100644 index b8ef5b6..0000000 --- a/skia4delphi/Binary/Android/Release/Build.txt +++ /dev/null @@ -1,6 +0,0 @@ - ------------------------------------------------------------------ -| Skia 98.0.0 | -|------------------------------------------------------------------| -| Host | Microsoft Windows 11 22000.613 | -| Toolchain | Android NDK 23.1.7779620 | -|__________________________________________________________________| \ No newline at end of file diff --git a/skia4delphi/Binary/Android/Release/libsk4d.so b/skia4delphi/Binary/Android/Release/libsk4d.so deleted file mode 100644 index 97eac1a..0000000 Binary files a/skia4delphi/Binary/Android/Release/libsk4d.so and /dev/null differ diff --git a/skia4delphi/Binary/Android64/Release/Build.txt b/skia4delphi/Binary/Android64/Release/Build.txt deleted file mode 100644 index b8ef5b6..0000000 --- a/skia4delphi/Binary/Android64/Release/Build.txt +++ /dev/null @@ -1,6 +0,0 @@ - ------------------------------------------------------------------ -| Skia 98.0.0 | -|------------------------------------------------------------------| -| Host | Microsoft Windows 11 22000.613 | -| Toolchain | Android NDK 23.1.7779620 | -|__________________________________________________________________| \ No newline at end of file diff --git a/skia4delphi/Binary/Android64/Release/libsk4d.so b/skia4delphi/Binary/Android64/Release/libsk4d.so deleted file mode 100644 index 10e409b..0000000 Binary files a/skia4delphi/Binary/Android64/Release/libsk4d.so and /dev/null differ diff --git a/skia4delphi/Binary/Linux64/Release/Build.txt b/skia4delphi/Binary/Linux64/Release/Build.txt deleted file mode 100644 index fd9b79d..0000000 --- a/skia4delphi/Binary/Linux64/Release/Build.txt +++ /dev/null @@ -1,12 +0,0 @@ - ------------------------------------------------------------------ -| Skia 98.0.0 | -|------------------------------------------------------------------| -| Host | Ubuntu 20.04.4 LTS | -| Toolchain | Clang 10.0.0 | -|------------------------------------------------------------------| -| Dependencies | -| ---------------- | -| | -| - libFontconfig1 development package 2.13.1 (libfontconfig1-dev) | -| - libGL1 Mesa development package 21.2.6 (libgl1-mesa-dev) | -|__________________________________________________________________| \ No newline at end of file diff --git a/skia4delphi/Binary/Linux64/Release/Other Distributions/Red Hat/Build.txt b/skia4delphi/Binary/Linux64/Release/Other Distributions/Red Hat/Build.txt deleted file mode 100644 index 2af5ec2..0000000 --- a/skia4delphi/Binary/Linux64/Release/Other Distributions/Red Hat/Build.txt +++ /dev/null @@ -1,12 +0,0 @@ - ------------------------------------------------------------------ -| Skia 98.0.0 | -|------------------------------------------------------------------| -| Host | Red Hat Enterprise Linux 8.5 | -| Toolchain | Clang 12.0.1 | -|------------------------------------------------------------------| -| Dependencies | -| ---------------- | -| | -| - Fontconfig development package 2.13.1 (fontconfig-devel) | -| - Mesa libGLw development package 8.0.0 (mesa-libGLw-devel) | -|__________________________________________________________________| \ No newline at end of file diff --git a/skia4delphi/Binary/OSX64/Release/Build.txt b/skia4delphi/Binary/OSX64/Release/Build.txt deleted file mode 100644 index ca8ca84..0000000 --- a/skia4delphi/Binary/OSX64/Release/Build.txt +++ /dev/null @@ -1,6 +0,0 @@ - ------------------------------------------------------------------ -| Skia 98.0.0 | -|------------------------------------------------------------------| -| Host | macOS Monterey 12.3.1 | -| Toolchain | Xcode 13.3.1 | -|__________________________________________________________________| \ No newline at end of file diff --git a/skia4delphi/Binary/OSXARM64/Release/Build.txt b/skia4delphi/Binary/OSXARM64/Release/Build.txt deleted file mode 100644 index ca8ca84..0000000 --- a/skia4delphi/Binary/OSXARM64/Release/Build.txt +++ /dev/null @@ -1,6 +0,0 @@ - ------------------------------------------------------------------ -| Skia 98.0.0 | -|------------------------------------------------------------------| -| Host | macOS Monterey 12.3.1 | -| Toolchain | Xcode 13.3.1 | -|__________________________________________________________________| \ No newline at end of file diff --git a/skia4delphi/Binary/OSXARM64/Release/sk4d.dylib b/skia4delphi/Binary/OSXARM64/Release/sk4d.dylib deleted file mode 100644 index 56b837d..0000000 Binary files a/skia4delphi/Binary/OSXARM64/Release/sk4d.dylib and /dev/null differ diff --git a/skia4delphi/Binary/Linux64/Release/libsk4d.so b/skia4delphi/Binary/Shared/OSX64/libsk4d.dylib similarity index 75% rename from skia4delphi/Binary/Linux64/Release/libsk4d.so rename to skia4delphi/Binary/Shared/OSX64/libsk4d.dylib index a36e51b..902ee19 100644 Binary files a/skia4delphi/Binary/Linux64/Release/libsk4d.so and b/skia4delphi/Binary/Shared/OSX64/libsk4d.dylib differ diff --git a/skia4delphi/Binary/OSX64/Release/sk4d.dylib b/skia4delphi/Binary/Shared/OSXARM64/libsk4d.dylib similarity index 77% rename from skia4delphi/Binary/OSX64/Release/sk4d.dylib rename to skia4delphi/Binary/Shared/OSXARM64/libsk4d.dylib index 7be5def..6fe61ac 100644 Binary files a/skia4delphi/Binary/OSX64/Release/sk4d.dylib and b/skia4delphi/Binary/Shared/OSXARM64/libsk4d.dylib differ diff --git a/skia4delphi/Binary/Win32/Release/sk4d.dll b/skia4delphi/Binary/Shared/iOSSimARM64/libsk4d.dylib similarity index 66% rename from skia4delphi/Binary/Win32/Release/sk4d.dll rename to skia4delphi/Binary/Shared/iOSSimARM64/libsk4d.dylib index ac0f074..f7d3f87 100644 Binary files a/skia4delphi/Binary/Win32/Release/sk4d.dll and b/skia4delphi/Binary/Shared/iOSSimARM64/libsk4d.dylib differ diff --git a/skia4delphi/Binary/Win32/Release/Build.txt b/skia4delphi/Binary/Win32/Release/Build.txt deleted file mode 100644 index f60224c..0000000 --- a/skia4delphi/Binary/Win32/Release/Build.txt +++ /dev/null @@ -1,12 +0,0 @@ - ------------------------------------------------------------------ -| Skia 98.0.0 | -|------------------------------------------------------------------| -| Host | Microsoft Windows 11 22000.613 | -| Toolchain | Clang 14.0.0 / Microsoft Visual Studio 2022 (17.1.5) | -|------------------------------------------------------------------| -| Dependencies | -| ---------------- | -| | -| - Windows SDK 10.0.22000.194 | -| | -|__________________________________________________________________| \ No newline at end of file diff --git a/skia4delphi/Binary/Win64/Release/Build.txt b/skia4delphi/Binary/Win64/Release/Build.txt deleted file mode 100644 index f60224c..0000000 --- a/skia4delphi/Binary/Win64/Release/Build.txt +++ /dev/null @@ -1,12 +0,0 @@ - ------------------------------------------------------------------ -| Skia 98.0.0 | -|------------------------------------------------------------------| -| Host | Microsoft Windows 11 22000.613 | -| Toolchain | Clang 14.0.0 / Microsoft Visual Studio 2022 (17.1.5) | -|------------------------------------------------------------------| -| Dependencies | -| ---------------- | -| | -| - Windows SDK 10.0.22000.194 | -| | -|__________________________________________________________________| \ No newline at end of file diff --git a/skia4delphi/Binary/Win64/Release/sk4d.dll b/skia4delphi/Binary/Win64/Release/sk4d.dll deleted file mode 100644 index ec2bdf5..0000000 Binary files a/skia4delphi/Binary/Win64/Release/sk4d.dll and /dev/null differ diff --git a/skia4delphi/Binary/iOSDevice64/Release/Build.txt b/skia4delphi/Binary/iOSDevice64/Release/Build.txt deleted file mode 100644 index ca8ca84..0000000 --- a/skia4delphi/Binary/iOSDevice64/Release/Build.txt +++ /dev/null @@ -1,6 +0,0 @@ - ------------------------------------------------------------------ -| Skia 98.0.0 | -|------------------------------------------------------------------| -| Host | macOS Monterey 12.3.1 | -| Toolchain | Xcode 13.3.1 | -|__________________________________________________________________| \ No newline at end of file diff --git a/skia4delphi/Binary/iOSDevice64/Release/sk4d.a b/skia4delphi/Binary/iOSDevice64/Release/sk4d.a deleted file mode 100644 index c6083c8..0000000 Binary files a/skia4delphi/Binary/iOSDevice64/Release/sk4d.a and /dev/null differ diff --git a/skia4delphi/README.md b/skia4delphi/README.md index 2943632..117648f 100644 --- a/skia4delphi/README.md +++ b/skia4delphi/README.md @@ -109,8 +109,6 @@ You can install **Skia4Delphi** in 3 ways: 1. Manual installation is possible, although it is not recommended; [Learn more...](Documents/INSTALLATION.md) 2. The pre-built Skia binaries were included in the source, but you can easily recompile them; [Learn more...](Documents/BUILD.md) -3. The pre-built Skia binary for **Linux64** targets was compiled for Debian (eg Ubuntu) and Red Hat (eg CentOS) based systems. If you want another distro you will need to [rebuild;](Documents/BUILD.md) -4. For Red Hat based systems you must replace the `Binary/Linux64/Release/libsk4d.so` file with the `Binary/Linux64/Release/Other Distributions/Red Hat/libsk4d.so` file. ### Enable Skia @@ -228,7 +226,7 @@ DrawExample(256, 256, LFont: ISkFont; LPaint: ISkPaint; begin - LFont := TSkFont.Create(TSkTypeface.MakeFromFile('Assets\Samples\nunito-extrabold.ttf'), 23); + LFont := TSkFont.Create(TSkTypeface.MakeFromFile('Samples\Demo\Assets\nunito-extrabold.ttf'), 23); LPaint := TSkPaint.Create; LPaint.Shader := TSkShader.MakeGradientLinear(PointF(0, 0), PointF(256, 145), $FFFF5F5F, $FF5B8DFE, TSkTileMode.Clamp); @@ -237,7 +235,7 @@ DrawExample(256, 256, ACanvas.DrawSimpleText('of your future that will', 2, 85, LFont, LPaint); ACanvas.DrawSimpleText('no longer exist."', 2, 115, LFont, LPaint); - LFont := TSkFont.Create(TSkTypeface.MakeFromFile('Assets\Samples\bonheur-royale-regular.ttf'), 28); + LFont := TSkFont.Create(TSkTypeface.MakeFromFile('Samples\Demo\Assets\bonheur-royale-regular.ttf'), 28); LPaint.Shader := nil; LPaint.Color := $FF5B8DFE; ACanvas.DrawSimpleText('(Steve Jobs)', 2, 150, LFont, LPaint); @@ -260,7 +258,7 @@ var LSVGDOM: ISkSVGDOM; LSize: TSizeF; begin - LSVGDOM := TSkSVGDOM.MakeFromFile('Assets\Samples\lion.svg'); + LSVGDOM := TSkSVGDOM.MakeFromFile('Samples\Demo\Assets\lion.svg'); LSize := TSizeF.Create(600, 600); LSVGDOM.SetContainerSize(LSize); @@ -312,6 +310,8 @@ The **Skia4Delphi** library supports many image formats. See below the list: | WBMP | .wbmp | | WebP | .webp | + _Note: Raw images are limited to non-windows platforms_ + - Supported formats for encoding | Image Format | Extensions | @@ -330,7 +330,7 @@ The example below demonstrates how to encoder to WebP format: var LImage: ISkImage; begin - LImage := TSkImage.MakeFromEncodedFile('Assets\Samples\kung-fu-panda.png'); + LImage := TSkImage.MakeFromEncodedFile('Samples\Demo\Assets\kung-fu-panda.png'); LImage.EncodeToFile('output.webp', TSkEncodedImageFormat.WEBP, 80); LImage.EncodeToFile('output.jpg', TSkEncodedImageFormat.JPEG, 80); end; @@ -568,7 +568,7 @@ var LAnimatedImage: TSkAnimatedImage; begin LAnimatedimage := TSkAnimatedImage.Create(Self); - LAnimatedimage.LoadFromFile('Assets\Samples\rocket.json'); + LAnimatedimage.LoadFromFile('Samples\Demo\Assets\rocket.json'); LAnimatedimage.Parent := Self; end; ``` @@ -633,14 +633,14 @@ var LSvg: TSkSvg; begin LSvg := TSkSvg.Create(Self); - LSvg.Svg.Source := TFile.ReadAllText('Assets\Samples\gorilla.svg'); + LSvg.Svg.Source := TFile.ReadAllText('Samples\Demo\Assets\gorilla.svg'); LSvg.Parent := Self; end; ``` The example above results in the output below: -

Gorilla

+

Gorilla

[Learn more...](Documents/SVG.md) @@ -654,25 +654,24 @@ The example above results in the output below: For the platforms supported by **Skia4Delphi** (listed above), the OS versions supported by the library are the same [OS versions that RAD Studio supports.](https://docwiki.embarcadero.com/PlatformStatus/en/Main_Page) -## Remarks - -1. The pre-built Skia binary for **Linux64** targets was compiled for Debian (eg Ubuntu) and Red Hat (eg CentOS) based systems. If you want another distro you will need to [rebuild;](Documents/BUILD.md) -2. For Red Hat based systems you must replace the `Binary/Linux64/Release/libsk4d.so` file with the `Binary/Linux64/Release/Other Distributions/Red Hat/libsk4d.so` file. - # Documentation The APIs are very similar to Skia's, few methods and functions have been renamed for readability, so the [Skia documentation](https://skia.org/docs) can be used. # Version -**[Skia4Delphi 3.4.1](/../../releases/latest)** +**[Skia4Delphi 4.0.2](/../../releases/latest)** -Skia Version used: [chrome/m98](https://github.com/google/skia/tree/chrome/m98) -What has changed from the original code? [Compare.](https://github.com/google/skia/compare/chrome/m98...skia4delphi:main) +Skia Version used: [chrome/m107](https://github.com/google/skia/tree/chrome/m107) -# Sponsors +# Sponsors & Partners -

A-dato logo

+

+ + A-dato logo + + DelphiStyles logo +

# Contributors diff --git a/skia4delphi/Source/FMX/Skia.FMX.Canvas.GL.pas b/skia4delphi/Source/FMX/Skia.FMX.Canvas.GL.pas index f051ea5..2368109 100644 --- a/skia4delphi/Source/FMX/Skia.FMX.Canvas.GL.pas +++ b/skia4delphi/Source/FMX/Skia.FMX.Canvas.GL.pas @@ -19,752 +19,796 @@ interface uses { Delphi } + FMX.Graphics, FMX.Types, + System.Types, {$IF DEFINED(MSWINDOWS)} - Winapi.OpenGL, + Winapi.Windows, {$ELSEIF DEFINED(ANDROID)} - Androidapi.Gles2, + Androidapi.Egl, + Androidapi.NativeWindow, {$ELSEIF DEFINED(IOS)} iOSapi.OpenGLES, {$ENDIF} - System.Generics.Collections, { Skia } Skia, Skia.FMX.Graphics; - type - { IGrGlContext } +{$IF DEFINED(MSWINDOWS)} - IGrGlContext = interface - ['{00129575-EB27-4220-8E3C-ACEA0EE42C4A}'] - procedure MakeCurrent; - procedure MakeCurrentOffScreen; + { TGlBackendContext } + + TGlBackendContext = record + DC: HDC; + GLRC: HGLRC; end; - { TGrGlContext } + { TGlSharedResources } - TGrGlContext = class abstract(TInterfacedObject, IGrGlContext) - strict private class var - FGlInterface: IGrGlInterface; + TGlSharedResources = class(TGrCanvasSharedResources) strict private - FContext: T; - FNativeWindowHandle: THandle; - procedure MakeCurrent; - procedure MakeCurrentOffScreen; + FContext: TGlBackendContext; + FGrGlInterface: IGrGlInterface; + FOldContext: TGlBackendContext; + FWindow: HWND; strict protected - class function DoCreateContext(const ANativeWindowHandle: THandle): T; virtual; abstract; - class function DoCreateNativeWindow(const AWindow: TWindowHandle): THandle; virtual; abstract; - class procedure DoDestroyContext(const ANativeWindowHandle: THandle; const AContext: T); virtual; abstract; - class procedure DoDestroyNativeWindow(const ANativeWindowHandle: THandle); virtual; - class procedure DoFinalize; virtual; abstract; - class function DoInitialize: IGrGlInterface; virtual; abstract; - class procedure DoMakeCurrent(const AContext: T); virtual; abstract; - class procedure DoMakeCurrentOffScreen(const AContext: T); virtual; + procedure AfterBeginContext; override; + procedure BeforeEndContext; override; + procedure FinalizeSharedResources; override; + procedure InitializeContext(out ASharedGrDirectContext: IGrDirectContext); override; + procedure InitializeSharedResources; override; public - constructor Create(const ANativeWindowHandle: THandle; const AContext: T); - destructor Destroy; override; - class procedure Finalize; - class function Initialize: Boolean; - class function MakeFromWindow(const AWindow: TWindowHandle): IGrGlContext; - class procedure SwapBuffers; virtual; - class property GlInterface: IGrGlInterface read FGlInterface; + property Context: TGlBackendContext read FContext; + property GrGlInterface: IGrGlInterface read FGrGlInterface; end; - { TGrCanvasGl } + { TGlContext } - TGrCanvasGl = class(TGrCanvasCustom) + TGlContext = record strict private - FNativeContext: IGrGlContext; - FWindowAttached: Boolean; - strict protected - function BeginWindow(const AContextHandle: THandle): ISkSurface; override; - function CreateDirectContext: IGrDirectContext; override; - function CreateSurfaceFromWindow: ISkSurface; override; - procedure EndWindow; override; - procedure FinalizeContext; override; - procedure Flush; override; - function InitializeContext: Boolean; override; - procedure PrepareContext; override; - class procedure DoFinalize; override; - class function DoInitialize: Boolean; override; + FContext: TGlBackendContext; + FOldContext: TGlBackendContext; + public + procedure Finalize(const ASharedSharedResources: IGrCanvasSharedResources; const AWindow: TWindowHandle); + function Initialize(const ASharedSharedResources: IGrCanvasSharedResources; const AWindow: TWindowHandle): Boolean; + function MakeContextCurrent(const ASharedSharedResources: IGrCanvasSharedResources): Boolean; + procedure RestoreContext(const ASharedSharedResources: IGrCanvasSharedResources); + procedure SaveContext(const ASharedSharedResources: IGrCanvasSharedResources); + procedure SwapBuffers(const ASharedSharedResources: IGrCanvasSharedResources); + property Context: TGlBackendContext read FContext; end; -implementation +{$ELSEIF DEFINED(ANDROID)} -uses - { Delphi } + { TGlBackendContext } - {$IF DEFINED(MSWINDOWS)} - FMX.Platform.Win, - Winapi.OpenGLext, - Winapi.Windows, - {$ELSEIF DEFINED(ANDROID)} - Androidapi.Egl, - Androidapi.JNI.GraphicsContentViewText, - Androidapi.JNIBridge, - Androidapi.NativeWindow, - Androidapi.NativeWindowJni, - FMX.Platform.UI.Android, - FMX.Presentation.Android.Style, - {$ELSEIF DEFINED(IOS)} - FMX.Platform.iOS, - iOSapi.GLKit, - Macapi.ObjectiveC, - {$ENDIF} - System.SysUtils; + TGlBackendContext = record + Draw: EGLSurface; + Read: EGLSurface; + Context: EGLContext; + end; -type + { TGlSharedResources } -{$IF DEFINED(MSWINDOWS)} + TGlSharedResources = class(TGrCanvasSharedResources) + strict private + FContext: TGlBackendContext; + FDisplay: EGLDisplay; + FGrGlInterface: IGrGlInterface; + FOldContext: TGlBackendContext; + strict protected + procedure AfterBeginContext; override; + procedure BeforeEndContext; override; + procedure FinalizeSharedResources; override; + procedure InitializeContext(out ASharedGrDirectContext: IGrDirectContext); override; + procedure InitializeSharedResources; override; + public + property Context: TGlBackendContext read FContext; + property Display: EGLDisplay read FDisplay; + property GrGlInterface: IGrGlInterface read FGrGlInterface; + end; - { TGrGlWindowsContext } + { TGlContext } - TGrGlWindowsContext = record - DC: HDC; - Context: HGLRC; - constructor Create(const ADC: HDC; const AContext: HGLRC); + TGlContext = record + strict private + FANativeWindow: PANativeWindow; + FContext: TGlBackendContext; + FOldContext: TGlBackendContext; + public + procedure Finalize(const ASharedSharedResources: IGrCanvasSharedResources; const AWindow: TWindowHandle); + function Initialize(const ASharedSharedResources: IGrCanvasSharedResources; const AWindow: TWindowHandle): Boolean; + function MakeContextCurrent(const ASharedSharedResources: IGrCanvasSharedResources): Boolean; + procedure RestoreContext(const ASharedSharedResources: IGrCanvasSharedResources); + procedure SaveContext(const ASharedSharedResources: IGrCanvasSharedResources); + procedure SwapBuffers(const ASharedSharedResources: IGrCanvasSharedResources); + property Context: TGlBackendContext read FContext; end; - { TGrGlWindows } - - TGrGlWindows = class(TGrGlContext) - strict private const - PixelFormatDescriptor: TPixelFormatDescriptor = ( - nSize : SizeOf(TPixelFormatDescriptor); - nVersion : 1; - dwFlags : PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER; - iPixelType : PFD_TYPE_RGBA; - cColorBits : 24; - cRedBits : 0; - cRedShift : 0; - cGreenBits : 0; - cGreenShift : 0; - cBlueBits : 0; - cBlueShift : 0; - cAlphaBits : 8; - cAlphaShift : 0; - cAccumBits : 0; - cAccumRedBits : 0; - cAccumGreenBits : 0; - cAccumBlueBits : 0; - cAccumAlphaBits : 0; - cDepthBits : 0; - cStencilBits : 8; - cAuxBuffers : 0; - iLayerType : PFD_MAIN_PLANE; - bReserved : 0; - dwLayerMask : 0; - dwVisibleMask : 0; - dwDamageMask : 0); - strict private class var +{$ELSEIF DEFINED(IOS)} + + TGlBackendContext = EAGLContext; + + { TGlSharedResources } + + TGlSharedResources = class(TGrCanvasSharedResources) + strict private + FContext: TGlBackendContext; + FGrGlInterface: IGrGlInterface; FLibModule: HMODULE; - FSharedPixelFormat: Integer; + FOldContext: TGlBackendContext; strict protected - class function DoCreateContext(const ANativeWindowHandle: THandle): TGrGlWindowsContext; override; - class function DoCreateNativeWindow(const AWindow: TWindowHandle): THandle; override; - class procedure DoDestroyContext(const ANativeWindowHandle: THandle; const AContext: TGrGlWindowsContext); override; - class procedure DoFinalize; override; - class function DoInitialize: IGrGlInterface; override; - class procedure DoMakeCurrent(const AContext: TGrGlWindowsContext); override; + procedure AfterBeginContext; override; + procedure BeforeEndContext; override; + procedure FinalizeSharedResources; override; + procedure InitializeContext(out ASharedGrDirectContext: IGrDirectContext); override; + procedure InitializeSharedResources; override; public - class procedure SwapBuffers; override; + property Context: TGlBackendContext read FContext; + property GrGlInterface: IGrGlInterface read FGrGlInterface; end; - TGrGlNativeContext = TGrGlWindows; - -{$ELSEIF DEFINED(ANDROID)} - - { TGrGlesAndroidContext } + { TGlContext } - TGrGlesAndroidContext = record - Surface: EGLSurface; - Context: EGLContext; - constructor Create(const ASurface: EGLSurface; const AContext: EGLContext); + TGlContext = record + strict private + FContext: TGlBackendContext; + FOldContext: TGlBackendContext; + public + procedure Finalize(const ASharedSharedResources: IGrCanvasSharedResources; const AWindow: TWindowHandle); + function Initialize(const ASharedSharedResources: IGrCanvasSharedResources; const AWindow: TWindowHandle): Boolean; + function MakeContextCurrent(const ASharedSharedResources: IGrCanvasSharedResources): Boolean; + procedure RestoreContext(const ASharedSharedResources: IGrCanvasSharedResources); + procedure SaveContext(const ASharedSharedResources: IGrCanvasSharedResources); + procedure SwapBuffers(const ASharedSharedResources: IGrCanvasSharedResources); + property Context: TGlBackendContext read FContext; end; - { TGrGlesAndroid } +{$ENDIF} - TGrGlesAndroid = class(TGrGlContext) - strict private const - ContextAttributes: array[0..2] of EGLint = (EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE); - strict private class var - FSharedConfig: EGLConfig; - FSharedDisplay: EGLDisplay; - FSharedSurface: EGLSurface; + { TGlCanvas } + + TGlCanvas = class(TGrCanvas) strict private - class procedure RaiseLastError; inline; + FContext: TGlContext; + FSampleCount: Integer; strict protected - class function DoCreateContext(const ANativeWindowHandle: THandle): TGrGlesAndroidContext; override; - class function DoCreateNativeWindow(const AWindow: TWindowHandle): THandle; override; - class procedure DoDestroyContext(const ANativeWindowHandle: THandle; const AContext: TGrGlesAndroidContext); override; - class procedure DoDestroyNativeWindow(const ANativeWindowHandle: THandle); override; - class procedure DoFinalize; override; - class function DoInitialize: IGrGlInterface; override; - class procedure DoMakeCurrent(const AContext: TGrGlesAndroidContext); override; - class procedure DoMakeCurrentOffScreen(const AContext: TGrGlesAndroidContext); override; + procedure BeforeRestore; override; + function CreateSurfaceFromWindow(var AGrDirectContext: IGrDirectContext): ISkSurface; override; + procedure DestroyContext; override; + procedure DoDrawBitmap(const ABitmap: FMX.Graphics.TBitmap; const ASrcRect, ADestRect: TRectF; const AOpacity: Single; const AHighSpeed: Boolean); override; + procedure DoEndScene; override; + class procedure InitializeSharedResources(out ASharedResources: IGrCanvasSharedResources); override; public - class procedure SwapBuffers; override; + destructor Destroy; override; end; - TGrGlNativeContext = TGrGlesAndroid; +{$ENDIF} -{$ELSEIF DEFINED(IOS)} +implementation - { TGrGlesIOS } +{$IF DEFINED(MSWINDOWS) or DEFINED(ANDROID) or DEFINED(IOS)} - TGrGlesIOS = class(TGrGlContext) - strict private class var - FLibModule: HMODULE; - strict protected - class function DoCreateContext(const ANativeWindowHandle: THandle): EAGLContext; override; - class function DoCreateNativeWindow(const AWindow: TWindowHandle): THandle; override; - class procedure DoDestroyContext(const ANativeWindowHandle: THandle; const AContext: EAGLContext); override; - class procedure DoDestroyNativeWindow(const ANativeWindowHandle: THandle); override; - class procedure DoFinalize; override; - class function DoInitialize: IGrGlInterface; override; - class procedure DoMakeCurrent(const AContext: EAGLContext); override; - end; +uses + { Delphi } + System.SysUtils, + {$IF DEFINED(MSWINDOWS)} + FMX.Platform.Win, + Winapi.OpenGL, + Winapi.OpenGLext; + {$ELSEIF DEFINED(ANDROID)} + Androidapi.Gles2, + Androidapi.JNI.GraphicsContentViewText, + Androidapi.JNIBridge, + Androidapi.NativeWindowJni, + FMX.Platform.UI.Android, + FMX.Presentation.Android.Style; + {$ELSEIF DEFINED(IOS)} + FMX.Platform.iOS, + iOSapi.GLKit, + Macapi.ObjectiveC; + {$ENDIF} - TGrGlNativeContext = TGrGlesIOS; +{$IF DEFINED(MSWINDOWS)} -{$ENDIF} +const + WGL_CONTEXT_CORE_PROFILE_BIT_ARB = $00000001; + WGL_CONTEXT_MAJOR_VERSION_ARB = $2091; + WGL_CONTEXT_MINOR_VERSION_ARB = $2092; + WGL_CONTEXT_PROFILE_MASK_ARB = $9126; + + PixelFormatDescriptor: TPixelFormatDescriptor = ( + nSize : SizeOf(TPixelFormatDescriptor); + nVersion : 1; + dwFlags : PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER; + iPixelType : PFD_TYPE_RGBA; + cColorBits : 24; + cRedBits : 0; + cRedShift : 0; + cGreenBits : 0; + cGreenShift : 0; + cBlueBits : 0; + cBlueShift : 0; + cAlphaBits : 8; + cAlphaShift : 0; + cAccumBits : 0; + cAccumRedBits : 0; + cAccumGreenBits : 0; + cAccumBlueBits : 0; + cAccumAlphaBits : 0; + cDepthBits : 24; + cStencilBits : 8; + cAuxBuffers : 0; + iLayerType : PFD_MAIN_PLANE; + bReserved : 0; + dwLayerMask : 0; + dwVisibleMask : 0; + dwDamageMask : 0); -{$IF DEFINED(MSWINDOWS)} +var + PixelFormat: Integer; -{ TGrGlWindowsContext } + ContextAttributes: array[0..6] of GLInt = ( + WGL_CONTEXT_MAJOR_VERSION_ARB , -1 , + WGL_CONTEXT_MINOR_VERSION_ARB , -1 , + WGL_CONTEXT_PROFILE_MASK_ARB , WGL_CONTEXT_CORE_PROFILE_BIT_ARB , + GL_NONE); -constructor TGrGlWindowsContext.Create(const ADC: HDC; const AContext: HGLRC); -begin - Context := AContext; - DC := ADC; -end; + wglCreateContextAttribsARB: function (hDC: HDC; hShareContext: HGLRC; const attribList: PInteger): HGLRC; stdcall; -{ TGrGlWindows } +{ TGlSharedResources } -class function TGrGlWindows.DoCreateContext( - const ANativeWindowHandle: THandle): TGrGlWindowsContext; -var - LContext: HGLRC; - LDC: HDC; +procedure TGlSharedResources.AfterBeginContext; begin - LDC := GetDC(ANativeWindowHandle); - if LDC = 0 then - RaiseLastOSError; - try - if not SetPixelFormat(LDC, FSharedPixelFormat, @PixelFormatDescriptor) then - RaiseLastOSError; - LContext := wglCreateContext(LDC); - if LContext = 0 then - RaiseLastOSError; - Result := TGrGlWindowsContext.Create(LDC, LContext); - except - ReleaseDC(ANativeWindowHandle, LDC); - raise; - end; + FOldContext.DC := wglGetCurrentDC; + FOldContext.GLRC := wglGetCurrentContext; + if not wglMakeCurrent(FContext.DC, FContext.GLRC) then + raise EGrCanvas.Create('Could not make the shared context as current.'); end; -class function TGrGlWindows.DoCreateNativeWindow( - const AWindow: TWindowHandle): THandle; +procedure TGlSharedResources.BeforeEndContext; begin - if not (AWindow is TWinWindowHandle) then - Exit(0); - Result := TWinWindowHandle(AWindow).Wnd; + wglMakeCurrent(FOldContext.DC, FOldContext.GLRC); end; -class procedure TGrGlWindows.DoDestroyContext( - const ANativeWindowHandle: THandle; const AContext: TGrGlWindowsContext); +procedure TGlSharedResources.FinalizeSharedResources; begin - wglMakeCurrent(0, 0); - wglDeleteContext(AContext.Context); - ReleaseDC(ANativeWindowHandle, AContext.DC); + wglDeleteContext(FContext.GLRC); + ReleaseDC(FWindow, FContext.DC); + DestroyWindow(FWindow); + Winapi.Windows.UnregisterClass('SkClass', HInstance); end; -class procedure TGrGlWindows.DoFinalize; +procedure TGlSharedResources.InitializeContext( + out ASharedGrDirectContext: IGrDirectContext); begin - FreeLibrary(FLibModule); + FGrGlInterface := TGrGlInterface.MakeNative; + ASharedGrDirectContext := TGrDirectContext.MakeGl(FGrGlInterface); end; -class function TGrGlWindows.DoInitialize: IGrGlInterface; +procedure TGlSharedResources.InitializeSharedResources; +const + CoreVersions: array[0..11] of GLInt = ( + 4, 3, + 4, 2, + 4, 1, + 4, 0, + 3, 3, + 3, 2); var + I: Integer; LClass: TWndClass; - LContext: HGLRC; - LDC: HDC; - LRect: TRect; - LWindow: HWND; -begin - FLibModule := SafeLoadLibrary(opengl32); - if FLibModule = 0 then - Exit(nil); + LGLRC: HGLRC; + LOldContext: TGlBackendContext; +begin + FillChar(LClass, SizeOf(TWndClass), 0); + LClass.lpfnWndProc := @DefWindowProc; + LClass.hInstance := HInstance; + LClass.lpszClassName := 'SkClass'; + if Winapi.Windows.RegisterClass(LClass) = 0 then + raise EGrCanvas.Create('Could not register the dummy class.'); + FWindow := CreateWindowEx(WS_EX_TOOLWINDOW, 'SkClass', nil, WS_POPUP, 0, 0, 0, 0, 0, 0, HInstance, nil); + if FWindow = 0 then + raise EGrCanvas.Create('Could not create the dummy window.'); try - FillChar(LClass, SizeOf(TWndClass), 0); - LClass.style := CS_HREDRAW or CS_VREDRAW or CS_OWNDC; - LClass.cbClsExtra := 0; - LClass.cbWndExtra := 0; - LClass.lpfnWndProc := @DefWindowProc; - LClass.hInstance := HInstance; - LClass.hIcon := LoadIcon(0, IDI_WINLOGO); - LClass.hCursor := LoadCursor(0, IDC_ARROW); - LClass.hbrBackground := 0; - LClass.lpszMenuName := nil; - LClass.lpszClassName := '_DummyClass'; - if Winapi.Windows.RegisterClass(LClass) = 0 then - Exit(nil); + FContext.DC := GetDC(FWindow); + if FContext.DC = 0 then + raise EGrCanvas.Create('Could not get a DC from the dummy window.'); try - LRect := TRect.Create(0, 8, 0, 8); - if not AdjustWindowRectEx(LRect, WS_SYSMENU, False, WS_EX_CLIENTEDGE) then - RaiseLastOSError; - LWindow := CreateWindowEx(WS_EX_CLIENTEDGE, LClass.lpszClassName, '_DummyWindow', WS_CLIPSIBLINGS or WS_CLIPCHILDREN or WS_SYSMENU, 0, 0, LRect.Width, LRect.Height, 0, 0, HInstance, nil); - if LWindow = 0 then - Exit(nil); + PixelFormat := ChoosePixelFormat(FContext.DC, @PixelFormatDescriptor); + if (PixelFormat = 0) or (not SetPixelFormat(FContext.DC, PixelFormat, @PixelFormatDescriptor)) then + raise EGrCanvas.Create('Could not choose/set pixel format for the dummy window DC.'); + LGLRC := wglCreateContext(FContext.DC); + if LGLRC = 0 then + raise EGrCanvas.Create('Could not create the dummy context.'); try - ShowWindow(LWindow, SW_HIDE); - LDC := GetDC(LWindow); - if LDC = 0 then - Exit(nil); + LOldContext.DC := wglGetCurrentDC; + LOldContext.GLRC := wglGetCurrentContext; + if not wglMakeCurrent(FContext.DC, LGLRC) then + raise EGrCanvas.Create('Could not make the dummy context as current.'); try - FSharedPixelFormat := ChoosePixelFormat(LDC, @PixelFormatDescriptor); - if (FSharedPixelFormat = 0) or (not SetPixelFormat(LDC, FSharedPixelFormat, @PixelFormatDescriptor)) then - Exit(nil); - LContext := wglCreateContext(LDC); - if LContext = 0 then - Exit(nil); - try - if not wglMakeCurrent(LDC, LContext) then - Exit(nil); - try - Result := TGrGlInterface.MakeNative; - finally - wglMakeCurrent(0, 0); + wglCreateContextAttribsARB := wglGetProcAddress('wglCreateContextAttribsARB'); + finally + wglMakeCurrent(LOldContext.DC, LOldContext.GLRC); + end; + if Assigned(wglCreateContextAttribsARB) then + begin + for I := 0 to Length(CoreVersions) div 2 - 1 do + begin + ContextAttributes[1] := CoreVersions[I * 2]; + ContextAttributes[3] := CoreVersions[I * 2 + 1]; + FContext.GLRC := wglCreateContextAttribsARB(FContext.DC, 0, @ContextAttributes[0]); + if FContext.GLRC <> 0 then + begin + wglDeleteContext(LGLRC); + Exit; end; - finally - wglDeleteContext(LContext); end; - finally - ReleaseDC(LWindow, LDC); + wglCreateContextAttribsARB := nil; end; - finally - DestroyWindow(LWindow); + FContext.GLRC := LGLRC; + except + wglDeleteContext(LGLRC); + raise; end; - finally - Winapi.Windows.UnregisterClass(LClass.lpszClassName, HInstance); + except + ReleaseDC(FWindow, FContext.DC); + raise; end; - finally - if not Assigned(Result) then - FreeLibrary(FLibModule); + except + DestroyWindow(FWindow); + raise; + end; +end; + +{ TGlContext } + +procedure TGlContext.Finalize( + const ASharedSharedResources: IGrCanvasSharedResources; + const AWindow: TWindowHandle); +begin + if FContext.GLRC <> 0 then + begin + wglDeleteContext(FContext.GLRC); + ReleaseDC(WindowHandleToPlatform(AWindow).Wnd, FContext.DC); end; end; -class procedure TGrGlWindows.DoMakeCurrent(const AContext: TGrGlWindowsContext); +function TGlContext.Initialize( + const ASharedSharedResources: IGrCanvasSharedResources; + const AWindow: TWindowHandle): Boolean; begin - if not wglMakeCurrent(AContext.DC, AContext.Context) then - RaiseLastOSError; + if FContext.GLRC = 0 then + begin + if WindowHandleToPlatform(AWindow).Wnd = 0 then + Exit(False); + FContext.DC := GetDC(WindowHandleToPlatform(AWindow).Wnd); + if FContext.DC = 0 then + Exit(False); + SetPixelFormat(FContext.DC, PixelFormat, @PixelFormatDescriptor); + if Assigned(wglCreateContextAttribsARB) then + begin + FContext.GLRC := wglCreateContextAttribsARB(FContext.DC, TGlSharedResources(ASharedSharedResources).Context.GLRC, @ContextAttributes[0]); + if FContext.GLRC = 0 then + begin + ReleaseDC(WindowHandleToPlatform(AWindow).Wnd, FContext.DC); + Exit(False); + end; + end + else + begin + FContext.GLRC := wglCreateContext(FContext.DC); + if FContext.GLRC = 0 then + begin + ReleaseDC(WindowHandleToPlatform(AWindow).Wnd, FContext.DC); + Exit(False); + end; + wglShareLists(TGlSharedResources(ASharedSharedResources).Context.GLRC, FContext.GLRC); + end; + end; + Result := True; end; -class procedure TGrGlWindows.SwapBuffers; +function TGlContext.MakeContextCurrent( + const ASharedSharedResources: IGrCanvasSharedResources): Boolean; begin - if not Winapi.Windows.SwapBuffers(wglGetCurrentDC) then - RaiseLastOSError; + Result := wglMakeCurrent(FContext.DC, FContext.GLRC); end; -{$ELSEIF DEFINED(ANDROID)} +procedure TGlContext.RestoreContext( + const ASharedSharedResources: IGrCanvasSharedResources); +begin + wglMakeCurrent(FOldContext.DC, FOldContext.GLRC); +end; -{ TGrGlesAndroidContext } +procedure TGlContext.SaveContext( + const ASharedSharedResources: IGrCanvasSharedResources); +begin + FOldContext.DC := wglGetCurrentDC; + FOldContext.GLRC := wglGetCurrentContext; +end; -constructor TGrGlesAndroidContext.Create(const ASurface: EGLSurface; - const AContext: EGLContext); +procedure TGlContext.SwapBuffers( + const ASharedSharedResources: IGrCanvasSharedResources); begin - Surface := ASurface; - Context := AContext; + if not Winapi.Windows.SwapBuffers(FContext.DC) then + raise EGrCanvas.Create('Could not swap buffers.'); end; -{ TGrGlesAndroid } +{$ELSEIF DEFINED(ANDROID)} -class function TGrGlesAndroid.DoCreateContext( - const ANativeWindowHandle: THandle): TGrGlesAndroidContext; const ContextAttributes: array[0..2] of EGLint = (EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE); -var - LContext: EGLContext; - LSurface: EGLSurface; -begin - LContext := eglCreateContext(FSharedDisplay, FSharedConfig, EGL_NO_CONTEXT, @ContextAttributes[0]); - if LContext = EGL_NO_CONTEXT then - RaiseLastError; - try - LSurface := eglCreateWindowSurface(FSharedDisplay, FSharedConfig, PANativeWindow(ANativeWindowHandle), nil); - if LSurface = EGL_NO_SURFACE then - RaiseLastError; - Result := TGrGlesAndroidContext.Create(LSurface, LContext); - except - eglDestroyContext(FSharedDisplay, LContext); - raise; - end; -end; -class function TGrGlesAndroid.DoCreateNativeWindow( - const AWindow: TWindowHandle): THandle; var - LANativeWindow: PANativeWindow; - LANativeWindowSurface: JSurface; - LANativeWindowSurfaceID: Pointer; + Config: EGLConfig; + +{ TGlSharedResources } + +procedure TGlSharedResources.AfterBeginContext; begin - if AWindow is TAndroidWindowHandle then - begin - if TAndroidWindowHandle(AWindow).Holder = nil then - Exit(0); - LANativeWindowSurfaceID := (TAndroidWindowHandle(AWindow).Holder.getSurface as ILocalObject).GetObjectID; - end - else if AWindow is TAndroidHandle then + if eglGetCurrentDisplay = FDisplay then begin - if TAndroidHandle(AWindow).Surface = nil then - Exit(0); - LANativeWindowSurface := TJSurface.JavaClass.init(TAndroidHandle(AWindow).Surface); - LANativeWindowSurfaceID := TJNIResolver.JavaInstanceToID(LANativeWindowSurface); + FOldContext.Draw := eglGetCurrentSurface(EGL_DRAW); + FOldContext.Read := eglGetCurrentSurface(EGL_READ); + FOldContext.Context := eglGetCurrentContext; end else - Exit(0); - LANativeWindow := ANativeWindow_fromSurface(TJNIResolver.GetJNIEnv, LANativeWindowSurfaceID); - if LANativeWindow = nil then - RaiseLastOSError; - try - if ANativeWindow_setBuffersGeometry(LANativeWindow, 0, 0, WINDOW_FORMAT_RGBA_8888) <> 0 then - RaiseLastOSError; - except - ANativeWindow_release(LANativeWindow); - raise; + begin + FOldContext.Draw := EGL_NO_SURFACE; + FOldContext.Read := EGL_NO_SURFACE; + FOldContext.Context := EGL_NO_CONTEXT; end; - Result := THandle(LANativeWindow); + if eglMakeCurrent(FDisplay, FContext.Draw, FContext.Read, FContext.Context) = EGL_FALSE then + raise EGrCanvas.Create('Could not make the shared context as current.'); end; -class procedure TGrGlesAndroid.DoDestroyContext( - const ANativeWindowHandle: THandle; const AContext: TGrGlesAndroidContext); +procedure TGlSharedResources.BeforeEndContext; begin - eglMakeCurrent(FSharedDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - eglDestroySurface(FSharedDisplay, AContext.Surface); - eglDestroyContext(FSharedDisplay, AContext.Context); + eglMakeCurrent(FDisplay, FOldContext.Draw, FOldContext.Read, FOldContext.Context); end; -class procedure TGrGlesAndroid.DoDestroyNativeWindow( - const ANativeWindowHandle: THandle); +procedure TGlSharedResources.FinalizeSharedResources; begin - ANativeWindow_release(PANativeWindow(ANativeWindowHandle)); + eglDestroyContext(FDisplay, FContext.Context); + eglDestroySurface(FDisplay, FContext.Draw); + eglTerminate(FDisplay); end; -class procedure TGrGlesAndroid.DoFinalize; +procedure TGlSharedResources.InitializeContext( + out ASharedGrDirectContext: IGrDirectContext); begin - eglDestroySurface(FSharedDisplay, FSharedSurface); - eglTerminate(FSharedDisplay); + FGrGlInterface := TGrGlInterface.MakeNative; + ASharedGrDirectContext := TGrDirectContext.MakeGl(FGrGlInterface); end; -class function TGrGlesAndroid.DoInitialize: IGrGlInterface; +procedure TGlSharedResources.InitializeSharedResources; const ConfigAttributes: array[0..16] of EGLint = ( - EGL_SURFACE_TYPE , EGL_WINDOW_BIT , - EGL_RENDERABLE_TYPE , EGL_OPENGL_ES2_BIT , - EGL_RED_SIZE , 8 , - EGL_GREEN_SIZE , 8 , - EGL_BLUE_SIZE , 8 , - EGL_ALPHA_SIZE , 8 , - EGL_DEPTH_SIZE , 0 , - EGL_STENCIL_SIZE , 8 , + EGL_RENDERABLE_TYPE , EGL_OPENGL_ES2_BIT , + EGL_SURFACE_TYPE , EGL_WINDOW_BIT or EGL_PBUFFER_BIT , + EGL_RED_SIZE , 8 , + EGL_GREEN_SIZE , 8 , + EGL_BLUE_SIZE , 8 , + EGL_ALPHA_SIZE , 8 , + EGL_DEPTH_SIZE , 24 , + EGL_STENCIL_SIZE , 8 , EGL_NONE); SurfaceAttributes: array[0..4] of EGLint = (EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE); var - LContext: EGLContext; LNumConfig: EGLint; begin - FSharedDisplay := eglGetDisplay(EGL_DEFAULT_DISPLAY); - if FSharedDisplay = EGL_NO_DISPLAY then - RaiseLastError; - if eglInitialize(FSharedDisplay, nil, nil) = EGL_FALSE then - RaiseLastError; + FDisplay := eglGetDisplay(EGL_DEFAULT_DISPLAY); + if (FDisplay = EGL_NO_DISPLAY) or (eglInitialize(FDisplay, nil, nil) = EGL_FALSE) then + raise EGrCanvas.Create('Could not initialize the default display.'); try - if eglChooseConfig(FSharedDisplay, @ConfigAttributes[0], @FSharedConfig, 1, @LNumConfig) = EGL_FALSE then - Exit(nil); - FSharedSurface := eglCreatePbufferSurface(FSharedDisplay, FSharedConfig, @SurfaceAttributes[0]); - if FSharedSurface = EGL_NO_SURFACE then - Exit(nil); + if eglChooseConfig(FDisplay, @ConfigAttributes[0], @Config, 1, @LNumConfig) = EGL_FALSE then + raise EGrCanvas.Create('Could not get frame buffer configurations list.'); + FContext.Draw := eglCreatePbufferSurface(FDisplay, Config, @SurfaceAttributes[0]); + if FContext.Draw = EGL_NO_SURFACE then + raise EGrCanvas.Create('Could not create a new pixel buffer surface.'); try - LContext := eglCreateContext(FSharedDisplay, FSharedConfig, EGL_NO_CONTEXT, @ContextAttributes[0]); - if LContext = EGL_NO_CONTEXT then - Exit(nil); - try - if eglMakeCurrent(FSharedDisplay, FSharedSurface, FSharedSurface, LContext) = EGL_FALSE then - Exit(nil); - try - Result := TGrGlInterface.MakeNative; - finally - eglMakeCurrent(FSharedDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - end; - finally - eglDestroyContext(FSharedDisplay, LContext); - end; - finally - if not Assigned(Result) then - eglDestroySurface(FSharedDisplay, FSharedSurface); + FContext.Read := FContext.Draw; + FContext.Context := eglCreateContext(FDisplay, Config, EGL_NO_CONTEXT, @ContextAttributes[0]); + if FContext.Context = EGL_NO_CONTEXT then + raise EGrCanvas.Create('Could not create the shared context.'); + except + eglDestroySurface(FDisplay, FContext.Draw); + raise; end; - finally - if not Assigned(Result) then - eglTerminate(FSharedDisplay); + except + eglTerminate(FDisplay); + raise; end; end; -class procedure TGrGlesAndroid.DoMakeCurrent( - const AContext: TGrGlesAndroidContext); +{ TGlContext } + +procedure TGlContext.Finalize( + const ASharedSharedResources: IGrCanvasSharedResources; + const AWindow: TWindowHandle); begin - if eglMakeCurrent(FSharedDisplay, AContext.Surface, AContext.Surface, AContext.Context) = EGL_FALSE then - RaiseLastError; + if FContext.Draw <> EGL_NO_SURFACE then + begin + eglDestroyContext(TGlSharedResources(ASharedSharedResources).Display, FContext.Context); + eglDestroySurface(TGlSharedResources(ASharedSharedResources).Display, FContext.Draw); + ANativeWindow_release(FANativeWindow); + end; end; -class procedure TGrGlesAndroid.DoMakeCurrentOffScreen( - const AContext: TGrGlesAndroidContext); +function TGlContext.Initialize( + const ASharedSharedResources: IGrCanvasSharedResources; + const AWindow: TWindowHandle): Boolean; +var + LANativeWindowSurface: JSurface; + LANativeWindowSurfaceID: Pointer; begin - if eglMakeCurrent(FSharedDisplay, FSharedSurface, FSharedSurface, AContext.Context) = EGL_FALSE then - RaiseLastError; + if FContext.Draw = EGL_NO_SURFACE then + begin + if AWindow is TAndroidWindowHandle then + begin + if TAndroidWindowHandle(AWindow).Holder = nil then + Exit(False); + LANativeWindowSurfaceID := (TAndroidWindowHandle(AWindow).Holder.getSurface as ILocalObject).GetObjectID; + end + else if AWindow is TAndroidHandle then + begin + if TAndroidHandle(AWindow).Surface = nil then + Exit(False); + LANativeWindowSurface := TJSurface.JavaClass.init(TAndroidHandle(AWindow).Surface); + LANativeWindowSurfaceID := TJNIResolver.JavaInstanceToID(LANativeWindowSurface); + end + else + Exit(False); + FANativeWindow := ANativeWindow_fromSurface(TJNIResolver.GetJNIEnv, LANativeWindowSurfaceID); + if FANativeWindow = nil then + Exit(False); + if ANativeWindow_setBuffersGeometry(FANativeWindow, 0, 0, WINDOW_FORMAT_RGBA_8888) <> 0 then + begin + ANativeWindow_release(FANativeWindow); + Exit(False); + end; + FContext.Draw := eglCreateWindowSurface(TGlSharedResources(ASharedSharedResources).Display, Config, FANativeWindow, nil); + if FContext.Draw = EGL_NO_SURFACE then + begin + ANativeWindow_release(FANativeWindow); + Exit(False); + end; + FContext.Context := eglCreateContext(TGlSharedResources(ASharedSharedResources).Display, Config, TGlSharedResources(ASharedSharedResources).Context.Context, @ContextAttributes[0]); + if FContext.Context = EGL_NO_CONTEXT then + begin + eglDestroySurface(TGlSharedResources(ASharedSharedResources).Display, FContext.Draw); + FContext.Draw := EGL_NO_SURFACE; + ANativeWindow_release(FANativeWindow); + Exit(False); + end; + FContext.Read := FContext.Draw; + end; + Result := True; end; -class procedure TGrGlesAndroid.RaiseLastError; +function TGlContext.MakeContextCurrent( + const ASharedSharedResources: IGrCanvasSharedResources): Boolean; begin - raise EGrCanvas.CreateFmt('OpenGLES error (%x)', [eglGetError]); + Result := eglMakeCurrent(TGlSharedResources(ASharedSharedResources).Display, FContext.Draw, FContext.Read, FContext.Context) <> EGL_FALSE; end; -class procedure TGrGlesAndroid.SwapBuffers; +procedure TGlContext.RestoreContext( + const ASharedSharedResources: IGrCanvasSharedResources); begin - if eglSwapBuffers(eglGetCurrentDisplay, eglGetCurrentSurface(EGL_DRAW)) = EGL_FALSE then - RaiseLastError; + eglMakeCurrent(TGlSharedResources(ASharedSharedResources).Display, FOldContext.Draw, FOldContext.Read, FOldContext.Context); end; -{$ELSEIF DEFINED(IOS)} - -{ TGrGlesIOS } - -class function TGrGlesIOS.DoCreateContext( - const ANativeWindowHandle: THandle): EAGLContext; -var - LView: GLKView; +procedure TGlContext.SaveContext( + const ASharedSharedResources: IGrCanvasSharedResources); begin - LView := TGLKView.Wrap(Pointer(ANativeWindowHandle)); - Result := TEAGLContext.Wrap(TEAGLContext.Alloc.initWithAPI(kEAGLRenderingAPIOpenGLES2)); - LView.setContext(Result); - LView.bindDrawable; + if eglGetCurrentDisplay = TGlSharedResources(ASharedSharedResources).Display then + begin + FOldContext.Draw := eglGetCurrentSurface(EGL_DRAW); + FOldContext.Read := eglGetCurrentSurface(EGL_READ); + FOldContext.Context := eglGetCurrentContext; + end + else + begin + FOldContext.Draw := EGL_NO_SURFACE; + FOldContext.Read := EGL_NO_SURFACE; + FOldContext.Context := EGL_NO_CONTEXT; + end; end; -class function TGrGlesIOS.DoCreateNativeWindow( - const AWindow: TWindowHandle): THandle; -var - LView: GLKView; +procedure TGlContext.SwapBuffers( + const ASharedSharedResources: IGrCanvasSharedResources); begin - if (not (AWindow is TiOSWindowHandle)) or (TiOSWindowHandle(AWindow).View = nil) or (not Supports(TiOSWindowHandle(AWindow).View, GLKView, LView)) then - Exit(0); - Result := THandle((LView as ILocalObject).GetObjectID); - LView.retain; + if eglSwapBuffers(TGlSharedResources(ASharedSharedResources).Display, FContext.Draw) = EGL_FALSE then + raise EGrCanvas.Create('Could not swap buffers.'); end; -class procedure TGrGlesIOS.DoDestroyContext(const ANativeWindowHandle: THandle; - const AContext: EAGLContext); +{$ELSEIF DEFINED(IOS)} + +{ TGlSharedResources } + +procedure TGlSharedResources.AfterBeginContext; begin - TEAGLContext.OCClass.setCurrentContext(nil); - AContext.release; + FOldContext := TEAGLContext.Wrap(TEAGLContext.OCClass.currentContext); + if not TEAGLContext.OCClass.setCurrentContext(FContext) then + raise EGrCanvas.Create('Could not make the shared context as current.'); end; -class procedure TGrGlesIOS.DoDestroyNativeWindow( - const ANativeWindowHandle: THandle); -var - LView: GLKView; +procedure TGlSharedResources.BeforeEndContext; begin - LView := TGLKView.Wrap(Pointer(ANativeWindowHandle)); - LView.release; + TEAGLContext.OCClass.setCurrentContext(FOldContext); end; -class procedure TGrGlesIOS.DoFinalize; +procedure TGlSharedResources.FinalizeSharedResources; begin + FContext.release; FreeLibrary(FLibModule); end; -class function TGrGlesIOS.DoInitialize: IGrGlInterface; -var - LContext: EAGLContext; +procedure TGlSharedResources.InitializeContext( + out ASharedGrDirectContext: IGrDirectContext); +begin + FGrGlInterface := TGrGlInterface.MakeNative; + ASharedGrDirectContext := TGrDirectContext.MakeGl(FGrGlInterface); +end; + +procedure TGlSharedResources.InitializeSharedResources; begin FLibModule := SafeLoadLibrary(libGLKit); if FLibModule = 0 then - Exit(nil); + raise EGrCanvas.Create('Could not load "GLKit" framework.'); try - LContext := TEAGLContext.Wrap(TEAGLContext.Alloc.initWithAPI(kEAGLRenderingAPIOpenGLES2)); - if LContext = nil then - Exit(nil); - try - if not TEAGLContext.OCClass.setCurrentContext(LContext) then - Exit(nil); - try - Result := TGrGlInterface.MakeNative; - finally - TEAGLContext.OCClass.setCurrentContext(nil); - end; - finally - LContext.release; - end; - finally - if not Assigned(Result) then - FreeLibrary(FLibModule); + FContext := TEAGLContext.Wrap(TEAGLContext.Alloc.initWithAPI(kEAGLRenderingAPIOpenGLES2)); + if FContext = nil then + raise EGrCanvas.Create('Could not create the shared context.'); + except + FreeLibrary(FLibModule); + raise; end; end; -class procedure TGrGlesIOS.DoMakeCurrent(const AContext: EAGLContext); -begin - if not TEAGLContext.OCClass.setCurrentContext(AContext) then - RaiseLastOSError; -end; - -{$ENDIF} - -{ TGrGlContext } +{ TGlContext } -constructor TGrGlContext.Create(const ANativeWindowHandle: THandle; - const AContext: T); +procedure TGlContext.Finalize( + const ASharedSharedResources: IGrCanvasSharedResources; + const AWindow: TWindowHandle); begin - FNativeWindowHandle := ANativeWindowHandle; - FContext := AContext; + if FContext <> nil then + FContext.release; end; -destructor TGrGlContext.Destroy; +function TGlContext.Initialize( + const ASharedSharedResources: IGrCanvasSharedResources; + const AWindow: TWindowHandle): Boolean; begin - DoDestroyContext(FNativeWindowHandle, FContext); - DoDestroyNativeWindow(FNativeWindowHandle); - inherited; + if FContext = nil then + begin + if WindowHandleToPlatform(AWindow).View = nil then + Exit(False); + FContext := TEAGLContext.Wrap(TEAGLContext.Alloc.initWithAPI(kEAGLRenderingAPIOpenGLES2, TGlSharedResources(ASharedSharedResources).Context.sharegroup)); + if FContext = nil then + Exit(False); + GLKView(WindowHandleToPlatform(AWindow).View).setContext(FContext); + GLKView(WindowHandleToPlatform(AWindow).View).bindDrawable; + end; + Result := True; end; -class procedure TGrGlContext.DoDestroyNativeWindow( - const ANativeWindowHandle: THandle); +function TGlContext.MakeContextCurrent( + const ASharedSharedResources: IGrCanvasSharedResources): Boolean; begin + Result := TEAGLContext.OCClass.setCurrentContext(FContext); end; -class procedure TGrGlContext.DoMakeCurrentOffScreen(const AContext: T); +procedure TGlContext.RestoreContext( + const ASharedSharedResources: IGrCanvasSharedResources); begin - DoMakeCurrent(AContext); + TEAGLContext.OCClass.setCurrentContext(FOldContext); end; -class procedure TGrGlContext.Finalize; +procedure TGlContext.SaveContext( + const ASharedSharedResources: IGrCanvasSharedResources); begin - DoFinalize; + FOldContext := TEAGLContext.Wrap(TEAGLContext.OCClass.currentContext); end; -class function TGrGlContext.Initialize: Boolean; +procedure TGlContext.SwapBuffers( + const ASharedSharedResources: IGrCanvasSharedResources); begin - FGlInterface := DoInitialize; - Result := Assigned(FGlInterface); end; -procedure TGrGlContext.MakeCurrent; -begin - DoMakeCurrent(FContext); -end; +{$ENDIF} + +{ TGlCanvas } -procedure TGrGlContext.MakeCurrentOffScreen; +procedure TGlCanvas.BeforeRestore; begin - DoMakeCurrentOffScreen(FContext); + if Parent <> nil then + FContext.MakeContextCurrent(SharedResources); end; -class function TGrGlContext.MakeFromWindow( - const AWindow: TWindowHandle): IGrGlContext; +function TGlCanvas.CreateSurfaceFromWindow( + var AGrDirectContext: IGrDirectContext): ISkSurface; var - LContext: T; - LNativeHandle: THandle; + LGrGlFramebufferInfo: TGrGlFramebufferInfo; + LGrRenderTarget: IGrBackendRenderTarget; begin - LNativeHandle := DoCreateNativeWindow(AWindow); - if LNativeHandle = 0 then + if not FContext.Initialize(SharedResources, Parent) then Exit(nil); - try - LContext := DoCreateContext(LNativeHandle); - except - DoDestroyNativeWindow(LNativeHandle); - raise; + FContext.SaveContext(SharedResources); + if not FContext.MakeContextCurrent(SharedResources) then + Exit(nil); + if not Assigned(AGrDirectContext) then + begin + AGrDirectContext := TGrDirectContext.MakeGl(TGlSharedResources(SharedResources).GrGlInterface); + if Quality = TCanvasQuality.HighQuality then + FSampleCount := GrDirectContext.GetMaxSurfaceSampleCountForColorType(TSkColorType.RGBA8888) + else + FSampleCount := 1; end; - Result := Create(LNativeHandle, LContext); + glGetIntegerv(GL_FRAMEBUFFER_BINDING, @GLuint(LGrGlFramebufferInfo.FBOID)); + LGrGlFramebufferInfo.Format := GrGlSizedFormat[TSkColorType.RGBA8888]; + LGrRenderTarget := TGrBackendRenderTarget.CreateGl(Round(Width * Scale), Round(Height * Scale), FSampleCount, 8, LGrGlFramebufferInfo); + Result := TSkSurface.MakeFromRenderTarget(GrDirectContext, LGrRenderTarget, TGrSurfaceOrigin.BottomLeft, TSkColorType.RGBA8888); end; -class procedure TGrGlContext.SwapBuffers; +destructor TGlCanvas.Destroy; begin + if Parent <> nil then + FContext.Finalize(SharedResources, Parent); + inherited; end; -{ TGrCanvasGl } - -function TGrCanvasGl.BeginWindow(const AContextHandle: THandle): ISkSurface; +procedure TGlCanvas.DestroyContext; begin - FWindowAttached := True; + FContext.SaveContext(SharedResources); try - Result := inherited; + FContext.MakeContextCurrent(SharedResources); + inherited; finally - FWindowAttached := Assigned(Result); + FContext.RestoreContext(SharedResources); end; end; -function TGrCanvasGl.CreateDirectContext: IGrDirectContext; -begin - Result := TGrDirectContext.MakeGl(TGrGlNativeContext.GlInterface); -end; - -function TGrCanvasGl.CreateSurfaceFromWindow: ISkSurface; -var - LFramebuffer: GLuint; - LMaxSamples: Integer; - LRenderTarget: IGrBackendRenderTarget; - LSamples: GLint; - LStencilBits: GLint; -begin - glGetIntegerv(GL_FRAMEBUFFER_BINDING, @LFramebuffer); - glGetIntegerv(GL_STENCIL_BITS, @LStencilBits); - glGetIntegerv(GL_SAMPLES, @LSamples); - LMaxSamples := Context.GetMaxSurfaceSampleCountForColorType(TSkColorType.RGBA8888); - if LSamples > LMaxSamples then - LSamples := LMaxSamples; - LRenderTarget := TGrBackendRenderTarget.CreateGl(DrawableWidth, DrawableHeight, LSamples, LStencilBits, TGrGlFramebufferInfo.Create(LFramebuffer, GrGlSizedFormat[TSkColorType.RGBA8888])); - Result := TSkSurface.MakeFromRenderTarget(Context, LRenderTarget, TGrSurfaceOrigin.BottomLeft, TSkColorType.RGBA8888); -end; - -class procedure TGrCanvasGl.DoFinalize; -begin - TGrGlNativeContext.Finalize; -end; - -class function TGrCanvasGl.DoInitialize: Boolean; -begin - Result := TGrGlNativeContext.Initialize; -end; - -procedure TGrCanvasGl.EndWindow; +procedure TGlCanvas.DoDrawBitmap(const ABitmap: FMX.Graphics.TBitmap; + const ASrcRect, ADestRect: TRectF; const AOpacity: Single; + const AHighSpeed: Boolean); begin + FContext.MakeContextCurrent(SharedResources); inherited; - FWindowAttached := False; -end; - -procedure TGrCanvasGl.FinalizeContext; -begin - FNativeContext := nil; end; -procedure TGrCanvasGl.Flush; +procedure TGlCanvas.DoEndScene; begin - TGrGlNativeContext.SwapBuffers; + if Parent <> nil then + begin + FContext.MakeContextCurrent(SharedResources); + inherited; + FContext.SwapBuffers(SharedResources); + FContext.RestoreContext(SharedResources); + end + else + inherited; end; -function TGrCanvasGl.InitializeContext: Boolean; +class procedure TGlCanvas.InitializeSharedResources( + out ASharedResources: IGrCanvasSharedResources); begin - FNativeContext := TGrGlNativeContext.MakeFromWindow(Parent); - Result := Assigned(FNativeContext); + ASharedResources := TGlSharedResources.Create; end; -procedure TGrCanvasGl.PrepareContext; -begin - if FWindowAttached then - FNativeContext.MakeCurrent - else - FNativeContext.MakeCurrentOffScreen; -end; +{$ENDIF} -{$ELSE} -implementation +{$HPPEMIT NOUSINGNAMESPACE} +{$IF DEFINED(MSWINDOWS) or DEFINED(ANDROID) or DEFINED(IOS)} + (*$HPPEMIT 'namespace Skia {'*) + (*$HPPEMIT ' namespace Fmx {'*) + (*$HPPEMIT ' namespace Types { using namespace ::Fmx::Types; }'*) + (*$HPPEMIT ' }'*) + (*$HPPEMIT '}'*) {$ENDIF} end. + diff --git a/skia4delphi/Source/FMX/Skia.FMX.Canvas.Metal.pas b/skia4delphi/Source/FMX/Skia.FMX.Canvas.Metal.pas index c7dcb1e..7328678 100644 --- a/skia4delphi/Source/FMX/Skia.FMX.Canvas.Metal.pas +++ b/skia4delphi/Source/FMX/Skia.FMX.Canvas.Metal.pas @@ -15,8 +15,6 @@ interface {$SCOPEDENUMS ON} -// The implementation of Metal is experimental. - {$IFDEF MACOS} uses @@ -38,112 +36,159 @@ interface Skia.FMX.Graphics; type - { TGrCanvasMetal } + { TMtlSharedResources } + + TMtlSharedResources = class(TGrCanvasSharedResources) + strict protected + procedure InitializeContext(out ASharedGrDirectContext: IGrDirectContext); override; + end; - TGrCanvasMetal = class(TGrCanvasCustom) - strict private class var - FSharedDevice: MTLDevice; + { TMtlCanvas } + + TMtlCanvas = class(TGrCanvas) strict private FCommandQueue: MTLCommandQueue; - FView: MTKView; + FSampleCount: Integer; strict protected - function CreateDirectContext: IGrDirectContext; override; - function CreateSurfaceFromWindow: ISkSurface; override; - procedure FinalizeContext; override; - procedure Flush; override; - function InitializeContext: Boolean; override; - class procedure DoFinalize; override; - class function DoInitialize: Boolean; override; + function CreateSurfaceFromWindow(var AGrDirectContext: IGrDirectContext): ISkSurface; override; + procedure DoEndScene; override; + class procedure InitializeSharedResources(out ASharedResources: IGrCanvasSharedResources); override; end; +{$ENDIF} + implementation -{ TGrCanvasMetal } +{$IFDEF MACOS} -function TGrCanvasMetal.CreateDirectContext: IGrDirectContext; -begin - FSharedDevice.retain; - FCommandQueue.retain; - Result := TGrDirectContext.MakeMetal(TGrMtlBackendContext.Create((FSharedDevice as ILocalObject).GetObjectID, (FCommandQueue as ILocalObject).GetObjectID, nil)); -end; +uses + { Delphi } + FMX.Graphics; -function TGrCanvasMetal.CreateSurfaceFromWindow: ISkSurface; -var - LDrawable: CAMetalDrawable; - LRenderTarget: IGrBackendRenderTarget; -begin - LDrawable := FView.currentDrawable; - if LDrawable = nil then - Exit(nil); - LRenderTarget := TGrBackendRenderTarget.CreateMetal(DrawableWidth, DrawableHeight, TGrMtlTextureInfo.Create((LDrawable.texture as ILocalObject).GetObjectID)); - Result := TSkSurface.MakeFromRenderTarget(Context, LRenderTarget, TGrSurfaceOrigin.TopLeft, TSkColorType.BGRA8888); -end; +{ TMtlSharedResources } -class procedure TGrCanvasMetal.DoFinalize; +procedure TMtlSharedResources.InitializeContext( + out ASharedGrDirectContext: IGrDirectContext); +var + LCommandQueue: MTLCommandQueue; + LDevice: MTLDevice; + LGrMtlBackendContext: TGrMtlBackendContext; begin - FSharedDevice.release; + LDevice := TMTLDevice.Wrap(MTLCreateSystemDefaultDevice); + if LDevice = nil then + raise EGrCanvas.Create('Could not get the default device instance Metal.'); + try + LCommandQueue := LDevice.newCommandQueue; + if LCommandQueue = nil then + raise EGrCanvas.Create('Could not create the shared command queue.'); + try + LGrMtlBackendContext.Device := (LDevice as ILocalObject).GetObjectID; + LGrMtlBackendContext.Queue := (LCommandQueue as ILocalObject).GetObjectID; + LGrMtlBackendContext.BinaryArchive := nil; + // The direct context will take ownership of the device and the queue. + ASharedGrDirectContext := TGrDirectContext.MakeMetal(LGrMtlBackendContext); + except + LCommandQueue.release; + raise; + end; + except + LDevice.release; + raise; + end; end; -class function TGrCanvasMetal.DoInitialize: Boolean; -begin - FSharedDevice := TMTLDevice.Wrap(MTLCreateSystemDefaultDevice); - Result := FSharedDevice <> nil; -end; +{ TMtlCanvas } -procedure TGrCanvasMetal.FinalizeContext; +function TMtlCanvas.CreateSurfaceFromWindow( + var AGrDirectContext: IGrDirectContext): ISkSurface; +var + LDevice: MTLDevice; + LGrMtlBackendContext: TGrMtlBackendContext; begin - FView.release; - FCommandQueue.release; + if not Assigned(AGrDirectContext) then + begin + if WindowHandleToPlatform(Parent).View = nil then + Exit(nil); + LDevice := TMTLDevice.Wrap(MTLCreateSystemDefaultDevice); + try + MTKView(WindowHandleToPlatform(Parent).View).setDevice(LDevice); + {$REGION ' - Workaround RSP-37935'} + // - --------------------------------------------------------------------- + // - WORKAROUND + // - --------------------------------------------------------------------- + // - + // - Description: + // - This code is a workaround to a problem when Zoomed setting is + // - enabled on the OS then the form does not fit the screen. + // - + // - Bug report: + // - https://quality.embarcadero.com/browse/RSP-37935 + // - + // - --------------------------------------------------------------------- + {$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion112))} + var LSize: CGSize; + LSize.width := Width * Scale; + LSize.height := Height * Scale; + MTKView(WindowHandleToPlatform(Parent).View).setDrawableSize(LSize); + {$ENDIF} + // - --------------------------------------------------------------------- + {$ENDREGION} + FCommandQueue := LDevice.newCommandQueue; + if FCommandQueue = nil then + raise EGrCanvas.Create('Could not create a command queue.'); + try + LGrMtlBackendContext.Device := (LDevice as ILocalObject).GetObjectID; + LGrMtlBackendContext.Queue := (FCommandQueue as ILocalObject).GetObjectID; + LGrMtlBackendContext.BinaryArchive := nil; + // The direct context will take ownership of the device and the queue. + AGrDirectContext := TGrDirectContext.MakeMetal(LGrMtlBackendContext); + except + FCommandQueue.release; + raise; + end; + except + LDevice.release; + raise; + end; + if Quality = TCanvasQuality.HighQuality then + FSampleCount := GrDirectContext.GetMaxSurfaceSampleCountForColorType(TSkColorType.BGRA8888) + else + FSampleCount := 1; + end; + Result := TSkSurface.MakeFromMTKView(AGrDirectContext, (MTKView(WindowHandleToPlatform(Parent).View) as ILocalObject).GetObjectID, TGrSurfaceOrigin.TopLeft, FSampleCount, TSkColorType.BGRA8888); end; -procedure TGrCanvasMetal.Flush; +procedure TMtlCanvas.DoEndScene; var LCommandBuffer: MTLCommandBuffer; begin - LCommandBuffer := FCommandQueue.commandBuffer; - LCommandBuffer.presentDrawable(MTKView(WindowHandleToPlatform(Parent).View).currentDrawable); - LCommandBuffer.commit; + inherited; + if Parent <> nil then + begin + LCommandBuffer := FCommandQueue.commandBuffer; + LCommandBuffer.presentDrawable(MTKView(WindowHandleToPlatform(Parent).View).currentDrawable); + LCommandBuffer.commit; + end; end; -function TGrCanvasMetal.InitializeContext: Boolean; +class procedure TMtlCanvas.InitializeSharedResources( + out ASharedResources: IGrCanvasSharedResources); begin - {$IFDEF IOS} - if (not (Parent is TiOSWindowHandle)) or (TiOSWindowHandle(Parent).View = nil) or (not Supports(TiOSWindowHandle(Parent).View, MTKView, FView)) then - Exit(False); - {$ELSE} - if (not (Parent is TMacWindowHandle)) or (TMacWindowHandle(Parent).View = nil) or (not Supports(TMacWindowHandle(Parent).View, MTKView, FView)) then - Exit(False); - {$ENDIF} - FCommandQueue := FSharedDevice.newCommandQueue; - FView.retain; - FView.setDevice(FSharedDevice); - {$REGION ' - Workaround RSP-37935'} - // - ------------------------------------------------------------------------- - // - WORKAROUND - // - ------------------------------------------------------------------------- - // - - // - Description: - // - This code is a workaround to a problem when Zoomed setting is enabled - // - on the OS then the form does not fit the screen - // - - // - Bug report: - // - https://quality.embarcadero.com/browse/RSP-37935 - // - - // - ------------------------------------------------------------------------- - {$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the issue has been fixed'} - {$ENDIF} - // - ------------------------------------------------------------------------- - var LSize: CGSize; - LSize.width := Width * Scale; - LSize.height := Height * Scale; - FView.setDrawableSize(LSize); - // - ------------------------------------------------------------------------- - {$ENDREGION} - Result := True; + ASharedResources := TMtlSharedResources.Create; end; +{$ENDIF} + +{$HPPEMIT NOUSINGNAMESPACE} +(*$HPPEMIT 'namespace Skia {'*) +(*$HPPEMIT ' namespace Fmx {'*) +(*$HPPEMIT ' namespace Platform {'*) +{$IFDEF IOS} + (*$HPPEMIT ' namespace Ios { using namespace ::Fmx::Platform::Ios; }'*) {$ELSE} -implementation + (*$HPPEMIT ' namespace Mac { using namespace ::Fmx::Platform::Mac; }'*) {$ENDIF} +(*$HPPEMIT ' }'*) +(*$HPPEMIT ' }'*) +(*$HPPEMIT '}'*) end. diff --git a/skia4delphi/Source/FMX/Skia.FMX.Graphics.pas b/skia4delphi/Source/FMX/Skia.FMX.Graphics.pas index 76aaca3..274386f 100644 --- a/skia4delphi/Source/FMX/Skia.FMX.Graphics.pas +++ b/skia4delphi/Source/FMX/Skia.FMX.Graphics.pas @@ -22,16 +22,15 @@ interface uses { Delphi } FMX.Graphics, - FMX.Types, FMX.TextLayout, + FMX.Types, System.Classes, - System.Generics.Collections, System.Generics.Defaults, System.Math.Vectors, + System.Messaging, System.SysUtils, System.Types, System.UITypes, - System.Messaging, { Skia } Skia; @@ -41,24 +40,6 @@ ESkCanvas = class(Exception); EGrCanvas = class(ESkCanvas); - { TSkBitmapHandle } - - TSkBitmapHandle = class - strict private - FHeight: Integer; - FPixels: Pointer; - FWidth: Integer; - public - constructor Create(const AWidth, AHeight: Integer); - destructor Destroy; override; - procedure Initialize; inline; - property Height: Integer read FHeight; - property Pixels: Pointer read FPixels; - property Width: Integer read FWidth; - end; - - TSkCanvasClass = class of TSkCanvasCustom; - { TSkCanvasCustom } TSkCanvasCustom = class abstract(TCanvas{$IFDEF MODULATE_CANVAS}, IModulateCanvas{$ENDIF}) @@ -69,152 +50,218 @@ TSaveState = class(TCanvasSaveState) public procedure Assign(ASource: TPersistent); override; end; - - strict private class var - FImageCache: TObjectDictionary>; + private + // Ideally, this function should be virtual and each Canvas should be able + // to choose its pixel format to avoid conversions, however, due to the + // current FMX code, they should be fixed per operating system. + class function PixelFormat: TPixelFormat; inline; {$IFDEF MODULATE_CANVAS} strict private FModulateColor: TAlphaColor; - { IModulateCanvas } function GetModulateColor: TAlphaColor; procedure SetModulateColor(const AColor: TAlphaColor); {$ENDIF} - private - FSurface: ISkSurface; strict private - FDrawableHeight: Integer; - FDrawableWidth: Integer; - function GetSamplingOptions(const AHighSpeed: Boolean = False): TSkSamplingOptions; - procedure SetupBrush(const ABrush: TBrush; const ARect: TRectF; const AOpacity: Single; const APaint: ISkPaint); + FBrushBitmapData: TBitmapData; + FBrushBitmapMapped: Boolean; + function GetSamplingOptions(const AHighSpeed: Boolean = False): TSkSamplingOptions; inline; + procedure BeginSkPaint(const ABrush: TBrush; const ARect: TRectF; const AOpacity: Single; const APaint: ISkPaint); strict protected - constructor CreateFromPrinter(const APrinter: TAbstractPrinter); override; - {$IFDEF MSWINDOWS} - constructor CreateFromWindow(const AParent: TWindowHandle; const AWidth, AHeight: Integer; const AQuality: TCanvasQuality = TCanvasQuality.SystemDefault); override; - {$ENDIF} - function BeginWindow(const AContextHandle: THandle): ISkSurface; virtual; abstract; - function BitmapToSkImage(const ABitmap: TBitmap): ISkImage; - function BrushToSkPaint(const ABrush: TBrush; const ARect: TRectF; const AOpacity: Single): ISkPaint; - function CreateCache(const AWidth, AHeight: Integer; const AColorType: TSkColorType; const APixels: Pointer; const ARowBytes: NativeUInt): ISkImage; virtual; + // Since FMX effects use TContext3D, on systems using OpenGLES it makes the + // current context the context it created, and does not revert to the old + // one after it has finished its task. + procedure BeforeRestore; virtual; + function BeginSkPaintFromBrush(const ABrush: TBrush; const ARect: TRectF; const AOpacity: Single): ISkPaint; inline; + function BeginSkPaintFromStrokeBrush(const ABrush: TStrokeBrush; const ARect: TRectF; const AOpacity: Single): ISkPaint; function CreateSaveState: TCanvasSaveState; override; - procedure DestroyWindow; virtual; - function DoBeginScene({$IF CompilerVersion < 35}const {$ENDIF}AClipRects: PClipRects = nil; AContextHandle: THandle = 0): Boolean; override; final; procedure DoDrawBitmap(const ABitmap: TBitmap; const ASrcRect, ADestRect: TRectF; const AOpacity: Single; const AHighSpeed: Boolean); override; procedure DoDrawEllipse(const ARect: TRectF; const AOpacity: Single; const ABrush: TStrokeBrush); override; procedure DoDrawLine(const APoint1, APoint2: TPointF; const AOpacity: Single; const ABrush: TStrokeBrush); override; procedure DoDrawPath(const APath: TPathData; const AOpacity: Single; const ABrush: TStrokeBrush); override; procedure DoDrawRect(const ARect: TRectF; const AOpacity: Single; const ABrush: TStrokeBrush); override; - procedure DoEndScene; override; final; procedure DoFillEllipse(const ARect: TRectF; const AOpacity: Single; const ABrush: TBrush); override; procedure DoFillPath(const APath: TPathData; const AOpacity: Single; const ABrush: TBrush); override; procedure DoFillRect(const ARect: TRectF; const AOpacity: Single; const ABrush: TBrush); override; {$IF CompilerVersion >= 30} procedure DoSetMatrix(const AMatrix: TMatrix); override; {$ENDIF} - procedure EndWindow; virtual; + procedure EndSkPaint(const ABrush: TBrush); + function GetCache(const ABitmapHandle: THandle): ISkImage; virtual; + function GetCanvas: ISkCanvas; virtual; abstract; procedure Resized; virtual; - procedure Restore; virtual; - procedure Save; virtual; - function StrokeBrushToSkPaint(const ABrush: TStrokeBrush; const ARect: TRectF; const AOpacity: Single): ISkPaint; - class procedure ClearCache(const ACanvas: TSkCanvasCustom); virtual; - class procedure ClearCacheBitmap(const ABitmapHandle: THandle); - class procedure DoClearCacheBitmap(const ACanvas: TSkCanvasCustom; const ABitmapHandle: THandle); virtual; - class procedure DoFinalize; virtual; - class procedure DoFinalizeBitmap(var ABitmapHandle: THandle); override; - class function DoInitialize: Boolean; virtual; - class function DoInitializeBitmap(const AWidth, AHeight: Integer; const AScale: Single; var APixelFormat: TPixelFormat): THandle; override; - class function DoMapBitmap(const ABitmapHandle: THandle; const AAccess: TMapAccess; var ABitmapData: TBitmapData): Boolean; override; - class procedure DoUnmapBitmap(const ABitmapHandle: THandle; var ABitmapData: TBitmapData); override; public - procedure BeforeDestruction; override; procedure Clear(const AColor: TAlphaColor); override; procedure ClearRect(const ARect: TRectF; const AColor: TAlphaColor = 0); override; procedure ExcludeClipRect(const ARect: TRectF); override; procedure IntersectClipRect(const ARect: TRectF); override; + function LoadFontFromStream(const AStream: TStream): Boolean; override; function PtInPath(const APoint: TPointF; const APath: TPathData): Boolean; override; {$IF CompilerVersion < 30} procedure SetMatrix(const AMatrix: TMatrix); override; {$ENDIF} + property Canvas: ISkCanvas read GetCanvas; procedure SetSize(const AWidth, AHeight: Integer); override; final; - property DrawableHeight: Integer read FDrawableHeight; - property DrawableWidth: Integer read FDrawableWidth; - /// Direct access to the Skia Surface. This property just won't be nil between BeginScene and EndScene calls. - property Surface: ISkSurface read FSurface; - class procedure Finalize; class function GetCanvasStyle: TCanvasStyles; override; - class function Initialize: Boolean; end; - { TSkCanvasRasterCustom } + { TSkBitmapHandle } + + TSkBitmapHandle = class + strict private + FHeight: Integer; + FPixelFormat: TPixelFormat; + FPixels: Pointer; + FWidth: Integer; + public + constructor Create(const AWidth, AHeight: Integer; const APixelFormat: TPixelFormat); + destructor Destroy; override; + procedure AllocatePixels; inline; + property Height: Integer read FHeight; + property PixelFormat: TPixelFormat read FPixelFormat; + property Pixels: Pointer read FPixels; + property Width: Integer read FWidth; + end; + + { TSkCanvasBase } - TSkCanvasRasterCustom = class abstract(TSkCanvasCustom) + TSkCanvasBase = class abstract(TSkCanvasCustom) strict private - FBufferHandle: THandle; + FSurface: ISkSurface; + protected + class procedure Finalize; virtual; + class procedure Initialize; virtual; strict protected - function BeginWindow(const AContextHandle: THandle): ISkSurface; override; - function CreateBuffer: THandle; virtual; abstract; - function CreateWindowSurface(const AContextHandle, ABufferHandle: THandle): ISkSurface; virtual; abstract; - procedure EndWindow; override; - procedure Flush(const ABufferHandle: THandle); virtual; abstract; - procedure FreeBuffer(const ABufferHandle: THandle); virtual; abstract; + {$IFDEF MSWINDOWS} + constructor CreateFromWindow(const AParent: TWindowHandle; const AWidth, AHeight: Integer; const AQuality: TCanvasQuality = TCanvasQuality.SystemDefault); override; + {$ENDIF} + function DoBeginScene({$IF CompilerVersion < 35}const {$ENDIF}AClipRects: PClipRects = nil; AContextHandle: THandle = 0): Boolean; override; + function CreateSurfaceFromBitmap: ISkSurface; virtual; + function CreateSurfaceFromWindow(const AContextHandle: THandle): ISkSurface; virtual; abstract; + procedure DoEndScene; override; + function GetCanvas: ISkCanvas; override; + {$IFDEF MSWINDOWS} procedure Resized; override; + {$ENDIF} + class procedure DoFinalizeBitmap(var ABitmapHandle: THandle); override; + class function DoInitializeBitmap(const AWidth, AHeight: Integer; const AScale: Single; var APixelFormat: TPixelFormat): THandle; override; + class function DoMapBitmap(const ABitmapHandle: THandle; const AAccess: TMapAccess; var ABitmapData: TBitmapData): Boolean; override; + class procedure DoUnmapBitmap(const ABitmapHandle: THandle; var ABitmapData: TBitmapData); override; public - destructor Destroy; override; + property Surface: ISkSurface read FSurface; end; - TSkContextBeforeDestructionMessage = class(TMessage); + { IGrCanvasSharedResources } - { TGrCanvasCustom } + IGrCanvasSharedResources = interface + ['{3681405A-B7C1-4244-98B6-E6D2B8E45BC2}'] + procedure BeginContext; + procedure EndContext; + function GetGrDirectContext: IGrDirectContext; + /// Direct access to the ganesh backend. This property can only be used between the BeginContext and EndContext call. + property GrDirectContext: IGrDirectContext read GetGrDirectContext; + end; + + { TGrCanvasSharedResources } - TGrCanvasCustom = class abstract(TSkCanvasCustom) + TGrCanvasSharedResources = class abstract(TInterfacedObject, IGrCanvasSharedResources) strict private - FContext: IGrDirectContext; - FContextInitialized: Boolean; + FGrDirectContext: IGrDirectContext; + procedure BeginContext; + procedure EndContext; + function GetGrDirectContext: IGrDirectContext; strict protected - function BeginWindow(const AContextHandle: THandle): ISkSurface; override; - function CreateContext: IGrDirectContext; virtual; abstract; - function CreateDirectContext: IGrDirectContext; virtual; abstract; - function CreateSurfaceFromWindow: ISkSurface; virtual; abstract; - procedure DestroyWindow; override; - procedure EndWindow; override; - procedure FinalizeContext; virtual; abstract; - procedure Flush; virtual; abstract; - function InitializeContext: Boolean; virtual; abstract; - procedure PrepareContext; virtual; - procedure Restore; override; - function CreateCache(const AWidth, AHeight: Integer; const AColorType: TSkColorType; const APixels: Pointer; const ARowBytes: NativeUInt): ISkImage; override; - class procedure ClearCache(const ACanvas: TSkCanvasCustom); override; - class procedure DoClearCacheBitmap(const ACanvas: TSkCanvasCustom; const ABitmapHandle: THandle); override; + procedure AfterBeginContext; virtual; + procedure BeforeEndContext; virtual; + procedure FinalizeSharedResources; virtual; + procedure InitializeContext(out ASharedGrDirectContext: IGrDirectContext); virtual; abstract; + procedure InitializeSharedResources; virtual; + public + constructor Create; + destructor Destroy; override; + end; + + { TGrBitmapHandle } + + TGrBitmapHandle = class(TSkBitmapHandle) + private + FSharedResources: IGrCanvasSharedResources; + FTexture: ISkImage; public destructor Destroy; override; - /// Direct access to the Skia Ganesh Direct Context. This property can only be used between BeginScene and EndScene calls. - property Context: IGrDirectContext read FContext; + procedure ClearCache; inline; + property Texture: ISkImage read FTexture; + end; + + { TGrCanvas } + + TGrCanvas = class abstract(TSkCanvasBase) + strict private class var + FSharedResources: IGrCanvasSharedResources; + strict private + FGrDirectContext: IGrDirectContext; + strict protected + function CreateSurfaceFromBitmap: ISkSurface; override; + function CreateSurfaceFromWindow(const AContextHandle: THandle): ISkSurface; overload; override; final; + function CreateSurfaceFromWindow(var AGrDirectContext: IGrDirectContext): ISkSurface; reintroduce; overload; virtual; abstract; + procedure DestroyContext; virtual; + procedure DoEndScene; override; + function GetCache(const ABitmapHandle: THandle): ISkImage; override; + class function DoInitializeBitmap(const AWidth, AHeight: Integer; const AScale: Single; var APixelFormat: TPixelFormat): THandle; override; + class function DoMapBitmap(const ABitmapHandle: THandle; const AAccess: TMapAccess; var ABitmapData: TBitmapData): Boolean; override; + class procedure Initialize; override; + class procedure InitializeSharedResources(out ASharedResources: IGrCanvasSharedResources); virtual; abstract; + public + procedure BeforeDestruction; override; + /// Direct access to the ganesh backend. This property can only be used between the BeginScene and EndScene call. + property GrDirectContext: IGrDirectContext read FGrDirectContext; + class property SharedResources: IGrCanvasSharedResources read FSharedResources; end; + TGrBeforeSharedContextDestructionMessage = class(TMessage); + { TSkTextLayout } TSkTextLayout = class(TTextLayout) strict private type - TParagraphItem = record + TParagraph = record Bounds: TRectF; Offset: TPointF; Paragraph: ISkParagraph; Range: TTextRange; end; + + TGraphemesMap = record + strict private + FCharIndexInGrapheme: TBytes; + FText: string; + function CreateGraphemesMapping(const AText: string): TBytes; + procedure SetText(const AText: string); inline; + public + procedure FindNextGraphemeBoundary(var AIndex: Integer); inline; + procedure FindPreviousGraphemeBoundary(var AIndex: Integer); inline; + property Text: string read FText write SetText; + end; + strict private class var FAttributesRangeComparer: IComparer; - FParagraphTextRangeComparer: IComparer; - class constructor Create; + FParagraphTextRangeComparer: IComparer; strict private FColor: TAlphaColor; + FGraphemesMap: TGraphemesMap; + {$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion113))} FIgnoreUpdates: Boolean; + {$ENDIF} FMaxLines: Integer; FOpacity: Single; - FParagraphs: TArray; + FParagraphs: TArray; FTextRect: TRectF; - function GetParagraphsInRange(const APos, ALength: Integer): TArray; + function GetParagraphsInRange(const APos, ALength: Integer): TArray; function NeedHorizontalAlignment: Boolean; procedure SetMaxLines(AValue: Integer); procedure UpdateParagraph; + class constructor Create; + protected + class procedure Initialize; strict protected procedure DoDrawLayout(const ACanvas: TCanvas); overload; override; procedure DoDrawLayout(const ACanvas: ISkCanvas); reintroduce; overload; @@ -255,6 +302,7 @@ implementation System.IOUtils, System.Math, System.UIConsts, + System.Generics.Collections, {$IF DEFINED(MSWINDOWS)} FMX.Platform.Win, Winapi.Windows, @@ -306,40 +354,6 @@ implementation Skia.FMX.Canvas.Metal; type - {$IF DEFINED(MSWINDOWS)} - - { TSkCanvasRasterWindows } - - TSkCanvasRasterWindows = class(TSkCanvasRasterCustom) - strict private - FDC: HDC; - strict protected - function CreateBuffer: THandle; override; - function CreateWindowSurface(const AContextHandle, ABufferHandle: THandle): ISkSurface; override; - procedure Flush(const ABufferHandle: THandle); override; - procedure FreeBuffer(const ABufferHandle: THandle); override; - end; - - {$ELSEIF DEFINED(MACOS) and NOT DEFINED(IOS)} - - { TSkCanvasRasterMacOS } - - TSkCanvasRasterMacOS = class(TSkCanvasRasterCustom) - strict private class var - FColorSpace: CGColorSpaceRef; - strict private - FContext: CGContextRef; - strict protected - function CreateBuffer: THandle; override; - function CreateWindowSurface(const AContextHandle, ABufferHandle: THandle): ISkSurface; override; - procedure Flush(const ABufferHandle: THandle); override; - procedure FreeBuffer(const ABufferHandle: THandle); override; - class procedure DoFinalize; override; - class function DoInitialize: Boolean; override; - end; - - {$ENDIF} - { TSkBitmapHandleCodec } TSkBitmapHandleCodec = class(TCustomBitmapCodec) @@ -359,1734 +373,2023 @@ TSkBitmapHandleCodec = class(TCustomBitmapCodec) {$IF DEFINED(MSWINDOWS)} -{ TSkCanvasRasterWindows } - -function TSkCanvasRasterWindows.CreateBuffer: THandle; -var - LBitmapInfo: TBitmapInfo; - LBits: Pointer; -begin - inherited Create; - FillChar(LBitmapInfo, SizeOf(TBitmapInfo), 0); - FillChar(LBitmapInfo, 0, SizeOf(TBitmapInfo)); - LBitmapInfo.bmiHeader.biSize := SizeOf(TBitmapInfoHeader); - LBitmapInfo.bmiHeader.biWidth := DrawableWidth; - LBitmapInfo.bmiHeader.biHeight := -DrawableHeight; - LBitmapInfo.bmiHeader.biPlanes := 1; - LBitmapInfo.bmiHeader.biBitCount := 32; - LBitmapInfo.bmiHeader.biCompression := BI_RGB; - LBitmapInfo.bmiHeader.biSizeImage := DrawableWidth * DrawableHeight * 4; - Result := THandle(CreateDIBSection(0, LBitmapInfo, DIB_RGB_COLORS, LBits, 0, 0)); -end; - -function TSkCanvasRasterWindows.CreateWindowSurface( - const AContextHandle, ABufferHandle: THandle): ISkSurface; -var - LBitmap: TBitmap; -begin - FDC := HDC(AContextHandle); - GetObject(HBITMAP(ABufferHandle), SizeOf(TBitmap), @LBitmap); - Result := TSkSurface.MakeRasterDirect(TSkImageInfo.Create(LBitmap.bmWidth, LBitmap.bmHeight), LBitmap.bmBits, LBitmap.bmWidthBytes); -end; + { TSkRasterWindowsCanvas } -procedure TSkCanvasRasterWindows.Flush(const ABufferHandle: THandle); -var - LBufferDC: HDC; -begin - if FDC <> 0 then - begin - LBufferDC := CreateCompatibleDC(0); - if LBufferDC = 0 then - RaiseLastOSError; - try - if SelectObject(LBufferDC, HBITMAP(ABufferHandle)) = 0 then - RaiseLastOSError; - if not BitBlt(FDC, 0, 0, DrawableWidth, DrawableHeight, LBufferDC, 0, 0, SRCCOPY) then - RaiseLastOSError; - finally - DeleteDC(LBufferDC); - end; + TSkRasterWindowsCanvas = class(TSkCanvasBase) + strict private + FBitmap: HBITMAP; + FBits: Pointer; + FDC: HDC; + strict protected + function CreateSurfaceFromWindow(const AContextHandle: THandle): ISkSurface; override; + procedure DoEndScene; override; + procedure Resized; override; + public + destructor Destroy; override; end; -end; - -procedure TSkCanvasRasterWindows.FreeBuffer(const ABufferHandle: THandle); -begin - DeleteObject(HBITMAP(ABufferHandle)); -end; {$ELSEIF DEFINED(MACOS) and NOT DEFINED(IOS)} -{ TSkCanvasRasterMacOS } + { TSkRasterMacOSCanvas } -function TSkCanvasRasterMacOS.CreateBuffer: THandle; -begin - Result := THandle(CGBitmapContextCreate(nil, DrawableWidth, DrawableHeight, 8, DrawableWidth * 4, FColorSpace, kCGImageAlphaPremultipliedLast)); -end; + TSkRasterMacOSCanvas = class(TSkCanvasBase) + strict private class var + FColorSpace: CGColorSpaceRef; + strict private + FBitmapContext: CGContextRef; + FContext: CGContextRef; + strict protected + function CreateSurfaceFromWindow(const AContextHandle: THandle): ISkSurface; override; + procedure DoEndScene; override; + procedure Resized; override; + class procedure Finalize; override; + class procedure Initialize; override; + public + destructor Destroy; override; + end; -function TSkCanvasRasterMacOS.CreateWindowSurface(const AContextHandle, - ABufferHandle: THandle): ISkSurface; -begin - FContext := CGContextRef(AContextHandle); - Result := TSkSurface.MakeRasterDirect(TSkImageInfo.Create(CGBitmapContextGetWidth(CGContextRef(ABufferHandle)), CGBitmapContextGetHeight(CGContextRef(ABufferHandle)), TSkColorType.RGBA8888), CGBitmapContextGetData(CGContextRef(ABufferHandle)), CGBitmapContextGetBytesPerRow(CGContextRef(ABufferHandle))); -end; +{$ENDIF} -class procedure TSkCanvasRasterMacOS.DoFinalize; -begin - CGColorSpaceRelease(FColorSpace); -end; +{ TSkCanvasCustom } -class function TSkCanvasRasterMacOS.DoInitialize: Boolean; +procedure TSkCanvasCustom.BeforeRestore; begin - FColorSpace := CGColorSpaceCreateDeviceRGB; - Result := FColorSpace <> nil; end; -procedure TSkCanvasRasterMacOS.Flush(const ABufferHandle: THandle); +procedure TSkCanvasCustom.BeginSkPaint(const ABrush: TBrush; + const ARect: TRectF; const AOpacity: Single; const APaint: ISkPaint); +const + WrapMode: array[TWrapMode.Tile..TWrapMode.TileOriginal] of TSkTileMode = (TSkTileMode.Repeat, TSkTileMode.Clamp); var - LImage: CGImageRef; + I: Integer; + LCenter: TPointF; + LColors: TArray; + LImage: ISkImage; + LMatrix: TMatrix; + LPositions: TArray; + LRadius: Single; + LRadiusX: Single; + LRadiusY: Single; begin - LImage := CGBitmapContextCreateImage(CGContextRef(ABufferHandle)); - try - CGContextDrawImage(FContext, CGRectMake(0, 0, Width, Height), LImage); - finally - CGImageRelease(LImage); + if ABrush.Kind = TBrushKind.Resource then + begin + if ABrush.Resource.Brush = nil then + Exit; + ABrush.Assign(ABrush.Resource.Brush); + end; + APaint.AntiAlias := Quality <> TCanvasQuality.HighPerformance; + case ABrush.Kind of + TBrushKind.Solid: APaint.Color := MakeColor(ABrush.Color, AOpacity); + TBrushKind.Gradient: + begin + SetLength(LColors, ABrush.Gradient.Points.Count); + SetLength(LPositions, ABrush.Gradient.Points.Count); + case ABrush.Gradient.Style of + TGradientStyle.Linear: + begin + for I := 0 to ABrush.Gradient.Points.Count - 1 do + begin + LColors[I] := MakeColor(ABrush.Gradient.Points[I].Color, AOpacity); + LPositions[I] := ABrush.Gradient.Points[I].Offset; + end; + APaint.Shader := TSkShader.MakeGradientLinear(TPointF.Create(ARect.Left + ABrush.Gradient.StartPosition.X * ARect.Width, ARect.Top + ABrush.Gradient.StartPosition.Y * ARect.Height), TPointF.Create(ARect.Left + ABrush.Gradient.StopPosition.X * ARect.Width, ARect.Top + ABrush.Gradient.StopPosition.Y * ARect.Height), LColors, LPositions); + end; + TGradientStyle.Radial: + begin + for I := 0 to ABrush.Gradient.Points.Count - 1 do + begin + LColors[ABrush.Gradient.Points.Count - 1 - I] := MakeColor(ABrush.Gradient.Points[I].Color, AOpacity); + LPositions[ABrush.Gradient.Points.Count - 1 - I] := 1 - ABrush.Gradient.Points[I].Offset; + end; + LCenter := TPointF.Create(ARect.Width * ABrush.Gradient.RadialTransform.RotationCenter.X, ARect.Height * ABrush.Gradient.RadialTransform.RotationCenter.Y) + ARect.TopLeft; + LRadiusX := ABrush.Gradient.RadialTransform.Scale.X * (ARect.Width / 2); + LRadiusY := ABrush.Gradient.RadialTransform.Scale.Y * (ARect.Height / 2); + if not SameValue(LRadiusX, LRadiusY, Epsilon) then + begin + if LRadiusX < LRadiusY then + begin + LRadius := LRadiusY; + LMatrix := TMatrix.CreateScaling(LRadiusX / LRadiusY, 1) * TMatrix.CreateTranslation(LCenter.X - (LCenter.X * (LRadiusX / LRadiusY)), 0); + end + else + begin + LRadius := LRadiusX; + LMatrix := TMatrix.CreateScaling(1, LRadiusY / LRadiusX) * TMatrix.CreateTranslation(0, LCenter.Y - (LCenter.Y * (LRadiusY / LRadiusX))); + end; + APaint.Shader := TSkShader.MakeGradientRadial(LCenter, LRadius, LColors, LMatrix, LPositions); + end + else + APaint.Shader := TSkShader.MakeGradientRadial(LCenter, LRadiusX, LColors, LPositions); + end; + end; + end; + TBrushKind.Bitmap: + begin + if ABrush.Bitmap.Bitmap.HandleAllocated then + begin + LImage := GetCache(ABrush.Bitmap.Bitmap.Image.Handle); + if not Assigned(LImage) then + begin + FBrushBitmapMapped := ABrush.Bitmap.Bitmap.Map(TMapAccess.Read, FBrushBitmapData); + if FBrushBitmapMapped then + LImage := TSkImage.MakeFromRaster(TSkImageInfo.Create(FBrushBitmapData.Width, FBrushBitmapData.Height, SkFmxColorType[FBrushBitmapData.PixelFormat]), FBrushBitmapData.Data, FBrushBitmapData.Pitch); + end; + if Assigned(LImage) then + begin + if ABrush.Bitmap.WrapMode = TWrapMode.TileStretch then + APaint.Shader := LImage.MakeShader(TMatrix.CreateScaling(ARect.Width / LImage.Width, ARect.Height / LImage.Height) * TMatrix.CreateTranslation(ARect.Left, ARect.Top), GetSamplingOptions) + else + APaint.Shader := LImage.MakeShader(GetSamplingOptions, WrapMode[ABrush.Bitmap.WrapMode], WrapMode[ABrush.Bitmap.WrapMode]); + APaint.AlphaF := AOpacity; + Exit; + end; + end; + APaint.Alpha := 0; + end; end; end; -procedure TSkCanvasRasterMacOS.FreeBuffer(const ABufferHandle: THandle); +function TSkCanvasCustom.BeginSkPaintFromBrush(const ABrush: TBrush; + const ARect: TRectF; const AOpacity: Single): ISkPaint; begin - CGContextRelease(CGContextRef(ABufferHandle)); + Result := TSkPaint.Create(TSkPaintStyle.Fill); + BeginSkPaint(ABrush, ARect, AOpacity, Result); end; -{$ENDIF} - -{ TSkTextLayout } - -procedure TSkTextLayout.ConvertToPath(const APath: TPathData); +function TSkCanvasCustom.BeginSkPaintFromStrokeBrush(const ABrush: TStrokeBrush; + const ARect: TRectF; const AOpacity: Single): ISkPaint; +const + StrokeCap : array[TStrokeCap] of TSkStrokeCap = (TSkStrokeCap.Square, TSkStrokeCap.Round); + StrokeJoin: array[TStrokeJoin] of TSkStrokeJoin = (TSkStrokeJoin.Miter, TSkStrokeJoin.Round, TSkStrokeJoin.Bevel); var - LPath: TPathData; I: Integer; + LCap: Single; + LDash: TDashArray; begin - APath.Clear; - for I := 0 to Length(FParagraphs) - 1 do + Result := TSkPaint.Create(TSkPaintStyle.Stroke); + BeginSkPaint(ABrush, ARect, AOpacity, Result); + Result.StrokeCap := StrokeCap[ABrush.Cap]; + Result.StrokeJoin := StrokeJoin[ABrush.Join]; + Result.StrokeWidth := ABrush.Thickness; + LDash := ABrush.DashArray; + if Length(LDash) > 0 then begin - if Assigned(FParagraphs[I].Paragraph) then + if ABrush.Dash = TStrokeDash.Custom then + LCap := ABrush.Thickness + else + LCap := 0; + for I := 0 to Length(LDash) - 1 do begin - LPath := TPathData.Create; - try - LPath.AddSkPath(FParagraphs[I].Paragraph.ToPath); - LPath.Translate(FParagraphs[I].Offset + TopLeft); - APath.AddPath(LPath); - finally - LPath.Free; - end; + if Odd(I) then + LDash[I] := (LDash[I] + 1) * ABrush.Thickness - LCap + else + LDash[I] := (LDash[I] - 1) * ABrush.Thickness + LCap; end; + Result.PathEffect := TSkPathEffect.MakeDash(TArray(LDash), ABrush.DashOffset * ABrush.Thickness); end; end; -class constructor TSkTextLayout.Create; +procedure TSkCanvasCustom.Clear(const AColor: TAlphaColor); begin - FAttributesRangeComparer := TComparer.Construct( - function(const ALeft, ARight: TTextAttributedRange): Integer - begin - if (ALeft.Range.Pos + ALeft.Range.Length) <= ARight.Range.Pos then - Result := -1 - else if ALeft.Range.Pos >= (ARight.Range.Pos + ARight.Range.Length) then - Result := 1 - else - Result := 0; - end); - FParagraphTextRangeComparer := TComparer.Construct( - function(const ALeft, ARight: TParagraphItem): Integer - begin - if (ALeft.Range.Length = 0) or (ARight.Range.Length = 0) then - begin - if InRange(ALeft.Range.Pos, ARight.Range.Pos, ARight.Range.Pos + ARight.Range.Length) or - InRange(ARight.Range.Pos, ALeft.Range.Pos, ALeft.Range.Pos + ALeft.Range.Length) then - begin - Result := 0; - end - else - Result := CompareValue(ALeft.Range.Pos, ARight.Range.Pos); - end - else if (ALeft.Range.Pos + ALeft.Range.Length) <= ARight.Range.Pos then - Result := -1 - else if ALeft.Range.Pos >= (ARight.Range.Pos + ARight.Range.Length) then - Result := 1 - else - Result := 0; - end); + {$IF CompilerVersion >= 35} + RaiseIfBeginSceneCountZero; + {$ELSE} + if BeginSceneCount > 0 then + {$ENDIF} + Canvas.Clear(AColor); end; -constructor TSkTextLayout.Create(const ACanvas: TCanvas); +procedure TSkCanvasCustom.ClearRect(const ARect: TRectF; + const AColor: TAlphaColor); begin - inherited; - {$REGION ' - Workaround RSP-36975'} - // - ------------------------------------------------------------------------- - // - WORKAROUND - // - ------------------------------------------------------------------------- - // - - // - Description: - // - This code is a workaround intended to fix issues with controls that - // - create the TTextLayout but doesn't set the TTextLayout.RightToLeft, - // - like the TText control. - // - - // - Bug report: - // - https://quality.embarcadero.com/browse/RSP-36975 - // - - // - ------------------------------------------------------------------------- - {$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the issue has been fixed'} - {$ENDIF} - // - ------------------------------------------------------------------------- - FIgnoreUpdates := True; + Canvas.Save; try - RightToLeft := Application.BiDiMode = TBiDiMode.bdRightToLeft; + Canvas.ClipRect(ARect); + Canvas.Clear(AColor); finally - FIgnoreUpdates := False; + Canvas.Restore; end; - // - ------------------------------------------------------------------------- - {$ENDREGION} end; -procedure TSkTextLayout.DoDrawLayout(const ACanvas: ISkCanvas); -var - I: Integer; +function TSkCanvasCustom.CreateSaveState: TCanvasSaveState; begin - if Assigned(FParagraphs) and Assigned(ACanvas) then - begin - if (FColor <> Color) or (FOpacity <> Opacity) then - UpdateParagraph; - ACanvas.Save; - try - ACanvas.ClipRect(TRectF.Create(TopLeft, MaxSize.X, MaxSize.Y)); - for I := 0 to Length(FParagraphs) - 1 do - if Assigned(FParagraphs[I].Paragraph) then - FParagraphs[I].Paragraph.Paint(ACanvas, FParagraphs[I].Offset.X + TopLeft.X, FParagraphs[I].Offset.Y + TopLeft.Y); - finally - ACanvas.Restore; - end; - end; + Result := TSaveState.Create; end; -procedure TSkTextLayout.DoDrawLayout(const ACanvas: TCanvas); +procedure TSkCanvasCustom.DoDrawBitmap(const ABitmap: FMX.Graphics.TBitmap; + const ASrcRect, ADestRect: TRectF; const AOpacity: Single; + const AHighSpeed: Boolean); +var + LBitmapData: TBitmapData; + LImage: ISkImage; + LPaint: ISkPaint; begin - if (ACanvas is TSkCanvasCustom) and Assigned(TSkCanvasCustom(ACanvas).Surface) then - DoDrawLayout(TSkCanvasCustom(ACanvas).Surface.Canvas); -end; - -function TSkTextLayout.DoPositionAtPoint(const APoint: TPointF): Integer; - - function TryGetNearestParagraphItem(const APoint: TPointF; out AItem: TParagraphItem): Boolean; - - function Distance(const ARect: TRectF; const APoint : TPointF): Single; - begin - if ARect.Contains(APoint) then - Result := -1 - else - begin - Result := ARect.TopLeft.Distance(APoint); - Result := Min(Result, ARect.BottomRight.Distance(APoint)); - Result := Min(Result, PointF(ARect.Left, ARect.Bottom).Distance(APoint)); - Result := Min(Result, PointF(ARect.Right, ARect.Top).Distance(APoint)); - end; - end; - - var - LDistance: Single; - LMinDistance: Single; - I: Integer; + if ABitmap.HandleAllocated then begin - AItem := Default(TParagraphItem); - Result := False; - if not Assigned(FParagraphs) then - Exit; - LMinDistance := MaxSingle; - for I := 0 to Length(FParagraphs) - 1 do + LPaint := TSkPaint.Create; + LPaint.AlphaF := AOpacity; + {$IFDEF MODULATE_CANVAS} + if FModulateColor <> TAlphaColors.Null then + LPaint.ColorFilter := TSkColorFilter.MakeBlend(FModulateColor, TSkBlendMode.SrcIn); + {$ENDIF} + LImage := GetCache(ABitmap.Image.Handle); + if Assigned(LImage) then + Canvas.DrawImageRect(LImage, ASrcRect, ADestRect, GetSamplingOptions(AHighSpeed), LPaint) + else begin - if Assigned(FParagraphs[I].Paragraph) then + if ABitmap.Map(TMapAccess.Read, LBitmapData) then begin - LDistance := Distance(FParagraphs[I].Bounds, APoint - TopLeft); - if LDistance < 0 then - begin - AItem := FParagraphs[I]; - Exit(True); - end; - if LDistance < LMinDistance then - begin - LMinDistance := LDistance; - AItem := FParagraphs[I]; - Result := True; + try + LImage := TSkImage.MakeFromRaster(TSkImageInfo.Create(LBitmapData.Width, LBitmapData.Height, SkFmxColorType[LBitmapData.PixelFormat]), LBitmapData.Data, LBitmapData.Pitch); + if Assigned(LImage) then + Canvas.DrawImageRect(LImage, ASrcRect, ADestRect, GetSamplingOptions(AHighSpeed), LPaint); + finally + ABitmap.Unmap(LBitmapData); end; end; end; end; +end; +procedure TSkCanvasCustom.DoDrawEllipse(const ARect: TRectF; + const AOpacity: Single; const ABrush: TStrokeBrush); var - LItem: TParagraphItem; + LPaint: ISkPaint; + LPathBuilder: ISkPathBuilder; begin - if not TryGetNearestParagraphItem(APoint, LItem) then - Exit(-1); - Result := LItem.Paragraph.GetGlyphPositionAtCoordinate(APoint.X - TopLeft.X - LItem.Offset.X, - APoint.Y - TopLeft.Y - LItem.Offset.Y).Position; -end; - -function TSkTextLayout.DoRegionForRange(const ARange: TTextRange): TRegion; - - function GetRegionForRange(const APos, ALength: Integer): TRegion; - var - LParagraphItem: TParagraphItem; - LTextBoxes: TArray; - LOldLength: Integer; - I: Integer; - begin - Result := nil; - for LParagraphItem in GetParagraphsInRange(APos, ALength) do - begin - if Assigned(LParagraphItem.Paragraph) then - begin - LTextBoxes := LParagraphItem.Paragraph.GetRectsForRange(APos - LParagraphItem.Range.Pos, - APos + ALength - LParagraphItem.Range.Pos, TSkRectHeightStyle.Max, TSkRectWidthStyle.Tight); - LOldLength := Length(Result); - SetLength(Result, LOldLength + Length(LTextBoxes)); - for I := LOldLength to Length(LTextBoxes) - 1 do - begin - Result[I] := LTextBoxes[I].Rect; - Result[I].Offset(LParagraphItem.Offset + TopLeft); - end; - end; - end; + if SameValue(ABrush.Thickness, 0, TEpsilon.Position) then + Exit; + LPathBuilder := TSkPathBuilder.Create; + LPathBuilder.AddOval(ARect, TSkPathDirection.CW, 3); + LPaint := BeginSkPaintFromStrokeBrush(ABrush, ARect, AOpacity); + try + Canvas.DrawPath(LPathBuilder.Detach, LPaint); + finally + EndSkPaint(ABrush); end; - -begin - if not Assigned(FParagraphs) then - Exit(nil); - if ARange.Length = 0 then - begin - if ARange.Pos = 0 then - begin - Result := GetRegionForRange(0, 1); - if Length(Result) > 0 then - Result := [RectF(Result[0].Left, Result[0].Top, Result[0].Left, Result[0].Bottom)]; - end - else - begin - Result := GetRegionForRange(ARange.Pos - 1, 1); - if Length(Result) > 0 then - Result := [RectF(Result[0].Right, Result[0].Top, Result[0].Right, Result[0].Bottom)]; - end; - end - else - Result := GetRegionForRange(ARange.Pos, ARange.Length); end; -procedure TSkTextLayout.DoRenderLayout; -type - THorizontalAlign = (Left, Center, Right); -const - RealHorizontalTextAlign: array[TTextAlign, Boolean] of THorizontalAlign = ((THorizontalAlign.Center, THorizontalAlign.Center), (THorizontalAlign.Left, THorizontalAlign.Right), (THorizontalAlign.Right, THorizontalAlign.Left)); - - function OffsetRect(const ARect: TRectF; const ADelta: TPointF): TRectF; - begin - Result := ARect; - Result.Offset(ADelta); - end; - - function CalcTextRect: TRectF; - - function GetParagraphItemBounds(const AParagraphItem: TParagraphItem): TRectF; - var - LTextBox: TSkTextBox; - LTextBoxes: TArray; - begin - Result := TRectF.Empty; - LTextBoxes := AParagraphItem.Paragraph.GetRectsForRange(0, AParagraphItem.Range.Length, TSkRectHeightStyle.Max, TSkRectWidthStyle.Tight); - for LTextBox in LTextBoxes do - begin - if Result.IsEmpty then - Result := LTextBox.Rect - else - Result := Result + LTextBox.Rect; - end; - if Result.IsEmpty then - Result.Height := AParagraphItem.Paragraph.Height; - end; - - var - I: Integer; - LOffset: TPointF; - begin - Result := TRectF.Empty; - LOffset := PointF(0, 0); - for I := 0 to Length(FParagraphs) - 1 do - begin - if Assigned(FParagraphs[I].Paragraph) then - begin - FParagraphs[I].Bounds := OffsetRect(GetParagraphItemBounds(FParagraphs[I]), LOffset); - if Result = TRectF.Empty then - Result := FParagraphs[I].Bounds - else - Result := Result + FParagraphs[I].Bounds; - LOffset.Y := FParagraphs[I].Bounds.Bottom; - end; - end; - end; - - function GetParagraphOffset(ATextRect: TRectF): TPointF; - var - LRealParagraphBounds: TRectF; - begin - ATextRect := RectF(0, 0, ATextRect.Width, ATextRect.Height); - if not NeedHorizontalAlignment then - begin - case RealHorizontalTextAlign[HorizontalAlign, RightToLeft] of - THorizontalAlign.Center : ATextRect.Offset((MaxSize.X - Padding.Left - Padding.Right - ATextRect.Width) / 2, 0); - THorizontalAlign.Right : ATextRect.Offset( MaxSize.X - Padding.Left - Padding.Right - ATextRect.Right, 0); - end; - end; - - LRealParagraphBounds := RectF(0, 0, ATextRect.Width, ATextRect.Height); - case RealHorizontalTextAlign[HorizontalAlign, RightToLeft] of - THorizontalAlign.Center : LRealParagraphBounds.Offset((MaxSize.X - Padding.Left - Padding.Right - LRealParagraphBounds.Width) / 2, 0); - THorizontalAlign.Right : LRealParagraphBounds.Offset( MaxSize.X - Padding.Left - Padding.Right - LRealParagraphBounds.Right, 0); - end; - case VerticalAlign of - TTextAlign.Center : LRealParagraphBounds.Offset(0, (MaxSize.Y - Padding.Top - Padding.Bottom - LRealParagraphBounds.Height) / 2); - TTextAlign.Trailing : LRealParagraphBounds.Offset(0, MaxSize.Y - Padding.Top - Padding.Bottom - LRealParagraphBounds.Bottom); - end; - LRealParagraphBounds.Offset(Padding.Rect.TopLeft); - Result := LRealParagraphBounds.TopLeft - ATextRect.TopLeft; - end; - +procedure TSkCanvasCustom.DoDrawLine(const APoint1, APoint2: TPointF; + const AOpacity: Single; const ABrush: TStrokeBrush); var - LParagraphsOffset: TPointF; - I: Integer; + LPaint: ISkPaint; begin - if FIgnoreUpdates then + if SameValue(ABrush.Thickness, 0, TEpsilon.Position) then Exit; - UpdateParagraph; - FTextRect := CalcTextRect; - LParagraphsOffset := GetParagraphOffset(FTextRect); - FTextRect.Offset(LParagraphsOffset); - for I := 0 to Length(FParagraphs) - 1 do - if Assigned(FParagraphs[I].Paragraph) then - FParagraphs[I].Bounds := OffsetRect(FParagraphs[I].Bounds, LParagraphsOffset); - for I := 0 to Length(FParagraphs) - 1 do - begin - if Assigned(FParagraphs[I].Paragraph) then - begin - FParagraphs[I].Offset := LParagraphsOffset; - LParagraphsOffset := LParagraphsOffset + PointF(0, FParagraphs[I].Bounds.Height); - end; - end; - case VerticalAlign of - TTextAlign.Leading : FTextRect.Bottom := Min(MaxSize.Y - Padding.Top - Padding.Bottom, FTextRect.Bottom); - TTextAlign.Center : FTextRect.Inflate(0, Min(((MaxSize.Y - Padding.Top - Padding.Bottom) - FTextRect.Height) / 2, 0)); - TTextAlign.Trailing : FTextRect.Top := Max(FTextRect.Bottom - (MaxSize.Y - Padding.Top - Padding.Bottom), FTextRect.Top); - end; - case RealHorizontalTextAlign[HorizontalAlign, RightToLeft] of - THorizontalAlign.Left : FTextRect.Right := Min(MaxSize.X - Padding.Left - Padding.Right, FTextRect.Right); - THorizontalAlign.Center : FTextRect.Inflate(Min(((MaxSize.X - Padding.Left - Padding.Right) - FTextRect.Width) / 2, 0), 0); - THorizontalAlign.Right : FTextRect.Left := Max(FTextRect.Right - (MaxSize.X - Padding.Left - Padding.Right), FTextRect.Left); + LPaint := BeginSkPaintFromStrokeBrush(ABrush, TRectF.Create(APoint1, APoint2), AOpacity); + try + Canvas.DrawLine(APoint1, APoint2, LPaint); + finally + EndSkPaint(ABrush); end; end; -function TSkTextLayout.GetParagraphsInRange(const APos, - ALength: Integer): TArray; +procedure TSkCanvasCustom.DoDrawPath(const APath: TPathData; + const AOpacity: Single; const ABrush: TStrokeBrush); var - LFoundIndex: Integer; - LItem: TParagraphItem; + LPaint: ISkPaint; begin - Result := nil; - LItem := Default(TParagraphItem); - LItem.Range := TTextRange.Create(APos, ALength); - if TArray.BinarySearch(FParagraphs, LItem, LFoundIndex, FParagraphTextRangeComparer) then - begin - repeat - Result := Result + [FParagraphs[LFoundIndex]]; - Inc(LFoundIndex); - until (LFoundIndex >= Length(FParagraphs)) or (FParagraphTextRangeComparer.Compare(FParagraphs[LFoundIndex], LItem) <> 0); + if SameValue(ABrush.Thickness, 0, TEpsilon.Position) then + Exit; + LPaint := BeginSkPaintFromStrokeBrush(ABrush, APath.GetBounds, AOpacity); + try + Canvas.DrawPath(APath.ToSkPath, LPaint); + finally + EndSkPaint(ABrush); end; end; -function TSkTextLayout.GetTextHeight: Single; -begin - Result := FTextRect.Height; -end; - -function TSkTextLayout.GetTextRect: TRectF; +procedure TSkCanvasCustom.DoDrawRect(const ARect: TRectF; + const AOpacity: Single; const ABrush: TStrokeBrush); +var + LPaint: ISkPaint; begin - Result := FTextRect; - Result.Offset(TopLeft); + if SameValue(ABrush.Thickness, 0, TEpsilon.Position) then + Exit; + LPaint := BeginSkPaintFromStrokeBrush(ABrush, ARect, AOpacity); + try + Canvas.DrawRect(ARect, LPaint); + finally + EndSkPaint(ABrush); + end; end; -function TSkTextLayout.GetTextWidth: Single; +procedure TSkCanvasCustom.DoFillEllipse(const ARect: TRectF; + const AOpacity: Single; const ABrush: TBrush); +var + LPaint: ISkPaint; + LPathBuilder: ISkPathBuilder; begin - Result := FTextRect.Width; + LPathBuilder := TSkPathBuilder.Create; + LPathBuilder.AddOval(ARect, TSkPathDirection.CW, 3); + LPaint := BeginSkPaintFromBrush(ABrush, ARect, AOpacity); + try + Canvas.DrawPath(LPathBuilder.Detach, LPaint); + finally + EndSkPaint(ABrush); + end; end; -// The SkParagraph normally doesn't cut a word in half, it cuts the whole word. -// In some scenarios it can cause some errors, for example in edits where it is -// mandatory to cut in the middle of the word. To fix this we will readjust the -// MaxWidth, align horizontally manually and cut with ClipRect. -function TSkTextLayout.NeedHorizontalAlignment: Boolean; +procedure TSkCanvasCustom.DoFillPath(const APath: TPathData; + const AOpacity: Single; const ABrush: TBrush); +var + LPaint: ISkPaint; begin - Result := (not WordWrap) and (Trimming = TTextTrimming.None); + LPaint := BeginSkPaintFromBrush(ABrush, APath.GetBounds, AOpacity); + try + Canvas.DrawPath(APath.ToSkPath, LPaint); + finally + EndSkPaint(ABrush); + end; end; -procedure TSkTextLayout.RenderLayout(const ACanvas: ISkCanvas); +procedure TSkCanvasCustom.DoFillRect(const ARect: TRectF; + const AOpacity: Single; const ABrush: TBrush); +var + LPaint: ISkPaint; begin - RenderLayout(nil); - DoDrawLayout(ACanvas); + LPaint := BeginSkPaintFromBrush(ABrush, ARect, AOpacity); + try + Canvas.DrawRect(ARect, LPaint); + finally + EndSkPaint(ABrush); + end; end; -procedure TSkTextLayout.SetMaxLines(AValue: Integer); +{$IF CompilerVersion >= 30} + +procedure TSkCanvasCustom.DoSetMatrix(const AMatrix: TMatrix); begin - AValue := Max(AValue, 0); - if FMaxLines <> AValue then - begin - FMaxLines := AValue; - BeginUpdate; - try - {$IF CompilerVersion >= 29} - SetNeedUpdate; - {$ELSE} - RightToLeft := not RightToLeft; - RightToLeft := not RightToLeft; - {$ENDIF} - finally - EndUpdate; - end; - end; + if BeginSceneCount > 0 then + Canvas.SetMatrix(AMatrix * TMatrix.CreateScaling(Scale, Scale)); end; -procedure TSkTextLayout.UpdateParagraph; -const - ZeroWidthChar = #8203; -{$IF CompilerVersion >= 31} - SkFontSlant : array[TFontSlant] of TSkFontSlant = (TSkFontSlant.Upright, TSkFontSlant.Italic, TSkFontSlant.Oblique); - SkFontWeight : array[TFontWeight] of Integer = (100, 200, 300, 350, 400, 500, 600, 700, 800, 900, 950); - SkFontWidth : array[TFontStretch] of Integer = (1, 2, 3, 4, 5, 6, 7, 8, 9); {$ENDIF} - function GetFontFamilies(const AValue: string): TArray; inline; - begin - Result := AValue.Split([', ', ','], TStringSplitOptions.ExcludeEmpty){$IFDEF MACOS} + ['Helvetica Neue']{$ELSEIF DEFINED(LINUX)} + ['Ubuntu']{$ENDIF}; - end; +procedure TSkCanvasCustom.EndSkPaint(const ABrush: TBrush); +begin + if (ABrush.Kind = TBrushKind.Bitmap) and (FBrushBitmapMapped) then + ABrush.Bitmap.Bitmap.Unmap(FBrushBitmapData); +end; - function GetNormalizedAttributes(const ASubText: string; const ASubTextPosition: Integer): TArray; - var - I: Integer; - LAttribute: TTextAttributedRange; - LAttributes: TList; - LIndex: Integer; - LNeighborAttribute: TTextAttributedRange; - begin - if AttributesCount = 0 then - Exit(nil); - LAttributes := TList.Create; - try - for I := 0 to AttributesCount - 1 do - begin - LAttribute := TTextAttributedRange.Create(TTextRange.Create(Attributes[I].Range.Pos - ASubTextPosition, Attributes[I].Range.Length), Attributes[I].Attribute); - if LAttribute.Range.Pos < 0 then - LAttribute.Range := TTextRange.Create(0, LAttribute.Range.Pos + LAttribute.Range.Length); - if (LAttribute.Range.Pos + LAttribute.Range.Length) > ASubText.Length then - LAttribute.Range := TTextRange.Create(LAttribute.Range.Pos, LAttribute.Range.Length - ((LAttribute.Range.Pos + LAttribute.Range.Length) - ASubText.Length)); - if LAttribute.Range.Length <= 0 then - begin - LAttribute.Free; - Continue; - end; - if LAttributes.BinarySearch(LAttribute, LIndex, FAttributesRangeComparer) then - begin - if (LAttributes[LIndex].Range.Pos < LAttribute.Range.Pos) and ((LAttributes[LIndex].Range.Pos + LAttributes[LIndex].Range.Length) > (LAttribute.Range.Pos + LAttribute.Range.Length)) then - begin - LNeighborAttribute := TTextAttributedRange.Create(TTextRange.Create(LAttribute.Range.Pos + LAttribute.Range.Length, LAttributes[LIndex].Range.Pos + LAttributes[LIndex].Range.Length - (LAttribute.Range.Pos + LAttribute.Range.Length)), LAttributes[LIndex].Attribute); - LAttributes.Insert(LIndex + 1, LNeighborAttribute); - LAttributes.Insert(LIndex + 1, LAttribute); - LNeighborAttribute := LAttributes[LIndex]; - LNeighborAttribute.Range.Length := LAttribute.Range.Pos - LNeighborAttribute.Range.Pos; - Continue; - end; - end; - LAttributes.Insert(LIndex, LAttribute); - if LIndex > 0 then - begin - LNeighborAttribute := LAttributes[LIndex - 1]; - if (LNeighborAttribute.Range.Pos + LNeighborAttribute.Range.Length) > LAttribute.Range.Pos then - begin - LNeighborAttribute.Range := TTextRange.Create(LNeighborAttribute.Range.Pos, LNeighborAttribute.Range.Length - ((LNeighborAttribute.Range.Pos + LNeighborAttribute.Range.Length) - LAttribute.Range.Pos)); - if LNeighborAttribute.Range.Length <= 0 then - begin - LNeighborAttribute.Free; - LAttributes.Delete(LIndex - 1); - Dec(LIndex); - end; - end; - end; - if LIndex < LAttributes.Count - 1 then - begin - LNeighborAttribute := LAttributes[LIndex + 1]; - if LNeighborAttribute.Range.Pos < (LAttribute.Range.Pos + LAttribute.Range.Length) then - begin - LNeighborAttribute.Range := TTextRange.Create(LAttribute.Range.Pos + LAttribute.Range.Length, LNeighborAttribute.Range.Length - ((LAttribute.Range.Pos + LAttribute.Range.Length) - LNeighborAttribute.Range.Pos)); - if LNeighborAttribute.Range.Length <= 0 then - begin - LNeighborAttribute.Free; - LAttributes.Delete(LIndex + 1); - end; - end; - end; - end; - Result := LAttributes.ToArray; - finally - LAttributes.Free; - end; - end; +procedure TSkCanvasCustom.ExcludeClipRect(const ARect: TRectF); +begin + Inc(FClippingChangeCount); + Canvas.ClipRect(ARect, TSkClipOp.Difference); +end; - function CreateTextStyle(const AAttribute: TTextAttribute): ISkTextStyle; - begin - Result := TSkTextStyle.Create; - Result.Color := MakeColor(AAttribute.Color, FOpacity); - if AAttribute.Font <> nil then - begin - Result.FontFamilies := GetFontFamilies(AAttribute.Font.Family); - Result.FontSize := AAttribute.Font.Size; - {$IF CompilerVersion < 31} - if (TFontStyle.fsBold in AAttribute.Font.Style) and (TFontStyle.fsItalic in AAttribute.Font.Style) then - Result.FontStyle := TSkFontStyle.BoldItalic - else if TFontStyle.fsBold in AAttribute.Font.Style then - Result.FontStyle := TSkFontStyle.Bold - else if TFontStyle.fsItalic in AAttribute.Font.Style then - Result.FontStyle := TSkFontStyle.Italic - else - Result.FontStyle := TSkFontStyle.Normal; - {$ELSE} - Result.FontStyle := TSkFontStyle.Create(SkFontWeight[AAttribute.Font.StyleExt.Weight], SkFontWidth[AAttribute.Font.StyleExt.Stretch], SkFontSlant[AAttribute.Font.StyleExt.Slant]); - {$ENDIF} - if (TFontStyle.fsUnderline in AAttribute.Font.Style) or (TFontStyle.fsStrikeOut in AAttribute.Font.Style) then - begin - Result.DecorationColor := MakeColor(AAttribute.Color, FOpacity); - if TFontStyle.fsUnderline in AAttribute.Font.Style then - Result.Decorations := Result.Decorations + [TSkTextDecoration.Underline]; - if TFontStyle.fsStrikeOut in AAttribute.Font.Style then - Result.Decorations := Result.Decorations + [TSkTextDecoration.LineThrough]; - end; - end; - end; +function TSkCanvasCustom.GetCache(const ABitmapHandle: THandle): ISkImage; +begin + Result := nil; +end; - function CreateDefaultTextStyle: ISkTextStyle; - begin - Result := TSkTextStyle.Create; - Result.Color := MakeColor(Color, FOpacity); - Result.FontFamilies := GetFontFamilies(Font.Family); - Result.FontSize := Font.Size; - {$IF CompilerVersion < 31} - if (TFontStyle.fsBold in Font.Style) and (TFontStyle.fsItalic in Font.Style) then - Result.FontStyle := TSkFontStyle.BoldItalic - else if TFontStyle.fsBold in Font.Style then - Result.FontStyle := TSkFontStyle.Bold - else if TFontStyle.fsItalic in Font.Style then - Result.FontStyle := TSkFontStyle.Italic - else - Result.FontStyle := TSkFontStyle.Normal; - {$ELSE} - Result.FontStyle := TSkFontStyle.Create(SkFontWeight[Font.StyleExt.Weight], SkFontWidth[Font.StyleExt.Stretch], SkFontSlant[Font.StyleExt.Slant]); - {$ENDIF} - if (TFontStyle.fsUnderline in Font.Style) or (TFontStyle.fsStrikeOut in Font.Style) then - begin - Result.DecorationColor := MakeColor(Color, FOpacity); - if TFontStyle.fsUnderline in Font.Style then - Result.Decorations := Result.Decorations + [TSkTextDecoration.Underline]; - if TFontStyle.fsStrikeOut in Font.Style then - Result.Decorations := Result.Decorations + [TSkTextDecoration.LineThrough]; - end; - end; +class function TSkCanvasCustom.GetCanvasStyle: TCanvasStyles; +begin + Result := []; +end; - function CreateParagraphStyle(const AAttributes: TArray; AMaxLines: Integer): ISkParagraphStyle; - const - SkTextAlign: array[TTextAlign] of TSkTextAlign = (TSkTextAlign.Center, TSkTextAlign.Start, TSkTextAlign.Terminate); - var - LAttribute: TTextAttributedRange; - LMinFontSize: Single; +{$IFDEF MODULATE_CANVAS} + +function TSkCanvasCustom.GetModulateColor: TAlphaColor; +begin + Result := FModulateColor; +end; + +{$ENDIF} + +function TSkCanvasCustom.GetSamplingOptions( + const AHighSpeed: Boolean): TSkSamplingOptions; +begin + if AHighSpeed then + Result := TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None) + else begin - Result := TSkParagraphStyle.Create; - if RightToLeft then - Result.TextDirection := TSkTextDirection.RightToLeft; - if Trimming in [TTextTrimming.Character, TTextTrimming.Word] then - Result.Ellipsis := '...'; - if WordWrap then - begin - if AMaxLines <= 0 then - Result.MaxLines := High(Integer) - else - Result.MaxLines := AMaxLines; - end - else - Result.MaxLines := 1; - if NeedHorizontalAlignment then - begin - if RightToLeft then - Result.TextAlign := TSkTextAlign.Terminate - else - Result.TextAlign := TSkTextAlign.Start; - end + case Quality of + TCanvasQuality.SystemDefault, + TCanvasQuality.HighQuality: Result := TSkSamplingOptions.High; else - Result.TextAlign := SkTextAlign[HorizontalAlign]; - Result.TextStyle := CreateDefaultTextStyle; - - if Result.MaxLines = NativeUInt(High(Integer)) then - begin - LMinFontSize := Result.TextStyle.FontSize; - for LAttribute in AAttributes do - LMinFontSize := Min(LMinFontSize, LAttribute.Attribute.Font.Size); - if LMinFontSize > 0.1 then - begin - AMaxLines := Ceil(MaxSize.Y / LMinFontSize); - if AMaxLines > 0 then - Result.MaxLines := AMaxLines; - end; + Result := TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.Nearest); end; end; +end; - // Temporary solution to fix an issue with Skia: https://bugs.chromium.org/p/skia/issues/detail?id=13117 - // SkParagraph has several issues with the #13 line break, so the best thing to do is replace it with #10 or a zero-widh character (#8203) - function NormalizeParagraphText(const AText: string): string; - begin - Result := AText.Replace(#13#10, ZeroWidthChar + #10).Replace(#13, #10); - end; +procedure TSkCanvasCustom.IntersectClipRect(const ARect: TRectF); +begin + Inc(FClippingChangeCount); + Canvas.ClipRect(ARect); +end; - function CreateParagraph(const AMaxLines: Integer; const ASubText: string; const ASubTextPosition: Integer): ISkParagraph; - var - LAttribute: TTextAttributedRange; - LAttributes: TArray; - LBuilder: ISkParagraphBuilder; - LLastAttributeEndIndex: Integer; - LText: string; - begin - FColor := Color; - FOpacity := Opacity; - LAttributes := GetNormalizedAttributes(ASubText, ASubTextPosition); - try - LBuilder := TSkParagraphBuilder.Create(CreateParagraphStyle(LAttributes, AMaxLines), TSkTypefaceManager.Provider); - LLastAttributeEndIndex := 0; - for LAttribute in LAttributes do - begin - if LLastAttributeEndIndex < LAttribute.Range.Pos then - LBuilder.AddText(ASubText.Substring(LLastAttributeEndIndex, LAttribute.Range.Pos - LLastAttributeEndIndex)); - LText := NormalizeParagraphText(ASubText.Substring(LAttribute.Range.Pos, LAttribute.Range.Length)); - if not LText.IsEmpty then - begin - LBuilder.PushStyle(CreateTextStyle(LAttribute.Attribute)); - LBuilder.AddText(LText); - LBuilder.Pop; - end; - LLastAttributeEndIndex := LAttribute.Range.Pos + LAttribute.Range.Length; - end; - if LLastAttributeEndIndex < ASubText.Length then - LBuilder.AddText(ASubText.Substring(LLastAttributeEndIndex, ASubText.Length - LLastAttributeEndIndex)); - finally - for LAttribute in LAttributes do - LAttribute.DisposeOf; - end; - Result := LBuilder.Build; - end; +function TSkCanvasCustom.LoadFontFromStream(const AStream: TStream): Boolean; +begin + TSkDefaultProviders.RegisterTypeface(AStream); + Result := True; +end; - procedure DoUpdateParagraph(var AParagraphItem: TParagraphItem; const ASubText: string; const AMaxLines: Integer); - {$IF CompilerVersion < 29} - const - MaxLayoutSize: TPointF = (X: $FFFF; Y: $FFFF); +class function TSkCanvasCustom.PixelFormat: TPixelFormat; +begin + {$IF DEFINED(MSWINDOWS)} + Result := TPixelFormat.BGRA; + {$ELSEIF DEFINED(IOS)} + if GlobalUseMetal then + Result := TPixelFormat.BGRA + else + Result := TPixelFormat.RGBA; + {$ELSEIF DEFINED(MACOS)} + Result := TPixelFormat.BGRA; + {$ELSEIF (CompilerVersion < 34) and DEFINED(ANDROID)} + // This is an old problem already fixed in recent versions, where the pixel + // format is not converted in the Surface to Bitmap assignment. + Result := TPixelFormat.BGRA; + {$ELSE} + Result := TPixelFormat.RGBA; {$ENDIF} - var - LLineMetric: TSkMetrics; - begin - AParagraphItem.Paragraph := CreateParagraph(AMaxLines, ASubText, AParagraphItem.Range.Pos); - if NeedHorizontalAlignment then - AParagraphItem.Paragraph.Layout(MaxLayoutSize.X) - else - AParagraphItem.Paragraph.Layout(MaxSize.X - Padding.Left - Padding.Right); - if WordWrap and (AParagraphItem.Paragraph.Height > MaxSize.Y - Padding.Top - Padding.Bottom) then - begin - for LLineMetric in AParagraphItem.Paragraph.LineMetrics do - begin - if (LLineMetric.LineNumber <> 0) and (LLineMetric.Baseline + LLineMetric.Descent > MaxSize.Y - Padding.Top - Padding.Bottom) then - begin - AParagraphItem.Paragraph := CreateParagraph(LLineMetric.LineNumber, ASubText, AParagraphItem.Range.Pos); - AParagraphItem.Paragraph.Layout(MaxSize.X - Padding.Left - Padding.Right); - Break; - end; - end; - end; - end; +end; +function TSkCanvasCustom.PtInPath(const APoint: TPointF; + const APath: TPathData): Boolean; var - LText: string; - LLines: TArray; - LPos: Integer; - LMaxLines: Integer; - LLimitedLines: Boolean; - I: Integer; + LPaint: ISkPaint; + LPath: ISkPath; begin - LText := Text; - - {$REGION ' - Workaround RSP-38480'} - // - ------------------------------------------------------------------------- - // - WORKAROUND - // - ------------------------------------------------------------------------- - // - - // - Description: - // - This code is a workaround intended to fix issues with controls that - // - create the TTextLayout but doesn't set the TTextLayout.RightToLeft, - // - like the TText control. - // - This code is a workaround intended to fix issues with function - // - FMX.Types.DelAmp with results in texts with #0 char at end of string - // - when the original text contains a '&' char - // - - // - Bug report: - // - https://quality.embarcadero.com/browse/RSP-38480 - // - - // - ------------------------------------------------------------------------- - {$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the issue has been fixed'} - {$ENDIF} - // - ------------------------------------------------------------------------- - if LText.EndsWith(#0) then - LText := LText.Substring(0, LText.Length - 1) + ZeroWidthChar; - // - ------------------------------------------------------------------------- - {$ENDREGION} - - if WordWrap or LText.IsEmpty then - LLines := [LText] - else - LLines := LText.Replace(#13#10, ZeroWidthChar + #10).Replace(#13, #10).Replace(#10, ZeroWidthChar + #10).Split([#10]); - LPos := 0; - LMaxLines := FMaxLines; - LLimitedLines := FMaxLines <> 0; - SetLength(FParagraphs, Length(LLines)); - for I := 0 to Length(LLines) - 1 do - begin - FParagraphs[I].Range := TTextRange.Create(LPos, LLines[I].Length); - if LMaxLines = -1 then - begin - FParagraphs[I].Bounds := TRectF.Empty; - FParagraphs[I].Paragraph := nil; - FParagraphs[I].Offset := PointF(0, 0); - end - else - begin - DoUpdateParagraph(FParagraphs[I], LLines[I], LMaxLines); - if LLimitedLines then - begin - Dec(LMaxLines, Length(FParagraphs[I].Paragraph.LineMetrics)); - if LMaxLines <= 0 then - LMaxLines := -1; - end; - end; - Inc(LPos, LLines[I].Length); - end; + LPaint := TSkPaint.Create; + LPath := LPaint.GetFillPath(APath.ToSkPath); + Result := Assigned(LPath) and (LPath.Contains(APoint.X, APoint.Y)); end; -{ TSkBitmapHandleCodec } - -class constructor TSkBitmapHandleCodec.Create; +procedure TSkCanvasCustom.Resized; begin - RegisterIfNotExists('.bmp', SVBitmaps, False); - RegisterIfNotExists('.gif', SVGIFImages, False); - RegisterIfNotExists('.ico', SVIcons, False); - RegisterIfNotExists('.wbmp', SWBMPImages, False); - RegisterIfNotExists('.webp', SVWEBPImages, True); - RegisterIfNotExists('.arw', SRawSony, False); - RegisterIfNotExists('.cr2', SRawCanon, False); - RegisterIfNotExists('.dng', SRawDNG, False); - RegisterIfNotExists('.nef', SRawNikon, False); - RegisterIfNotExists('.nrw', SRawNikon, False); - RegisterIfNotExists('.orf', SRawORF, False); - RegisterIfNotExists('.raf', SRawRAF, False); - RegisterIfNotExists('.rw2', SRawPanasonic, False); - RegisterIfNotExists('.pef', SRawPEF, False); - RegisterIfNotExists('.srw', SRawSRW, False); end; -function TSkBitmapHandleCodec.FitSize(const AWidth, AHeight: Integer; const AFitWidth, - AFitHeight: Single): TSize; -var - LRatio: Single; +{$IF CompilerVersion < 30} + +procedure TSkCanvasCustom.SetMatrix(const AMatrix: TMatrix); begin - if (AWidth / AFitWidth) > (AHeight / AFitHeight) then - LRatio := AWidth / AFitWidth - else - LRatio := AHeight / AFitHeight; - if LRatio < 1 then - Result := TSize.Create(AWidth, AHeight) - else - Result := TSize.Create(Trunc((AWidth + Epsilon) / LRatio), Trunc((AHeight + Epsilon) / LRatio)); + inherited; + if BeginSceneCount > 0 then + Canvas.SetMatrix(AMatrix * TMatrix.CreateScaling(Scale, Scale)); end; -class function TSkBitmapHandleCodec.GetImageSize(const AFileName: string): TPointF; -var - LCodec: ISkCodec; +{$ENDIF} + +{$IFDEF MODULATE_CANVAS} + +procedure TSkCanvasCustom.SetModulateColor(const AColor: TAlphaColor); begin - LCodec := TSkCodec.MakeFromFile(AFileName); - if not Assigned(LCodec) then - Exit(TPointF.Create(0, 0)); - Result := TPointF.Create(LCodec.Width, LCodec.Height); + FModulateColor := AColor; end; -class function TSkBitmapHandleCodec.IsValid(const AStream: TStream): Boolean; +{$ENDIF} - function IsValid(const AMemoryStream: TCustomMemoryStream): Boolean; inline; +procedure TSkCanvasCustom.SetSize(const AWidth, AHeight: Integer); +begin + if (Width <> AWidth) or (Height <> AHeight) then begin - Result := Assigned(TSkCodec.MakeWithoutCopy(AMemoryStream.Memory, AMemoryStream.Size)); + inherited; + Resized; end; +end; -var - LMemoryStream: TMemoryStream; +{ TSkCanvasCustom.TSaveState } + +procedure TSkCanvasCustom.TSaveState.Assign(ASource: TPersistent); begin - if AStream is TCustomMemoryStream then - Result := IsValid(TCustomMemoryStream(AStream)) - else - begin - LMemoryStream := TMemoryStream.Create; - try - LMemoryStream.CopyFrom(AStream, 0); - Result := IsValid(LMemoryStream); - finally - LMemoryStream.Free; - end; - end; + inherited; + if ASource is TSkCanvasCustom then + TSkCanvasCustom(ASource).Canvas.Save; end; -function TSkBitmapHandleCodec.LoadFromFile(const AFileName: string; - const ABitmapSurface: TBitmapSurface; const AMaxSizeLimit: Cardinal): Boolean; -var - LCodec: ISkCodec; - LImage: ISkImage; - LSize: TSize; +procedure TSkCanvasCustom.TSaveState.AssignTo(ADest: TPersistent); begin - LCodec := TSkCodec.MakeFromFile(AFileName); - if not Assigned(LCodec) then - Exit(False); - if AMaxSizeLimit > 0 then - begin - LSize := FitSize(LCodec.Width, LCodec.Height, AMaxSizeLimit, AMaxSizeLimit); - ABitmapSurface.SetSize(LSize.Width, LSize.Height, SkFmxPixelFormat[SkNative32ColorType]); - LImage := LCodec.GetImage(SkNative32ColorType); - Result := (Assigned(LImage)) and (LImage.ScalePixels(TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height), ABitmapSurface.Bits, ABitmapSurface.Pitch, TSkImageCachingHint.Disallow)); - end - else + inherited; + if ADest is TSkCanvasCustom then begin - ABitmapSurface.SetSize(LCodec.Width, LCodec.Height, SkFmxPixelFormat[SkNative32ColorType]); - Result := LCodec.GetPixels(ABitmapSurface.Bits, ABitmapSurface.Pitch, SkNative32ColorType); + TSkCanvasCustom(ADest).BeforeRestore; + TSkCanvasCustom(ADest).Canvas.Restore; end; end; -function TSkBitmapHandleCodec.LoadFromStream(const AStream: TStream; - const ABitmapSurface: TBitmapSurface; const AMaxSizeLimit: Cardinal): Boolean; +{ TSkBitmapHandle } - function LoadFromStream(const AMemoryStream: TCustomMemoryStream): Boolean; - var - LCodec: ISkCodec; - LImage: ISkImage; - LSize: TSize; - begin - LCodec := TSkCodec.MakeWithoutCopy(AMemoryStream.Memory, AMemoryStream.Size); - if not Assigned(LCodec) then - Exit(False); - if AMaxSizeLimit > 0 then - begin - LSize := FitSize(LCodec.Width, LCodec.Height, AMaxSizeLimit, AMaxSizeLimit); - ABitmapSurface.SetSize(LSize.Width, LSize.Height, SkFmxPixelFormat[SkNative32ColorType]); - LImage := LCodec.GetImage(SkNative32ColorType); - Result := (Assigned(LImage)) and (LImage.ScalePixels(TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height), ABitmapSurface.Bits, ABitmapSurface.Pitch, TSkImageCachingHint.Disallow)); - end - else - begin - ABitmapSurface.SetSize(LCodec.Width, LCodec.Height, SkFmxPixelFormat[SkNative32ColorType]); - Result := LCodec.GetPixels(ABitmapSurface.Bits, ABitmapSurface.Pitch, SkNative32ColorType); - end; - end; +procedure TSkBitmapHandle.AllocatePixels; +begin + if FPixels = nil then + FPixels := AllocMem(FWidth * FHeight * PixelFormatBytes[FPixelFormat]); +end; -var - LMemoryStream: TMemoryStream; + +constructor TSkBitmapHandle.Create(const AWidth, AHeight: Integer; + const APixelFormat: TPixelFormat); begin - if AStream is TCustomMemoryStream then - Result := LoadFromStream(TCustomMemoryStream(AStream)) - else - begin - LMemoryStream := TMemoryStream.Create; - try - LMemoryStream.CopyFrom(AStream, 0); - Result := LoadFromStream(LMemoryStream); - finally - LMemoryStream.Free; - end; - end; + inherited Create; + FWidth := AWidth; + FHeight := AHeight; + FPixelFormat := APixelFormat; end; -function TSkBitmapHandleCodec.LoadThumbnailFromFile(const AFileName: string; - const AFitWidth, AFitHeight: Single; const AUseEmbedded: Boolean; - const ABitmapSurface: TBitmapSurface): Boolean; -var - LCodec: ISkCodec; - LImage: ISkImage; - LSize: TSize; +destructor TSkBitmapHandle.Destroy; begin - LCodec := TSkCodec.MakeFromFile(AFileName); - if not Assigned(LCodec) then - Exit(False); - LSize := FitSize(LCodec.Width, LCodec.Height, AFitWidth, AFitHeight); - ABitmapSurface.SetSize(LSize.Width, LSize.Height, SkFmxPixelFormat[SkNative32ColorType]); - LImage := LCodec.GetImage(SkNative32ColorType); - Result := (Assigned(LImage)) and (LImage.ScalePixels(TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height), ABitmapSurface.Bits, ABitmapSurface.Pitch, TSkImageCachingHint.Disallow)); + FreeMem(FPixels); + inherited; end; -class procedure TSkBitmapHandleCodec.RegisterIfNotExists(const AFileExtension, - ADescription: string; const ACanSave: Boolean); -begin - if not TBitmapCodecManager.CodecExists(AFileExtension) then - TBitmapCodecManager.RegisterBitmapCodecClass(AFileExtension, ADescription, ACanSave, TSkBitmapHandleCodec); -end; +{ TSkCanvasBase } -function TSkBitmapHandleCodec.SaveToFile(const AFileName: string; - const ABitmapSurface: TBitmapSurface; - const ASaveParams: PBitmapCodecSaveParams): Boolean; -var - LQuality: Integer; -begin - if ASaveParams <> nil then - LQuality := ASaveParams.Quality - else - LQuality := 100; - TSkImageEncoder.EncodeToFile(AFileName, TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height, SkFmxColorType[ABitmapSurface.PixelFormat]), ABitmapSurface.Bits, ABitmapSurface.Pitch, LQuality); - Result := True; -end; +{$IFDEF MSWINDOWS} -function TSkBitmapHandleCodec.SaveToStream(const AStream: TStream; - const ABitmapSurface: TBitmapSurface; const AExtension: string; - const ASaveParams: PBitmapCodecSaveParams): Boolean; -var - LQuality: Integer; +constructor TSkCanvasBase.CreateFromWindow(const AParent: TWindowHandle; + const AWidth, AHeight: Integer; const AQuality: TCanvasQuality); begin - if ASaveParams <> nil then - LQuality := ASaveParams.Quality - else - LQuality := 100; - TSkImageEncoder.EncodeToStream(AStream, TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height, SkFmxColorType[ABitmapSurface.PixelFormat]), ABitmapSurface.Bits, ABitmapSurface.Pitch, TSkEncodedImageFormat.FromExtension(AExtension), LQuality); - Result := True; + inherited; + if WindowHandleToPlatform(Parent){$IF CompilerVersion < 30}.Form{$ENDIF}.Transparency then + WindowHandleToPlatform(Parent).CreateBuffer({$IF CompilerVersion < 31}Width, Height{$ELSE}WindowHandleToPlatform(Parent).WndClientSize.Width, WindowHandleToPlatform(Parent).WndClientSize.Height{$ENDIF}); end; -{ TSkBitmapHandle } - -constructor TSkBitmapHandle.Create(const AWidth, AHeight: Integer); -begin - inherited Create; - FWidth := AWidth; - FHeight := AHeight; -end; +{$ENDIF} -destructor TSkBitmapHandle.Destroy; +function TSkCanvasBase.CreateSurfaceFromBitmap: ISkSurface; begin - FreeMem(FPixels); - inherited; + TSkBitmapHandle(Bitmap.Handle).AllocatePixels; + Result := TSkSurface.MakeRasterDirect(TSkImageInfo.Create(TSkBitmapHandle(Bitmap.Handle).Width, TSkBitmapHandle(Bitmap.Handle).Height, SkFmxColorType[TSkBitmapHandle(Bitmap.Handle).PixelFormat]), TSkBitmapHandle(Bitmap.Handle).Pixels, TSkBitmapHandle(Bitmap.Handle).Width * PixelFormatBytes[TSkBitmapHandle(Bitmap.Handle).PixelFormat]); end; -procedure TSkBitmapHandle.Initialize; +function TSkCanvasBase.DoBeginScene({$IF CompilerVersion < 35}const {$ENDIF}AClipRects: PClipRects; + AContextHandle: THandle): Boolean; begin - if FPixels = nil then - FPixels := AllocMem(FWidth * FHeight * 4); + Result := inherited; + if Result then + begin + if Bitmap <> nil then + FSurface := CreateSurfaceFromBitmap + else if Parent <> nil then + FSurface := CreateSurfaceFromWindow(AContextHandle) + else + Exit(False); + Result := Assigned(FSurface); + if Result then + FSurface.Canvas.SetMatrix(TMatrix.CreateScaling(Scale, Scale)); + end; end; -{ TSkCanvasCustom } - -procedure TSkCanvasCustom.BeforeDestruction; +procedure TSkCanvasBase.DoEndScene; begin - inherited; + {$IFDEF MSWINDOWS} if Parent <> nil then - DestroyWindow; -end; - -function TSkCanvasCustom.BitmapToSkImage( - const ABitmap: FMX.Graphics.TBitmap): ISkImage; -var - LBitmapData: TBitmapData; -begin - if not ABitmap.HandleAllocated then - Exit(nil); - if ABitmap.CanvasClass.InheritsFrom(ClassType) then - begin - if TSkBitmapHandle(ABitmap.Handle).Pixels = nil then - Exit(nil); - if (Parent <> nil) and (Assigned(FImageCache)) then - begin - if (FImageCache.ContainsKey(Self)) and (FImageCache[Self].ContainsKey(ABitmap.Handle)) then - Result := FImageCache[Self][ABitmap.Handle] - else - begin - Result := CreateCache(ABitmap.Width, ABitmap.Height, SkFmxColorType[ABitmap.PixelFormat], TSkBitmapHandle(ABitmap.Handle).Pixels, ABitmap.Width * 4); - if not FImageCache.ContainsKey(Self) then - FImageCache.Add(Self, TDictionary.Create); - FImageCache[Self].Add(ABitmap.Handle, Result); - end; - end - else - Result := TSkImage.MakeFromRaster(TSkImageInfo.Create(ABitmap.Width, ABitmap.Height, SkFmxColorType[ABitmap.PixelFormat]), TSkBitmapHandle(ABitmap.Handle).Pixels, ABitmap.Width * 4); - end - else begin - if not ABitmap.Map(TMapAccess.Read, LBitmapData) then - Exit(nil); - try - Result := TSkImage.MakeRasterCopy(TSkImageInfo.Create(LBitmapData.Width, LBitmapData.Height, SkFmxColorType[LBitmapData.PixelFormat]), LBitmapData.Data, LBitmapData.Pitch); - finally - ABitmap.Unmap(LBitmapData); - end; + if WindowHandleToPlatform(Parent){$IF CompilerVersion < 30}.Form{$ENDIF}.Transparency then + FSurface.ReadPixels(TSkImageInfo.Create({$IF CompilerVersion < 31}Width, Height{$ELSE}WindowHandleToPlatform(Parent).WndClientSize.Width, WindowHandleToPlatform(Parent).WndClientSize.Height{$ENDIF}, TSkColorType.BGRA8888), WindowHandleToPlatform(Parent).BufferBits, {$IF CompilerVersion < 31}Width{$ELSE}WindowHandleToPlatform(Parent).WndClientSize.Width{$ENDIF} * SkBytesPerPixel[TSkColorType.BGRA8888]); end; + {$ENDIF} + FSurface := nil; + inherited; end; -function TSkCanvasCustom.BrushToSkPaint(const ABrush: TBrush; - const ARect: TRectF; const AOpacity: Single): ISkPaint; +class procedure TSkCanvasBase.DoFinalizeBitmap(var ABitmapHandle: THandle); begin - Result := TSkPaint.Create(TSkPaintStyle.Fill); - SetupBrush(ABrush, ARect, AOpacity, Result); + TSkBitmapHandle(ABitmapHandle).Free; end; -procedure TSkCanvasCustom.Clear(const AColor: TAlphaColor); +class function TSkCanvasBase.DoInitializeBitmap(const AWidth, AHeight: Integer; + const AScale: Single; var APixelFormat: TPixelFormat): THandle; begin - {$IF CompilerVersion >= 35} - RaiseIfBeginSceneCountZero; - {$ELSE} - if BeginSceneCount > 0 then - {$ENDIF} - FSurface.Canvas.Clear(AColor); + if APixelFormat = TPixelFormat.None then + APixelFormat := PixelFormat; + Result := THandle(TSkBitmapHandle.Create(AWidth, AHeight, APixelFormat)); + APixelFormat := PixelFormat; end; -class procedure TSkCanvasCustom.ClearCache(const ACanvas: TSkCanvasCustom); +class function TSkCanvasBase.DoMapBitmap(const ABitmapHandle: THandle; + const AAccess: TMapAccess; var ABitmapData: TBitmapData): Boolean; begin - FImageCache[ACanvas].Clear; + TSkBitmapHandle(ABitmapHandle).AllocatePixels; + ABitmapData.Data := TSkBitmapHandle(ABitmapHandle).Pixels; + ABitmapData.Pitch := TSkBitmapHandle(ABitmapHandle).Width * PixelFormatBytes[TSkBitmapHandle(ABitmapHandle).PixelFormat]; + Result := True; end; -class procedure TSkCanvasCustom.ClearCacheBitmap(const ABitmapHandle: THandle); +class procedure TSkCanvasBase.DoUnmapBitmap(const ABitmapHandle: THandle; + var ABitmapData: TBitmapData); begin - TThread.Queue(nil, - procedure () - var - LCanvas: TSkCanvasCustom; - begin - if Assigned(FImageCache) then - begin - for LCanvas in FImageCache.Keys do - begin - if FImageCache[LCanvas].ContainsKey(ABitmapHandle) then - DoClearCacheBitmap(LCanvas, ABitmapHandle); - end; - end; - end); end; -procedure TSkCanvasCustom.ClearRect(const ARect: TRectF; - const AColor: TAlphaColor); +class procedure TSkCanvasBase.Finalize; begin - FSurface.Canvas.Save; - try - FSurface.Canvas.ClipRect(ARect); - FSurface.Canvas.Clear(AColor); - finally - FSurface.Canvas.Restore; - end; + SkFinalize; end; -function TSkCanvasCustom.CreateCache(const AWidth, AHeight: Integer; - const AColorType: TSkColorType; const APixels: Pointer; - const ARowBytes: NativeUInt): ISkImage; +function TSkCanvasBase.GetCanvas: ISkCanvas; begin - Result := TSkImage.MakeFromRaster(TSkImageInfo.Create(AWidth, AHeight, AColorType), APixels, ARowBytes); + Result := FSurface.Canvas; end; -constructor TSkCanvasCustom.CreateFromPrinter(const APrinter: TAbstractPrinter); +class procedure TSkCanvasBase.Initialize; begin - raise ESkCanvas.Create('Create from printer is not supported'); + SkInitialize; end; {$IFDEF MSWINDOWS} -constructor TSkCanvasCustom.CreateFromWindow(const AParent: TWindowHandle; - const AWidth, AHeight: Integer; const AQuality: TCanvasQuality); +procedure TSkCanvasBase.Resized; begin inherited; - if WindowHandleToPlatform(Parent){$IF CompilerVersion < 30}.Form{$ENDIF}.Transparency then - WindowHandleToPlatform(Parent).CreateBuffer({$IF CompilerVersion < 31}Width, Height{$ELSE}WindowHandleToPlatform(Parent).WndClientSize.Width, WindowHandleToPlatform(Parent).WndClientSize.Height{$ENDIF}); + end; {$ENDIF} -function TSkCanvasCustom.CreateSaveState: TCanvasSaveState; -begin - Result := TSaveState.Create; -end; - -procedure TSkCanvasCustom.DestroyWindow; -begin - if Assigned(FImageCache) then - FImageCache.Remove(Self); -end; +{ TGrBitmapHandle } -function TSkCanvasCustom.DoBeginScene({$IF CompilerVersion < 35}const {$ENDIF}AClipRects: PClipRects; - AContextHandle: THandle): Boolean; +procedure TGrBitmapHandle.ClearCache; begin - Result := inherited; - if Result then + if Assigned(FTexture) then begin - if Bitmap <> nil then - begin - ClearCacheBitmap(Bitmap.Handle); - TSkBitmapHandle(Bitmap.Handle).Initialize; - FDrawableWidth := Width; - FDrawableHeight := Height; - FSurface := TSkSurface.MakeRasterDirect(TSkImageInfo.Create(Width, Height, SkFmxColorType[Bitmap.PixelFormat]), TSkBitmapHandle(Bitmap.Handle).Pixels, Width * 4); - end - else if Parent <> nil then - begin - FDrawableWidth := Round(Width * Scale); - FDrawableHeight := Round(Height * Scale); - FSurface := BeginWindow(AContextHandle); - end - else - Exit(False); - Result := Assigned(FSurface); - if Result then - FSurface.Canvas.SetMatrix(TMatrix.CreateScaling(Scale, Scale)); + FSharedResources.BeginContext; + try + FTexture := nil; + finally + FSharedResources.EndContext; + end; end; end; -class procedure TSkCanvasCustom.DoClearCacheBitmap( - const ACanvas: TSkCanvasCustom; const ABitmapHandle: THandle); +destructor TGrBitmapHandle.Destroy; begin - FImageCache[ACanvas].Remove(ABitmapHandle); + ClearCache; + inherited; end; -procedure TSkCanvasCustom.DoDrawBitmap(const ABitmap: FMX.Graphics.TBitmap; - const ASrcRect, ADestRect: TRectF; const AOpacity: Single; const AHighSpeed: Boolean); -var - LImage: ISkImage; - LPaint: ISkPaint; -begin - LImage := BitmapToSkImage(ABitmap); - if Assigned(LImage) then - begin - LPaint := TSkPaint.Create; - LPaint.AlphaF := AOpacity; - {$IFDEF MODULATE_CANVAS} - if FModulateColor <> TAlphaColors.Null then - LPaint.ColorFilter := TSkColorFilter.MakeBlend(FModulateColor, TSkBlendMode.SrcIn); - {$ENDIF} - FSurface.Canvas.DrawImageRect(LImage, ASrcRect, ADestRect, GetSamplingOptions(AHighSpeed), LPaint); - end; -end; +{ TGrCanvasSharedResources } -procedure TSkCanvasCustom.DoDrawEllipse(const ARect: TRectF; - const AOpacity: Single; const ABrush: TStrokeBrush); -var - LPathBuilder: ISkPathBuilder; +procedure TGrCanvasSharedResources.AfterBeginContext; begin - if SameValue(ABrush.Thickness, 0, TEpsilon.Position) then - Exit; - LPathBuilder := TSkPathBuilder.Create; - LPathBuilder.AddOval(ARect, TSkPathDirection.CW, 3); - FSurface.Canvas.DrawPath(LPathBuilder.Detach, StrokeBrushToSkPaint(ABrush, ARect, AOpacity)); end; -procedure TSkCanvasCustom.DoDrawLine(const APoint1, APoint2: TPointF; - const AOpacity: Single; const ABrush: TStrokeBrush); +procedure TGrCanvasSharedResources.BeforeEndContext; begin - if SameValue(ABrush.Thickness, 0, TEpsilon.Position) then - Exit; - FSurface.Canvas.DrawLine(APoint1, APoint2, StrokeBrushToSkPaint(ABrush, TRectF.Create(APoint1, APoint2), AOpacity)); end; -procedure TSkCanvasCustom.DoDrawPath(const APath: TPathData; - const AOpacity: Single; const ABrush: TStrokeBrush); +procedure TGrCanvasSharedResources.BeginContext; begin - if SameValue(ABrush.Thickness, 0, TEpsilon.Position) then - Exit; - FSurface.Canvas.DrawPath(APath.ToSkPath, StrokeBrushToSkPaint(ABrush, APath.GetBounds, AOpacity)); + TMonitor.Enter(Self); + AfterBeginContext; end; -procedure TSkCanvasCustom.DoDrawRect(const ARect: TRectF; - const AOpacity: Single; const ABrush: TStrokeBrush); +constructor TGrCanvasSharedResources.Create; begin - if SameValue(ABrush.Thickness, 0, TEpsilon.Position) then - Exit; - FSurface.Canvas.DrawRect(ARect, StrokeBrushToSkPaint(ABrush, ARect, AOpacity)); + inherited; + InitializeSharedResources; + try + AfterBeginContext; + try + InitializeContext(FGrDirectContext); + finally + BeforeEndContext; + end; + except + FinalizeSharedResources; + raise; + end; end; -procedure TSkCanvasCustom.DoEndScene; +destructor TGrCanvasSharedResources.Destroy; begin - if Parent <> nil then - begin - {$IFDEF MSWINDOWS} - if WindowHandleToPlatform(Parent){$IF CompilerVersion < 30}.Form{$ENDIF}.Transparency then - FSurface.ReadPixels(TSkImageInfo.Create({$IF CompilerVersion < 31}Width, Height{$ELSE}WindowHandleToPlatform(Parent).WndClientSize.Width, WindowHandleToPlatform(Parent).WndClientSize.Height{$ENDIF}), WindowHandleToPlatform(Parent).BufferBits, {$IF CompilerVersion < 31}Width{$ELSE}WindowHandleToPlatform(Parent).WndClientSize.Width{$ENDIF} * 4); - {$ENDIF} - EndWindow; + AfterBeginContext; + try + TMessageManager.DefaultManager.SendMessage(TObject(FGrDirectContext), TGrBeforeSharedContextDestructionMessage.Create); + FGrDirectContext := nil; + finally + BeforeEndContext; end; - FSurface := nil; + FinalizeSharedResources; inherited; end; -procedure TSkCanvasCustom.DoFillEllipse(const ARect: TRectF; - const AOpacity: Single; const ABrush: TBrush); -var - LPathBuilder: ISkPathBuilder; +procedure TGrCanvasSharedResources.EndContext; begin - LPathBuilder := TSkPathBuilder.Create; - LPathBuilder.AddOval(ARect, TSkPathDirection.CW, 3); - FSurface.Canvas.DrawPath(LPathBuilder.Detach, BrushToSkPaint(ABrush, ARect, AOpacity)); + FGrDirectContext.FlushAndSubmit(True); + BeforeEndContext; + TMonitor.Exit(Self); end; -procedure TSkCanvasCustom.DoFillPath(const APath: TPathData; - const AOpacity: Single; const ABrush: TBrush); +procedure TGrCanvasSharedResources.FinalizeSharedResources; begin - FSurface.Canvas.DrawPath(APath.ToSkPath, BrushToSkPaint(ABrush, APath.GetBounds, AOpacity)); end; -procedure TSkCanvasCustom.DoFillRect(const ARect: TRectF; - const AOpacity: Single; const ABrush: TBrush); +function TGrCanvasSharedResources.GetGrDirectContext: IGrDirectContext; begin - FSurface.Canvas.DrawRect(ARect, BrushToSkPaint(ABrush, ARect, AOpacity)); + Result := FGrDirectContext; end; -class procedure TSkCanvasCustom.DoFinalize; +procedure TGrCanvasSharedResources.InitializeSharedResources; begin end; -class procedure TSkCanvasCustom.DoFinalizeBitmap(var ABitmapHandle: THandle); +{ TGrCanvas } + +procedure TGrCanvas.BeforeDestruction; begin - ClearCacheBitmap(ABitmapHandle); - TSkBitmapHandle(ABitmapHandle).Free; + inherited; + if Assigned(FGrDirectContext) then + DestroyContext; end; -class function TSkCanvasCustom.DoInitialize: Boolean; +function TGrCanvas.CreateSurfaceFromBitmap: ISkSurface; begin - Result := True; + TGrBitmapHandle(Bitmap.Handle).ClearCache; + Result := inherited; end; -class function TSkCanvasCustom.DoInitializeBitmap(const AWidth, - AHeight: Integer; const AScale: Single; - var APixelFormat: TPixelFormat): THandle; +function TGrCanvas.CreateSurfaceFromWindow( + const AContextHandle: THandle): ISkSurface; begin - Result := THandle(TSkBitmapHandle.Create(AWidth, AHeight)); - if APixelFormat = TPixelFormat.None then - begin - {$IF DEFINED(MSWINDOWS)} - APixelFormat := TPixelFormat.BGRA; - {$ELSEIF DEFINED(MACOS)} - if GlobalUseMetal then - APixelFormat := TPixelFormat.BGRA - else - APixelFormat := TPixelFormat.RGBA; - {$ELSE} - APixelFormat := TPixelFormat.RGBA; - {$ENDIF} - end; + Result := CreateSurfaceFromWindow(FGrDirectContext); end; -class function TSkCanvasCustom.DoMapBitmap(const ABitmapHandle: THandle; - const AAccess: TMapAccess; var ABitmapData: TBitmapData): Boolean; +procedure TGrCanvas.DestroyContext; begin - if AAccess <> TMapAccess.Read then - ClearCacheBitmap(ABitmapHandle); - TSkBitmapHandle(ABitmapHandle).Initialize; - ABitmapData.Data := TSkBitmapHandle(ABitmapHandle).Pixels; - ABitmapData.Pitch := TSkBitmapHandle(ABitmapHandle).Width * 4; - Result := True; + FGrDirectContext := nil; end; -{$IF CompilerVersion >= 30} - -procedure TSkCanvasCustom.DoSetMatrix(const AMatrix: TMatrix); +procedure TGrCanvas.DoEndScene; begin - if BeginSceneCount > 0 then - FSurface.Canvas.SetMatrix(AMatrix * TMatrix.CreateScaling(Scale, Scale)); + if Parent <> nil then + begin + Surface.Flush; + GrDirectContext.FlushAndSubmit; + end; + inherited; end; -{$ENDIF} - -class procedure TSkCanvasCustom.DoUnmapBitmap(const ABitmapHandle: THandle; - var ABitmapData: TBitmapData); +class function TGrCanvas.DoInitializeBitmap(const AWidth, AHeight: Integer; + const AScale: Single; var APixelFormat: TPixelFormat): THandle; begin + if APixelFormat = TPixelFormat.None then + APixelFormat := PixelFormat; + Result := THandle(TGrBitmapHandle.Create(AWidth, AHeight, APixelFormat)); end; -procedure TSkCanvasCustom.EndWindow; +class function TGrCanvas.DoMapBitmap(const ABitmapHandle: THandle; + const AAccess: TMapAccess; var ABitmapData: TBitmapData): Boolean; begin + if AAccess <> TMapAccess.Read then + TGrBitmapHandle(ABitmapHandle).ClearCache; + Result := inherited; end; -procedure TSkCanvasCustom.ExcludeClipRect(const ARect: TRectF); +function TGrCanvas.GetCache(const ABitmapHandle: THandle): ISkImage; begin - Inc(FClippingChangeCount); - FSurface.Canvas.ClipRect(ARect, TSkClipOp.Difference); + if Parent <> nil then + begin + if not Assigned(TGrBitmapHandle(ABitmapHandle).FTexture) then + begin + TGrBitmapHandle(ABitmapHandle).FSharedResources := FSharedResources; + FSharedResources.BeginContext; + try + TGrBitmapHandle(ABitmapHandle).FTexture := TSkImage.MakeCrossContext(FSharedResources.GrDirectContext, TSkImageInfo.Create(TGrBitmapHandle(ABitmapHandle).Width, TGrBitmapHandle(ABitmapHandle).Height, SkFmxColorType[TGrBitmapHandle(ABitmapHandle).PixelFormat]), TGrBitmapHandle(ABitmapHandle).Pixels, TGrBitmapHandle(ABitmapHandle).Width * PixelFormatBytes[TGrBitmapHandle(ABitmapHandle).PixelFormat], False, True); + finally + FSharedResources.EndContext; + end; + end; + Result := TGrBitmapHandle(ABitmapHandle).FTexture; + end; end; -class procedure TSkCanvasCustom.Finalize; -var - LCanvas: TSkCanvasCustom; +class procedure TGrCanvas.Initialize; begin - DoFinalize; - for LCanvas in FImageCache.Keys do - ClearCache(LCanvas); - FImageCache.Free; - TSkiaAPI.Terminate; + inherited; + try + InitializeSharedResources(FSharedResources); + except + inherited Finalize; + raise; + end; end; -class function TSkCanvasCustom.GetCanvasStyle: TCanvasStyles; -begin - Result := []; -end; - -{$IFDEF MODULATE_CANVAS} +{ TSkTextLayout.TGraphemesMap } -function TSkCanvasCustom.GetModulateColor: TAlphaColor; -begin - Result := FModulateColor; +function TSkTextLayout.TGraphemesMap.CreateGraphemesMapping( + const AText: string): TBytes; +var + I: Integer; + LCharIndex: Integer; + LGrapheme: TSkUnicodeBreakIteratorElem; + LGraphemesIterator: ISkUnicodeBreakIterator; + LUnicode: ISkUnicode; +begin + // For each char of the text in the same position of this array will have the + // index that it represents in the current grapheme, that is, index zero means + // a beginning of the grapheme. + SetLength(Result, Length(AText) + 1); + if AText <> '' then + begin + LUnicode := TSkUnicode.Create; + LGraphemesIterator := LUnicode.GetBreakIterator(TSkBreakType.Graphemes, AText); + LGraphemesIterator.MoveNext; + I := 0; + for LGrapheme in LGraphemesIterator do + begin + LCharIndex := 0; + repeat + Result[I] := LCharIndex; + Inc(LCharIndex); + Inc(I); + until I = LGrapheme.Position; + end; + end; + Result[High(Result)] := 0; end; -{$ENDIF} - -function TSkCanvasCustom.GetSamplingOptions( - const AHighSpeed: Boolean): TSkSamplingOptions; +procedure TSkTextLayout.TGraphemesMap.FindNextGraphemeBoundary( + var AIndex: Integer); begin - if AHighSpeed then - Result := TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None) - else + if AIndex < Length(FCharIndexInGrapheme) then begin - case Quality of - TCanvasQuality.SystemDefault, - TCanvasQuality.HighQuality: Result := TSkSamplingOptions.High; - else - Result := TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.Nearest); - end; + while (FCharIndexInGrapheme[AIndex] <> 0) do + Inc(AIndex); end; end; -class function TSkCanvasCustom.Initialize: Boolean; +procedure TSkTextLayout.TGraphemesMap.FindPreviousGraphemeBoundary( + var AIndex: Integer); begin - TSkiaAPI.Initialize; - if not DoInitialize then - begin - TSkiaAPI.Terminate; - Exit(False); - end; - FImageCache := TObjectDictionary>.Create([doOwnsValues]); - Result := True; + Dec(AIndex, FCharIndexInGrapheme[AIndex]); end; -procedure TSkCanvasCustom.IntersectClipRect(const ARect: TRectF); +procedure TSkTextLayout.TGraphemesMap.SetText(const AText: string); begin - Inc(FClippingChangeCount); - FSurface.Canvas.ClipRect(ARect); + if (FText <> AText) or (FCharIndexInGrapheme = nil) then + begin + FText := AText; + FCharIndexInGrapheme := CreateGraphemesMapping(AText); + end; end; -function TSkCanvasCustom.PtInPath(const APoint: TPointF; - const APath: TPathData): Boolean; +{ TSkTextLayout } + +procedure TSkTextLayout.ConvertToPath(const APath: TPathData); var - LPaint: ISkPaint; - LPath: ISkPath; + I: Integer; + LPath: TPathData; begin - LPaint := TSkPaint.Create; - LPath := LPaint.GetFillPath(APath.ToSkPath); - Result := Assigned(LPath) and (LPath.Contains(APoint.X, APoint.Y)); + if (not Assigned(FParagraphs)) or (not Assigned(APath)) then + Exit; + for I := 0 to Length(FParagraphs) - 1 do + begin + if Assigned(FParagraphs[I].Paragraph) then + begin + LPath := TPathData.Create; + try + LPath.AddSkPath(FParagraphs[I].Paragraph.ToPath); + LPath.Translate(FParagraphs[I].Offset + TopLeft); + APath.AddPath(LPath); + finally + LPath.Free; + end; + end; + end; end; -procedure TSkCanvasCustom.Resized; +class constructor TSkTextLayout.Create; begin - {$IFDEF MSWINDOWS} - if (Parent <> nil) and (WindowHandleToPlatform(Parent){$IF CompilerVersion < 30}.Form{$ENDIF}.Transparency) then - WindowHandleToPlatform(Parent).ResizeBuffer({$IF CompilerVersion < 31}Width, Height{$ELSE}WindowHandleToPlatform(Parent).WndClientSize.Width, WindowHandleToPlatform(Parent).WndClientSize.Height{$ENDIF}); - {$ENDIF} + FAttributesRangeComparer := TComparer.Construct( + function(const ALeft, ARight: TTextAttributedRange): Integer + begin + if (ALeft.Range.Pos + ALeft.Range.Length) <= ARight.Range.Pos then + Result := -1 + else if ALeft.Range.Pos >= (ARight.Range.Pos + ARight.Range.Length) then + Result := 1 + else + Result := 0; + end); + FParagraphTextRangeComparer := TComparer.Construct( + function(const ALeft, ARight: TParagraph): Integer + begin + if (ALeft.Range.Length = 0) or (ARight.Range.Length = 0) then + begin + if InRange(ALeft.Range.Pos, ARight.Range.Pos, ARight.Range.Pos + ARight.Range.Length) or + InRange(ARight.Range.Pos, ALeft.Range.Pos, ALeft.Range.Pos + ALeft.Range.Length) then + begin + Result := 0; + end + else + Result := CompareValue(ALeft.Range.Pos, ARight.Range.Pos); + end + else if (ALeft.Range.Pos + ALeft.Range.Length) <= ARight.Range.Pos then + Result := -1 + else if ALeft.Range.Pos >= (ARight.Range.Pos + ARight.Range.Length) then + Result := 1 + else + Result := 0; + end); end; -procedure TSkCanvasCustom.Restore; +constructor TSkTextLayout.Create(const ACanvas: TCanvas); begin - FSurface.Canvas.Restore; + inherited; + {$REGION ' - Workaround RSP-36975'} + // - ------------------------------------------------------------------------- + // - WORKAROUND + // - ------------------------------------------------------------------------- + // - + // - Description: + // - This code is a workaround intended to fix issues with controls that + // - create the TTextLayout but doesn't set the TTextLayout.RightToLeft, + // - like the TText control. + // - + // - Bug report: + // - https://quality.embarcadero.com/browse/RSP-36975 + // - + // - ------------------------------------------------------------------------- + {$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion113))} + FIgnoreUpdates := True; + try + RightToLeft := Application.BiDiMode = TBiDiMode.bdRightToLeft; + finally + FIgnoreUpdates := False; + end; + {$ENDIF} + // - ------------------------------------------------------------------------- + {$ENDREGION} end; -procedure TSkCanvasCustom.Save; +procedure TSkTextLayout.DoDrawLayout(const ACanvas: ISkCanvas); +var + I: Integer; begin - FSurface.Canvas.Save; + if Assigned(FParagraphs) and Assigned(ACanvas) then + begin + if (FColor <> Color) or (FOpacity <> Opacity) then + UpdateParagraph; + ACanvas.Save; + try + ACanvas.ClipRect(TRectF.Create(TopLeft, MaxSize.X, MaxSize.Y)); + for I := 0 to Length(FParagraphs) - 1 do + if Assigned(FParagraphs[I].Paragraph) then + FParagraphs[I].Paragraph.Paint(ACanvas, FParagraphs[I].Offset.X + TopLeft.X, FParagraphs[I].Offset.Y + TopLeft.Y); + finally + ACanvas.Restore; + end; + end; end; -{$IF CompilerVersion < 30} - -procedure TSkCanvasCustom.SetMatrix(const AMatrix: TMatrix); +procedure TSkTextLayout.DoDrawLayout(const ACanvas: TCanvas); +var + I: Integer; + LTextLayout: TTextLayout; + LTextLayoutClass: TTextLayoutClass; begin - inherited; - if BeginSceneCount > 0 then - FSurface.Canvas.SetMatrix(AMatrix * TMatrix.CreateScaling(Scale, Scale)); + if not Assigned(ACanvas) then + Exit; + if ACanvas is TSkCanvasCustom then + begin + if ACanvas.BeginSceneCount > 0 then + DoDrawLayout(TSkCanvasCustom(ACanvas).Canvas); + end + else + begin + LTextLayoutClass := TTextLayoutManager.TextLayoutByCanvas(ACanvas.ClassType); + if LTextLayoutClass <> nil then + begin + LTextLayout := LTextLayoutClass.Create; + try + LTextLayout.BeginUpdate; + try + LTextLayout.Text := Text; + LTextLayout.Padding := Padding; + LTextLayout.WordWrap := WordWrap; + LTextLayout.HorizontalAlign := HorizontalAlign; + LTextLayout.VerticalAlign := VerticalAlign; + LTextLayout.Color := Color; + LTextLayout.Font := Font; + LTextLayout.Opacity := Opacity; + LTextLayout.Trimming := Trimming; + LTextLayout.RightToLeft := RightToLeft; + LTextLayout.MaxSize := MaxSize; + LTextLayout.TopLeft := TopLeft; + LTextLayout.ClearAttributes; + for I := 0 to AttributesCount - 1 do + LTextLayout.AddAttribute(Attributes[I]); + finally + LTextLayout.EndUpdate; + end; + LTextLayout.RenderLayout(ACanvas); + finally + LTextLayout.Free; + end; + end; + end; end; -{$ENDIF} +function TSkTextLayout.DoPositionAtPoint(const APoint: TPointF): Integer; -{$IFDEF MODULATE_CANVAS} + function TryGetNearestParagraph(const APoint: TPointF; + out AParagraph: TParagraph): Boolean; + var + I: Integer; + LDistance: Single; + LMinDistance: Single; + LPoint: TPointF; + begin + Result := False; + LPoint := APoint - TopLeft; + LMinDistance := MaxSingle; + for I := 0 to Length(FParagraphs) - 1 do + begin + if Assigned(FParagraphs[I].Paragraph) then + begin + if FParagraphs[I].Bounds.Contains(APoint) then + LDistance := -1 + else + begin + LDistance := FParagraphs[I].Bounds.TopLeft.Distance(LPoint); + LDistance := Min(LDistance, FParagraphs[I].Bounds.BottomRight.Distance(LPoint)); + LDistance := Min(LDistance, PointF(FParagraphs[I].Bounds.Left, FParagraphs[I].Bounds.Bottom).Distance(LPoint)); + LDistance := Min(LDistance, PointF(FParagraphs[I].Bounds.Right, FParagraphs[I].Bounds.Top).Distance(LPoint)); + end; + if LDistance < 0 then + begin + AParagraph := FParagraphs[I]; + Exit(True); + end; + if LDistance < LMinDistance then + begin + LMinDistance := LDistance; + AParagraph := FParagraphs[I]; + Result := True; + end; + end; + end; + end; -procedure TSkCanvasCustom.SetModulateColor(const AColor: TAlphaColor); +var + LParagraph: TParagraph; begin - FModulateColor := AColor; + if (not Assigned(FParagraphs)) or (not TryGetNearestParagraph(APoint, LParagraph)) then + Exit(-1); + Result := LParagraph.Paragraph.GetGlyphPositionAtCoordinate(APoint.X - TopLeft.X - LParagraph.Offset.X, APoint.Y - TopLeft.Y - LParagraph.Offset.Y).Position; end; -{$ENDIF} +function TSkTextLayout.DoRegionForRange(const ARange: TTextRange): TRegion; -procedure TSkCanvasCustom.SetSize(const AWidth, AHeight: Integer); -begin - if (Width <> AWidth) or (Height <> AHeight) then + // SkParagraph returns one rectangle for each grapheme, while other TextLayout + // implementations consider a single rectangle containing graphemes side by + // side on the same line. Simulating this behavior avoids issues in text + // editing controls. + function SummarizeRegion(const ARegion: TRegion): TRegion; + var + I: Integer; + LLastRect: PRectF; + LResultCount: Integer; + begin + Assert(Length(ARegion) > 1); + LResultCount := 1; + SetLength(Result, Length(ARegion)); + Result[0] := ARegion[0]; + LLastRect := @Result[0]; + for I := 1 to Length(ARegion) - 1 do + begin + if (SameValue(LLastRect.Right, ARegion[I].Left, 1)) and (InRange(ARegion[I].CenterPoint.Y, LLastRect.Top, LLastRect.Bottom) or InRange(LLastRect.CenterPoint.Y, ARegion[I].Top, ARegion[I].Bottom)) then + begin + LLastRect.Right := ARegion[I].Right; + LLastRect.Top := Min(LLastRect.Top, ARegion[I].Top); + LLastRect.Bottom := Max(LLastRect.Bottom, ARegion[I].Bottom); + end + else + begin + Result[LResultCount] := ARegion[I]; + Inc(LResultCount); + Inc(LLastRect); + end; + end; + SetLength(Result, LResultCount); + end; + + function GetRegionForRange(const AStartIndex, AEndIndex: Integer): TRegion; + var + I: Integer; + LLength: Integer; + LParagraph: TParagraph; + LTextBoxes: TArray; begin - inherited; - Resized; + Result := nil; + for LParagraph in GetParagraphsInRange(AStartIndex, AEndIndex - AStartIndex) do + begin + if Assigned(LParagraph.Paragraph) then + begin + LTextBoxes := LParagraph.Paragraph.GetRectsForRange(AStartIndex - LParagraph.Range.Pos, AEndIndex - LParagraph.Range.Pos, TSkRectHeightStyle.Max, TSkRectWidthStyle.Tight); + LLength := Length(Result); + SetLength(Result, LLength + Length(LTextBoxes)); + for I := LLength to Length(LTextBoxes) - 1 do + begin + Result[I] := LTextBoxes[I].Rect; + Result[I].Offset(LParagraph.Offset + TopLeft); + end; + end; + end; + if Length(Result) > 1 then + Result := SummarizeRegion(Result); end; -end; -procedure TSkCanvasCustom.SetupBrush(const ABrush: TBrush; const ARect: TRectF; - const AOpacity: Single; const APaint: ISkPaint); -const - WrapMode: array[TWrapMode.Tile..TWrapMode.TileOriginal] of TSkTileMode = (TSkTileMode.Repeat, TSkTileMode.Clamp); var - I: Integer; - LCenter: TPointF; - LColors: TArray; - LImage: ISkImage; - LMatrix: TMatrix; - LPositions: TArray; - LRadius: Single; - LRadiusX: Single; - LRadiusY: Single; + LEndIndex: Integer; + LStartIndex: Integer; begin - if ABrush.Kind = TBrushKind.Resource then + if not Assigned(FParagraphs) then + Exit(nil); + FGraphemesMap.Text := Text; + LStartIndex := Max(ARange.Pos, 0); + LEndIndex := Min(LStartIndex + ARange.Length, Text.Length); + FGraphemesMap.FindPreviousGraphemeBoundary(LStartIndex); + FGraphemesMap.FindPreviousGraphemeBoundary(LEndIndex); + + if LStartIndex = LEndIndex then begin - if ABrush.Resource.Brush = nil then - Exit; - ABrush.Assign(ABrush.Resource.Brush); - end; - APaint.AntiAlias := Quality <> TCanvasQuality.HighPerformance; - case ABrush.Kind of - TBrushKind.Solid: APaint.Color := MakeColor(ABrush.Color, AOpacity); - TBrushKind.Gradient: - begin - SetLength(LColors, ABrush.Gradient.Points.Count); - SetLength(LPositions, ABrush.Gradient.Points.Count); - case ABrush.Gradient.Style of - TGradientStyle.Linear: - begin - for I := 0 to ABrush.Gradient.Points.Count - 1 do - begin - LColors[I] := MakeColor(ABrush.Gradient.Points[I].Color, AOpacity); - LPositions[I] := ABrush.Gradient.Points[I].Offset; - end; - APaint.Shader := TSkShader.MakeGradientLinear(TPointF.Create(ARect.Left + ABrush.Gradient.StartPosition.X * ARect.Width, ARect.Top + ABrush.Gradient.StartPosition.Y * ARect.Height), TPointF.Create(ARect.Left + ABrush.Gradient.StopPosition.X * ARect.Width, ARect.Top + ABrush.Gradient.StopPosition.Y * ARect.Height), LColors, LPositions); - end; - TGradientStyle.Radial: - begin - for I := 0 to ABrush.Gradient.Points.Count - 1 do - begin - LColors[ABrush.Gradient.Points.Count - 1 - I] := MakeColor(ABrush.Gradient.Points[I].Color, AOpacity); - LPositions[ABrush.Gradient.Points.Count - 1 - I] := 1 - ABrush.Gradient.Points[I].Offset; - end; - LCenter := TPointF.Create(ARect.Width * ABrush.Gradient.RadialTransform.RotationCenter.X, ARect.Height * ABrush.Gradient.RadialTransform.RotationCenter.Y) + ARect.TopLeft; - LRadiusX := ABrush.Gradient.RadialTransform.Scale.X * (ARect.Width / 2); - LRadiusY := ABrush.Gradient.RadialTransform.Scale.Y * (ARect.Height / 2); - if not SameValue(LRadiusX, LRadiusY, Epsilon) then - begin - if LRadiusX < LRadiusY then - begin - LRadius := LRadiusY; - LMatrix := TMatrix.CreateScaling(LRadiusX / LRadiusY, 1) * TMatrix.CreateTranslation(LCenter.X - (LCenter.X * (LRadiusX / LRadiusY)), 0); - end - else - begin - LRadius := LRadiusX; - LMatrix := TMatrix.CreateScaling(1, LRadiusY / LRadiusX) * TMatrix.CreateTranslation(0, LCenter.Y - (LCenter.Y * (LRadiusY / LRadiusX))); - end; - APaint.Shader := TSkShader.MakeGradientRadial(LCenter, LRadius, LColors, LMatrix, LPositions); - end - else - APaint.Shader := TSkShader.MakeGradientRadial(LCenter, LRadiusX, LColors, LPositions); + if LStartIndex = 0 then + begin + // Right grapheme + LEndIndex := 1; + FGraphemesMap.FindNextGraphemeBoundary(LEndIndex); + Result := GetRegionForRange(LStartIndex, LEndIndex); + if Length(Result) > 0 then + Result := [RectF(Result[0].Left, Result[0].Top, Result[0].Left, Result[0].Bottom)]; + end + else + begin + // Left grapheme + Dec(LStartIndex); + FGraphemesMap.FindPreviousGraphemeBoundary(LStartIndex); + Result := GetRegionForRange(LStartIndex, LEndIndex); + if Length(Result) > 0 then + Result := [RectF(Result[0].Right, Result[0].Top, Result[0].Right, Result[0].Bottom)]; + end; + end + else + Result := GetRegionForRange(LStartIndex, LEndIndex); +end; + +procedure TSkTextLayout.DoRenderLayout; +type + THorizontalAlign = (Left, Center, Right); +const + HorizontalTextAlign: array[TTextAlign, Boolean] of THorizontalAlign = ((THorizontalAlign.Center, THorizontalAlign.Center), (THorizontalAlign.Left, THorizontalAlign.Right), (THorizontalAlign.Right, THorizontalAlign.Left)); + + function GetTextRect: TRectF; + var + I: Integer; + LOffset: TPointF; + LTextBox: TSkTextBox; + LTextBoxes: TArray; + begin + Result := TRectF.Empty; + LOffset := PointF(0, 0); + for I := 0 to Length(FParagraphs) - 1 do + begin + if Assigned(FParagraphs[I].Paragraph) then + begin + FParagraphs[I].Bounds := TRectF.Empty; + LTextBoxes := FParagraphs[I].Paragraph.GetRectsForRange(0, FParagraphs[I].Range.Length, TSkRectHeightStyle.Max, TSkRectWidthStyle.Tight); + for LTextBox in LTextBoxes do + begin + if FParagraphs[I].Bounds.IsEmpty then + FParagraphs[I].Bounds := LTextBox.Rect + else + FParagraphs[I].Bounds := FParagraphs[I].Bounds + LTextBox.Rect; + end; + if FParagraphs[I].Bounds.IsEmpty then + FParagraphs[I].Bounds.Height := FParagraphs[I].Paragraph.Height; + FParagraphs[I].Bounds.Offset(LOffset); + if Result.IsEmpty then + Result := FParagraphs[I].Bounds + else + Result := Result + FParagraphs[I].Bounds; + LOffset.Y := FParagraphs[I].Bounds.Bottom; + end; + end; + end; + + function GetParagraphOffset(ATextRect: TRectF): TPointF; + var + LBounds: TRectF; + begin + ATextRect := RectF(0, 0, ATextRect.Width, ATextRect.Height); + if not NeedHorizontalAlignment then + begin + case HorizontalTextAlign[HorizontalAlign, RightToLeft] of + THorizontalAlign.Center: ATextRect.Offset((MaxSize.X - Padding.Left - Padding.Right - ATextRect.Width) / 2, 0); + THorizontalAlign.Right : ATextRect.Offset(MaxSize.X - Padding.Left - Padding.Right - ATextRect.Right, 0); + end; + end; + + LBounds := RectF(0, 0, ATextRect.Width, ATextRect.Height); + case HorizontalTextAlign[HorizontalAlign, RightToLeft] of + THorizontalAlign.Center: LBounds.Offset((MaxSize.X - Padding.Left - Padding.Right - LBounds.Width) / 2, 0); + THorizontalAlign.Right : LBounds.Offset(MaxSize.X - Padding.Left - Padding.Right - LBounds.Right, 0); + end; + case VerticalAlign of + TTextAlign.Center : LBounds.Offset(0, (MaxSize.Y - Padding.Top - Padding.Bottom - LBounds.Height) / 2); + TTextAlign.Trailing: LBounds.Offset(0, MaxSize.Y - Padding.Top - Padding.Bottom - LBounds.Bottom); + end; + LBounds.Offset(Padding.Rect.TopLeft); + Result := LBounds.TopLeft - ATextRect.TopLeft; + end; + +var + I: Integer; + LOffset: TPointF; +begin + {$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion113))} + if FIgnoreUpdates then + Exit; + {$ENDIF} + UpdateParagraph; + FTextRect := GetTextRect; + LOffset := GetParagraphOffset(FTextRect); + FTextRect.Offset(LOffset); + for I := 0 to Length(FParagraphs) - 1 do + begin + if Assigned(FParagraphs[I].Paragraph) then + FParagraphs[I].Bounds.Offset(LOffset); + end; + for I := 0 to Length(FParagraphs) - 1 do + begin + if Assigned(FParagraphs[I].Paragraph) then + begin + FParagraphs[I].Offset := LOffset; + LOffset := LOffset + PointF(0, FParagraphs[I].Bounds.Height); + end; + end; + case VerticalAlign of + TTextAlign.Leading : FTextRect.Bottom := Min(MaxSize.Y - Padding.Top - Padding.Bottom, FTextRect.Bottom); + TTextAlign.Center : FTextRect.Inflate(0, Min(((MaxSize.Y - Padding.Top - Padding.Bottom) - FTextRect.Height) / 2, 0)); + TTextAlign.Trailing: FTextRect.Top := Max(FTextRect.Bottom - (MaxSize.Y - Padding.Top - Padding.Bottom), FTextRect.Top); + end; + case HorizontalTextAlign[HorizontalAlign, RightToLeft] of + THorizontalAlign.Left : FTextRect.Right := Min(MaxSize.X - Padding.Left - Padding.Right, FTextRect.Right); + THorizontalAlign.Center: FTextRect.Inflate(Min(((MaxSize.X - Padding.Left - Padding.Right) - FTextRect.Width) / 2, 0), 0); + THorizontalAlign.Right : FTextRect.Left := Max(FTextRect.Right - (MaxSize.X - Padding.Left - Padding.Right), FTextRect.Left); + end; +end; + +function TSkTextLayout.GetParagraphsInRange(const APos, + ALength: Integer): TArray; +var + LFoundIndex: Integer; + LParagraph: TParagraph; +begin + Result := nil; + LParagraph.Range := TTextRange.Create(APos, ALength); + if TArray.BinarySearch(FParagraphs, LParagraph, LFoundIndex, FParagraphTextRangeComparer) then + begin + repeat + Result := Result + [FParagraphs[LFoundIndex]]; + Inc(LFoundIndex); + until (LFoundIndex >= Length(FParagraphs)) or (FParagraphTextRangeComparer.Compare(FParagraphs[LFoundIndex], LParagraph) <> 0); + end; +end; + +function TSkTextLayout.GetTextHeight: Single; +begin + Result := FTextRect.Height; +end; + +function TSkTextLayout.GetTextRect: TRectF; +begin + Result := FTextRect; + Result.Offset(TopLeft); +end; + +function TSkTextLayout.GetTextWidth: Single; +begin + Result := FTextRect.Width; +end; + +class procedure TSkTextLayout.Initialize; +{$IFDEF ANDROID} +const + FontFilesFilter = '*.ttf'; // Do not localize +var + LFileName: string; +{$ENDIF} +begin + {$IFDEF ANDROID} + for LFileName in TDirectory.GetFiles(TPath.GetDocumentsPath, FontFilesFilter) do + TSkDefaultProviders.RegisterTypeface(LFileName); + {$ENDIF} +end; + +// The SkParagraph normally doesn't cut a word in half, it cuts the whole word. +// In some scenarios it can cause some errors, for example in edits where it is +// mandatory to cut in the middle of the word. To fix this we will readjust the +// MaxWidth, align horizontally manually and cut with ClipRect. +function TSkTextLayout.NeedHorizontalAlignment: Boolean; +begin + Result := (not WordWrap) and (Trimming = TTextTrimming.None); +end; + +procedure TSkTextLayout.RenderLayout(const ACanvas: ISkCanvas); +begin + RenderLayout(nil); + DoDrawLayout(ACanvas); +end; + +procedure TSkTextLayout.SetMaxLines(AValue: Integer); +begin + AValue := Max(AValue, 0); + if FMaxLines <> AValue then + begin + FMaxLines := AValue; + BeginUpdate; + try + {$IF CompilerVersion >= 29} + SetNeedUpdate; + {$ELSE} + RightToLeft := not RightToLeft; + RightToLeft := not RightToLeft; + {$ENDIF} + finally + EndUpdate; + end; + end; +end; + +procedure TSkTextLayout.UpdateParagraph; +const +{$IF CompilerVersion >= 31} + SkFontSlant : array[TFontSlant] of TSkFontSlant = (TSkFontSlant.Upright, TSkFontSlant.Italic, TSkFontSlant.Oblique); + SkFontWeight: array[TFontWeight] of Integer = (100, 200, 300, 350, 400, 500, 600, 700, 800, 900, 950); + SkFontWidth : array[TFontStretch] of Integer = (1, 2, 3, 4, 5, 6, 7, 8, 9); +{$ENDIF} + ZeroWidthChar = #8203; + + function GetFontFamilies(const AValue: string): TArray; inline; + begin + Result := AValue.Split([', ', ','], TStringSplitOptions.ExcludeEmpty){$IFDEF MACOS} + ['Helvetica Neue']{$ELSEIF DEFINED(LINUX)} + ['Ubuntu']{$ENDIF}; + end; + + function GetNormalizedAttributes(const ASubText: string; + const ASubTextPosition: Integer): TArray; + var + I: Integer; + LAttribute: TTextAttributedRange; + LAttributes: TList; + LIndex: Integer; + LNeighborAttribute: TTextAttributedRange; + begin + if AttributesCount = 0 then + Exit(nil); + LAttributes := TList.Create; + try + for I := 0 to AttributesCount - 1 do + begin + LAttribute := TTextAttributedRange.Create(TTextRange.Create(Attributes[I].Range.Pos - ASubTextPosition, Attributes[I].Range.Length), Attributes[I].Attribute); + if LAttribute.Range.Pos < 0 then + LAttribute.Range := TTextRange.Create(0, LAttribute.Range.Pos + LAttribute.Range.Length); + if (LAttribute.Range.Pos + LAttribute.Range.Length) > ASubText.Length then + LAttribute.Range := TTextRange.Create(LAttribute.Range.Pos, LAttribute.Range.Length - ((LAttribute.Range.Pos + LAttribute.Range.Length) - ASubText.Length)); + if LAttribute.Range.Length <= 0 then + begin + LAttribute.Free; + Continue; + end; + if LAttributes.BinarySearch(LAttribute, LIndex, FAttributesRangeComparer) then + begin + if (LAttributes[LIndex].Range.Pos < LAttribute.Range.Pos) and ((LAttributes[LIndex].Range.Pos + LAttributes[LIndex].Range.Length) > (LAttribute.Range.Pos + LAttribute.Range.Length)) then + begin + LNeighborAttribute := TTextAttributedRange.Create(TTextRange.Create(LAttribute.Range.Pos + LAttribute.Range.Length, LAttributes[LIndex].Range.Pos + LAttributes[LIndex].Range.Length - (LAttribute.Range.Pos + LAttribute.Range.Length)), LAttributes[LIndex].Attribute); + LAttributes.Insert(LIndex + 1, LNeighborAttribute); + LAttributes.Insert(LIndex + 1, LAttribute); + LNeighborAttribute := LAttributes[LIndex]; + LNeighborAttribute.Range.Length := LAttribute.Range.Pos - LNeighborAttribute.Range.Pos; + Continue; + end; + end; + LAttributes.Insert(LIndex, LAttribute); + if LIndex > 0 then + begin + LNeighborAttribute := LAttributes[LIndex - 1]; + if (LNeighborAttribute.Range.Pos + LNeighborAttribute.Range.Length) > LAttribute.Range.Pos then + begin + LNeighborAttribute.Range := TTextRange.Create(LNeighborAttribute.Range.Pos, LNeighborAttribute.Range.Length - ((LNeighborAttribute.Range.Pos + LNeighborAttribute.Range.Length) - LAttribute.Range.Pos)); + if LNeighborAttribute.Range.Length <= 0 then + begin + LNeighborAttribute.Free; + LAttributes.Delete(LIndex - 1); + Dec(LIndex); end; + end; + end; + if LIndex < LAttributes.Count - 1 then + begin + LNeighborAttribute := LAttributes[LIndex + 1]; + if LNeighborAttribute.Range.Pos < (LAttribute.Range.Pos + LAttribute.Range.Length) then + begin + LNeighborAttribute.Range := TTextRange.Create(LAttribute.Range.Pos + LAttribute.Range.Length, LNeighborAttribute.Range.Length - ((LAttribute.Range.Pos + LAttribute.Range.Length) - LNeighborAttribute.Range.Pos)); + if LNeighborAttribute.Range.Length <= 0 then + begin + LNeighborAttribute.Free; + LAttributes.Delete(LIndex + 1); + end; + end; end; end; - TBrushKind.Bitmap: + Result := LAttributes.ToArray; + finally + LAttributes.Free; + end; + end; + + procedure InitializeTextStyle(const ATextStyle: ISkTextStyle; const AFont: TFont; const AColor: TAlphaColor); + begin + ATextStyle.Color := MakeColor(AColor, FOpacity); + ATextStyle.FontFamilies := GetFontFamilies(AFont.Family); + ATextStyle.FontSize := AFont.Size; + {$IF CompilerVersion < 31} + if (TFontStyle.fsBold in AFont.Style) and (TFontStyle.fsItalic in AFont.Style) then + ATextStyle.FontStyle := TSkFontStyle.BoldItalic + else if TFontStyle.fsBold in AFont.Style then + ATextStyle.FontStyle := TSkFontStyle.Bold + else if TFontStyle.fsItalic in AFont.Style then + ATextStyle.FontStyle := TSkFontStyle.Italic + else + ATextStyle.FontStyle := TSkFontStyle.Normal; + {$ELSE} + ATextStyle.FontStyle := TSkFontStyle.Create(SkFontWeight[AFont.StyleExt.Weight], SkFontWidth[AFont.StyleExt.Stretch], SkFontSlant[AFont.StyleExt.Slant]); + {$ENDIF} + if (TFontStyle.fsUnderline in AFont.Style) or (TFontStyle.fsStrikeOut in AFont.Style) then + begin + ATextStyle.DecorationColor := MakeColor(Color, FOpacity); + if TFontStyle.fsUnderline in AFont.Style then + ATextStyle.Decorations := ATextStyle.Decorations + [TSkTextDecoration.Underline]; + if TFontStyle.fsStrikeOut in AFont.Style then + ATextStyle.Decorations := ATextStyle.Decorations + [TSkTextDecoration.LineThrough]; + end; + end; + + function CreateTextStyle(const AAttribute: TTextAttribute): ISkTextStyle; + begin + Result := TSkTextStyle.Create; + if AAttribute.Font <> nil then + InitializeTextStyle(Result, AAttribute.Font, AAttribute.Color) + else + InitializeTextStyle(Result, Font, AAttribute.Color); + end; + + function CreateDefaultTextStyle: ISkTextStyle; + begin + Result := TSkTextStyle.Create; + InitializeTextStyle(Result, Font, Color); + end; + + function CreateParagraphStyle(const AAttributes: TArray; + AMaxLines: Integer): ISkParagraphStyle; + const + SkTextAlign: array[TTextAlign] of TSkTextAlign = (TSkTextAlign.Center, TSkTextAlign.Start, TSkTextAlign.Terminate); + var + LAttribute: TTextAttributedRange; + LMinFontSize: Single; + begin + Result := TSkParagraphStyle.Create; + if RightToLeft then + Result.TextDirection := TSkTextDirection.RightToLeft; + if Trimming in [TTextTrimming.Character, TTextTrimming.Word] then + Result.Ellipsis := '...'; + if WordWrap then + begin + if AMaxLines <= 0 then + Result.MaxLines := High(Integer) + else + Result.MaxLines := AMaxLines; + end + else + Result.MaxLines := 1; + if NeedHorizontalAlignment then + begin + if RightToLeft then + Result.TextAlign := TSkTextAlign.Terminate + else + Result.TextAlign := TSkTextAlign.Start; + end + else + Result.TextAlign := SkTextAlign[HorizontalAlign]; + Result.TextStyle := CreateDefaultTextStyle; + if Result.MaxLines = NativeUInt(High(Integer)) then + begin + LMinFontSize := Result.TextStyle.FontSize; + for LAttribute in AAttributes do + LMinFontSize := Min(LMinFontSize, LAttribute.Attribute.Font.Size); + if LMinFontSize > 0.1 then begin - LImage := BitmapToSkImage(ABrush.Bitmap.Bitmap); - if Assigned(LImage) then + AMaxLines := Ceil(MaxSize.Y / LMinFontSize); + if AMaxLines > 0 then + Result.MaxLines := AMaxLines; + end; + end; + end; + + // Temporary solution to fix an issue with Skia + // https://bugs.chromium.org/p/skia/issues/detail?id=13117 + // + // SkParagraph has several issues with the #13 line break, so the best thing + // to do is replace it with #10 or a zero-widh character (#8203) + function NormalizeParagraphText(const AText: string): string; inline; + begin + Result := AText.Replace(#13#10, ZeroWidthChar + #10).Replace(#13, #10); + end; + + function CreateParagraph(const AMaxLines: Integer; const ASubText: string; + const ASubTextPosition: Integer): ISkParagraph; + var + LAttribute: TTextAttributedRange; + LAttributes: TArray; + LBuilder: ISkParagraphBuilder; + LLastAttributeEndIndex: Integer; + LText: string; + begin + FColor := Color; + FOpacity := Opacity; + LAttributes := GetNormalizedAttributes(ASubText, ASubTextPosition); + try + LBuilder := TSkParagraphBuilder.Create(CreateParagraphStyle(LAttributes, AMaxLines), TSkDefaultProviders.TypefaceFont); + LLastAttributeEndIndex := 0; + for LAttribute in LAttributes do + begin + if LLastAttributeEndIndex < LAttribute.Range.Pos then + LBuilder.AddText(ASubText.Substring(LLastAttributeEndIndex, LAttribute.Range.Pos - LLastAttributeEndIndex)); + LText := NormalizeParagraphText(ASubText.Substring(LAttribute.Range.Pos, LAttribute.Range.Length)); + if not LText.IsEmpty then begin - if ABrush.Bitmap.WrapMode = TWrapMode.TileStretch then - APaint.Shader := LImage.MakeShader(TMatrix.CreateScaling(ARect.Width / LImage.Width, ARect.Height / LImage.Height) * TMatrix.CreateTranslation(ARect.Left, ARect.Top), GetSamplingOptions) - else - APaint.Shader := LImage.MakeShader(GetSamplingOptions, WrapMode[ABrush.Bitmap.WrapMode], WrapMode[ABrush.Bitmap.WrapMode]); - APaint.AlphaF := AOpacity; - end - else - APaint.Alpha := 0; + LBuilder.PushStyle(CreateTextStyle(LAttribute.Attribute)); + LBuilder.AddText(LText); + LBuilder.Pop; + end; + LLastAttributeEndIndex := LAttribute.Range.Pos + LAttribute.Range.Length; end; + if LLastAttributeEndIndex < ASubText.Length then + LBuilder.AddText(ASubText.Substring(LLastAttributeEndIndex, ASubText.Length - LLastAttributeEndIndex)); + finally + for LAttribute in LAttributes do + LAttribute.DisposeOf; + end; + Result := LBuilder.Build; + end; + + procedure DoUpdateParagraph(var AParagraph: TParagraph; + const ASubText: string; const AMaxLines: Integer); + {$IF CompilerVersion < 29} + const + MaxLayoutSize: TPointF = (X: $FFFF; Y: $FFFF); + {$ENDIF} + var + LMetrics: TSkMetrics; + begin + AParagraph.Paragraph := CreateParagraph(AMaxLines, ASubText, AParagraph.Range.Pos); + if NeedHorizontalAlignment then + AParagraph.Paragraph.Layout(MaxLayoutSize.X) + else + AParagraph.Paragraph.Layout(MaxSize.X - Padding.Left - Padding.Right); + if WordWrap and (AParagraph.Paragraph.Height > MaxSize.Y - Padding.Top - Padding.Bottom) then + begin + for LMetrics in AParagraph.Paragraph.LineMetrics do + begin + if (LMetrics.LineNumber <> 0) and (LMetrics.Baseline + LMetrics.Descent > MaxSize.Y - Padding.Top - Padding.Bottom) then + begin + AParagraph.Paragraph := CreateParagraph(LMetrics.LineNumber, ASubText, AParagraph.Range.Pos); + AParagraph.Paragraph.Layout(MaxSize.X - Padding.Left - Padding.Right); + Break; + end; + end; + end; + end; + +var + I: Integer; + LLimitedLines: Boolean; + LLines: TArray; + LMaxLines: Integer; + LPos: Integer; + LText: string; +begin + LText := Text; + + {$REGION ' - Workaround RSP-38480'} + // - ------------------------------------------------------------------------- + // - WORKAROUND + // - ------------------------------------------------------------------------- + // - + // - Description: + // - This code is a workaround intended to fix issues with controls that + // - create the TTextLayout but doesn't set the TTextLayout.RightToLeft, + // - like the TText control. + // - This code is a workaround intended to fix issues with function + // - FMX.Types.DelAmp with results in texts with #0 char at end of string + // - when the original text contains a '&' char + // - + // - Bug report: + // - https://quality.embarcadero.com/browse/RSP-38480 + // - + // - ------------------------------------------------------------------------- + {$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion112))} + if LText.EndsWith(#0) then + LText := LText.Substring(0, LText.Length - 1) + ZeroWidthChar; + {$ENDIF} + // - ------------------------------------------------------------------------- + {$ENDREGION} + + if WordWrap or LText.IsEmpty then + LLines := [LText] + else + LLines := LText.Replace(#13#10, ZeroWidthChar + #10).Replace(#13, #10).Replace(#10, ZeroWidthChar + #10).Split([#10]); + LPos := 0; + LMaxLines := FMaxLines; + LLimitedLines := FMaxLines <> 0; + SetLength(FParagraphs, Length(LLines)); + for I := 0 to Length(LLines) - 1 do + begin + FParagraphs[I].Range := TTextRange.Create(LPos, LLines[I].Length); + if LMaxLines = -1 then + begin + FParagraphs[I].Bounds := TRectF.Empty; + FParagraphs[I].Paragraph := nil; + FParagraphs[I].Offset := PointF(0, 0); + end + else + begin + DoUpdateParagraph(FParagraphs[I], LLines[I], LMaxLines); + if LLimitedLines then + begin + Dec(LMaxLines, Length(FParagraphs[I].Paragraph.LineMetrics)); + if LMaxLines <= 0 then + LMaxLines := -1; + end; + end; + Inc(LPos, LLines[I].Length); + end; +end; + +{ TSkBitmapHandleCodec } + +class constructor TSkBitmapHandleCodec.Create; +begin + RegisterIfNotExists('.bmp', SVBitmaps, False); + RegisterIfNotExists('.gif', SVGIFImages, False); + RegisterIfNotExists('.ico', SVIcons, False); + RegisterIfNotExists('.wbmp', SWBMPImages, False); + RegisterIfNotExists('.webp', SVWEBPImages, True); + {$IFNDEF MSWINDOWS} + RegisterIfNotExists('.arw', SRawSony, False); + RegisterIfNotExists('.cr2', SRawCanon, False); + RegisterIfNotExists('.dng', SRawDNG, False); + RegisterIfNotExists('.nef', SRawNikon, False); + RegisterIfNotExists('.nrw', SRawNikon, False); + RegisterIfNotExists('.orf', SRawORF, False); + RegisterIfNotExists('.raf', SRawRAF, False); + RegisterIfNotExists('.rw2', SRawPanasonic, False); + RegisterIfNotExists('.pef', SRawPEF, False); + RegisterIfNotExists('.srw', SRawSRW, False); + {$ENDIF} +end; + +function TSkBitmapHandleCodec.FitSize(const AWidth, AHeight: Integer; + const AFitWidth, AFitHeight: Single): TSize; +var + LRatio: Single; +begin + if (AWidth / AFitWidth) > (AHeight / AFitHeight) then + LRatio := AWidth / AFitWidth + else + LRatio := AHeight / AFitHeight; + if LRatio < 1 then + Result := TSize.Create(AWidth, AHeight) + else + Result := TSize.Create(Trunc((AWidth + Epsilon) / LRatio), Trunc((AHeight + Epsilon) / LRatio)); +end; + +class function TSkBitmapHandleCodec.GetImageSize( + const AFileName: string): TPointF; +var + LCodec: ISkCodec; +begin + LCodec := TSkCodec.MakeFromFile(AFileName); + if not Assigned(LCodec) then + Exit(TPointF.Create(0, 0)); + Result := TPointF.Create(LCodec.Width, LCodec.Height); +end; + +class function TSkBitmapHandleCodec.IsValid(const AStream: TStream): Boolean; + + function IsValid(const AMemoryStream: TCustomMemoryStream): Boolean; inline; + begin + Result := Assigned(TSkCodec.MakeWithoutCopy(AMemoryStream.Memory, AMemoryStream.Size)); + end; + +var + LMemoryStream: TMemoryStream; +begin + if AStream is TCustomMemoryStream then + Result := IsValid(TCustomMemoryStream(AStream)) + else + begin + LMemoryStream := TMemoryStream.Create; + try + LMemoryStream.CopyFrom(AStream, 0); + Result := IsValid(LMemoryStream); + finally + LMemoryStream.Free; + end; end; end; -function TSkCanvasCustom.StrokeBrushToSkPaint(const ABrush: TStrokeBrush; - const ARect: TRectF; const AOpacity: Single): ISkPaint; -const - StrokeCap : array[TStrokeCap] of TSkStrokeCap = (TSkStrokeCap.Square, TSkStrokeCap.Round); - StrokeJoin : array[TStrokeJoin] of TSkStrokeJoin = (TSkStrokeJoin.Miter, TSkStrokeJoin.Round, TSkStrokeJoin.Bevel); +function TSkBitmapHandleCodec.LoadFromFile(const AFileName: string; + const ABitmapSurface: TBitmapSurface; const AMaxSizeLimit: Cardinal): Boolean; var - I: Integer; - LCap: Single; - LDash: TDashArray; + LCodec: ISkCodec; + LImage: ISkImage; + LSize: TSize; begin - Result := TSkPaint.Create(TSkPaintStyle.Stroke); - SetupBrush(ABrush, ARect, AOpacity, Result); - Result.StrokeCap := StrokeCap[ABrush.Cap]; - Result.StrokeJoin := StrokeJoin[ABrush.Join]; - Result.StrokeWidth := ABrush.Thickness; - LDash := ABrush.DashArray; - if Length(LDash) > 0 then + LCodec := TSkCodec.MakeFromFile(AFileName); + if not Assigned(LCodec) then + Exit(False); + if AMaxSizeLimit > 0 then begin - if ABrush.Dash = TStrokeDash.Custom then - LCap := ABrush.Thickness + LSize := FitSize(LCodec.Width, LCodec.Height, AMaxSizeLimit, AMaxSizeLimit); + ABitmapSurface.SetSize(LSize.Width, LSize.Height, SkFmxPixelFormat[SkNative32ColorType]); + LImage := LCodec.GetImage(SkNative32ColorType); + Result := (Assigned(LImage)) and (LImage.ScalePixels(TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height), ABitmapSurface.Bits, ABitmapSurface.Pitch, TSkImageCachingHint.Disallow)); + end + else + begin + ABitmapSurface.SetSize(LCodec.Width, LCodec.Height, SkFmxPixelFormat[SkNative32ColorType]); + Result := LCodec.GetPixels(ABitmapSurface.Bits, ABitmapSurface.Pitch, SkNative32ColorType); + end; +end; + +function TSkBitmapHandleCodec.LoadFromStream(const AStream: TStream; + const ABitmapSurface: TBitmapSurface; const AMaxSizeLimit: Cardinal): Boolean; + + function LoadFromStream(const AMemoryStream: TCustomMemoryStream): Boolean; + var + LCodec: ISkCodec; + LImage: ISkImage; + LSize: TSize; + begin + LCodec := TSkCodec.MakeWithoutCopy(AMemoryStream.Memory, AMemoryStream.Size); + if not Assigned(LCodec) then + Exit(False); + if AMaxSizeLimit > 0 then + begin + LSize := FitSize(LCodec.Width, LCodec.Height, AMaxSizeLimit, AMaxSizeLimit); + ABitmapSurface.SetSize(LSize.Width, LSize.Height, SkFmxPixelFormat[SkNative32ColorType]); + LImage := LCodec.GetImage(SkNative32ColorType); + Result := (Assigned(LImage)) and (LImage.ScalePixels(TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height), ABitmapSurface.Bits, ABitmapSurface.Pitch, TSkImageCachingHint.Disallow)); + end else - LCap := 0; - for I := 0 to Length(LDash) - 1 do begin - if Odd(I) then - LDash[I] := (LDash[I] + 1) * ABrush.Thickness - LCap - else - LDash[I] := (LDash[I] - 1) * ABrush.Thickness + LCap; + ABitmapSurface.SetSize(LCodec.Width, LCodec.Height, SkFmxPixelFormat[SkNative32ColorType]); + Result := LCodec.GetPixels(ABitmapSurface.Bits, ABitmapSurface.Pitch, SkNative32ColorType); end; - Result.PathEffect := TSkPathEffect.MakeDash(TArray(LDash), ABrush.DashOffset * ABrush.Thickness); end; -end; - -{ TSkCanvasCustom.TSaveState } -procedure TSkCanvasCustom.TSaveState.Assign(ASource: TPersistent); +var + LMemoryStream: TMemoryStream; begin - inherited; - if ASource is TSkCanvasCustom then - TSkCanvasCustom(ASource).Save; + if AStream is TCustomMemoryStream then + Result := LoadFromStream(TCustomMemoryStream(AStream)) + else + begin + LMemoryStream := TMemoryStream.Create; + try + LMemoryStream.CopyFrom(AStream, 0); + Result := LoadFromStream(LMemoryStream); + finally + LMemoryStream.Free; + end; + end; end; -procedure TSkCanvasCustom.TSaveState.AssignTo(ADest: TPersistent); +function TSkBitmapHandleCodec.LoadThumbnailFromFile(const AFileName: string; + const AFitWidth, AFitHeight: Single; const AUseEmbedded: Boolean; + const ABitmapSurface: TBitmapSurface): Boolean; +var + LCodec: ISkCodec; + LImage: ISkImage; + LSize: TSize; begin - inherited; - if ADest is TSkCanvasCustom then - TSkCanvasCustom(ADest).Restore; + LCodec := TSkCodec.MakeFromFile(AFileName); + if not Assigned(LCodec) then + Exit(False); + LSize := FitSize(LCodec.Width, LCodec.Height, AFitWidth, AFitHeight); + ABitmapSurface.SetSize(LSize.Width, LSize.Height, SkFmxPixelFormat[SkNative32ColorType]); + LImage := LCodec.GetImage(SkNative32ColorType); + Result := (Assigned(LImage)) and (LImage.ScalePixels(TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height), ABitmapSurface.Bits, ABitmapSurface.Pitch, TSkImageCachingHint.Disallow)); end; -{ TSkCanvasRasterCustom } - -function TSkCanvasRasterCustom.BeginWindow( - const AContextHandle: THandle): ISkSurface; +class procedure TSkBitmapHandleCodec.RegisterIfNotExists(const AFileExtension, + ADescription: string; const ACanSave: Boolean); begin - if FBufferHandle = 0 then - FBufferHandle := CreateBuffer; - Result := CreateWindowSurface(AContextHandle, FBufferHandle); + if not TBitmapCodecManager.CodecExists(AFileExtension) then + TBitmapCodecManager.RegisterBitmapCodecClass(AFileExtension, ADescription, ACanSave, TSkBitmapHandleCodec); end; -destructor TSkCanvasRasterCustom.Destroy; +function TSkBitmapHandleCodec.SaveToFile(const AFileName: string; + const ABitmapSurface: TBitmapSurface; + const ASaveParams: PBitmapCodecSaveParams): Boolean; +var + LQuality: Integer; begin - if FBufferHandle <> 0 then - FreeBuffer(FBufferHandle); - inherited; + if ASaveParams <> nil then + LQuality := ASaveParams.Quality + else + LQuality := 100; + TSkImageEncoder.EncodeToFile(AFileName, TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height, SkFmxColorType[ABitmapSurface.PixelFormat]), ABitmapSurface.Bits, ABitmapSurface.Pitch, LQuality); + Result := True; end; -procedure TSkCanvasRasterCustom.EndWindow; +function TSkBitmapHandleCodec.SaveToStream(const AStream: TStream; + const ABitmapSurface: TBitmapSurface; const AExtension: string; + const ASaveParams: PBitmapCodecSaveParams): Boolean; +var + LQuality: Integer; begin - Flush(FBufferHandle); + if ASaveParams <> nil then + LQuality := ASaveParams.Quality + else + LQuality := 100; + TSkImageEncoder.EncodeToStream(AStream, TSkImageInfo.Create(ABitmapSurface.Width, ABitmapSurface.Height, SkFmxColorType[ABitmapSurface.PixelFormat]), ABitmapSurface.Bits, ABitmapSurface.Pitch, ExtensionToEncodedImageFormat(AExtension), LQuality); + Result := True; +end; + +{$IF DEFINED(MSWINDOWS)} + +{ TSkRasterWindowsCanvas } + +function TSkRasterWindowsCanvas.CreateSurfaceFromWindow( + const AContextHandle: THandle): ISkSurface; +var + LBitmapInfo: TBitmapInfo; + LHeight: Integer; + LWidth: Integer; +begin + LWidth := Round(Width * Scale); + LHeight := Round(Height * Scale); + if FBitmap = 0 then + begin + FillChar(LBitmapInfo, SizeOf(TBitmapInfo), 0); + FillChar(LBitmapInfo, 0, SizeOf(TBitmapInfo)); + LBitmapInfo.bmiHeader.biSize := SizeOf(TBitmapInfoHeader); + LBitmapInfo.bmiHeader.biWidth := LWidth; + LBitmapInfo.bmiHeader.biHeight := -LHeight; + LBitmapInfo.bmiHeader.biPlanes := 1; + LBitmapInfo.bmiHeader.biBitCount := 32; + LBitmapInfo.bmiHeader.biCompression := BI_RGB; + LBitmapInfo.bmiHeader.biSizeImage := LWidth * LHeight * SkBytesPerPixel[TSkColorType.BGRA8888]; + FBitmap := CreateDIBSection(0, LBitmapInfo, DIB_RGB_COLORS, FBits, 0, 0); + if FBitmap = 0 then + raise ESkCanvas.Create('Could not create a DIB.'); + end; + FDC := HDC(AContextHandle); + Result := TSkSurface.MakeRasterDirect(TSkImageInfo.Create(LWidth, LHeight, TSkColorType.BGRA8888), FBits, LWidth * SkBytesPerPixel[TSkColorType.BGRA8888]); +end; + +destructor TSkRasterWindowsCanvas.Destroy; +begin + if FBitmap <> 0 then + DeleteObject(FBitmap); + inherited; end; -procedure TSkCanvasRasterCustom.Resized; +procedure TSkRasterWindowsCanvas.DoEndScene; +var + LBitmapDC: HDC; begin inherited; - if FBufferHandle <> 0 then + if Parent <> nil then begin - FreeBuffer(FBufferHandle); - FBufferHandle := 0; + if FDC <> 0 then + begin + LBitmapDC := CreateCompatibleDC(0); + if LBitmapDC = 0 then + raise ESkCanvas.Create('Could not create a DC.'); + try + if SelectObject(LBitmapDC, FBitmap) = 0 then + raise ESkCanvas.Create('Could not select the bitmap in to the DC.'); + if not BitBlt(FDC, 0, 0, Round(Width * Scale), Round(Height * Scale), LBitmapDC, 0, 0, SRCCOPY) then + raise ESkCanvas.Create('Unable to move pixels to window context.'); + finally + DeleteDC(LBitmapDC); + end; + end; end; end; -{ TGrCanvasCustom } - -function TGrCanvasCustom.BeginWindow(const AContextHandle: THandle): ISkSurface; +procedure TSkRasterWindowsCanvas.Resized; begin - if not FContextInitialized then - begin - FContextInitialized := InitializeContext; - if not FContextInitialized then - Exit(nil); - end; - PrepareContext; - if not Assigned(FContext) then + if FBitmap <> 0 then begin - FContext := CreateDirectContext; - if not Assigned(FContext) then - Exit(nil); + DeleteObject(FBitmap); + FBitmap := 0; end; - Result := CreateSurfaceFromWindow; end; -class procedure TGrCanvasCustom.ClearCache(const ACanvas: TSkCanvasCustom); -begin - TGrCanvasCustom(ACanvas).PrepareContext; - inherited; -end; +{$ELSEIF DEFINED(MACOS) and NOT DEFINED(IOS)} -function TGrCanvasCustom.CreateCache(const AWidth, AHeight: Integer; - const AColorType: TSkColorType; const APixels: Pointer; - const ARowBytes: NativeUInt): ISkImage; +{ TSkRasterMacOSCanvas } + +function TSkRasterMacOSCanvas.CreateSurfaceFromWindow( + const AContextHandle: THandle): ISkSurface; +var + LHeight: Integer; + LWidth: Integer; begin - Result := inherited; - Result := Result.MakeTextureImage(FContext); + LWidth := Round(Width * Scale); + LHeight := Round(Height * Scale); + if FBitmapContext = nil then + begin + FBitmapContext := CGBitmapContextCreate(nil, LWidth, LHeight, 8, LWidth * SkBytesPerPixel[TSkColorType.RGBA8888], FColorSpace, kCGImageAlphaPremultipliedLast); + if FBitmapContext = nil then + raise ESkCanvas.Create('Could not create a bitmap graphics context.'); + end; + FContext := CGContextRef(AContextHandle); + Result := TSkSurface.MakeRasterDirect(TSkImageInfo.Create(LWidth, LHeight, TSkColorType.RGBA8888), CGBitmapContextGetData(FBitmapContext), LWidth * SkBytesPerPixel[TSkColorType.RGBA8888]); end; -destructor TGrCanvasCustom.Destroy; +destructor TSkRasterMacOSCanvas.Destroy; begin - if FContextInitialized then - FinalizeContext; + if FBitmapContext <> nil then + CGContextRelease(FBitmapContext); inherited; end; -procedure TGrCanvasCustom.DestroyWindow; +procedure TSkRasterMacOSCanvas.DoEndScene; +var + LImage: CGImageRef; begin - if Assigned(FContext) then + inherited; + if Parent <> nil then begin - PrepareContext; - TMessageManager.DefaultManager.SendMessage(Self, TSkContextBeforeDestructionMessage.Create); - inherited; - FContext := nil; + LImage := CGBitmapContextCreateImage(FBitmapContext); + if LImage = nil then + raise ESkCanvas.Create('Could not create a image from the pixel data in a bitmap graphics context.'); + try + CGContextDrawImage(FContext, CGRectMake(0, 0, Width, Height), LImage); + finally + CGImageRelease(LImage); + end; end; end; -class procedure TGrCanvasCustom.DoClearCacheBitmap( - const ACanvas: TSkCanvasCustom; const ABitmapHandle: THandle); +class procedure TSkRasterMacOSCanvas.Finalize; begin - TGrCanvasCustom(ACanvas).PrepareContext; + CGColorSpaceRelease(FColorSpace); inherited; end; -procedure TGrCanvasCustom.EndWindow; +class procedure TSkRasterMacOSCanvas.Initialize; begin - FSurface.FlushAndSubmit; - FSurface := nil; - FContext.FlushAndSubmit; - Flush; + inherited; + try + FColorSpace := CGColorSpaceCreateDeviceRGB; + if FColorSpace = nil then + raise ESkCanvas.Create('Could not create a device-dependent RGB color space.'); + except + inherited Finalize; + raise; + end; end; -procedure TGrCanvasCustom.PrepareContext; +procedure TSkRasterMacOSCanvas.Resized; begin + if FBitmapContext <> nil then + begin + CGContextRelease(FBitmapContext); + FBitmapContext := nil; + end; end; -procedure TGrCanvasCustom.Restore; -begin - if Parent <> nil then - PrepareContext; - inherited; -end; +{$ENDIF} + +(*$HPPEMIT 'namespace Skia {'*) +(*$HPPEMIT ' namespace Fmx {'*) +(*$HPPEMIT ' namespace Types { using namespace ::Fmx::Types; }'*) +(*$HPPEMIT ' namespace Graphics { using namespace ::Fmx::Graphics; }'*) +(*$HPPEMIT ' namespace Textlayout { using namespace ::Fmx::Textlayout; }'*) +(*$HPPEMIT ' }'*) +(*$HPPEMIT '}'*) + +{$HPPEMIT NOUSINGNAMESPACE} +{$HPPEMIT END '#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_SKIA)'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::_di_IGrCanvasSharedResources;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::EGrCanvas;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::ESkCanvas;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::IGrCanvasSharedResources;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::TGrBeforeSharedContextDestructionMessage;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::TGrBitmapHandle;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::TGrCanvas;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::TGrCanvasSharedResources;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::TSkBitmapHandle;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::TSkCanvasBase;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::TSkCanvasCustom;'} +{$HPPEMIT END ' using ::Skia::Fmx::Graphics::TSkTextLayout;'} +{$HPPEMIT END '#endif'} {$REGION ' - Workaround RSP-36957'} // - --------------------------------------------------------------------------- @@ -2101,10 +2404,7 @@ procedure TGrCanvasCustom.Restore; // - https://quality.embarcadero.com/browse/RSP-36957 // - // - --------------------------------------------------------------------------- -{$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the issue has been fixed'} -{$ENDIF} -// - --------------------------------------------------------------------------- +{$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion112))} {$IF DEFINED(ANDROID) or DEFINED(IOS)} type @@ -2207,6 +2507,7 @@ procedure TRSP36957Workaround.TContextOpenGLPatch.DoCopyToBits( end; end; +{$ENDIF} {$ENDIF} // - --------------------------------------------------------------------------- {$ENDREGION} @@ -2224,10 +2525,7 @@ procedure TRSP36957Workaround.TContextOpenGLPatch.DoCopyToBits( // - https://quality.embarcadero.com/browse/RSP-37147 // - // - --------------------------------------------------------------------------- -{$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the issue has been fixed'} -{$ENDIF} -// - --------------------------------------------------------------------------- +{$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion112))} {$IFDEF MACOS} type @@ -2238,9 +2536,6 @@ TRSP37147Workaround = record {$RTTI EXPLICIT METHODS([vcProtected])} TContextMetalPatch = class(TCustomContextMetal) protected - {$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the private fields of the FMX.Context.Metal.TContextMetal is the same below and in the same order'} - {$ENDIF} FPipelineStateConfiguration: TPipelineStateConfiguration; FDepthStencilStateConfiguration: TDepthStencilStateConfiguration; FCommandQueue: MTLCommandQueue; @@ -2381,6 +2676,7 @@ procedure TRSP37147Workaround.TContextMetalPatch.DoCopyToBits( end; end; +{$ENDIF} {$ENDIF} // - --------------------------------------------------------------------------- {$ENDREGION} @@ -2398,10 +2694,7 @@ procedure TRSP37147Workaround.TContextMetalPatch.DoCopyToBits( // - https://quality.embarcadero.com/browse/RSP-37829 // - // - --------------------------------------------------------------------------- -{$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the issue has been fixed'} -{$ENDIF} -// - --------------------------------------------------------------------------- +{$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion112))} {$IFDEF MACOS} type @@ -2416,9 +2709,6 @@ TRSP37829Workaround = record {$RTTI EXPLICIT METHODS([vcProtected])} TContextMetalPatch = class(TCustomContextMetal) protected - {$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the private fields of the FMX.Context.Metal.TContextMetal is the same below and in the same order'} - {$ENDIF} FPipelineStateConfiguration: TPipelineStateConfiguration; FDepthStencilStateConfiguration: TDepthStencilStateConfiguration; FCommandQueue: MTLCommandQueue; @@ -2497,6 +2787,7 @@ procedure TRSP37829Workaround.TContextMetalPatch.DoEndScene; FCommandBuffer.waitUntilCompleted; end; +{$ENDIF} {$ENDIF} // - --------------------------------------------------------------------------- {$ENDREGION} @@ -2518,10 +2809,7 @@ procedure TRSP37829Workaround.TContextMetalPatch.DoEndScene; // - https://quality.embarcadero.com/browse/RSP-37660 // - // - --------------------------------------------------------------------------- -{$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the issue has been fixed'} -{$ENDIF} -// - --------------------------------------------------------------------------- +{$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion112))} {$IFDEF IOS} type @@ -2529,9 +2817,6 @@ procedure TRSP37829Workaround.TContextMetalPatch.DoEndScene; TRSP37660Workaround = record strict private type - {$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the unit "FMX.MediaLibrary.IOS" has been changed, and apply all changes to this workaround'} - {$ENDIF} TImageDelegate = class; TImageManagerCocoa = class; @@ -3032,37 +3317,33 @@ procedure TRSP37660Workaround.TShareService.Share(const AControl: TControl; end; end; +{$ENDIF} {$ENDIF} // - --------------------------------------------------------------------------- {$ENDREGION} {$REGION '- Canvas Registration'} - type + TSkCanvasClass = class of TSkCanvasBase; + { TSkCanvasService } TSkCanvasService = class(TInterfacedObject, IFMXCanvasService) - strict private class var - FDefaultPixelFormat: TPixelFormat; strict private FCanvasClass: TSkCanvasClass; FCurrent: IFMXCanvasService; - {$IFDEF DEBUG} - strict private + {$IFDEF DEBUG} FGlobalUseSkiaInRegistration: Boolean; FMainFormChangedMessageId: Integer; procedure MainFormChangedChangeHandler(const ASender: TObject; const AMessage: System.Messaging.TMessage); - {$ENDIF} - strict private + {$ENDIF} procedure RegisterCanvasClasses; procedure UnregisterCanvasClasses; - class function GetCanvasClass: TSkCanvasClass; static; inline; public constructor Create(const ACurrent: IFMXCanvasService); {$IFDEF DEBUG} destructor Destroy; override; {$ENDIF} - class property DefaultPixelFormat: TPixelFormat read FDefaultPixelFormat; end; { TSkCanvasService } @@ -3085,66 +3366,53 @@ destructor TSkCanvasService.Destroy; inherited; end; -{$ENDIF} - -class function TSkCanvasService.GetCanvasClass: TSkCanvasClass; -begin - {$IF DEFINED(MSWINDOWS)} - if (GlobalUseSkiaRasterWhenAvailable) or (not TGrCanvasGL.Initialize) then - begin - if not TSkCanvasRasterWindows.Initialize then - Exit(nil); - Result := TSkCanvasRasterWindows - end - else - Result := TGrCanvasGL; - {$ELSE} - {$IF DEFINED(MACOS)} - if GlobalUseMetal then - Result := TGrCanvasMetal - else - {$IFDEF IOS} - Result := TGrCanvasGL; - {$ELSE} - Result := TSkCanvasRasterMacOS; - {$ENDIF} - {$ELSEIF DEFINED(ANDROID)} - Result := TGrCanvasGL; - {$ELSE} - Result := nil; - {$ENDIF} - if Assigned(Result) and not Result.Initialize then - Result := nil; - {$ENDIF} -end; - -{$IFDEF DEBUG} - procedure TSkCanvasService.MainFormChangedChangeHandler(const ASender: TObject; const AMessage: System.Messaging.TMessage); +const + MessageText = 'Your declaration of GlobalUseSkia has no effect because the ' + + 'canvas service has already been started. In this case, just ' + + 'create a unit in the project like "Project.Startup.pas", ' + + 'place the GlobalUseSkia declaration in the initialization of' + + ' this new unit, and declare this new unit before any other ' + + 'unit of yours in the .dpr, that is, right after FMX.Forms.'; begin TMessageManager.DefaultManager.Unsubscribe(TMainFormChangedMessage, FMainFormChangedMessageId); FMainFormChangedMessageId := 0; if FGlobalUseSkiaInRegistration <> GlobalUseSkia then - begin - raise ESkCanvas.Create('Your declaration of GlobalUseSkia has no effect because the canvas service '+ - 'has already been started. In this case, just create a unit in the project like "Project.Startup.pas", '+ - 'place the GlobalUseSkia declaration in the initialization of this new unit, and declare this new unit '+ - 'before any other unit of yours in the .dpr, that is, right after FMX.Forms.'); - end; + raise ESkCanvas.Create(MessageText); end; {$ENDIF} procedure TSkCanvasService.RegisterCanvasClasses; begin + TSkTextLayout.Initialize; if Assigned(FCurrent) then begin if GlobalUseSkia then begin - FCanvasClass := GetCanvasClass; + {$IF DEFINED(MSWINDOWS)} + if GlobalUseSkiaRasterWhenAvailable then + FCanvasClass := TSkRasterWindowsCanvas + else + FCanvasClass := TGlCanvas; + {$ELSEIF DEFINED(MACOS)} + if GlobalUseMetal then + FCanvasClass := TMtlCanvas + else + {$IFDEF IOS} + FCanvasClass := TGlCanvas; + {$ELSE} + FCanvasClass := TSkRasterMacOSCanvas; + {$ENDIF} + {$ELSEIF DEFINED(ANDROID)} + FCanvasClass := TGlCanvas; + {$ELSE} + FCanvasClass := nil; + {$ENDIF} if Assigned(FCanvasClass) then begin + FCanvasClass.Initialize; // Ensuring that our canvas will be chosen as the default TCanvasManager.EnableSoftwareCanvas(True); TCanvasManager.RegisterCanvas(FCanvasClass, True, False); @@ -3159,6 +3427,7 @@ procedure TSkCanvasService.RegisterCanvasClasses; TBitmapCodecManager.RegisterBitmapCodecClass('.png', SVPNGImages, True, TSkBitmapHandleCodec); end; // Apply workarounds + {$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion112))} {$IF DEFINED(ANDROID) or DEFINED(IOS)} TRSP36957Workaround.Apply; {$ENDIF} @@ -3171,6 +3440,7 @@ procedure TSkCanvasService.RegisterCanvasClasses; {$IFDEF IOS} TRSP37660Workaround.Apply; {$ENDIF} + {$ENDIF} end; end; FCurrent.RegisterCanvasClasses; diff --git a/skia4delphi/Source/FMX/Skia.FMX.pas b/skia4delphi/Source/FMX/Skia.FMX.pas index 328cccf..77296fd 100644 --- a/skia4delphi/Source/FMX/Skia.FMX.pas +++ b/skia4delphi/Source/FMX/Skia.FMX.pas @@ -21,16 +21,16 @@ interface System.Types, System.UITypes, System.Classes, + System.Math, System.Messaging, + System.Generics.Collections, FMX.Types, FMX.Graphics, FMX.Controls, - FMX.Ani, FMX.ActnList, { Skia } - Skia, - Skia.FMX.Graphics; + Skia; const {$IF CompilerVersion < 33} @@ -38,7 +38,7 @@ interface {$ELSEIF CompilerVersion < 35} SkSupportedPlatformsMask = pidWin32 or pidWin64 or pidAndroid32Arm or pidAndroid64Arm; {$ELSE} - SkSupportedPlatformsMask = pidWin32 or pidWin64 or pidLinux64 or pidAndroidArm32 or pidAndroidArm64 or pidiOSDevice64 or pidOSX64 or pidOSXArm64; + SkSupportedPlatformsMask = pidAllPlatforms; {$ENDIF} type @@ -54,6 +54,7 @@ ESkLabel = class(ESkFMX); TSkBitmapHelper = class helper for TBitmap public + constructor CreateFromSkImage(const AImage: ISkImage); procedure SkiaDraw(const AProc: TSkDrawProc; const AStartClean: Boolean = True); function ToSkImage: ISkImage; end; @@ -62,11 +63,52 @@ TSkBitmapHelper = class helper for TBitmap TSkPathDataHelper = class helper for TPathData public + constructor CreateFromSkPath(const AValue: ISkPath); procedure AddSkPath(const AValue: ISkPath); - procedure FromSkPath(const AValue: ISkPath); + procedure FromSkPath(const AValue: ISkPath); deprecated 'Use TPathData.CreateFromSkPath instead'; function ToSkPath: ISkPath; end; + { TSkPersistent } + + TSkPersistent = class(TPersistent) + strict private + FChanged: Boolean; + FCreated: Boolean; + FIgnoringAllChanges: Boolean; + FOnChange: TNotifyEvent; + FUpdatingCount: Integer; + function GetUpdating: Boolean; + protected + procedure DoAssign(ASource: TPersistent); virtual; + procedure DoChanged; virtual; + function GetHasChanged: Boolean; virtual; + function SetValue(var AField: Byte; const AValue: Byte): Boolean; overload; + function SetValue(var AField: Word; const AValue: Word): Boolean; overload; + function SetValue(var AField: Cardinal; const AValue: Cardinal): Boolean; overload; + function SetValue(var AField: Boolean; const AValue: Boolean): Boolean; overload; + function SetValue(var AField: Integer; const AValue: Integer): Boolean; overload; + function SetValue(var AField: Int64; const AValue: Int64): Boolean; overload; + function SetValue(var AField: Single; const AValue: Single; const AEpsilon: Single = 0.0): Boolean; overload; + function SetValue(var AField: Double; const AValue: Double; const AEpsilon: Double = 0.0): Boolean; overload; + function SetValue(var AField: TBytes; const AValue: TBytes): Boolean; overload; + function SetValue(var AField: string; const AValue: string): Boolean; overload; + function SetValue(var AField: T; const AValue: T): Boolean; overload; + property Created: Boolean read FCreated; + property UpdatingCount: Integer read FUpdatingCount; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + public + procedure AfterConstruction; override; + procedure Assign(ASource: TPersistent); override; final; + procedure BeginUpdate; overload; + procedure BeginUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; + procedure Change; virtual; + procedure EndUpdate; overload; + procedure EndUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; + property HasChanged: Boolean read GetHasChanged; + property Updating: Boolean read GetUpdating; + end; + TSkDrawEvent = procedure(ASender: TObject; const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single) of object; TSkDrawCacheKind = (Never, Raster, Always); @@ -236,60 +278,197 @@ TSkSvg = class(TSkCustomControl) property OnDraw; end; + { TSkCustomAnimation } + + TSkCustomAnimation = class(TSkPersistent) + protected const + DefaultAutoReverse = False; + DefaultDelay = 0; + DefaultEnabled = True; + DefaultInverse = False; + DefaultLoop = True; + DefaultPause = False; + DefaultSpeed = 1; + DefaultStartFromCurrent = False; + DefaultStartProgress = 0; + DefaultStopProgress = 1; + ProgressEpsilon = 0; + SpeedEpsilon = 1E-3; + SpeedRoundTo = -3; + TimeEpsilon = 1E-3; + TimeRoundTo = -3; + strict private type + TProcess = class + strict private + // Unsafe referece for TSkAnimation in list + FAniList: TList; + FAniProcessingList: TList; + [unsafe] FAniRoot: TSkCustomAnimation; + FAnimation: TFmxObject; + FMainFormChangedMessageId: Integer; + FTime: Double; + FTimerService: IFMXTimerService; + procedure DoAdd(const AAnimation: TSkCustomAnimation); + procedure DoRemove(const AAnimation: TSkCustomAnimation); + procedure DoRootChanged(const AAnimation: TSkCustomAnimation); + procedure MainFormChangeHandler(const ASender: TObject; const AMessage: TMessage); + procedure OnProcess(ASender: TObject); + procedure TryFindRoot; + strict private + class var FProcess: TProcess; + class destructor Destroy; + public + constructor Create; + destructor Destroy; override; + class procedure Add(const AAnimation: TSkCustomAnimation); static; + class procedure Remove(const AAnimation: TSkCustomAnimation); static; + class procedure RootChanged(const AAnimation: TSkCustomAnimation); static; + end; + strict private + FAllowAnimation: Boolean; + FAutoReverse: Boolean; + FCurrentTime: Double; + FCurrentTimeChanged: Boolean; + FDelay: Double; + FDelayTime: Double; + FDuration: Double; + FEnabled: Boolean; + FEnabledChanged: Boolean; + FInverse: Boolean; + FLoop: Boolean; + FNeedStart: Boolean; + FNeedStartRepaint: Boolean; + [unsafe] FOwner: TComponent; + FPause: Boolean; + FProcessDuration: Double; + FProcessing: Boolean; + FProcessTime: Double; + FProgress: Double; + FRunning: Boolean; + FSavedInverse: Boolean; + FSavedProgress: Double; + FSpeed: Double; + FStartFromCurrent: Boolean; + FStartProgress: Double; + FStopProgress: Double; + FTickCount: Integer; + function CanProcessing: Boolean; + function DoSetCurrentTime(const AValue: Double): Boolean; + function GetRoot: IRoot; + procedure InternalStart(const ACanProcess: Boolean); + function IsDelayStored: Boolean; + function IsProgressStored: Boolean; + function IsSpeedStored: Boolean; + function IsStartProgressStored: Boolean; + function IsStopProgressStored: Boolean; + procedure ProcessTick(ADeltaTime: Double); + procedure SetAllowAnimation(const AValue: Boolean); + procedure SetCurrentTime(const AValue: Double); + procedure SetDelay(const AValue: Double); + procedure SetEnabled(const AValue: Boolean); + procedure SetLoop(const AValue: Boolean); + procedure SetPause(const AValue: Boolean); + procedure SetProcessing(const AValue: Boolean); + procedure SetProgress(const AValue: Double); + procedure SetRunning(const AValue: Boolean); + procedure SetSpeed(const AValue: Double); + procedure SetStartProgress(const AValue: Double); + procedure SetStartValues(const ADelayTime: Double; const AStartAtEnd: Boolean); + procedure SetStopProgress(const AValue: Double); + procedure UpdateCurrentTime(const AIsRunning, ARecalcProcessDuration: Boolean); inline; + private + property Root: IRoot read GetRoot; + property SavedProgress: Double read FSavedProgress write FSavedProgress; + protected + procedure BeforePaint; + procedure DoAssign(ASource: TPersistent); override; + procedure DoChanged; override; + procedure DoFinish; virtual; abstract; + procedure DoProcess; virtual; abstract; + procedure DoStart; virtual; abstract; + function GetDuration: Double; + procedure RootChanged; + procedure SetDuration(const AValue: Double); + property AllowAnimation: Boolean read FAllowAnimation write SetAllowAnimation; + property Owner: TComponent read FOwner; + property Processing: Boolean read FProcessing; + public + constructor Create(const AOwner: TComponent); + destructor Destroy; override; + function Equals(AObject: TObject): Boolean; override; + procedure Start; virtual; + procedure Stop; virtual; + procedure StopAtCurrent; virtual; + property AutoReverse: Boolean read FAutoReverse write FAutoReverse default DefaultAutoReverse; + /// Current time of the animation in seconds + property CurrentTime: Double read FCurrentTime write SetCurrentTime stored False nodefault; + /// Delay in seconds to start the animation + property Delay: Double read FDelay write SetDelay stored IsDelayStored; + /// Duration in seconds + property Duration: Double read GetDuration; + /// Enables the animation to run automatically (in the next control's paint). + property Enabled: Boolean read FEnabled write SetEnabled default DefaultEnabled; + property Inverse: Boolean read FInverse write FInverse default DefaultInverse; + property Loop: Boolean read FLoop write SetLoop default DefaultLoop; + property Pause: Boolean read FPause write SetPause default DefaultPause; + /// Normalized CurrentTime (value between 0..1) + property Progress: Double read FProgress write SetProgress stored IsProgressStored; + property Running: Boolean read FRunning; + property Speed: Double read FSpeed write SetSpeed stored IsSpeedStored; + property StartFromCurrent: Boolean read FStartFromCurrent write FStartFromCurrent default DefaultStartFromCurrent; + property StartProgress: Double read FStartProgress write SetStartProgress stored IsStartProgressStored; + property StopProgress: Double read FStopProgress write SetStopProgress stored IsStopProgressStored; + end; + TSkAnimationDrawEvent = procedure(ASender: TObject; const ACanvas: ISkCanvas; const ADest: TRectF; const AProgress: Double; const AOpacity: Single) of object; TSkAnimationDrawProc = reference to procedure(const ACanvas: ISkCanvas; const ADest: TRectF; const AProgress: Double; const AOpacity: Single); { TSkCustomAnimatedControl } TSkCustomAnimatedControl = class abstract(TSkCustomControl) + protected type + TAnimationBase = class(TSkCustomAnimation) + strict private + FInsideDoProcess: Boolean; + protected + procedure DoChanged; override; + procedure DoFinish; override; + procedure DoProcess; override; + procedure DoStart; override; + end; strict private FAbsoluteVisible: Boolean; FAbsoluteVisibleCached: Boolean; - FAnimation: TAnimation; - FAnimationStartTickCount: Cardinal; - FFixedProgress: Boolean; - FIsStaticImage: Boolean; - FLoop: Boolean; FOnAnimationDraw: TSkAnimationDrawEvent; - FOnAnimationFinished: TNotifyEvent; - FOnAnimationProgress: TNotifyEvent; + FOnAnimationFinish: TNotifyEvent; + FOnAnimationProcess: TNotifyEvent; FOnAnimationStart: TNotifyEvent; - FProgress: Double; - FProgressChangedManually: Boolean; - FSuccessRepaint: Boolean; + FSuccessRedraw: Boolean; + procedure CheckDuration; function GetAbsoluteVisible: Boolean; - function GetRunningAnimation: Boolean; - procedure SetFixedProgress(const AValue: Boolean); - procedure SetIsStaticImage(const AValue: Boolean); - procedure SetLoop(const AValue: Boolean); - procedure SetProgress(AValue: Double); - private - procedure ProcessAnimation; - procedure SetOnAnimationDraw(const Value: TSkAnimationDrawEvent); + procedure SetOnAnimationDraw(const AValue: TSkAnimationDrawEvent); strict protected + FAnimation: TAnimationBase; procedure AncestorVisibleChanged(const AVisible: Boolean); override; function CanRunAnimation: Boolean; virtual; procedure CheckAnimation; - procedure DoAnimationFinished; virtual; - procedure DoAnimationProgress; virtual; + function CreateAnimation: TAnimationBase; virtual; abstract; + procedure DoAnimationChanged; virtual; + procedure DoAnimationFinish; virtual; + procedure DoAnimationProcess; virtual; procedure DoAnimationStart; virtual; + procedure DoRootChanged; override; procedure Draw(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); override; - function GetDuration: Double; virtual; abstract; - property IsStaticImage: Boolean read FIsStaticImage write SetIsStaticImage; + procedure ReadState(AReader: TReader); override; procedure RenderFrame(const ACanvas: ISkCanvas; const ADest: TRectF; const AProgress: Double; const AOpacity: Single); virtual; property AbsoluteVisible: Boolean read GetAbsoluteVisible; - property Duration: Double read GetDuration; - property FixedProgress: Boolean read FFixedProgress write SetFixedProgress; - property Progress: Double read FProgress write SetProgress; - property Loop: Boolean read FLoop write SetLoop; property OnAnimationDraw: TSkAnimationDrawEvent read FOnAnimationDraw write SetOnAnimationDraw; - property OnAnimationFinished: TNotifyEvent read FOnAnimationFinished write FOnAnimationFinished; - property OnAnimationProgress: TNotifyEvent read FOnAnimationProgress write FOnAnimationProgress; + property OnAnimationFinish: TNotifyEvent read FOnAnimationFinish write FOnAnimationFinish; + property OnAnimationProcess: TNotifyEvent read FOnAnimationProcess write FOnAnimationProcess; property OnAnimationStart: TNotifyEvent read FOnAnimationStart write FOnAnimationStart; - property RunningAnimation: Boolean read GetRunningAnimation; public constructor Create(AOwner: TComponent); override; - procedure RecalcEnabled; override; + destructor Destroy; override; procedure SetNewScene(AScene: IScene); override; end; @@ -297,27 +476,60 @@ TSkCustomAnimatedControl = class abstract(TSkCustomControl) [ComponentPlatforms(SkSupportedPlatformsMask)] TSkAnimatedPaintBox = class(TSkCustomAnimatedControl) - strict private - const + public type + { TAnimation } + + TAnimation = class(TAnimationBase) + protected const DefaultDuration = 1; + strict private + function IsDurationStored: Boolean; + strict protected + procedure DoAssign(ASource: TPersistent); override; + public + constructor Create(const AOwner: TFmxObject); + function Equals(AObject: TObject): Boolean; override; + published + property AutoReverse; + property Delay; + property Duration: Double read GetDuration write SetDuration stored IsDurationStored; + property Enabled; + property Inverse; + property Loop; + property Progress; + property Speed; + property StartFromCurrent; + property StartProgress; + property StopProgress; + end; strict private - FAnimate: Boolean; - FDuration: Double; - function IsDurationStored: Boolean; - procedure SetAnimate(const AValue: Boolean); - procedure SetDuration(const AValue: Double); + function GetAnimation: TAnimation; + procedure ReadAnimate(AReader: TReader); + procedure ReadDuration(AReader: TReader); + procedure ReadLoop(AReader: TReader); + procedure SetAnimation(const AValue: TAnimation); strict protected - function CanRunAnimation: Boolean; override; - function GetDuration: Double; override; - public - constructor Create(AOwner: TComponent); override; - property FixedProgress; - property Progress; + function CreateAnimation: TSkCustomAnimatedControl.TAnimationBase; override; + procedure DefineProperties(AFiler: TFiler); override; published - property Animate: Boolean read FAnimate write SetAnimate default True; - property Duration: Double read FDuration write SetDuration stored IsDurationStored; - property Loop default True; + property Animation: TAnimation read GetAnimation write SetAnimation; property OnAnimationDraw; + property OnAnimationFinish; + property OnAnimationProcess; + property OnAnimationStart; + end; + + { TSkAnimatedPaintBoxHelper } + + TSkAnimatedPaintBoxHelper = class helper for TSkAnimatedPaintBox + strict protected + function RunningAnimation: Boolean; deprecated 'Use Animation.Running instead'; + public + function Animate: Boolean; deprecated 'Use Animation.Enabled instead'; + function Duration: Double; deprecated 'Use Animation.Duration instead'; + function FixedProgress: Boolean; deprecated 'Use Animation.Enabled instead'; + function Loop: Boolean; deprecated 'Use Animation.Loop instead'; + function Progress: Double; deprecated 'Use Animation.Progress instead'; end; TSkAnimatedImageWrapMode = (Fit, FitCrop, Original, OriginalCenter, Place, Stretch); @@ -326,72 +538,96 @@ TSkAnimatedPaintBox = class(TSkCustomAnimatedControl) [ComponentPlatforms(SkSupportedPlatformsMask)] TSkAnimatedImage = class(TSkCustomAnimatedControl) - public - type - { TSource } - - TSource = class(TPersistent) - strict private - FData: TBytes; - FOnChange: TNotifyEvent; - procedure SetData(const AValue: TBytes); - public - constructor Create(const AOnChange: TNotifyEvent); - procedure Assign(ASource: TPersistent); override; - function Equals(AObject: TObject): Boolean; override; - property Data: TBytes read FData write SetData; - end; + public type + { TAnimation } - { TFormatInfo } + TAnimation = class(TAnimationBase) + published + property AutoReverse; + property Delay; + property Duration; + property Enabled; + property Inverse; + property Loop; + property Progress; + property Speed; + property StartFromCurrent; + property StartProgress; + property StopProgress; + end; - TFormatInfo = record - Description: string; - Extensions: TArray; - Name: string; - constructor Create(const AName, ADescription: string; const AExtensions: TArray); - end; + { TSource } - { TAnimationCodec } - - TAnimationCodec = class - strict private - FQuality: TCanvasQuality; - strict protected - function GetDuration: Double; virtual; abstract; - function GetIsStatic: Boolean; virtual; abstract; - function GetSize: TSizeF; virtual; abstract; - public - procedure Render(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); virtual; abstract; - procedure SeekFrameTime(const ATime: Double); virtual; abstract; - class function SupportedFormats: TArray; virtual; abstract; - class function TryDetectFormat(const ABytes: TBytes; out AFormat: TFormatInfo): Boolean; virtual; abstract; - class function TryMakeFromStream(const AStream: TStream; out ACodec: TAnimationCodec): Boolean; virtual; abstract; - property Duration: Double read GetDuration; - property IsStatic: Boolean read GetIsStatic; - property Quality: TCanvasQuality read FQuality write FQuality; - property Size: TSizeF read GetSize; - end; + TSource = class(TPersistent) + public type + TChangeProc = procedure of object; + strict private + FData: TBytes; + FOnChange: TChangeProc; + procedure SetData(const AValue: TBytes); + public + constructor Create(const AOnChange: TChangeProc); + procedure Assign(ASource: TPersistent); override; + function Equals(AObject: TObject): Boolean; override; + property Data: TBytes read FData write SetData; + end; - TAnimationCodecClass = class of TAnimationCodec; - strict private - class var - FRegisteredCodecs: TArray; + { TFormatInfo } + + TFormatInfo = record + Description: string; + Extensions: TArray; + Name: string; + constructor Create(const AName, ADescription: string; const AExtensions: TArray); + end; + + { TAnimationCodec } + + TAnimationCodec = class + strict private + FQuality: TCanvasQuality; + strict protected + function GetDuration: Double; virtual; abstract; + function GetFPS: Double; virtual; abstract; + function GetIsStatic: Boolean; virtual; abstract; + function GetSize: TSizeF; virtual; abstract; + public + procedure Render(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); virtual; abstract; + procedure SeekFrameTime(const ATime: Double); virtual; abstract; + class function SupportedFormats: TArray; virtual; abstract; + class function TryDetectFormat(const ABytes: TBytes; out AFormat: TFormatInfo): Boolean; virtual; abstract; + class function TryMakeFromStream(const AStream: TStream; out ACodec: TAnimationCodec): Boolean; virtual; abstract; + property Duration: Double read GetDuration; + property FPS: Double read GetFPS; + property IsStatic: Boolean read GetIsStatic; + property Quality: TCanvasQuality read FQuality write FQuality; + property Size: TSizeF read GetSize; + end; + + TAnimationCodecClass = class of TAnimationCodec; + strict private class var + FRegisteredCodecs: TArray; strict private FCodec: TAnimationCodec; FSource: TSource; FWrapMode: TSkAnimatedImageWrapMode; + function GetAnimation: TAnimation; function GetOriginalSize: TSizeF; procedure ReadData(AStream: TStream); + procedure ReadLoop(AReader: TReader); + procedure ReadOnAnimationFinished(AReader: TReader); + procedure ReadOnAnimationProgress(AReader: TReader); + procedure SetAnimation(const AValue: TAnimation); procedure SetSource(const AValue: TSource); procedure SetWrapMode(const AValue: TSkAnimatedImageWrapMode); - procedure SourceChange(ASender: TObject); procedure WriteData(AStream: TStream); strict protected - function CanRunAnimation: Boolean; override; + function CreateAnimation: TSkCustomAnimatedControl.TAnimationBase; override; procedure DefineProperties(AFiler: TFiler); override; procedure Draw(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); override; - function GetDuration: Double; override; procedure RenderFrame(const ACanvas: ISkCanvas; const ADest: TRectF; const AProgress: Double; const AOpacity: Single); override; + procedure SourceChange; virtual; + property Codec: TAnimationCodec read FCodec; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -399,58 +635,27 @@ TAnimationCodecClass = class of TAnimationCodec; procedure LoadFromStream(const AStream: TStream); class procedure RegisterCodec(const ACodecClass: TAnimationCodecClass); static; class property RegisteredCodecs: TArray read FRegisteredCodecs; - property FixedProgress; property OriginalSize: TSizeF read GetOriginalSize; - property Progress; - property RunningAnimation; published - property Loop default True; + property Animation: TAnimation read GetAnimation write SetAnimation; property Source: TSource read FSource write SetSource; property WrapMode: TSkAnimatedImageWrapMode read FWrapMode write SetWrapMode default TSkAnimatedImageWrapMode.Fit; property OnAnimationDraw; - property OnAnimationFinished; - property OnAnimationProgress; + property OnAnimationFinish; + property OnAnimationProcess; property OnAnimationStart; end; - { TSkPersistentData } + { TSkAnimatedImageHelper } - TSkPersistentData = class(TPersistent) - strict private - FChanged: Boolean; - FCreated: Boolean; - FIgnoringAllChanges: Boolean; - FOnChange: TNotifyEvent; - FUpdatingCount: Integer; - function GetUpdating: Boolean; - protected - procedure DoAssign(ASource: TPersistent); virtual; - procedure DoChanged; virtual; - function GetHasChanged: Boolean; virtual; - procedure SetValue(var AField: Byte; const AValue: Byte); overload; - procedure SetValue(var AField: Word; const AValue: Word); overload; - procedure SetValue(var AField: Cardinal; const AValue: Cardinal); overload; - procedure SetValue(var AField: Boolean; const AValue: Boolean); overload; - procedure SetValue(var AField: Integer; const AValue: Integer); overload; - procedure SetValue(var AField: Int64; const AValue: Int64); overload; - procedure SetValue(var AField: Single; const AValue: Single; const AEpsilon: Single = 0.0); overload; - procedure SetValue(var AField: Double; const AValue: Double; const AEpsilon: Double = 0.0); overload; - procedure SetValue(var AField: TBytes; const AValue: TBytes); overload; - procedure SetValue(var AField: string; const AValue: string); overload; - procedure SetValue(var AField: T; const AValue: T); overload; - property Created: Boolean read FCreated; - property UpdatingCount: Integer read FUpdatingCount; + TSkAnimatedImageHelper = class helper for TSkAnimatedImage + strict protected + function Duration: Double; deprecated 'Use Animation.Duration instead'; public - procedure AfterConstruction; override; - procedure Assign(ASource: TPersistent); override; final; - procedure BeginUpdate; overload; - procedure BeginUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; - procedure Change; virtual; - procedure EndUpdate; overload; - procedure EndUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; - property HasChanged: Boolean read GetHasChanged; - property Updating: Boolean read GetUpdating; - property OnChange: TNotifyEvent read FOnChange write FOnChange; + function FixedProgress: Boolean; deprecated 'Use Animation.Enabled instead'; + function Loop: Boolean; deprecated 'Use Animation.Loop instead'; + function Progress: Double; deprecated 'Use Animation.Progress instead'; + function RunningAnimation: Boolean; deprecated 'Use Animation.Running instead'; end; {$IF CompilerVersion < 31} @@ -461,13 +666,12 @@ TSkPersistentData = class(TPersistent) { TSkFontComponent } - TSkFontComponent = class(TSkPersistentData) - strict protected - const - DefaultSize = 14; - DefaultSlant = TFontSlant.Regular; - DefaultStretch = TFontStretch.Regular; - DefaultWeight = TFontWeight.Regular; + TSkFontComponent = class(TSkPersistent) + strict protected const + DefaultSize = 14; + DefaultSlant = TFontSlant.Regular; + DefaultStretch = TFontStretch.Regular; + DefaultWeight = TFontWeight.Regular; strict private FFamilies: string; FSize: Single; @@ -488,6 +692,7 @@ TSkFontComponent = class(TSkPersistentData) public constructor Create; function Equals(AObject: TObject): Boolean; override; + property OnChange; published property Families: string read FFamilies write SetFamilies stored IsFamiliesStored; property Size: Single read FSize write SetSize stored IsSizeStored; @@ -500,52 +705,50 @@ TSkFontComponent = class(TSkPersistentData) { TSkTextSettings } - TSkTextSettings = class(TSkPersistentData) - public - type - { TDecorations } - - TDecorations = class(TSkPersistentData) - strict protected - const - DefaultColor = TAlphaColors.Null; - DefaultDecorations = []; - DefaultStrokeColor = TAlphaColors.Null; - DefaultStyle = TSkTextDecorationStyle.Solid; - DefaultThickness = 1; - strict private - FColor: TAlphaColor; - FDecorations: TSkTextDecorations; - FStrokeColor: TAlphaColor; - FStyle: TSkTextDecorationStyle; - FThickness: Single; - procedure SetColor(const AValue: TAlphaColor); - procedure SetDecorations(const AValue: TSkTextDecorations); - procedure SetStrokeColor(const AValue: TAlphaColor); - procedure SetStyle(const AValue: TSkTextDecorationStyle); - procedure SetThickness(const AValue: Single); - strict protected - procedure DoAssign(ASource: TPersistent); override; - function IsThicknessStored: Boolean; virtual; - public - constructor Create; - function Equals(AObject: TObject): Boolean; override; - published - property Color: TAlphaColor read FColor write SetColor default DefaultColor; - property Decorations: TSkTextDecorations read FDecorations write SetDecorations default DefaultDecorations; - property StrokeColor: TAlphaColor read FStrokeColor write SetStrokeColor default DefaultStrokeColor; - property Style: TSkTextDecorationStyle read FStyle write SetStyle default DefaultStyle; - property Thickness: Single read FThickness write SetThickness stored IsThicknessStored; - end; - strict protected - const - DefaultFontColor = TAlphaColors.Black; - DefaultHeightMultiplier = 0; - DefaultHorzAlign = TSkTextHorzAlign.Leading; - DefaultLetterSpacing = 0; - DefaultMaxLines = 1; - DefaultTrimming = TTextTrimming.Word; - DefaultVertAlign = TTextAlign.Center; + TSkTextSettings = class(TSkPersistent) + public type + { TDecorations } + + TDecorations = class(TSkPersistent) + strict protected + const + DefaultColor = TAlphaColors.Null; + DefaultDecorations = []; + DefaultStrokeColor = TAlphaColors.Null; + DefaultStyle = TSkTextDecorationStyle.Solid; + DefaultThickness = 1; + strict private + FColor: TAlphaColor; + FDecorations: TSkTextDecorations; + FStrokeColor: TAlphaColor; + FStyle: TSkTextDecorationStyle; + FThickness: Single; + procedure SetColor(const AValue: TAlphaColor); + procedure SetDecorations(const AValue: TSkTextDecorations); + procedure SetStrokeColor(const AValue: TAlphaColor); + procedure SetStyle(const AValue: TSkTextDecorationStyle); + procedure SetThickness(const AValue: Single); + strict protected + procedure DoAssign(ASource: TPersistent); override; + function IsThicknessStored: Boolean; virtual; + public + constructor Create; + function Equals(AObject: TObject): Boolean; override; + published + property Color: TAlphaColor read FColor write SetColor default DefaultColor; + property Decorations: TSkTextDecorations read FDecorations write SetDecorations default DefaultDecorations; + property StrokeColor: TAlphaColor read FStrokeColor write SetStrokeColor default DefaultStrokeColor; + property Style: TSkTextDecorationStyle read FStyle write SetStyle default DefaultStyle; + property Thickness: Single read FThickness write SetThickness stored IsThicknessStored; + end; + strict protected const + DefaultFontColor = TAlphaColors.Black; + DefaultHeightMultiplier = 0; + DefaultHorzAlign = TSkTextHorzAlign.Leading; + DefaultLetterSpacing = 0; + DefaultMaxLines = 1; + DefaultTrimming = TTextTrimming.Word; + DefaultVertAlign = TTextAlign.Center; strict private FDecorations: TDecorations; FFont: TSkFontComponent; @@ -582,6 +785,7 @@ TDecorations = class(TSkPersistentData) procedure UpdateStyledSettings(const AOldTextSettings, ADefaultTextSettings: TSkTextSettings; var AStyledSettings: TStyledSettings); virtual; property Owner: TPersistent read FOwner; + property OnChange; published property Decorations: TDecorations read FDecorations write SetDecorations; property Font: TSkFontComponent read FFont write SetFont; @@ -710,151 +914,150 @@ TSkStyleTextObject = class(TSkCustomStyleTextObject) [ComponentPlatforms(SkSupportedPlatformsMask)] TSkLabel = class(TSkStyledControl, ISkTextSettings{$IF CompilerVersion >= 29}, ICaption{$ENDIF}) - public - type - TWordsCollection = class; - TCustomWordsItemClass = class of TCustomWordsItem; - - TCustomWordsItem = class(TCollectionItem) - strict protected - const - DefaultBackgroundColor = TAlphaColors.Null; - DefaultCursor = crDefault; - DefaultFontColor = TAlphaColors.Black; - DefaultHeightMultiplier = 0; - DefaultLetterSpacing = 0; - DefaultName = 'Item 0'; - DefaultText = ''; - strict private - FBackgroundColor: TAlphaColor; - FChanged: Boolean; - FCursor: TCursor; - FIgnoringAllChanges: Boolean; - FName: string; - FOnClick: TNotifyEvent; - FTag: NativeInt; - FTagFloat: Single; - [Weak] FTagObject: TObject; - FTagString: string; - FText: string; - FTextSettingsInfo: TSkTextSettingsInfo; - FUpdatingCount: Integer; - [unsafe] FWords: TWordsCollection; - procedure CheckName(const AName: string; AWordsCollection: TWordsCollection); - function GetDecorations: TSkTextSettings.TDecorations; - function GetFont: TSkFontComponent; - function GetFontColor: TAlphaColor; - function GetHeightMultiplier: Single; - function GetLetterSpacing: Single; - function GetStyledSettings: TStyledSettings; - function IsFontColorStored: Boolean; - function IsHeightMultiplierStored: Boolean; - function IsLetterSpacingStored: Boolean; - function IsNameStored: Boolean; - function IsStyledSettingsStored: Boolean; - function IsTextStored: Boolean; - procedure TextSettingsChange(ASender: TObject); - procedure SetBackgroundColor(const AValue: TAlphaColor); - procedure SetCursor(const AValue: TCursor); - procedure SetDecorations(const AValue: TSkTextSettings.TDecorations); - procedure SetFont(const AValue: TSkFontComponent); - procedure SetFontColor(const AValue: TAlphaColor); - procedure SetHeightMultiplier(const AValue: Single); - procedure SetLetterSpacing(const AValue: Single); - procedure SetName(const AValue: string); - procedure SetStyledSettings(const AValue: TStyledSettings); - procedure SetText(const AValue: string); - function UniqueName(const AName: string; const ACollection: TCollection): string; - strict protected - procedure DoAssign(ASource: TPersistent); virtual; - procedure DoChanged; virtual; - function GetDisplayName: string; override; - procedure SetCollection(AValue: TCollection); override; - public - constructor Create(ACollection: TCollection); override; - destructor Destroy; override; - procedure Assign(ASource: TPersistent); override; final; - procedure BeginUpdate; overload; - procedure Change; virtual; - procedure EndUpdate; overload; - procedure EndUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; - property BackgroundColor: TAlphaColor read FBackgroundColor write SetBackgroundColor default DefaultBackgroundColor; - property Cursor: TCursor read FCursor write SetCursor default crDefault; - property Decorations: TSkTextSettings.TDecorations read GetDecorations write SetDecorations; - property Font: TSkFontComponent read GetFont write SetFont; - property FontColor: TAlphaColor read GetFontColor write SetFontColor stored IsFontColorStored; - property HeightMultiplier: Single read GetHeightMultiplier write SetHeightMultiplier stored IsHeightMultiplierStored; - property LetterSpacing: Single read GetLetterSpacing write SetLetterSpacing stored IsLetterSpacingStored; - /// The case-insensitive name of the item in the collection. This field cannot be empty and must be unique for his collection - property Name: string read FName write SetName stored IsNameStored; - property StyledSettings: TStyledSettings read GetStyledSettings write SetStyledSettings stored IsStyledSettingsStored; - property Tag: NativeInt read FTag write FTag default 0; - property TagFloat: Single read FTagFloat write FTagFloat; - property TagObject: TObject read FTagObject write FTagObject; - property TagString: string read FTagString write FTagString; - property Text: string read FText write SetText stored IsTextStored; - property Words: TWordsCollection read FWords; - property OnClick: TNotifyEvent read FOnClick write FOnClick; - end; + public type + TWordsCollection = class; + TCustomWordsItemClass = class of TCustomWordsItem; + + TCustomWordsItem = class(TCollectionItem) + strict protected + const + DefaultBackgroundColor = TAlphaColors.Null; + DefaultCursor = crDefault; + DefaultFontColor = TAlphaColors.Black; + DefaultHeightMultiplier = 0; + DefaultLetterSpacing = 0; + DefaultName = 'Item 0'; + DefaultText = ''; + strict private + FBackgroundColor: TAlphaColor; + FChanged: Boolean; + FCursor: TCursor; + FIgnoringAllChanges: Boolean; + FName: string; + FOnClick: TNotifyEvent; + FTag: NativeInt; + FTagFloat: Single; + [Weak] FTagObject: TObject; + FTagString: string; + FText: string; + FTextSettingsInfo: TSkTextSettingsInfo; + FUpdatingCount: Integer; + [unsafe] FWords: TWordsCollection; + procedure CheckName(const AName: string; AWordsCollection: TWordsCollection); + function GetDecorations: TSkTextSettings.TDecorations; + function GetFont: TSkFontComponent; + function GetFontColor: TAlphaColor; + function GetHeightMultiplier: Single; + function GetLetterSpacing: Single; + function GetStyledSettings: TStyledSettings; + function IsFontColorStored: Boolean; + function IsHeightMultiplierStored: Boolean; + function IsLetterSpacingStored: Boolean; + function IsNameStored: Boolean; + function IsStyledSettingsStored: Boolean; + function IsTextStored: Boolean; + procedure TextSettingsChange(ASender: TObject); + procedure SetBackgroundColor(const AValue: TAlphaColor); + procedure SetCursor(const AValue: TCursor); + procedure SetDecorations(const AValue: TSkTextSettings.TDecorations); + procedure SetFont(const AValue: TSkFontComponent); + procedure SetFontColor(const AValue: TAlphaColor); + procedure SetHeightMultiplier(const AValue: Single); + procedure SetLetterSpacing(const AValue: Single); + procedure SetName(const AValue: string); + procedure SetStyledSettings(const AValue: TStyledSettings); + procedure SetText(const AValue: string); + function UniqueName(const AName: string; const ACollection: TCollection): string; + strict protected + procedure DoAssign(ASource: TPersistent); virtual; + procedure DoChanged; virtual; + function GetDisplayName: string; override; + procedure SetCollection(AValue: TCollection); override; + public + constructor Create(ACollection: TCollection); override; + destructor Destroy; override; + procedure Assign(ASource: TPersistent); override; final; + procedure BeginUpdate; overload; + procedure Change; virtual; + procedure EndUpdate; overload; + procedure EndUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; + property BackgroundColor: TAlphaColor read FBackgroundColor write SetBackgroundColor default DefaultBackgroundColor; + property Cursor: TCursor read FCursor write SetCursor default crDefault; + property Decorations: TSkTextSettings.TDecorations read GetDecorations write SetDecorations; + property Font: TSkFontComponent read GetFont write SetFont; + property FontColor: TAlphaColor read GetFontColor write SetFontColor stored IsFontColorStored; + property HeightMultiplier: Single read GetHeightMultiplier write SetHeightMultiplier stored IsHeightMultiplierStored; + property LetterSpacing: Single read GetLetterSpacing write SetLetterSpacing stored IsLetterSpacingStored; + /// The case-insensitive name of the item in the collection. This field cannot be empty and must be unique for his collection + property Name: string read FName write SetName stored IsNameStored; + property StyledSettings: TStyledSettings read GetStyledSettings write SetStyledSettings stored IsStyledSettingsStored; + property Tag: NativeInt read FTag write FTag default 0; + property TagFloat: Single read FTagFloat write FTagFloat; + property TagObject: TObject read FTagObject write FTagObject; + property TagString: string read FTagString write FTagString; + property Text: string read FText write SetText stored IsTextStored; + property Words: TWordsCollection read FWords; + property OnClick: TNotifyEvent read FOnClick write FOnClick; + end; - { TWordsCollection } - - TWordsCollection = class(TOwnedCollection) - strict protected - const - DefaultColor = TAlphaColors.Black; - DefaultFontSize = 14; - DefaultFontSlant = TFontSlant.Regular; - DefaultFontWeight = TFontWeight.Regular; - strict private - [unsafe] FLabel: TSkLabel; - FOnChange: TNotifyEvent; - function GetItem(AIndex: Integer): TCustomWordsItem; - function GetItemByName(const AName: string): TCustomWordsItem; - procedure SetItem(AIndex: Integer; const AValue: TCustomWordsItem); - strict protected - procedure Update(AItem: TCollectionItem); override; - public - constructor Create(AOwner: TPersistent; AItemClass: TCustomWordsItemClass); - function Add: TCustomWordsItem; overload; - function Add(const AText: string; const AColor: TAlphaColor = DefaultColor; - const AFontSize: Single = DefaultFontSize; - const AFontWeight: TFontWeight = DefaultFontWeight; - const AFontSlant: TFontSlant = DefaultFontSlant): TCustomWordsItem; overload; - function AddOrSet(const AName, AText: string; const AFontColor: TAlphaColor = DefaultColor; - const AFont: TSkFontComponent = nil; const AOnClick: TNotifyEvent = nil; - const ACursor: TCursor = crDefault): TCustomWordsItem; - function Insert(AIndex: Integer): TCustomWordsItem; - /// Case-insensitive search of item by name - function IndexOf(const AName: string): Integer; - /// Case-insensitive search of item by name - property ItemByName[const AName: string]: TCustomWordsItem read GetItemByName; - property Items[AIndex: Integer]: TCustomWordsItem read GetItem write SetItem; default; - property &Label: TSkLabel read FLabel; - property OnChange: TNotifyEvent read FOnChange write FOnChange; - end; + { TWordsCollection } - { TWordsItem } - - TWordsItem = class(TCustomWordsItem) - published - property BackgroundColor; - property Cursor; - property Decorations; - property Font; - property FontColor; - property HeightMultiplier; - property LetterSpacing; - property Name; - property StyledSettings; - property TagString; - property Text; - property OnClick; - end; + TWordsCollection = class(TOwnedCollection) + strict protected + const + DefaultColor = TAlphaColors.Black; + DefaultFontSize = 14; + DefaultFontSlant = TFontSlant.Regular; + DefaultFontWeight = TFontWeight.Regular; + strict private + [unsafe] FLabel: TSkLabel; + FOnChange: TNotifyEvent; + function GetItem(AIndex: Integer): TCustomWordsItem; + function GetItemByName(const AName: string): TCustomWordsItem; + procedure SetItem(AIndex: Integer; const AValue: TCustomWordsItem); + strict protected + procedure Update(AItem: TCollectionItem); override; + public + constructor Create(AOwner: TPersistent; AItemClass: TCustomWordsItemClass); + function Add: TCustomWordsItem; overload; + function Add(const AText: string; const AColor: TAlphaColor = DefaultColor; + const AFontSize: Single = DefaultFontSize; + const AFontWeight: TFontWeight = DefaultFontWeight; + const AFontSlant: TFontSlant = DefaultFontSlant): TCustomWordsItem; overload; + function AddOrSet(const AName, AText: string; const AFontColor: TAlphaColor = DefaultColor; + const AFont: TSkFontComponent = nil; const AOnClick: TNotifyEvent = nil; + const ACursor: TCursor = crDefault): TCustomWordsItem; + function Insert(AIndex: Integer): TCustomWordsItem; + /// Case-insensitive search of item by name + function IndexOf(const AName: string): Integer; + /// Case-insensitive search of item by name + property ItemByName[const AName: string]: TCustomWordsItem read GetItemByName; + property Items[AIndex: Integer]: TCustomWordsItem read GetItem write SetItem; default; + property &Label: TSkLabel read FLabel; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + + { TWordsItem } + + TWordsItem = class(TCustomWordsItem) + published + property BackgroundColor; + property Cursor; + property Decorations; + property Font; + property FontColor; + property HeightMultiplier; + property LetterSpacing; + property Name; + property StyledSettings; + property TagString; + property Text; + property OnClick; + end; - { TItemClickedMessage } + { TItemClickedMessage } - TItemClickedMessage = class(TMessage); + TItemClickedMessage = class(TMessage); strict private FAutoSize: Boolean; FBackgroundPicture: ISkPicture; @@ -876,6 +1079,7 @@ TItemClickedMessage = class(TMessage); FWordsMouseOver: TCustomWordsItem; procedure DeleteParagraph; procedure GetFitSize(var AWidth, AHeight: Single); + function GetLinesCount: Integer; function GetParagraph: ISkParagraph; function GetParagraphBounds: TRectF; function GetText: string; @@ -928,7 +1132,9 @@ TItemClickedMessage = class(TMessage); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; + function DidExceedMaxLines: Boolean; property DefaultTextSettings: TSkTextSettings read GetDefaultTextSettings; + property LinesCount: Integer read GetLinesCount; {$IF CompilerVersion < 30} property PressedPosition: TPointF read FPressedPosition write FPressedPosition; {$ENDIF} @@ -991,28 +1197,46 @@ TItemClickedMessage = class(TMessage); property OnDraw; end; - { TSkTypefaceManager } + { TSkDefaultProviders } - TSkTypefaceManager = class sealed - strict private - class var FProvider: ISkTypefaceFontProvider; + TSkDefaultProviders = class sealed + strict private class var + FResource: ISkResourceProvider; + FTypefaceFont: ISkTypefaceFontProvider; class constructor Create; public class procedure RegisterTypeface(const AFileName: string); overload; static; class procedure RegisterTypeface(const AStream: TStream); overload; static; - class property Provider: ISkTypefaceFontProvider read FProvider; + class property Resource: ISkResourceProvider read FResource write FResource; + class property TypefaceFont: ISkTypefaceFontProvider read FTypefaceFont; + end; + + { TSkTypefaceManager } + + TSkTypefaceManager = class sealed + public + class function Provider: ISkTypefaceFontProvider; static; deprecated 'Use TSkDefaultProviders.TypefaceFont instead'; + class procedure RegisterTypeface(const AFileName: string); overload; static; deprecated 'Use TSkDefaultProviders.RegisterTypeface instead'; + class procedure RegisterTypeface(const AStream: TStream); overload; static; deprecated 'Use TSkDefaultProviders.RegisterTypeface instead'; end; +procedure AddSkPathToPathData(const APathData: TPathData; const ASkPath: ISkPath); +function BitmapToSkImage(const ABitmap: TBitmap): ISkImage; +function PathDataToSkPath(const APathData: TPathData): ISkPath; +procedure SkiaDraw(const ABitmap: TBitmap; const AProc: TSkDrawProc; const AStartClean: Boolean = True); +function SkImageToBitmap(const AImage: ISkImage): TBitmap; +function SkPathToPathData(const ASkPath: ISkPath): TPathData; + const SkFmxColorType: array[TPixelFormat] of TSkColorType = ( { None } TSkColorType.Unknown, - { RGB } TSkColorType.RGB888X, + { RGB } TSkColorType.Unknown, { RGBA } TSkColorType.RGBA8888, { BGR } TSkColorType.Unknown, { BGRA } TSkColorType.BGRA8888, { RGBA16 } TSkColorType.RGBA16161616, - { BGR_565 } TSkColorType.Unknown, - { BGRA4 } TSkColorType.Unknown, + { BGR_565 } TSkColorType.RGB565, + { BGRA4 } TSkColorType.ARGB4444, { BGR4 } TSkColorType.Unknown, { BGR5_A1 } TSkColorType.Unknown, { BGR5 } TSkColorType.Unknown, @@ -1031,13 +1255,14 @@ TSkTypefaceManager = class sealed { RGBA32F } TSkColorType.RGBAF32 ); + SkFmxPixelFormat: array[TSkColorType] of TPixelFormat = ( { Unknown } TPixelFormat.None, { Alpha8 } TPixelFormat.A, - { RGB565 } TPixelFormat.None, - { ARGB4444 } TPixelFormat.None, + { RGB565 } TPixelFormat.BGR_565, + { ARGB4444 } TPixelFormat.BGRA4, { RGBA8888 } TPixelFormat.RGBA, - { RGB888X } TPixelFormat.RGB, + { RGB888X } TPixelFormat.None, { BGRA8888 } TPixelFormat.BGRA, { RGBA1010102 } TPixelFormat.RGB10_A2, { BGRA1010102 } TPixelFormat.BGR10_A2, @@ -1053,7 +1278,8 @@ TSkTypefaceManager = class sealed { Alpha16 } TPixelFormat.None, { RG1616 } TPixelFormat.None, { RGBA16161616 } TPixelFormat.RGBA16, - { SRGBA8888 } TPixelFormat.None + { SRGBA8888 } TPixelFormat.None, + { R8 } TPixelFormat.None ); var @@ -1070,20 +1296,23 @@ implementation uses { Delphi } - System.Math, System.Math.Vectors, System.ZLib, System.IOUtils, System.TypInfo, System.Character, - System.Generics.Collections, System.Generics.Defaults, System.RTLConsts, {$IF CompilerVersion >= 29} FMX.Utils, {$ENDIF} + FMX.Platform, FMX.BehaviorManager, - FMX.Forms; + FMX.Forms, + FMX.Ani, + + { Skia } + Skia.FMX.Graphics; type { TSkDefaultAnimationCodec } @@ -1096,6 +1325,7 @@ TSkDefaultAnimationCodec = class(TSkAnimatedImage.TAnimationCodec) FStream: TStream; strict protected function GetDuration: Double; override; + function GetFPS: Double; override; function GetIsStatic: Boolean; override; function GetSize: TSizeF; override; public @@ -1117,6 +1347,7 @@ TSkLottieAnimationCodec = class(TSkAnimatedImage.TAnimationCodec) FSkottie: ISkottieAnimation; strict protected function GetDuration: Double; override; + function GetFPS: Double; override; function GetIsStatic: Boolean; override; function GetSize: TSizeF; override; public @@ -1166,6 +1397,16 @@ TSkRectFHelper = record helper for TRectF SkFontWeightValue: array[TFontWeight] of Integer = (100, 200, 300, 350, 400, 500, 600, 700, 800, 900, 950); SkFontWidthValue: array[TFontStretch] of Integer = (1, 2, 3, 4, 5, 6, 7, 8, 9); +procedure AddSkPathToPathData(const APathData: TPathData; const ASkPath: ISkPath); +begin + APathData.AddSkPath(ASkPath); +end; + +function BitmapToSkImage(const ABitmap: TBitmap): ISkImage; +begin + Result := ABitmap.ToSkImage; +end; + function IsSameBytes(const ALeft, ARight: TBytes): Boolean; begin Result := (ALeft = ARight) or @@ -1173,6 +1414,11 @@ function IsSameBytes(const ALeft, ARight: TBytes): Boolean; ((Length(ALeft) = 0) or CompareMem(PByte(@ALeft[0]), PByte(@ARight[0]), Length(ALeft)))); end; +function PathDataToSkPath(const APathData: TPathData): ISkPath; +begin + Result := APathData.ToSkPath; +end; + function PlaceIntoTopLeft(const ASourceRect, ADesignatedArea: TRectF): TRectF; begin Result := ASourceRect; @@ -1181,6 +1427,21 @@ function PlaceIntoTopLeft(const ASourceRect, ADesignatedArea: TRectF): TRectF; Result.SetLocation(ADesignatedArea.TopLeft); end; +procedure SkiaDraw(const ABitmap: TBitmap; const AProc: TSkDrawProc; const AStartClean: Boolean); +begin + ABitmap.SkiaDraw(AProc, AStartClean); +end; + +function SkImageToBitmap(const AImage: ISkImage): TBitmap; +begin + Result := TBitmap.CreateFromSkImage(AImage); +end; + +function SkPathToPathData(const ASkPath: ISkPath): TPathData; +begin + Result := TPathData.CreateFromSkPath(ASkPath); +end; + {$IF CompilerVersion < 31} { TSkCanvasHelper } @@ -1236,24 +1497,37 @@ function RectCenter(var R: TRectF; const Bounds: TRectF): TRectF; { TSkBitmapHelper } +constructor TSkBitmapHelper.CreateFromSkImage(const AImage: ISkImage); +var + LData: TBitmapData; +begin + Assert(Assigned(AImage)); + Create(AImage.Width, AImage.Height); + if (not IsEmpty) and Map(TMapAccess.Write, LData) then + begin + try + AImage.ReadPixels(TSkImageInfo.Create(Width, Height, SkFmxColorType[LData.PixelFormat]), LData.Data, LData.Pitch); + finally + Unmap(LData); + end; + end; +end; + procedure TSkBitmapHelper.SkiaDraw(const AProc: TSkDrawProc; const AStartClean: Boolean); - procedure DrawInSurface(const ASurface: ISkSurface); + procedure Draw(const ACanvas: ISkCanvas); begin - if Assigned(ASurface) then - begin - if AStartClean then - ASurface.Canvas.Clear(TAlphaColors.Null); - AProc(ASurface.Canvas); - end; + if AStartClean then + ACanvas.Clear(TAlphaColors.Null); + AProc(ACanvas); end; var - LColorType: TSkColorType; - LSurface: ISkSurface; - LData: TBitmapData; LAccess: TMapAccess; LBeginSceneCount: Integer; + LColorType: TSkColorType; + LData: TBitmapData; + LSurface: ISkSurface; begin Assert(Assigned(AProc)); if IsEmpty then @@ -1273,10 +1547,7 @@ procedure TSkBitmapHelper.SkiaDraw(const AProc: TSkDrawProc; const AStartClean: // - https://quality.embarcadero.com/browse/RSP-38418 // - // - ----------------------------------------------------------------------- - {$IF CompilerVersion > 35} - {$MESSAGE WARN 'Check if the issue has been fixed'} - {$ENDIF} - // - ----------------------------------------------------------------------- + {$IF (CompilerVersion < 35) or ((CompilerVersion = 35) and not DECLARED(RTLVersion113))} if Image.RefCount > 1 then begin LBeginSceneCount := Canvas.BeginSceneCount; @@ -1287,18 +1558,22 @@ procedure TSkBitmapHelper.SkiaDraw(const AProc: TSkDrawProc; const AStartClean: Dec(LBeginSceneCount); end; end; + {$ENDIF} // - ----------------------------------------------------------------------- {$ENDREGION} - if (Canvas.BeginSceneCount = 0) and Canvas.BeginScene then + if Canvas.BeginSceneCount = 0 then begin - try - DrawInSurface(TSkCanvasCustom(Canvas).Surface); - finally - Canvas.EndScene; + if Canvas.BeginScene then + begin + try + Draw(TSkCanvasCustom(Canvas).Canvas); + finally + Canvas.EndScene; + end; end; end else - DrawInSurface(TSkCanvasCustom(Canvas).Surface); + Draw(TSkCanvasCustom(Canvas).Canvas); end else begin @@ -1315,7 +1590,7 @@ procedure TSkBitmapHelper.SkiaDraw(const AProc: TSkDrawProc; const AStartClean: if Map(LAccess, LData) then try LSurface := TSkSurface.MakeRasterDirect(TSkImageInfo.Create(LData.Width, LData.Height, LColorType), LData.Data, LData.Pitch); - DrawInSurface(LSurface); + Draw(LSurface.Canvas); finally Unmap(LData); end; @@ -1338,7 +1613,7 @@ function TSkBitmapHelper.ToSkImage: ISkImage; if not Map(TMapAccess.Read, LData) then raise ESkBitmapHelper.Create('Could not map the bitmap'); try - Result := TSkImage.MakeFromRaster(TSkImageInfo.Create(Width, Height, LColorType), LData.Data, LData.Pitch); + Result := TSkImage.MakeRasterCopy(TSkImageInfo.Create(Width, Height, LColorType), LData.Data, LData.Pitch); finally Unmap(LData); end; @@ -1369,6 +1644,12 @@ procedure TSkPathDataHelper.AddSkPath(const AValue: ISkPath); end; end; +constructor TSkPathDataHelper.CreateFromSkPath(const AValue: ISkPath); +begin + Create; + AddSkPath(AValue); +end; + procedure TSkPathDataHelper.FromSkPath(const AValue: ISkPath); begin Clear; @@ -1399,78 +1680,281 @@ function TSkPathDataHelper.ToSkPath: ISkPath; Result := LPathBuilder.Detach; end; -{ TSkCustomControl } +{ TSkPersistent } -constructor TSkCustomControl.Create(AOwner: TComponent); +procedure TSkPersistent.AfterConstruction; begin inherited; - FDrawCacheKind := TSkDrawCacheKind.Raster; - HitTest := False; + FCreated := True; end; -destructor TSkCustomControl.Destroy; +procedure TSkPersistent.Assign(ASource: TPersistent); begin - FBuffer.Free; - inherited; + if ASource <> Self then + begin + BeginUpdate; + try + DoAssign(ASource); + finally + EndUpdate; + end; + end; end; -procedure TSkCustomControl.Draw(const ACanvas: ISkCanvas; const ADest: TRectF; - const AOpacity: Single); +procedure TSkPersistent.BeginUpdate; begin - if csDesigning in ComponentState then - DrawDesignBorder(ACanvas, ADest, AOpacity); + BeginUpdate(False); end; -procedure TSkCustomControl.DrawDesignBorder(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); -const - DesignBorderColor = $A0909090; -var - R: TRectF; - LPaint: ISkPaint; +procedure TSkPersistent.BeginUpdate(const AIgnoreAllChanges: Boolean); begin - R := ADest; - InflateRect(R, -0.5, -0.5); - ACanvas.Save; - try - LPaint := TSkPaint.Create(TSkPaintStyle.Stroke); - LPaint.AlphaF := AOpacity; - LPaint.Color := DesignBorderColor; - LPaint.StrokeWidth := 1; - LPaint.PathEffect := TSKPathEffect.MakeDash([3, 1], 0); - ACanvas.DrawRect(R, LPaint); - finally - ACanvas.Restore; - end; + Inc(FUpdatingCount); + FIgnoringAllChanges := FIgnoringAllChanges or AIgnoreAllChanges; end; -function TSkCustomControl.NeedsRedraw: Boolean; +procedure TSkPersistent.Change; begin - Result := (not FDrawCached) or (FDrawCacheKind = TSkDrawCacheKind.Never) or (FBuffer = nil); + if FUpdatingCount > 0 then + FChanged := True + else + begin + FChanged := False; + DoChanged; + end; end; -procedure TSkCustomControl.Paint; +procedure TSkPersistent.DoAssign(ASource: TPersistent); +begin + inherited Assign(ASource); +end; + +procedure TSkPersistent.DoChanged; +begin + if FCreated and Assigned(FOnChange) then + FOnChange(Self); +end; + +procedure TSkPersistent.EndUpdate; +begin + EndUpdate(False); +end; + +procedure TSkPersistent.EndUpdate(const AIgnoreAllChanges: Boolean); +var + LCallChange: Boolean; + LIgnoreChanges: Boolean; +begin + LIgnoreChanges := AIgnoreAllChanges or FIgnoringAllChanges; + LCallChange := False; + if FUpdatingCount <= 0 then + raise ESkPersistentData.Create('The object is not in update state'); + Dec(FUpdatingCount); + if (not LIgnoreChanges) and HasChanged then + LCallChange := True + else + FChanged := False; + if FUpdatingCount <= 0 then + FIgnoringAllChanges := False; + if LCallChange and (FUpdatingCount = 0) then + begin + FChanged := False; + DoChanged; + end; +end; + +function TSkPersistent.GetHasChanged: Boolean; +begin + Result := FChanged; +end; - procedure DrawUsingSkia(const ASurface: ISkSurface; const ADestRect: TRectF; const AOpacity: Single); +function TSkPersistent.GetUpdating: Boolean; +begin + Result := FUpdatingCount > 0; +end; + +function TSkPersistent.SetValue(var AField: Byte; const AValue: Byte): Boolean; +begin + Result := AField <> AValue; + if Result then begin - if Assigned(ASurface) then - begin - Draw(ASurface.Canvas, ADestRect, AOpacity); - if Assigned(FOnDraw) then - FOnDraw(Self, ASurface.Canvas, ADestRect, AOpacity); - end; + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Word; const AValue: Word): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Double; const AValue, + AEpsilon: Double): Boolean; +begin + Result := not SameValue(AField, AValue, AEpsilon); + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: TBytes; const AValue: TBytes): Boolean; +begin + Result := not IsSameBytes(AField, AValue); + if Result then + begin + AField := Copy(AValue); + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: string; const AValue: string): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Single; const AValue, + AEpsilon: Single): Boolean; +begin + Result := not SameValue(AField, AValue, AEpsilon); + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Boolean; + const AValue: Boolean): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Cardinal; + const AValue: Cardinal): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Integer; + const AValue: Integer): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Int64; const AValue: Int64): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: T; const AValue: T): Boolean; +begin + if Assigned(TypeInfo(T)) and (PTypeInfo(TypeInfo(T)).Kind in [TTypeKind.tkSet, TTypeKind.tkEnumeration, TTypeKind.tkRecord{$IF CompilerVersion >= 33}, TTypeKind.tkMRecord{$ENDIF}]) then + Result := not CompareMem(@AField, @AValue, SizeOf(T)) + else + Result := TComparer.Default.Compare(AField, AValue) <> 0; + if Result then + begin + AField := AValue; + Change; + end; +end; + +{ TSkCustomControl } + +constructor TSkCustomControl.Create(AOwner: TComponent); +begin + inherited; + FDrawCacheKind := TSkDrawCacheKind.Raster; + HitTest := False; +end; + +destructor TSkCustomControl.Destroy; +begin + FBuffer.Free; + inherited; +end; + +procedure TSkCustomControl.Draw(const ACanvas: ISkCanvas; const ADest: TRectF; + const AOpacity: Single); +begin + if csDesigning in ComponentState then + DrawDesignBorder(ACanvas, ADest, AOpacity); +end; + +procedure TSkCustomControl.DrawDesignBorder(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); +const + DesignBorderColor = $A0909090; +var + R: TRectF; + LPaint: ISkPaint; +begin + R := ADest; + InflateRect(R, -0.5, -0.5); + ACanvas.Save; + try + LPaint := TSkPaint.Create(TSkPaintStyle.Stroke); + LPaint.AlphaF := AOpacity; + LPaint.Color := DesignBorderColor; + LPaint.StrokeWidth := 1; + LPaint.PathEffect := TSKPathEffect.MakeDash([3, 1], 0); + ACanvas.DrawRect(R, LPaint); + finally + ACanvas.Restore; end; +end; + +function TSkCustomControl.NeedsRedraw: Boolean; +begin + Result := (not FDrawCached) or (FDrawCacheKind = TSkDrawCacheKind.Never) or (FBuffer = nil); +end; +procedure TSkCustomControl.Paint; var - LSceneScale: Single; + LAbsoluteBimapSize: TSize; LAbsoluteScale: TPointF; LAbsoluteSize: TSize; - LAbsoluteBimapSize: TSize; - LMaxBitmapSize: Integer; + LDestRect: TRectF; LExceededRatio: Single; + LMaxBitmapSize: Integer; + LSceneScale: Single; begin if (FDrawCacheKind <> TSkDrawCacheKind.Always) and (Canvas is TSkCanvasCustom) then begin - DrawUsingSkia(TSkCanvasCustom(Canvas).Surface, Canvas.AlignToPixel(LocalRect), AbsoluteOpacity); + LDestRect := Canvas.AlignToPixel(LocalRect); + Draw(TSkCanvasCustom(Canvas).Canvas, LDestRect, AbsoluteOpacity); + if Assigned(FOnDraw) then + FOnDraw(Self, TSkCanvasCustom(Canvas).Canvas, LDestRect, AbsoluteOpacity); FreeAndNil(FBuffer); end else @@ -1584,7 +2068,7 @@ procedure TSkStyledControl.DrawDesignBorder(const ACanvas: ISkCanvas; const ADes LPaint.AlphaF := AOpacity; LPaint.Color := DesignBorderColor; LPaint.StrokeWidth := 1; - LPaint.PathEffect := TSKPathEffect.MakeDash([3, 1], 0); + LPaint.PathEffect := TSkPathEffect.MakeDash([3, 1], 0); ACanvas.DrawRect(R, LPaint); finally ACanvas.Restore; @@ -1597,28 +2081,21 @@ function TSkStyledControl.NeedsRedraw: Boolean; end; procedure TSkStyledControl.Paint; - - procedure DrawUsingSkia(const ASurface: ISkSurface; const ADestRect: TRectF; const AOpacity: Single); - begin - if Assigned(ASurface) then - begin - Draw(ASurface.Canvas, ADestRect, AOpacity); - if Assigned(FOnDraw) then - FOnDraw(Self, ASurface.Canvas, ADestRect, AOpacity); - end; - end; - var - LSceneScale: Single; + LAbsoluteBimapSize: TSize; LAbsoluteScale: TPointF; LAbsoluteSize: TSize; - LAbsoluteBimapSize: TSize; - LMaxBitmapSize: Integer; + LDestRect: TRectF; LExceededRatio: Single; + LMaxBitmapSize: Integer; + LSceneScale: Single; begin if (FDrawCacheKind <> TSkDrawCacheKind.Always) and (Canvas is TSkCanvasCustom) then begin - DrawUsingSkia(TSkCanvasCustom(Canvas).Surface, Canvas.AlignToPixel(LocalRect), AbsoluteOpacity); + LDestRect := Canvas.AlignToPixel(LocalRect); + Draw(TSkCanvasCustom(Canvas).Canvas, LDestRect, AbsoluteOpacity); + if Assigned(FOnDraw) then + FOnDraw(Self, TSkCanvasCustom(Canvas).Canvas, LDestRect, AbsoluteOpacity); FreeAndNil(FBuffer); end else @@ -1794,7 +2271,7 @@ function TSkSvgBrush.IsWrapModeStored: Boolean; function TSkSvgBrush.MakeDOM: ISkSVGDOM; begin - Result := TSkSVGDOM.Make(FSource); + Result := TSkSVGDOM.Make(FSource, TSkDefaultProviders.Resource); end; procedure TSkSvgBrush.RecreateDOM; @@ -1866,8 +2343,8 @@ procedure TSkSvgBrush.Render(const ACanvas: ISkCanvas; const ADestRect: TRectF; begin if AWrapMode <> TSkSvgWrapMode.Default then begin - ADOM.Root.Width := TSkSVGLength.Create(AWrappedDest.Width, TSkSVGLengthUnit.PX); - ADOM.Root.Height := TSkSVGLength.Create(AWrappedDest.Height, TSkSVGLengthUnit.PX); + ADOM.Root.Width := TSkSVGLength.Create(AWrappedDest.Width, TSkSVGLengthUnit.Pixel); + ADOM.Root.Height := TSkSVGLength.Create(AWrappedDest.Height, TSkSVGLengthUnit.Pixel); end; end else @@ -1923,8 +2400,8 @@ procedure TSkSvgBrush.Render(const ACanvas: ISkCanvas; const ADestRect: TRectF; begin if FWrapMode <> TSkSvgWrapMode.Default then begin - LDOM.Root.Width := TSkSVGLength.Create(LWrappedDest.Width, TSkSVGLengthUnit.PX); - LDOM.Root.Height := TSkSVGLength.Create(LWrappedDest.Height, TSkSVGLengthUnit.PX); + LDOM.Root.Width := TSkSVGLength.Create(LWrappedDest.Width, TSkSVGLengthUnit.Pixel); + LDOM.Root.Height := TSkSVGLength.Create(LWrappedDest.Height, TSkSVGLengthUnit.Pixel); end; end else @@ -2016,284 +2493,813 @@ procedure TSkSvg.SvgChanged(ASender: TObject); Redraw; end; -type - { TRepaintAnimation } +{ TBasicAnimation } - TRepaintAnimation = class(TAnimation) +type + TBasicAnimation = class(TAnimation) protected procedure ProcessAnimation; override; end; -{ TRepaintAnimation } - -procedure TRepaintAnimation.ProcessAnimation; +procedure TBasicAnimation.ProcessAnimation; begin - TSkCustomAnimatedControl(Parent).ProcessAnimation; end; -{ TSkCustomAnimatedControl } +{ TSkCustomAnimation.TProcess } -procedure TSkCustomAnimatedControl.AncestorVisibleChanged(const AVisible: Boolean); -var - LLastAbsoluteVisible: Boolean; +class procedure TSkCustomAnimation.TProcess.Add(const AAnimation: TSkCustomAnimation); begin - LLastAbsoluteVisible := FAbsoluteVisible; - if not AVisible then - begin - FAbsoluteVisible := False; - FAbsoluteVisibleCached := True; - end - else - FAbsoluteVisibleCached := False; - if (not FFixedProgress) and (not FProgressChangedManually) and (not LLastAbsoluteVisible) and AbsoluteVisible then - begin - FProgress := 0; - FAnimationStartTickCount := TThread.GetTickCount; - end; - CheckAnimation; - inherited; + if FProcess = nil then + FProcess := TProcess.Create; + FProcess.DoAdd(AAnimation); end; -function TSkCustomAnimatedControl.CanRunAnimation: Boolean; +constructor TSkCustomAnimation.TProcess.Create; begin - Result := (not FIsStaticImage) and Assigned(Scene) and (not FFixedProgress) and - ([csDestroying, csDesigning] * ComponentState = []) and - AbsoluteVisible and AbsoluteEnabled and - (AbsoluteWidth > 0) and (AbsoluteHeight > 0) and - (FLoop or not SameValue(FProgress, 1, TEpsilon.Matrix)) and - (Scene.GetObject is TCommonCustomForm) and TCommonCustomForm(Scene.GetObject).Visible; + inherited Create; + if not TPlatformServices.Current.SupportsPlatformService(IFMXTimerService, FTimerService) then + raise EUnsupportedPlatformService.Create('IFMXTimerService'); + FAniList := TList.Create; + FAniProcessingList := TList.Create; + FAnimation := TBasicAnimation.Create(nil); + TBasicAnimation(FAnimation).Loop := True; + TBasicAnimation(FAnimation).Duration := 30; + TBasicAnimation(FAnimation).OnProcess := OnProcess; + FMainFormChangedMessageId := TMessageManager.DefaultManager.SubscribeToMessage(TMainFormChangedMessage, MainFormChangeHandler); +end; + +destructor TSkCustomAnimation.TProcess.Destroy; +begin + TMessageManager.DefaultManager.Unsubscribe(TMainFormChangedMessage, FMainFormChangedMessageId); + FreeAndNil(FAniList); + FAniProcessingList.Free; + FAnimation.Free; + inherited; end; -procedure TSkCustomAnimatedControl.CheckAnimation; +class destructor TSkCustomAnimation.TProcess.Destroy; +begin + FProcess.Free; + inherited; +end; - procedure FixStartTickCount; - var - LNewTickCount: Int64; +procedure TSkCustomAnimation.TProcess.DoAdd(const AAnimation: TSkCustomAnimation); +begin + if FAniList.IndexOf(AAnimation) < 0 then + FAniList.Add(AAnimation); + if not TBasicAnimation(FAnimation).Enabled and (FAniList.Count > 0) then begin - LNewTickCount := TThread.GetTickCount - Round(FProgress * Duration * 1000); - if LNewTickCount < 0 then - LNewTickCount := High(Cardinal) + LNewTickCount; - FAnimationStartTickCount := Cardinal(LNewTickCount); + FTime := FTimerService.GetTick; + if Assigned(Application.MainForm) then + begin + FAnimation.SetRoot(Application.MainForm); + FAniRoot := nil; + end + else if Assigned(AAnimation.Root) then + begin + FAnimation.SetRoot(AAnimation.Root); + FAniRoot := AAnimation; + end; end; + TBasicAnimation(FAnimation).Enabled := Assigned(FAnimation.Root) and (FAniList.Count > 0); +end; -var - LCanRunAnimation: Boolean; +procedure TSkCustomAnimation.TProcess.DoRemove(const AAnimation: TSkCustomAnimation); begin - if Assigned(FAnimation) then + if FAniList <> nil then begin - LCanRunAnimation := CanRunAnimation; - if FAnimation.Enabled <> LCanRunAnimation then + FAniList.Remove(AAnimation); + FAniProcessingList.Remove(AAnimation); + if FAniRoot = AAnimation then begin - FAnimation.Enabled := LCanRunAnimation; - if LCanRunAnimation then - begin - FixStartTickCount; - DoAnimationStart; - end - else - DoAnimationFinished; + FAnimation.SetRoot(nil); + FAniRoot := nil; + TryFindRoot; end; + TBasicAnimation(FAnimation).Enabled := Assigned(FAnimation.Root) and (FAniList.Count > 0); end; end; -constructor TSkCustomAnimatedControl.Create(AOwner: TComponent); +procedure TSkCustomAnimation.TProcess.DoRootChanged(const AAnimation: TSkCustomAnimation); begin - inherited; - DisabledOpacity := 1; - if csDesigning in ComponentState then + if FAniRoot = AAnimation then + begin + FAnimation.SetRoot(nil); + FAniRoot := nil; + TryFindRoot; + end + else if not Assigned(FAnimation.Root) and Assigned(AAnimation.Root) then begin - FProgress := 0.5; - FFixedProgress := True; + FAnimation.SetRoot(AAnimation.Root); + FAniRoot := AAnimation; end; - FIsStaticImage := True; - FLoop := True; - FAnimation := TRepaintAnimation.Create(Self); - FAnimation.Stored := False; - FAnimation.Loop := True; - FAnimation.Duration := 30; - FAnimation.Parent := Self; - FAbsoluteVisible := Visible; - FAbsoluteVisibleCached := True; - if FIsStaticImage then - DrawCacheKind := TSkDrawCacheKind.Raster - else - DrawCacheKind := TSkDrawCacheKind.Never; + TBasicAnimation(FAnimation).Enabled := Assigned(FAnimation.Root) and (FAniList.Count > 0); end; -procedure TSkCustomAnimatedControl.DoAnimationFinished; +procedure TSkCustomAnimation.TProcess.MainFormChangeHandler( + const ASender: TObject; const AMessage: TMessage); begin - if Assigned(FOnAnimationFinished) then - FOnAnimationFinished(Self); - FProgressChangedManually := False; + FAnimation.SetRoot(nil); + TryFindRoot; end; -procedure TSkCustomAnimatedControl.DoAnimationProgress; +procedure TSkCustomAnimation.TProcess.OnProcess(ASender: TObject); +var + I: Integer; + LNewTime: Double; + LDeltaTime: Double; + [unsafe] LAnimation: TSkCustomAnimation; begin - if Assigned(FOnAnimationProgress) then - FOnAnimationProgress(Self); + LNewTime := FTimerService.GetTick; + LDeltaTime := LNewTime - FTime; + if LDeltaTime < TimeEpsilon then + Exit; + FTime := LNewTime; + if FAniList.Count > 0 then + begin + FAniProcessingList.AddRange(FAniList); + I := FAniProcessingList.Count - 1; + while I >= 0 do + begin + if I < FAniProcessingList.Count then + begin + LAnimation := FAniProcessingList[I]; + FAniProcessingList.Delete(I); + if LAnimation.Running then + LAnimation.ProcessTick(LDeltaTime); + Dec(I); + end + else + I := FAniProcessingList.Count - 1; + end; + end; end; -procedure TSkCustomAnimatedControl.DoAnimationStart; +class procedure TSkCustomAnimation.TProcess.Remove( + const AAnimation: TSkCustomAnimation); begin - if Assigned(FOnAnimationStart) then - FOnAnimationStart(Self); + if FProcess <> nil then + FProcess.DoRemove(AAnimation); end; -procedure TSkCustomAnimatedControl.Draw(const ACanvas: ISkCanvas; - const ADest: TRectF; const AOpacity: Single); +class procedure TSkCustomAnimation.TProcess.RootChanged( + const AAnimation: TSkCustomAnimation); +begin + if FProcess <> nil then + FProcess.DoRootChanged(AAnimation); +end; - procedure FixElapsedSeconds(const ACurrentTickCount: Cardinal; - var AStartTickCount: Cardinal; var AElapsedSeconds: Double); - var - LMillisecondsElapsed: Int64; +procedure TSkCustomAnimation.TProcess.TryFindRoot; +var + I: Integer; +begin + if Assigned(Application.MainForm) then + begin + FAnimation.SetRoot(Application.MainForm); + FAniRoot := nil; + end + else begin - Assert(ACurrentTickCount < AStartTickCount); - if ACurrentTickCount >= Cardinal(Ceil(Duration * 1000)) then + for I := 0 to FAniList.Count - 1 do begin - if FLoop then + if Assigned(TSkCustomAnimation(FAniList[I]).Root) then begin - LMillisecondsElapsed := ACurrentTickCount + High(Cardinal) - AStartTickCount; - LMillisecondsElapsed := LMillisecondsElapsed mod Round(Duration * 1000); - Assert(ACurrentTickCount > LMillisecondsElapsed); - FAnimationStartTickCount := Cardinal(ACurrentTickCount - LMillisecondsElapsed); - end - else - AStartTickCount := ACurrentTickCount - Cardinal(Ceil(Duration * 1000)); - AElapsedSeconds := (ACurrentTickCount - AStartTickCount) / 1000; - end + FAniRoot := TSkCustomAnimation(FAniList[I]); + FAnimation.SetRoot(FAniRoot.Root); + Break; + end; + end; + end; +end; + +{ TSkCustomAnimation } + +procedure TSkCustomAnimation.BeforePaint; +begin + if FNeedStart then + begin + if FAllowAnimation then + InternalStart(False) else + FNeedStartRepaint := True; + end; +end; + +function TSkCustomAnimation.CanProcessing: Boolean; +begin + Result := FRunning and (not FPause) and (FSpeed >= SpeedEpsilon) and (FProcessDuration >= TimeEpsilon) and (FAllowAnimation or not FLoop); +end; + +constructor TSkCustomAnimation.Create(const AOwner: TComponent); +begin + inherited Create; + FOwner := AOwner; + Assign(nil); +end; + +destructor TSkCustomAnimation.Destroy; +begin + SetProcessing(False); + inherited; +end; + +procedure TSkCustomAnimation.DoAssign(ASource: TPersistent); +var + LSourceAnimation: TSkCustomAnimation absolute ASource; +begin + if ASource = nil then + begin + AutoReverse := DefaultAutoReverse; + Delay := DefaultDelay; + Enabled := DefaultEnabled; + Inverse := DefaultInverse; + Loop := DefaultLoop; + Pause := DefaultPause; + Speed := DefaultSpeed; + StartFromCurrent := DefaultStartFromCurrent; + StartProgress := DefaultStartProgress; + StopProgress := DefaultStopProgress; + DoSetCurrentTime(0); + SetRunning(False); + end + else if ASource is TSkCustomAnimation then + begin + AutoReverse := LSourceAnimation.AutoReverse; + Delay := LSourceAnimation.Delay; + Enabled := LSourceAnimation.Enabled; + Inverse := LSourceAnimation.Inverse; + Loop := LSourceAnimation.Loop; + Pause := LSourceAnimation.Pause; + Speed := LSourceAnimation.Speed; + StartFromCurrent := LSourceAnimation.StartFromCurrent; + StartProgress := LSourceAnimation.StartProgress; + StopProgress := LSourceAnimation.StopProgress; + DoSetCurrentTime(LSourceAnimation.CurrentTime); + SetRunning(LSourceAnimation.Running); + end + else + inherited; +end; + +procedure TSkCustomAnimation.DoChanged; +var + LCanProcess: Boolean; +begin + UpdateCurrentTime(FRunning, True); + LCanProcess := FAllowAnimation; + + if FEnabledChanged then + begin + FEnabledChanged := False; + if not FEnabled then + Stop + else if (not Assigned(FOwner)) or (not (csDesigning in FOwner.ComponentState)) then begin - LMillisecondsElapsed := ACurrentTickCount + High(Cardinal) - AStartTickCount; - AElapsedSeconds := LMillisecondsElapsed / 1000; + FNeedStart := True; + FNeedStartRepaint := False; end; - Assert(AElapsedSeconds >= 0); end; + if FNeedStart and FNeedStartRepaint and FAllowAnimation then + begin + Start; + LCanProcess := False; + end; + SetProcessing(CanProcessing); + inherited; + if LCanProcess then + DoProcess; +end; - function CalcProgress: Double; - var - LElapsedSeconds: Double; - LDuration: Double; - LCurrentTickCount: Cardinal; +function TSkCustomAnimation.DoSetCurrentTime(const AValue: Double): Boolean; +begin + Result := SetValue(FDelayTime, 0, TimeEpsilon); + Result := SetValue(FCurrentTime, EnsureRange(AValue, 0, FDuration), TimeEpsilon) or Result; +end; + +function TSkCustomAnimation.Equals(AObject: TObject): Boolean; +var + LSourceAnimation: TSkCustomAnimation absolute AObject; +begin + Result := (AObject is TSkCustomAnimation) and + (FAutoReverse = LSourceAnimation.AutoReverse) and + (FEnabled = LSourceAnimation.Enabled) and + (FInverse = LSourceAnimation.Inverse) and + (FLoop = LSourceAnimation.Loop) and + (FPause = LSourceAnimation.Pause) and + (FStartFromCurrent = LSourceAnimation.StartFromCurrent) and + (FRunning = LSourceAnimation.Running) and + SameValue(FCurrentTime, LSourceAnimation.CurrentTime, TimeEpsilon) and + SameValue(FDelay, LSourceAnimation.Delay, TimeEpsilon) and + SameValue(FSpeed, LSourceAnimation.Speed, SpeedEpsilon) and + SameValue(FStartProgress, LSourceAnimation.StartProgress, ProgressEpsilon) and + SameValue(FStopProgress, LSourceAnimation.StopProgress, ProgressEpsilon); +end; + +function TSkCustomAnimation.GetDuration: Double; +begin + Result := FDuration; +end; + +function TSkCustomAnimation.GetRoot: IRoot; +begin + if FOwner is TFmxObject then + Result := TFmxObject(FOwner).Root + else + Result := nil; +end; + +procedure TSkCustomAnimation.InternalStart(const ACanProcess: Boolean); +begin + FNeedStart := False; + if not FLoop then + FTickCount := 0; + if FAutoReverse then + begin + if FRunning then + FInverse := FSavedInverse + else + FSavedInverse := FInverse; + end; + if FProcessDuration < TimeEpsilon then + begin + SetStartValues(0, True); + FRunning := True; + DoStart; + if ACanProcess and FAllowAnimation then + DoProcess; + FRunning := False; + FProcessTime := 0; + DoFinish; + end + else + begin + SetStartValues(FDelay, False); + FRunning := True; + FEnabled := True; + SetProcessing(CanProcessing); + + if FDelay < TimeEpsilon then + begin + DoStart; + if ACanProcess and FAllowAnimation then + DoProcess; + end + else + DoStart; + end; +end; + +function TSkCustomAnimation.IsDelayStored: Boolean; +begin + Result := not SameValue(FDelay, DefaultDelay, TimeEpsilon); +end; + +function TSkCustomAnimation.IsProgressStored: Boolean; +begin + Result := not SameValue(FProgress, DefaultStartProgress, ProgressEpsilon); +end; + +function TSkCustomAnimation.IsSpeedStored: Boolean; +begin + Result := not SameValue(FSpeed, DefaultSpeed, SpeedEpsilon); +end; + +function TSkCustomAnimation.IsStartProgressStored: Boolean; +begin + Result := not SameValue(FStartProgress, DefaultStartProgress, ProgressEpsilon); +end; + +function TSkCustomAnimation.IsStopProgressStored: Boolean; +begin + Result := not SameValue(FStopProgress, DefaultStopProgress, ProgressEpsilon); +end; + +procedure TSkCustomAnimation.ProcessTick(ADeltaTime: Double); +begin + if Assigned(FOwner) and (csDestroying in FOwner.ComponentState) then + Exit; + SetProcessing(CanProcessing); + if (not FRunning) or FPause or (FSpeed < SpeedEpsilon) or (not FProcessing) then + Exit; + + if FDelayTime >= TimeEpsilon then begin - if Enabled then + FDelayTime := FDelayTime - ADeltaTime; + if FDelayTime < TimeEpsilon then begin - LCurrentTickCount := TThread.GetTickCount; - LElapsedSeconds := (LCurrentTickCount - FAnimationStartTickCount) / 1000; - if LElapsedSeconds < 0 then - FixElapsedSeconds(LCurrentTickCount, FAnimationStartTickCount, LElapsedSeconds); - LDuration := Duration; - if SameValue(LDuration, 0, TEpsilon.Matrix) then - Result := 1 + ADeltaTime := Max(-FDelayTime, 0); + SetStartValues(0, False); + if ADeltaTime < TimeEpsilon then + Exit; + end + else + Exit; + end; + + if FInverse then + FProcessTime := FProcessTime - ADeltaTime * FSpeed + else + FProcessTime := FProcessTime + ADeltaTime * FSpeed; + if FProcessTime >= FProcessDuration then + begin + FProcessTime := FProcessDuration; + if FLoop then + begin + if FAutoReverse then + begin + FInverse := True; + FProcessTime := FProcessDuration; + end + else + FProcessTime := 0; + end + else + if FAutoReverse and (FTickCount = 0) then + begin + Inc(FTickCount); + FInverse := True; + FProcessTime := FProcessDuration; + end else + FRunning := False; + end + else if FProcessTime <= 0 then + begin + FProcessTime := 0; + if FLoop then + begin + if FAutoReverse then begin - if FLoop then - begin - {$IF CompilerVersion >= 29} - LElapsedSeconds := FMod(LElapsedSeconds, LDuration); - {$ELSE} - LElapsedSeconds := (Round(LElapsedSeconds * 1000) mod Round(LDuration * 1000)) / 1000; - {$ENDIF} - end - else - LElapsedSeconds := Min(LElapsedSeconds, LDuration); - Result := LElapsedSeconds / LDuration; - end; + FInverse := False; + FProcessTime := 0; + end + else + FProcessTime := FProcessDuration; end else - Result := FProgress; + if FAutoReverse and (FTickCount = 0) then + begin + Inc(FTickCount); + FInverse := False; + FProcessTime := 0; + end + else + FRunning := False; end; + UpdateCurrentTime(True, Updating); -var - LProgress: Double; + if not FRunning then + begin + if FAutoReverse then + FInverse := FSavedInverse; + FEnabled := False; + SetProcessing(False); + end; + + if FAllowAnimation then + DoProcess; + if not FRunning then + DoFinish; +end; + +procedure TSkCustomAnimation.RootChanged; begin - inherited; - if Assigned(FAnimation) and not FAnimation.Enabled then - CheckAnimation; - if FFixedProgress then - LProgress := FProgress - else - LProgress := CalcProgress; - RenderFrame(ACanvas, ADest, LProgress, AOpacity); - if not SameValue(LProgress, FProgress, TEpsilon.Matrix) then + if FProcessing then + TProcess.RootChanged(Self); +end; + +procedure TSkCustomAnimation.SetAllowAnimation(const AValue: Boolean); +begin + SetValue(FAllowAnimation, AValue); +end; + +procedure TSkCustomAnimation.SetCurrentTime(const AValue: Double); +begin + BeginUpdate; + try + FCurrentTimeChanged := DoSetCurrentTime(RoundTo(AValue, TimeRoundTo)) or FCurrentTimeChanged; + finally + EndUpdate; + end; +end; + +procedure TSkCustomAnimation.SetDelay(const AValue: Double); +begin + FDelay := Max(0, RoundTo(AValue, TimeRoundTo)); + FDelayTime := Min(FDelayTime, FDelay); +end; + +procedure TSkCustomAnimation.SetDuration(const AValue: Double); +begin + SetValue(FDuration, Max(RoundTo(AValue, TimeRoundTo), 0), TimeEpsilon); +end; + +procedure TSkCustomAnimation.SetEnabled(const AValue: Boolean); +begin + BeginUpdate; + try + FEnabledChanged := SetValue(FEnabled, AValue) or FEnabledChanged; + finally + EndUpdate; + end; +end; + +procedure TSkCustomAnimation.SetLoop(const AValue: Boolean); +begin + SetValue(FLoop, AValue); +end; + +procedure TSkCustomAnimation.SetPause(const AValue: Boolean); +begin + SetValue(FPause, AValue); +end; + +procedure TSkCustomAnimation.SetProcessing(const AValue: Boolean); +begin + if FProcessing <> AValue then begin - FProgress := LProgress; - DoAnimationProgress; + FProcessing := AValue; + if FProcessing then + TProcess.Add(Self) + else + TProcess.Remove(Self); end; - if (not FLoop) and SameValue(LProgress, 1, TEpsilon.Matrix) then +end; + +procedure TSkCustomAnimation.SetProgress(const AValue: Double); +begin + FSavedProgress := AValue; + CurrentTime := FDuration * EnsureRange(AValue, 0, 1); +end; + +procedure TSkCustomAnimation.SetRunning(const AValue: Boolean); +begin + SetValue(FRunning, AValue); +end; + +procedure TSkCustomAnimation.SetSpeed(const AValue: Double); +begin + SetValue(FSpeed, Max(RoundTo(AValue, SpeedRoundTo), 0), SpeedEpsilon); +end; + +procedure TSkCustomAnimation.SetStartProgress(const AValue: Double); +begin + SetValue(FStartProgress, EnsureRange(AValue, 0, 1), ProgressEpsilon); +end; + +procedure TSkCustomAnimation.SetStartValues(const ADelayTime: Double; const AStartAtEnd: Boolean); +begin + FDelayTime := ADelayTime; + if FStartFromCurrent and not AStartAtEnd then + FProcessTime := EnsureRange(FCurrentTime - Min(FStartProgress, FStopProgress) * FDuration, 0, FProcessDuration) + else + FProcessTime := IfThen(FInverse = AStartAtEnd, 0, FProcessDuration); + UpdateCurrentTime(True, Updating); +end; + +procedure TSkCustomAnimation.SetStopProgress(const AValue: Double); +begin + SetValue(FStopProgress, EnsureRange(AValue, 0, 1), ProgressEpsilon); +end; + +procedure TSkCustomAnimation.Start; +begin + InternalStart(True); +end; + +procedure TSkCustomAnimation.Stop; +begin + FNeedStart := False; + if not FRunning then + Exit; + if FAutoReverse then + FInverse := FSavedInverse; + if FInverse then + begin + FCurrentTime := 0; + FProgress := 0; + end + else begin + FCurrentTime := FProcessDuration; FProgress := 1; - CheckAnimation; end; - FSuccessRepaint := True; + if FAllowAnimation then + DoProcess; + FRunning := False; + FEnabled := False; + SetProcessing(False); + DoFinish; end; -function TSkCustomAnimatedControl.GetAbsoluteVisible: Boolean; +procedure TSkCustomAnimation.StopAtCurrent; begin - if not FAbsoluteVisibleCached then + FNeedStart := False; + if not FRunning then + Exit; + if FAutoReverse then + FInverse := FSavedInverse; + FRunning := False; + FEnabled := False; + SetProcessing(False); + DoFinish; +end; + +procedure TSkCustomAnimation.UpdateCurrentTime(const AIsRunning, ARecalcProcessDuration: Boolean); +begin + if ARecalcProcessDuration then begin - FAbsoluteVisible := GetParentedVisible; - FAbsoluteVisibleCached := True; + FProcessDuration := Abs(FStopProgress - FStartProgress) * FDuration; + if FProcessDuration < TimeEpsilon then + FProcessDuration := 0; end; - Result := FAbsoluteVisible; + if FCurrentTimeChanged and AIsRunning then + FProcessTime := EnsureRange(FCurrentTime - Min(FStartProgress, FStopProgress) * FDuration, 0, FProcessDuration); + if AIsRunning then + FCurrentTime := Min(FStartProgress, FStopProgress) * FDuration + FProcessTime + else + FCurrentTime := EnsureRange(FCurrentTime, 0, FDuration); + FCurrentTimeChanged := False; + if FDuration < TimeEpsilon then + begin + if FInverse then + FProgress := FStopProgress + else + FProgress := FStartProgress; + end + else + FProgress := FCurrentTime / FDuration; end; -function TSkCustomAnimatedControl.GetRunningAnimation: Boolean; +{ TSkCustomAnimatedControl.TAnimationBase } + +procedure TSkCustomAnimatedControl.TAnimationBase.DoChanged; begin - Result := Assigned(FAnimation) and FAnimation.Enabled; + inherited; + if Created then + TSkCustomAnimatedControl(Owner).DoAnimationChanged; end; -procedure TSkCustomAnimatedControl.ProcessAnimation; +procedure TSkCustomAnimatedControl.TAnimationBase.DoFinish; begin - if not FSuccessRepaint then - CheckAnimation; - FSuccessRepaint := False; - Repaint; + TSkCustomAnimatedControl(Owner).DoAnimationFinish; end; -procedure TSkCustomAnimatedControl.RecalcEnabled; +procedure TSkCustomAnimatedControl.TAnimationBase.DoProcess; begin - inherited; - CheckAnimation; + if FInsideDoProcess then + Exit; + FInsideDoProcess := True; + try + TSkCustomAnimatedControl(Owner).DoAnimationProcess; + finally + FInsideDoProcess := False; + end; end; -procedure TSkCustomAnimatedControl.RenderFrame(const ACanvas: ISkCanvas; - const ADest: TRectF; const AProgress: Double; const AOpacity: Single); +procedure TSkCustomAnimatedControl.TAnimationBase.DoStart; begin - if Assigned(FOnAnimationDraw) then - FOnAnimationDraw(Self, ACanvas, ADest, AProgress, AOpacity); + TSkCustomAnimatedControl(Owner).DoAnimationStart; end; -procedure TSkCustomAnimatedControl.SetFixedProgress(const AValue: Boolean); +{ TSkCustomAnimatedControl } + +procedure TSkCustomAnimatedControl.AncestorVisibleChanged(const AVisible: Boolean); +var + LLastAbsoluteVisible: Boolean; begin - if FFixedProgress <> AValue then + LLastAbsoluteVisible := FAbsoluteVisible; + if not AVisible then begin - FFixedProgress := AValue; - CheckAnimation; - end; + FAbsoluteVisible := False; + FAbsoluteVisibleCached := True; + end + else + FAbsoluteVisibleCached := False; + if Assigned(FAnimation) and FAnimation.Loop and FAnimation.Running and (not LLastAbsoluteVisible) and AbsoluteVisible then + FAnimation.Start; + CheckAnimation; + inherited; +end; + +function TSkCustomAnimatedControl.CanRunAnimation: Boolean; +begin + Result := Assigned(Scene) and ([csDestroying, csLoading] * ComponentState = []) and + AbsoluteVisible and + (not SameValue(AbsoluteWidth, 0, TEpsilon.Position)) and + (not SameValue(AbsoluteHeight, 0, TEpsilon.Position)) and + (Scene.GetObject is TCommonCustomForm) and TCommonCustomForm(Scene.GetObject).Visible; +end; + +procedure TSkCustomAnimatedControl.CheckAnimation; +begin + if Assigned(FAnimation) then + FAnimation.AllowAnimation := CanRunAnimation; end; -procedure TSkCustomAnimatedControl.SetIsStaticImage(const AValue: Boolean); +procedure TSkCustomAnimatedControl.CheckDuration; begin - if FIsStaticImage <> AValue then + if Assigned(FAnimation) then begin - FIsStaticImage := AValue; - if FIsStaticImage then + if SameValue(FAnimation.Duration, 0, TAnimationBase.TimeEpsilon) then DrawCacheKind := TSkDrawCacheKind.Raster else DrawCacheKind := TSkDrawCacheKind.Never; - CheckAnimation; end; end; -procedure TSkCustomAnimatedControl.SetLoop(const AValue: Boolean); +constructor TSkCustomAnimatedControl.Create(AOwner: TComponent); begin - if FLoop <> AValue then - begin - FLoop := AValue; + inherited; + FAnimation := CreateAnimation; + FAbsoluteVisible := Visible; + FAbsoluteVisibleCached := True; + CheckDuration; +end; + +destructor TSkCustomAnimatedControl.Destroy; +begin + FreeAndNil(FAnimation); + inherited; +end; + +procedure TSkCustomAnimatedControl.DoAnimationChanged; +begin + CheckDuration; + if csDesigning in ComponentState then + Repaint; +end; + +procedure TSkCustomAnimatedControl.DoAnimationFinish; +begin + Redraw; + if Assigned(FOnAnimationFinish) then + FOnAnimationFinish(Self); +end; + +procedure TSkCustomAnimatedControl.DoAnimationProcess; +begin + if not FSuccessRedraw then + CheckAnimation; + FSuccessRedraw := False; + Redraw; + if Assigned(FOnAnimationProcess) then + FOnAnimationProcess(Self); +end; + +procedure TSkCustomAnimatedControl.DoAnimationStart; +begin + if Assigned(FOnAnimationStart) then + FOnAnimationStart(Self); +end; + +procedure TSkCustomAnimatedControl.DoRootChanged; +begin + inherited; + if Assigned(FAnimation) then + FAnimation.RootChanged; +end; + +procedure TSkCustomAnimatedControl.Draw(const ACanvas: ISkCanvas; + const ADest: TRectF; const AOpacity: Single); +begin + inherited; + if not FAnimation.AllowAnimation then CheckAnimation; + FAnimation.BeforePaint; + RenderFrame(ACanvas, ADest, FAnimation.Progress, AOpacity); + FSuccessRedraw := True; +end; + +function TSkCustomAnimatedControl.GetAbsoluteVisible: Boolean; +begin + if not FAbsoluteVisibleCached then + begin + FAbsoluteVisible := GetParentedVisible; + FAbsoluteVisibleCached := True; + end; + Result := FAbsoluteVisible; +end; + +procedure TSkCustomAnimatedControl.ReadState(AReader: TReader); +begin + FAnimation.BeginUpdate; + try + FAnimation.SavedProgress := FAnimation.Progress; + inherited; + FAnimation.Progress := FAnimation.SavedProgress; + finally + FAnimation.EndUpdate; end; end; +procedure TSkCustomAnimatedControl.RenderFrame(const ACanvas: ISkCanvas; + const ADest: TRectF; const AProgress: Double; const AOpacity: Single); +begin + if Assigned(FOnAnimationDraw) then + FOnAnimationDraw(Self, ACanvas, ADest, AProgress, AOpacity); +end; + procedure TSkCustomAnimatedControl.SetNewScene(AScene: IScene); var LCanCheck: Boolean; @@ -2305,70 +3311,117 @@ procedure TSkCustomAnimatedControl.SetNewScene(AScene: IScene); end; procedure TSkCustomAnimatedControl.SetOnAnimationDraw( - const Value: TSkAnimationDrawEvent); + const AValue: TSkAnimationDrawEvent); begin - FOnAnimationDraw := Value; + if TMethod(FOnAnimationDraw) <> TMethod(AValue) then + begin + FOnAnimationDraw := AValue; + Redraw; + end; end; -procedure TSkCustomAnimatedControl.SetProgress(AValue: Double); +{ TSkAnimatedPaintBox.TAnimation } + +constructor TSkAnimatedPaintBox.TAnimation.Create(const AOwner: TFmxObject); begin - FProgressChangedManually := True; - AValue := EnsureRange(AValue, 0, 1); - if not SameValue(FProgress, AValue, TEpsilon.Matrix) then - begin - FProgress := AValue; - if SameValue(FProgress, 0, TEpsilon.Matrix) then - FAnimationStartTickCount := TThread.GetTickCount; - CheckAnimation; - DoAnimationProgress; - Repaint; - end; + inherited Create(AOwner); + Duration := DefaultDuration; +end; + +procedure TSkAnimatedPaintBox.TAnimation.DoAssign(ASource: TPersistent); +var + LSourceAnimation: TSkCustomAnimation absolute ASource; +begin + if ASource = nil then + Duration := DefaultDuration + else if ASource is TSkCustomAnimation then + Duration := LSourceAnimation.Duration; + inherited; +end; + +function TSkAnimatedPaintBox.TAnimation.Equals(AObject: TObject): Boolean; +var + LSourceAnimation: TSkCustomAnimation absolute AObject; +begin + Result := inherited and SameValue(Duration, LSourceAnimation.Duration, TimeEpsilon); +end; + +function TSkAnimatedPaintBox.TAnimation.IsDurationStored: Boolean; +begin + Result := not SameValue(Duration, DefaultDuration, TimeEpsilon); end; { TSkAnimatedPaintBox } -function TSkAnimatedPaintBox.CanRunAnimation: Boolean; +function TSkAnimatedPaintBox.CreateAnimation: TSkCustomAnimatedControl.TAnimationBase; begin - Result := FAnimate and inherited; + Result := TAnimation.Create(Self); end; -constructor TSkAnimatedPaintBox.Create(AOwner: TComponent); +procedure TSkAnimatedPaintBox.DefineProperties(AFiler: TFiler); begin inherited; - FAnimate := True; - FDuration := DefaultDuration; - IsStaticImage := not FAnimate; + // Backward compatibility with version 3 + AFiler.DefineProperty('Animate', ReadAnimate, nil, False); + AFiler.DefineProperty('Duration', ReadDuration, nil, False); + AFiler.DefineProperty('Loop', ReadLoop, nil, False); +end; + +function TSkAnimatedPaintBox.GetAnimation: TSkAnimatedPaintBox.TAnimation; +begin + Result := TSkAnimatedPaintBox.TAnimation(FAnimation); +end; + +procedure TSkAnimatedPaintBox.ReadAnimate(AReader: TReader); +begin + Animation.Enabled := AReader.ReadBoolean; +end; + +procedure TSkAnimatedPaintBox.ReadDuration(AReader: TReader); +begin + Animation.Duration := AReader.ReadFloat; +end; + +procedure TSkAnimatedPaintBox.ReadLoop(AReader: TReader); +begin + Animation.Loop := AReader.ReadBoolean; +end; + +procedure TSkAnimatedPaintBox.SetAnimation(const AValue: TSkAnimatedPaintBox.TAnimation); +begin + FAnimation.Assign(AValue); +end; + +{ TSkAnimatedPaintBoxHelper } + +function TSkAnimatedPaintBoxHelper.Animate: Boolean; +begin + Result := Animation.Enabled; +end; + +function TSkAnimatedPaintBoxHelper.Duration: Double; +begin + Result := Animation.Duration; end; -function TSkAnimatedPaintBox.GetDuration: Double; +function TSkAnimatedPaintBoxHelper.FixedProgress: Boolean; begin - Result := FDuration; + Result := not Animation.Enabled; end; -function TSkAnimatedPaintBox.IsDurationStored: Boolean; +function TSkAnimatedPaintBoxHelper.Loop: Boolean; begin - Result := not SameValue(FDuration, DefaultDuration, TEpsilon.Vector); + Result := Animation.Loop; end; -procedure TSkAnimatedPaintBox.SetAnimate(const AValue: Boolean); +function TSkAnimatedPaintBoxHelper.Progress: Double; begin - if FAnimate <> AValue then - begin - FAnimate := AValue; - if FAnimate then - Progress := 0; - IsStaticImage := not FAnimate; - Redraw; - end; + Result := Animation.Progress; end; -procedure TSkAnimatedPaintBox.SetDuration(const AValue: Double); +function TSkAnimatedPaintBoxHelper.RunningAnimation: Boolean; begin - if not SameValue(FDuration, AValue, TEpsilon.Vector) then - begin - FDuration := AValue; - CheckAnimation; - end; + Result := Animation.Running; end; { TSkAnimatedImage.TSource } @@ -2377,11 +3430,13 @@ procedure TSkAnimatedImage.TSource.Assign(ASource: TPersistent); begin if ASource is TSource then Data := TSource(ASource).Data + else if ASource = nil then + Data := nil else inherited; end; -constructor TSkAnimatedImage.TSource.Create(const AOnChange: TNotifyEvent); +constructor TSkAnimatedImage.TSource.Create(const AOnChange: TChangeProc); begin inherited Create; FOnChange := AOnChange; @@ -2398,7 +3453,7 @@ procedure TSkAnimatedImage.TSource.SetData(const AValue: TBytes); begin FData := Copy(AValue); if Assigned(FOnChange) then - FOnChange(Self); + FOnChange(); end; end; @@ -2414,17 +3469,17 @@ constructor TSkAnimatedImage.TFormatInfo.Create(const AName, { TSkAnimatedImage } -function TSkAnimatedImage.CanRunAnimation: Boolean; -begin - Result := Assigned(FCodec) and inherited; -end; - constructor TSkAnimatedImage.Create(AOwner: TComponent); begin inherited; FSource := TSource.Create(SourceChange); end; +function TSkAnimatedImage.CreateAnimation: TSkCustomAnimatedControl.TAnimationBase; +begin + Result := TAnimation.Create(Self); +end; + procedure TSkAnimatedImage.DefineProperties(AFiler: TFiler); function DoWrite: Boolean; @@ -2438,6 +3493,10 @@ procedure TSkAnimatedImage.DefineProperties(AFiler: TFiler); begin inherited; AFiler.DefineBinaryProperty('Data', ReadData, WriteData, DoWrite); + // Backward compatibility with version 3 + AFiler.DefineProperty('Loop', ReadLoop, nil, False); + AFiler.DefineProperty('OnAnimationFinished', ReadOnAnimationFinished, nil, False); + AFiler.DefineProperty('OnAnimationProgress', ReadOnAnimationProgress, nil, False); end; destructor TSkAnimatedImage.Destroy; @@ -2456,12 +3515,9 @@ procedure TSkAnimatedImage.Draw(const ACanvas: ISkCanvas; const ADest: TRectF; DrawDesignBorder(ACanvas, ADest, AOpacity); end; -function TSkAnimatedImage.GetDuration: Double; +function TSkAnimatedImage.GetAnimation: TSkAnimatedImage.TAnimation; begin - if Assigned(FCodec) then - Result := FCodec.Duration - else - Result := 0; + Result := TSkAnimatedImage.TAnimation(FAnimation); end; function TSkAnimatedImage.GetOriginalSize: TSizeF; @@ -2495,6 +3551,32 @@ procedure TSkAnimatedImage.ReadData(AStream: TStream); LoadFromStream(AStream); end; +procedure TSkAnimatedImage.ReadLoop(AReader: TReader); +begin + Animation.Loop := AReader.ReadBoolean; +end; + +type + TReaderAccess = class(TReader) end; + +procedure TSkAnimatedImage.ReadOnAnimationFinished(AReader: TReader); +var + LMethod: TMethod; +begin + LMethod := TReaderAccess(AReader).FindMethodInstance(AReader.Root, AReader.ReadIdent); + if LMethod.Code <> nil then + OnAnimationFinish := TNotifyEvent(LMethod); +end; + +procedure TSkAnimatedImage.ReadOnAnimationProgress(AReader: TReader); +var + LMethod: TMethod; +begin + LMethod := TReaderAccess(AReader).FindMethodInstance(AReader.Root, AReader.ReadIdent); + if LMethod.Code <> nil then + OnAnimationProcess := TNotifyEvent(LMethod); +end; + class procedure TSkAnimatedImage.RegisterCodec( const ACodecClass: TAnimationCodecClass); begin @@ -2542,12 +3624,29 @@ procedure TSkAnimatedImage.RenderFrame(const ACanvas: ISkCanvas; end; begin - FCodec.Quality := Canvas.Quality; - FCodec.SeekFrameTime(AProgress * Duration); - FCodec.Render(ACanvas, GetWrappedRect(ADest), AOpacity); + if Assigned(FCodec) then + begin + FCodec.Quality := Canvas.Quality; + if (csDesigning in ComponentState) and (not Animation.Running) and (AProgress = 0) then + FCodec.SeekFrameTime(Animation.Duration / 8) + else + FCodec.SeekFrameTime(Animation.CurrentTime); + ACanvas.Save; + try + ACanvas.ClipRect(ADest); + FCodec.Render(ACanvas, GetWrappedRect(ADest), AOpacity); + finally + ACanvas.Restore; + end; + end; inherited; end; +procedure TSkAnimatedImage.SetAnimation(const AValue: TSkAnimatedImage.TAnimation); +begin + FAnimation.Assign(AValue); +end; + procedure TSkAnimatedImage.SetSource(const AValue: TSource); begin FSource.Assign(AValue); @@ -2562,7 +3661,7 @@ procedure TSkAnimatedImage.SetWrapMode(const AValue: TSkAnimatedImageWrapMode); end; end; -procedure TSkAnimatedImage.SourceChange(ASender: TObject); +procedure TSkAnimatedImage.SourceChange; var LCodecClass: TAnimationCodecClass; LStream: TStream; @@ -2579,9 +3678,14 @@ procedure TSkAnimatedImage.SourceChange(ASender: TObject); finally LStream.Free; end; - if not FixedProgress then - Progress := 0; - IsStaticImage := (FCodec = nil) or FCodec.IsStatic; + if Assigned(FCodec) then + begin + Animation.SetDuration(FCodec.Duration); + if Animation.Running then + Animation.Start; + end + else + Animation.SetDuration(0); Redraw; end; @@ -2591,6 +3695,33 @@ procedure TSkAnimatedImage.WriteData(AStream: TStream); AStream.WriteBuffer(FSource.Data, Length(FSource.Data)); end; +{ TSkAnimatedImageHelper } + +function TSkAnimatedImageHelper.Duration: Double; +begin + Result := Animation.Duration; +end; + +function TSkAnimatedImageHelper.FixedProgress: Boolean; +begin + Result := not Animation.Enabled; +end; + +function TSkAnimatedImageHelper.Loop: Boolean; +begin + Result := Animation.Loop; +end; + +function TSkAnimatedImageHelper.Progress: Double; +begin + Result := Animation.Progress; +end; + +function TSkAnimatedImageHelper.RunningAnimation: Boolean; +begin + Result := Animation.Running; +end; + { TSkDefaultAnimationCodec } constructor TSkDefaultAnimationCodec.Create( @@ -2612,6 +3743,11 @@ function TSkDefaultAnimationCodec.GetDuration: Double; Result := FAnimationCodec.Duration / 1000; end; +function TSkDefaultAnimationCodec.GetFPS: Double; +begin + Result := TAnimation.DefaultAniFrameRate; +end; + function TSkDefaultAnimationCodec.GetIsStatic: Boolean; begin Result := FAnimationCodec.Duration = 0; @@ -2716,6 +3852,11 @@ function TSkLottieAnimationCodec.GetDuration: Double; Result := FSkottie.Duration; end; +function TSkLottieAnimationCodec.GetFPS: Double; +begin + Result := FSkottie.FPS; +end; + function TSkLottieAnimationCodec.GetIsStatic: Boolean; begin Result := False; @@ -2821,7 +3962,7 @@ class function TSkLottieAnimationCodec.TryMakeFromStream(const AStream: TStream; begin LDecompressionStream := TDecompressionStream.Create(AStream, 31); try - Result := TSkottieAnimation.MakeFromStream(LDecompressionStream); + Result := TSkottieAnimation.MakeFromStream(LDecompressionStream, TSkDefaultProviders.Resource); finally LDecompressionStream.Free; end; @@ -2833,7 +3974,7 @@ class function TSkLottieAnimationCodec.TryMakeFromStream(const AStream: TStream; if IsTgs then LSkottie := MakeFromTgsStream(AStream) else - LSkottie := TSkottieAnimation.MakeFromStream(AStream); + LSkottie := TSkottieAnimation.MakeFromStream(AStream, TSkDefaultProviders.Resource); Result := Assigned(LSkottie); if Result then @@ -2842,208 +3983,6 @@ class function TSkLottieAnimationCodec.TryMakeFromStream(const AStream: TStream; ACodec := nil; end; -{ TSkPersistentData } - -procedure TSkPersistentData.AfterConstruction; -begin - inherited; - FCreated := True; -end; - -procedure TSkPersistentData.Assign(ASource: TPersistent); -begin - if ASource <> Self then - begin - BeginUpdate; - try - DoAssign(ASource); - finally - EndUpdate; - end; - end; -end; - -procedure TSkPersistentData.BeginUpdate; -begin - BeginUpdate(False); -end; - -procedure TSkPersistentData.BeginUpdate(const AIgnoreAllChanges: Boolean); -begin - Inc(FUpdatingCount); - FIgnoringAllChanges := FIgnoringAllChanges or AIgnoreAllChanges; -end; - -procedure TSkPersistentData.Change; -begin - if FUpdatingCount > 0 then - FChanged := True - else - begin - FChanged := False; - DoChanged; - end; -end; - -procedure TSkPersistentData.DoAssign(ASource: TPersistent); -begin - inherited Assign(ASource); -end; - -procedure TSkPersistentData.DoChanged; -begin - if FCreated and Assigned(FOnChange) then - FOnChange(Self); -end; - -procedure TSkPersistentData.EndUpdate; -begin - EndUpdate(False); -end; - -procedure TSkPersistentData.EndUpdate(const AIgnoreAllChanges: Boolean); -var - LCallChange: Boolean; - LIgnoreChanges: Boolean; -begin - LIgnoreChanges := AIgnoreAllChanges or FIgnoringAllChanges; - LCallChange := False; - if FUpdatingCount <= 0 then - raise ESkPersistentData.Create('The object is not in update state'); - Dec(FUpdatingCount); - if (not LIgnoreChanges) and HasChanged then - LCallChange := True - else - FChanged := False; - if FUpdatingCount <= 0 then - FIgnoringAllChanges := False; - if LCallChange and (FUpdatingCount = 0) then - begin - FChanged := False; - DoChanged; - end; -end; - -function TSkPersistentData.GetHasChanged: Boolean; -begin - Result := FChanged; -end; - -function TSkPersistentData.GetUpdating: Boolean; -begin - Result := FUpdatingCount > 0; -end; - -procedure TSkPersistentData.SetValue(var AField: Byte; const AValue: Byte); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Word; const AValue: Word); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Double; const AValue, - AEpsilon: Double); -begin - if not SameValue(AField, AValue, AEpsilon) then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: TBytes; const AValue: TBytes); -begin - if not IsSameBytes(AField, AValue) then - begin - AField := Copy(AValue); - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: string; const AValue: string); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Single; const AValue, - AEpsilon: Single); -begin - if not SameValue(AField, AValue, AEpsilon) then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Boolean; - const AValue: Boolean); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Cardinal; - const AValue: Cardinal); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Integer; - const AValue: Integer); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Int64; const AValue: Int64); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: T; const AValue: T); -var - LDifferent: Boolean; -begin - if Assigned(TypeInfo(T)) and (PTypeInfo(TypeInfo(T)).Kind in [TTypeKind.tkSet, TTypeKind.tkEnumeration, TTypeKind.tkRecord{$IF CompilerVersion >= 33}, TTypeKind.tkMRecord{$ENDIF}]) then - LDifferent := not CompareMem(@AField, @AValue, SizeOf(T)) - else - LDifferent := TComparer.Default.Compare(AField, AValue) <> 0; - if LDifferent then - begin - AField := AValue; - Change; - end; -end; - { TSkFontComponent } procedure TSkFontComponent.AssignTo(ADest: TPersistent); @@ -4324,6 +5263,14 @@ destructor TSkLabel.Destroy; inherited; end; +function TSkLabel.DidExceedMaxLines: Boolean; +var + LParagraph: ISkParagraph; +begin + LParagraph := Paragraph; + Result := Assigned(LParagraph) and (LParagraph.DidExceedMaxLines); +end; + procedure TSkLabel.DoEndUpdate; begin if (not (csLoading in ComponentState)) and FAutoSize and HasFitSizeChanged then @@ -4577,6 +5524,17 @@ procedure TSkLabel.GetFitSize(var AWidth, AHeight: Single); end; end; +function TSkLabel.GetLinesCount: Integer; +var + LParagraph: ISkParagraph; +begin + LParagraph := Paragraph; + if Assigned(LParagraph) then + Result := Length(LParagraph.LineMetrics) + else + Result := 0; +end; + function TSkLabel.GetParagraph: ISkParagraph; type TDrawKind = (Fill, Stroke); @@ -4736,7 +5694,7 @@ function TSkLabel.GetParagraph: ISkParagraph; begin LFontBehavior := nil; LDefaultTextStyle := CreateDefaultTextStyle(ADrawKind); - LBuilder := TSkParagraphBuilder.Create(CreateParagraphStyle(LDefaultTextStyle), TSkTypefaceManager.Provider); + LBuilder := TSkParagraphBuilder.Create(CreateParagraphStyle(LDefaultTextStyle), TSkDefaultProviders.TypefaceFont); for I := 0 to FWords.Count- 1 do begin if FWords[I].Text = '' then @@ -5075,21 +6033,38 @@ procedure TSkLabel.WordsChange(ASender: TObject); TextSettingsChanged(nil); end; +{ TSkDefaultProviders } + +class constructor TSkDefaultProviders.Create; +begin + FTypefaceFont := TSkTypefaceFontProvider.Create; +end; + +class procedure TSkDefaultProviders.RegisterTypeface(const AFileName: string); +begin + FTypefaceFont.RegisterTypeface(TSkTypeFace.MakeFromFile(AFileName)); +end; + +class procedure TSkDefaultProviders.RegisterTypeface(const AStream: TStream); +begin + FTypefaceFont.RegisterTypeface(TSkTypeFace.MakeFromStream(AStream)); +end; + { TSkTypefaceManager } -class constructor TSkTypefaceManager.Create; +class function TSkTypefaceManager.Provider: ISkTypefaceFontProvider; begin - FProvider := TSkTypefaceFontProvider.Create; + Result := TSkDefaultProviders.TypefaceFont; end; class procedure TSkTypefaceManager.RegisterTypeface(const AFileName: string); begin - FProvider.RegisterTypeface(TSkTypeFace.MakeFromFile(AFileName)); + TSkDefaultProviders.RegisterTypeface(AFileName); end; class procedure TSkTypefaceManager.RegisterTypeface(const AStream: TStream); begin - FProvider.RegisterTypeface(TSkTypeFace.MakeFromStream(AStream)); + TSkDefaultProviders.RegisterTypeface(AStream); end; { Register } @@ -5099,10 +6074,92 @@ procedure Register; RegisterComponents('Skia', [TSkAnimatedImage, TSkAnimatedPaintBox, TSkLabel, TSkPaintBox, TSkStyleTextObject, TSkSvg]); end; +{$IFDEF MSWINDOWS} + {$HPPEMIT '#ifdef USEPACKAGES'} + {$HPPEMIT ' #pragma link "Skia.Package.FMX.bpi"'} + {$HPPEMIT '#elif defined(__WIN32__)'} + {$HPPEMIT ' #pragma link "Skia.Package.FMX.lib"'} + {$HPPEMIT '#elif defined(_WIN64)'} + {$HPPEMIT ' #pragma link "Skia.Package.FMX.a"'} + {$HPPEMIT '#endif'} +{$ENDIF} + +(*$HPPEMIT 'namespace Skia {'*) +(*$HPPEMIT ' namespace Fmx {'*) +(*$HPPEMIT ' namespace Types { using namespace ::Fmx::Types; }'*) +(*$HPPEMIT ' namespace Graphics { using namespace ::Fmx::Graphics; }'*) +(*$HPPEMIT ' namespace Controls { using namespace ::Fmx::Controls; }'*) +(*$HPPEMIT ' namespace Ani { using namespace ::Fmx::Ani; }'*) +(*$HPPEMIT ' namespace Actnlist { using namespace ::Fmx::Actnlist; }'*) +(*$HPPEMIT ' }'*) +(*$HPPEMIT '}'*) + +{$HPPEMIT NOUSINGNAMESPACE} +{$HPPEMIT END '#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_SKIA)'} +{$HPPEMIT END ' using ::Skia::Fmx::_di_ISkStyleTextObject;'} +{$HPPEMIT END ' using ::Skia::Fmx::_di_ISkTextSettings;'} +{$HPPEMIT END ' using ::Skia::Fmx::_di_TSkAnimationDrawProc;'} +{$HPPEMIT END ' using ::Skia::Fmx::_di_TSkDrawProc;'} +{$HPPEMIT END ' using ::Skia::Fmx::ESkBitmapHelper;'} +{$HPPEMIT END ' using ::Skia::Fmx::ESkFMX;'} +{$HPPEMIT END ' using ::Skia::Fmx::ESkLabel;'} +{$HPPEMIT END ' using ::Skia::Fmx::ESkPersistentData;'} +{$HPPEMIT END ' using ::Skia::Fmx::ESkTextSettingsInfo;'} +{$HPPEMIT END ' using ::Skia::Fmx::ISkStyleTextObject;'} +{$HPPEMIT END ' using ::Skia::Fmx::ISkTextSettings;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkAnimatedImage;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkAnimatedImageWrapMode;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkAnimatedPaintBox;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkAnimationDrawEvent;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkAnimationDrawProc;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkCustomAnimatedControl;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkCustomAnimation;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkCustomControl;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkCustomStyleTextObject;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkDefaultProviders;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkDrawCacheKind;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkDrawEvent;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkDrawProc;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkFontComponent;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkLabel;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkPaintBox;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkPersistent;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkStyledControl;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkStyleTextObject;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkSvg;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkSvgBrush;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkSvgSource;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkSvgWrapMode;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkTextHorzAlign;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkTextSettings;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkTextSettingsClass;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkTextSettingsInfo;'} +{$HPPEMIT END ' using ::Skia::Fmx::TSkTypefaceManager;'} +{$HPPEMIT END ' typedef void (__fastcall *TAddSkPathToPathDataProc)(::Fmx::Graphics::TPathData* const APathData, const ::Skia::_di_ISkPath ASkPath);'} +{$HPPEMIT END ' typedef ::Skia::_di_ISkImage (__fastcall *TBitmapToSkImageFunc)(::Fmx::Graphics::TBitmap* const ABitmap);'} +{$HPPEMIT END ' typedef ::Skia::_di_ISkPath (__fastcall *TPathDataToSkPathFunc)(::Fmx::Graphics::TPathData* const APathData);'} +{$HPPEMIT END ' typedef void (__fastcall *TSkiaDrawProc)(::Fmx::Graphics::TBitmap* const ABitmap, const ::Skia::Fmx::_di_TSkDrawProc AProc, const bool AStartClean);'} +{$HPPEMIT END ' typedef ::Fmx::Graphics::TBitmap* (__fastcall *TSkImageToBitmapFunc)(const ::Skia::_di_ISkImage AImage);'} +{$HPPEMIT END ' typedef ::Fmx::Graphics::TPathData* (__fastcall *TSkPathToPathDataFunc)(const ::Skia::_di_ISkPath ASkPath);'} +{$HPPEMIT END ' static const int SkSupportedPlatformsMask = ::Skia::Fmx::SkSupportedPlatformsMask;'} +{$HPPEMIT END ' static bool& GlobalDisableSkiaCodecsReplacement = ::Skia::Fmx::GlobalDisableSkiaCodecsReplacement;'} +{$HPPEMIT END ' static bool& GlobalUseSkia = ::Skia::Fmx::GlobalUseSkia;'} +{$HPPEMIT END ' static bool& GlobalUseSkiaRasterWhenAvailable = ::Skia::Fmx::GlobalUseSkiaRasterWhenAvailable;'} +{$HPPEMIT END ' static ::System::StaticArray<::Skia::TSkColorType, 24>& SkFmxColorType = ::Skia::Fmx::SkFmxColorType;'} +{$HPPEMIT END ' static ::System::StaticArray<::Fmx::Types::TPixelFormat, 23>& SkFmxPixelFormat = ::Skia::Fmx::SkFmxPixelFormat;'} +{$HPPEMIT END ' static const TAddSkPathToPathDataProc AddSkPathToPathData = ::Skia::Fmx::AddSkPathToPathData;'} +{$HPPEMIT END ' static const TBitmapToSkImageFunc BitmapToSkImage = ::Skia::Fmx::BitmapToSkImage;'} +{$HPPEMIT END ' static const TPathDataToSkPathFunc PathDataToSkPath = ::Skia::Fmx::PathDataToSkPath;'} +{$HPPEMIT END ' static const TSkiaDrawProc SkiaDraw = ::Skia::Fmx::SkiaDraw;'} +{$HPPEMIT END ' static const TSkImageToBitmapFunc SkImageToBitmap = ::Skia::Fmx::SkImageToBitmap;'} +{$HPPEMIT END ' static const TSkPathToPathDataFunc SkPathToPathData = ::Skia::Fmx::SkPathToPathData;'} +{$HPPEMIT END '#endif'} + initialization RegisterFMXClasses([TSkAnimatedImage, TSkAnimatedPaintBox, TSkCustomControl, TSkLabel, TSkPaintBox, TSkStyledControl, TSkCustomStyleTextObject, TSkStyleTextObject, TSkSvgBrush, TSkSvg]); - RegisterFMXClasses([TSkFontComponent, TSkTextSettings, TSkTextSettingsInfo, TSkTextSettings.TDecorations, + RegisterFMXClasses([TSkAnimatedImage.TAnimation, TSkAnimatedPaintBox.TAnimation, TSkCustomAnimation, + TSkFontComponent, TSkTextSettings, TSkTextSettingsInfo, TSkTextSettings.TDecorations, TSkLabel.TCustomWordsItem, TSkLabel.TWordsCollection]); TSkAnimatedImage.RegisterCodec(TSkLottieAnimationCodec); TSkAnimatedImage.RegisterCodec(TSkDefaultAnimationCodec); diff --git a/skia4delphi/Source/Skia.Api.pas b/skia4delphi/Source/Skia.Api.pas index 878e449..c3c145a 100644 --- a/skia4delphi/Source/Skia.Api.pas +++ b/skia4delphi/Source/Skia.Api.pas @@ -1,3969 +1,4269 @@ -{************************************************************************} -{ } -{ Skia4Delphi } -{ } -{ Copyright (c) 2011-2022 Google LLC. } -{ Copyright (c) 2021-2022 Skia4Delphi Project. } -{ } -{ Use of this source code is governed by a BSD-style license that can be } -{ found in the LICENSE file. } -{ } -{************************************************************************} -{$IFNDEF SKIA_EMBEDDED} -unit Skia.API; -{$ENDIF} - -interface - -{$ALIGN ON} -{$MINENUMSIZE 4} - -{$IF NOT DEFINED(IOS) or NOT DEFINED(CPUARM)} - {$DEFINE SK_DYNAMIC_LOADING} -{$ENDIF} - -{$IFDEF SK_DYNAMIC_LOADING} - -uses - { Delphi } - {$IFDEF MSWINDOWS} - Winapi.Windows, - {$ENDIF} - System.SysUtils; - -{$ENDIF} - -type - {$REGION 'C types'} - - bool = System.Boolean; - {$IF CompilerVersion < 31} - char = System.AnsiChar; - {$ELSE} - char = System.UTF8Char; - {$ENDIF} - char16_t = System.Char; - double = System.Double; - float = System.Single; - int16_t = System.SmallInt; - int32_t = System.Integer; - int64_t = System.Int64; - int8_t = System.ShortInt; - intptr_t = System.NativeInt; - long = System.LongInt; - size_t = System.NativeUInt; - uint16_t = System.Word; - uint32_t = System.Cardinal; - uint64_t = System.UInt64; - uint8_t = System.Byte; - uintptr_t = System.NativeUInt; - - pbool = ^bool; - pchar = ^char; - pchar16_t = ^char16_t; - pdouble = ^double; - pfloat = ^float; - pint16_t = ^int16_t; - pint32_t = ^int32_t; - pint64_t = ^int64_t; - pint8_t = ^int8_t; - pintptr_t = ^intptr_t; - plong = ^long; - psize_t = ^size_t; - puint16_t = ^uint16_t; - puint32_t = ^uint32_t; - puint64_t = ^uint64_t; - puint8_t = ^uint8_t; - puintptr_t = ^uintptr_t; - - {$ENDREGION} - - {$REGION 'Skia types'} - - {$REGION 'include/c/sk4d_types.h'} - gr_backendformat_t = THandle; - gr_backendrendertarget_t = THandle; - gr_backendtexture_t = THandle; - gr_directcontext_t = THandle; - sk_animcodecplayer_t = THandle; - sk_blender_t = THandle; - sk_canvas_t = THandle; - sk_codec_t = THandle; - sk_colorfilter_t = THandle; - sk_colorspace_t = THandle; - sk_colorspaceiccprofile_t = THandle; - sk_data_t = THandle; - sk_document_t = THandle; - sk_dynamicmemorywstream_t = THandle; - sk_filestream_t = THandle; - sk_filewstream_t = THandle; - sk_font_t = THandle; - sk_fontmgr_t = THandle; - sk_image_t = THandle; - sk_imagefilter_t = THandle; - sk_maskfilter_t = THandle; - sk_memorystream_t = THandle; - sk_opbuilder_t = THandle; - sk_paint_t = THandle; - sk_path_t = THandle; - sk_pathbuilder_t = THandle; - sk_patheffect_t = THandle; - sk_pathiterator_t = THandle; - sk_pathmeasure_t = THandle; - sk_pathrawiter_t = THandle; - sk_picture_t = THandle; - sk_picturerecorder_t = THandle; - sk_pixmap_t = THandle; - sk_refcnt_t = THandle; - sk_region_t = THandle; - sk_regioncliperator_t = THandle; - sk_regioniterator_t = THandle; - sk_regionspanerator_t = THandle; - sk_rrect_t = THandle; - sk_runtimeeffect_t = THandle; - sk_shader_t = THandle; - sk_stream_t = THandle; - sk_streamadapter_t = THandle; - sk_string_t = THandle; - sk_surface_t = THandle; - sk_textblob_t = THandle; - sk_tracememorydump_t = THandle; - sk_tracememorydumpbaseclass_t = THandle; - sk_typeface_t = THandle; - sk_vertices_t = THandle; - sk_wstream_t = THandle; - sk_wstreamadapter_t = THandle; - - pgr_backendformat_t = ^gr_backendformat_t; - pgr_backendrendertarget_t = ^gr_backendrendertarget_t; - pgr_backendtexture_t = ^gr_backendtexture_t; - pgr_directcontext_t = ^gr_directcontext_t; - psk_animcodecplayer_t = ^sk_animcodecplayer_t; - psk_blender_t = ^sk_blender_t; - psk_canvas_t = ^sk_canvas_t; - psk_codec_t = ^sk_codec_t; - psk_colorfilter_t = ^sk_colorfilter_t; - psk_colorspace_t = ^sk_colorspace_t; - psk_colorspaceiccprofile_t = ^sk_colorspaceiccprofile_t; - psk_data_t = ^sk_data_t; - psk_document_t = ^sk_document_t; - psk_dynamicmemorywstream_t = ^sk_dynamicmemorywstream_t; - psk_filestream_t = ^sk_filestream_t; - psk_filewstream_t = ^sk_filewstream_t; - psk_font_t = ^sk_font_t; - psk_fontmgr_t = ^sk_fontmgr_t; - psk_image_t = ^sk_image_t; - psk_imagefilter_t = ^sk_imagefilter_t; - psk_maskfilter_t = ^sk_maskfilter_t; - psk_memorystream_t = ^sk_memorystream_t; - psk_opbuilder_t = ^sk_opbuilder_t; - psk_paint_t = ^sk_paint_t; - psk_path_t = ^sk_path_t; - psk_pathbuilder_t = ^sk_pathbuilder_t; - psk_patheffect_t = ^sk_patheffect_t; - psk_pathiterator_t = ^sk_pathiterator_t; - psk_pathmeasure_t = ^sk_pathmeasure_t; - psk_pathrawiter_t = ^sk_pathrawiter_t; - psk_picture_t = ^sk_picture_t; - psk_picturerecorder_t = ^sk_picturerecorder_t; - psk_pixmap_t = ^sk_pixmap_t; - psk_refcnt_t = ^sk_refcnt_t; - psk_region_t = ^sk_region_t; - psk_regioncliperator_t = ^sk_regioncliperator_t; - psk_regioniterator_t = ^sk_regioniterator_t; - psk_regionspanerator_t = ^sk_regionspanerator_t; - psk_rrect_t = ^sk_rrect_t; - psk_runtimeeffect_t = ^sk_runtimeeffect_t; - psk_shader_t = ^sk_shader_t; - psk_stream_t = ^sk_stream_t; - psk_streamadapter_t = ^sk_streamadapter_t; - psk_string_t = ^sk_string_t; - psk_surface_t = ^sk_surface_t; - psk_textblob_t = ^sk_textblob_t; - psk_tracememorydump_t = ^sk_tracememorydump_t; - psk_tracememorydumpbaseclass_t = ^sk_tracememorydumpbaseclass_t; - psk_typeface_t = ^sk_typeface_t; - psk_vertices_t = ^sk_vertices_t; - psk_wstream_t = ^sk_wstream_t; - psk_wstreamadapter_t = ^sk_wstreamadapter_t; - - gr_backendapi_t = ( - OPEN_GL_GR_BACKENDAPI, - METAL_GR_BACKENDAPI = 2 - ); - pgr_backendapi_t = ^gr_backendapi_t; - - gr_surfaceorigin_t = ( - TOP_LEFT_GR_SURFACEORIGIN, - BOTTOM_LEFT_GR_SURFACEORIGIN - ); - pgr_surfaceorigin_t = ^gr_surfaceorigin_t; - - sk_alphatype_t = ( - UNKNOWN_SK_ALPHATYPE, - OPAQUE_SK_ALPHATYPE, - PREMUL_SK_ALPHATYPE, - UNPREMUL_SK_ALPHATYPE - ); - psk_alphatype_t = ^sk_alphatype_t; - - sk_blendmode_t = ( - CLEAR_SK_BLENDMODE, - SRC_SK_BLENDMODE, - DEST_SK_BLENDMODE, - SRC_OVER_SK_BLENDMODE, - DEST_OVER_SK_BLENDMODE, - SRC_IN_SK_BLENDMODE, - DEST_IN_SK_BLENDMODE, - SRC_OUT_SK_BLENDMODE, - DEST_OUT_SK_BLENDMODE, - SRC_A_TOP_SK_BLENDMODE, - DEST_A_TOP_SK_BLENDMODE, - XOR_SK_BLENDMODE, - PLUS_SK_BLENDMODE, - MODULATE_SK_BLENDMODE, - SCREEN_SK_BLENDMODE, - OVERLAY_SK_BLENDMODE, - DARKEN_SK_BLENDMODE, - LIGHTEN_SK_BLENDMODE, - COLOR_DODGE_SK_BLENDMODE, - COLOR_BURN_SK_BLENDMODE, - HARD_LIGHT_SK_BLENDMODE, - SOFT_LIGHT_SK_BLENDMODE, - DIFFERENCE_SK_BLENDMODE, - EXCLUSION_SK_BLENDMODE, - MULTIPLY_SK_BLENDMODE, - HUE_SK_BLENDMODE, - SATURATION_SK_BLENDMODE, - COLOR_SK_BLENDMODE, - LUMINOSITY_SK_BLENDMODE - ); - psk_blendmode_t = ^sk_blendmode_t; - - sk_blurstyle_t = ( - NORMAL_SK_BLURSTYLE, - SOLID_SK_BLURSTYLE, - OUTER_SK_BLURSTYLE, - INNER_SK_BLURSTYLE - ); - psk_blurstyle_t = ^sk_blurstyle_t; - - sk_clipop_t = ( - DIFFERENCE_SK_CLIPOP, - INTERSECT_SK_CLIPOP - ); - psk_clipop_t = ^sk_clipop_t; - - sk_colorchannel_t = ( - R_SK_COLORCHANNEL, - G_SK_COLORCHANNEL, - B_SK_COLORCHANNEL, - A_SK_COLORCHANNEL - ); - psk_colorchannel_t = ^sk_colorchannel_t; - - sk_colortype_t = ( - UNKNOWN_SK_COLORTYPE, - ALPHA8_SK_COLORTYPE, - RGB565_SK_COLORTYPE, - ARGB4444_SK_COLORTYPE, - RGBA8888_SK_COLORTYPE, - RGB888X_SK_COLORTYPE, - BGRA8888_SK_COLORTYPE, - RGBA1010102_SK_COLORTYPE, - BGRA1010102_SK_COLORTYPE, - RGB101010X_SK_COLORTYPE, - BGR101010X_SK_COLORTYPE, - GRAY8_SK_COLORTYPE, - RGBAF16_SK_COLORTYPE, - RGBAF16CLAMPED_SK_COLORTYPE, - RGBAF32_SK_COLORTYPE, - RG88_SK_COLORTYPE, - ALPHAF16_SK_COLORTYPE, - RGF16_SK_COLORTYPE, - ALPHA16_SK_COLORTYPE, - RG1616_SK_COLORTYPE, - RGBA16161616_SK_COLORTYPE, - SRGBA8888_SK_COLORTYPE - ); - psk_colortype_t = ^sk_colortype_t; - - sk_drawpointsmode_t = ( - POINTS_SK_DRAWPOINTSMODE, - LINES_SK_DRAWPOINTSMODE, - POLYGON_DRAWPOINTSMODE - ); - psk_drawpointsmode_t = ^sk_drawpointsmode_t; - - sk_encodedimageformat_t = ( - BMP_SK_ENCODEDIMAGEFORMAT, - GIF_SK_ENCODEDIMAGEFORMAT, - ICO_SK_ENCODEDIMAGEFORMAT, - JPEG_SK_ENCODEDIMAGEFORMAT, - PNG_SK_ENCODEDIMAGEFORMAT, - WBMP_SK_ENCODEDIMAGEFORMAT, - WEBP_SK_ENCODEDIMAGEFORMAT, - PKM_SK_ENCODEDIMAGEFORMAT, - KTX_SK_ENCODEDIMAGEFORMAT, - ASTC_SK_ENCODEDIMAGEFORMAT, - DNG_SK_ENCODEDIMAGEFORMAT, - HEIF_SK_ENCODEDIMAGEFORMAT, - AVIF_SK_ENCODEDIMAGEFORMAT - ); - psk_encodedimageformat_t = ^sk_encodedimageformat_t; - - sk_filtermode_t = ( - NEAREST_SK_FILTERMODE, - LINEAR_SK_FILTERMODE - ); - psk_filtermode_t = ^sk_filtermode_t; - - sk_fontedging_t = ( - ALIAS_SK_FONTEDGING, - ANTI_ALIAS_SK_FONTEDGING, - SUBPIXEL_ANTI_ALIAS_SK_FONTEDGING - ); - psk_fontedging_t = ^sk_fontedging_t; - - sk_fonthinting_t = ( - NONE_SK_FONTHINTING, - SLIGHT_SK_FONTHINTING, - NORMAL_SK_FONTHINTING, - FULL_SK_FONTHINTING - ); - psk_fonthinting_t = ^sk_fonthinting_t; - - sk_fontslant_t = ( - UPRIGHT_SK_FONTSLANT, - ITALIC_SK_FONTSLANT, - OBLIQUE_SK_FONTSLANT - ); - psk_fontslant_t = ^sk_fontslant_t; - - sk_contrastinvertstyle_t = ( - NO_INVERT_SK_CONTRASTINVERTSTYLE, - INVERT_BRIGHTNESS_SK_CONTRASTINVERTSTYLE, - INVERT_LIGHTNESS_SK_CONTRASTINVERTSTYLE - ); - psk_contrastinvertstyle_t = ^sk_contrastinvertstyle_t; - - sk_imagecachinghint_t = ( - ALLOW_SK_IMAGECACHINGHINT, - DISALLOW_SK_IMAGECACHINGHINT - ); - psk_imagecachinghint_t = ^sk_imagecachinghint_t; - - sk_latticerecttype_t = ( - DEFAULT_SK_LATTICERECTTYPE, - TRANSPARENT_SK_LATTICERECTTYPE, - FIXED_COLOR_SK_LATTICERECTTYPE - ); - psk_latticerecttype_t = ^sk_latticerecttype_t; - - sk_mipmapmode_t = ( - NONE_SK_MIPMAPMODE, - NEAREST_SK_MIPMAPMODE, - LINEAR_SK_MIPMAPMODE - ); - psk_mipmapmode_t = ^sk_mipmapmode_t; - - sk_paintstyle_t = ( - FILL_SK_PAINTSTYLE, - STROKE_SK_PAINTSTYLE, - STROKE_AND_FILL_SK_PAINTSTYLE - ); - psk_paintstyle_t = ^sk_paintstyle_t; - - sk_patharcsize_t = ( - SMALL_SK_ARCSIZE, - LARGE_SK_ARCSIZE - ); - psk_patharcsize_t = ^sk_patharcsize_t; - - sk_pathdirection_t = ( - CW_SK_PATHDIRECTION, - CCW_SK_PATHDIRECTION - ); - psk_pathdirection_t = ^sk_pathdirection_t; - - sk_patheffect1dstyle_t = ( - TRANSLATE_SK_PATHEFFECT1DSTYLE, - ROTATE_SK_PATHEFFECT1DSTYLE, - MORPH_SK_PATHEFFECT1DSTYLE - ); - psk_patheffect1dstyle_t = ^sk_patheffect1dstyle_t; - - sk_patheffecttrimmode_t = ( - NORMAL_SK_PATHEFFECTTRIMMODE, - INVERTED_SK_PATHEFFECTTRIMMODE - ); - psk_patheffecttrimmode_t = ^sk_patheffecttrimmode_t; - - sk_pathfilltype_t = ( - WINDING_SK_PATHFILLTYPE, - EVEN_ODD_SK_PATHFILLTYPE, - INVERSE_WINDING_SK_PATHFILLTYPE, - INVERSE_EVEN_ODD_SK_PATHFILLTYPE - ); - psk_pathfilltype_t = ^sk_pathfilltype_t; - - sk_pathop_t = ( - DIFFERENCE_SK_PATHOP, - INTERSECT_SK_PATHOP, - UNION_SK_PATHOP, - XOR_SK_PATHOP, - REVERSE_DIFFERENCE_SK_PATHOP - ); - psk_pathop_t = ^sk_pathop_t; - - sk_pathverb_t = ( - MOVE_SK_PATHVERB, - LINE_SK_PATHVERB, - QUAD_SK_PATHVERB, - CONIC_SK_PATHVERB, - CUBIC_SK_PATHVERB, - CLOSE_SK_PATHVERB - ); - psk_pathverb_t = ^sk_pathverb_t; - - sk_pixelgeometry_t = ( - UNKNOWN_SK_PIXELGEOMETRY, - RGB_HORIZONTAL_SK_PIXELGEOMETRY, - BGR_HORIZONTAL_SK_PIXELGEOMETRY, - RGB_VERTICAL_SK_PIXELGEOMETRY, - BGR_VERTICAL_SK_PIXELGEOMETRY - ); - psk_pixelgeometry_t = ^sk_pixelgeometry_t; - - sk_regionop_t = ( - DIFFERENCE_SK_REGIONOP, - INTERSECT_SK_REGIONOP, - UNION_SK_REGIONOP, - XOR_SK_REGIONOP, - REVERSE_DIFFERENCE_SK_REGIONOP, - REPLACE_SK_REGIONOP - ); - psk_regionop_t = ^sk_regionop_t; - - sk_rrectcorner_t = ( - UPPER_LEFT_SK_RRECTCORNER, - UPPER_RIGHT_SK_RRECTCORNER, - LOWER_RIGHT_SK_RRECTCORNER, - LOWER_LEFT_SK_RRECTCORNER - ); - psk_rrectcorner_t = ^sk_rrectcorner_t; - - sk_runtimeeffectchildtype_t = ( - SHADER_SK_RUNTIMEEFFECTCHILDTYPE, - COLOR_FILTER_SK_RUNTIMEEFFECTCHILDTYPE, - BLENDER_FILTER_SK_RUNTIMEEFFECTCHILDTYPE - ); - psk_runtimeeffectchildtype_t = ^sk_runtimeeffectchildtype_t; - - sk_runtimeeffectuniformtype_t = ( - FLOAT_SK_RUNTIMEEFFECTUNIFORMTYPE, - FLOAT2_SK_RUNTIMEEFFECTUNIFORMTYPE, - FLOAT3_SK_RUNTIMEEFFECTUNIFORMTYPE, - FLOAT4_SK_RUNTIMEEFFECTUNIFORMTYPE, - FLOAT2X2_SK_RUNTIMEEFFECTUNIFORMTYPE, - FLOAT3X3_SK_RUNTIMEEFFECTUNIFORMTYPE, - FLOAT4X4_SK_RUNTIMEEFFECTUNIFORMTYPE, - INT_SK_RUNTIMEEFFECTUNIFORMTYPE, - INT2_SK_RUNTIMEEFFECTUNIFORMTYPE, - INT3_SK_RUNTIMEEFFECTUNIFORMTYPE, - INT4_SK_RUNTIMEEFFECTUNIFORMTYPE - ); - psk_runtimeeffectuniformtype_t = ^sk_runtimeeffectuniformtype_t; - - sk_srcrectconstraint_t = ( - CLOSE_SK_SRCRECTCONSTRAINT, - FAST_SK_SRCRECTCONSTRAINT - ); - psk_srcrectconstraint_t = ^sk_srcrectconstraint_t; - - sk_strokecap_t = ( - BUTT_SK_STROKECAP, - ROUND_SK_STROKECAP, - SQUARE_SK_STROKECAP - ); - psk_strokecap_t = ^sk_strokecap_t; - - sk_strokejoin_t = ( - MITER_SK_STROKEJOIN, - ROUND_SK_STROKEJOIN, - BEVEL_SK_STROKEJOIN - ); - psk_strokejoin_t = ^sk_strokejoin_t; - - sk_textencoding_t = ( - UTF8_SK_TEXTENCODING, - UTF16_SK_TEXTENCODING, - UTF32_SK_TEXTENCODING, - GLYPH_ID_SK_TEXTENCODING - ); - psk_textencoding_t = ^sk_textencoding_t; - - sk_tilemode_t = ( - CLAMP_SK_TILEMODE, - REPEAT_SK_TILEMODE, - MIRROR_SK_TILEMODE, - DECAL_SK_TILEMODE - ); - psk_tilemode_t = ^sk_tilemode_t; - - sk_vertexmode_t = ( - TRIANGLES_SK_VERTEXMODE, - TRIANGLE_STRIP_SK_VERTEXMODE, - TRIANGLE_FAN_SK_VERTEXMODE - ); - psk_vertexmode_t = ^sk_vertexmode_t; - - sk_color_t = uint32_t; - sk_glyphid_t = uint16_t; - sk_unichar_t = int32_t; - - psk_color_t = ^sk_color_t; - psk_glyphid_t = ^sk_glyphid_t; - psk_unichar_t = ^sk_unichar_t; - - sk_color4f_t = record - r: float; - g: float; - b: float; - a: float; - end; - psk_color4f_t = ^sk_color4f_t; - - sk_colormatrix_t = record - m_11: float; - m_12: float; - m_13: float; - m_14: float; - m_15: float; - m_21: float; - m_22: float; - m_23: float; - m_24: float; - m_25: float; - m_31: float; - m_32: float; - m_33: float; - m_34: float; - m_35: float; - m_41: float; - m_42: float; - m_43: float; - m_44: float; - m_45: float; - end; - psk_colormatrix_t = ^sk_colormatrix_t; - - sk_colorspaceprimaries_t = record - rx: float; - ry: float; - gx: float; - gy: float; - bx: float; - by: float; - wx: float; - wy: float; - end; - psk_colorspaceprimaries_t = ^sk_colorspaceprimaries_t; - - sk_colorspacetransferfn_t = record - g: float; - a: float; - b: float; - c: float; - d: float; - e: float; - f: float; - end; - psk_colorspacetransferfn_t = ^sk_colorspacetransferfn_t; - - sk_colorspacexyz_t = record - m_11: float; - m_12: float; - m_13: float; - m_21: float; - m_22: float; - m_23: float; - m_31: float; - m_32: float; - m_33: float; - end; - psk_colorspacexyz_t = ^sk_colorspacexyz_t; - - sk_cubicresampler_t = record - b: float; - c: float; - end; - psk_cubicresampler_t = ^sk_cubicresampler_t; - - sk_datetime_t = record - time_zone_minutes : int16_t; - year : uint16_t; - month : uint8_t; - day_of_week : uint8_t; - day : uint8_t; - hour : uint8_t; - minute : uint8_t; - second : uint8_t; - end; - psk_datetime_t = ^sk_datetime_t; - - sk_fontmetrics_t = record - flags : uint32_t; - top : float; - ascent : float; - descent : float; - bottom : float; - leading : float; - avg_char_width : float; - max_char_width : float; - x_min : float; - x_max : float; - x_height : float; - cap_height : float; - underline_thickness : float; - underline_position : float; - strikeout_thickness : float; - strikeout_position : float; - end; - psk_fontmetrics_t = ^sk_fontmetrics_t; - - sk_fontstyle_t = record - weight : int32_t; - width : int32_t; - slant : sk_fontslant_t; - end; - psk_fontstyle_t = ^sk_fontstyle_t; - - sk_highcontrastconfig_t = record - grayscale : bool; - invert_style : sk_contrastinvertstyle_t; - contrast : float; - end; - psk_highcontrastconfig_t = ^sk_highcontrastconfig_t; - - sk_imageinfo_t = record - width : int32_t; - height : int32_t; - color_type : sk_colortype_t; - alpha_type : sk_alphatype_t; - color_space : sk_colorspace_t; - end; - psk_imageinfo_t = ^sk_imageinfo_t; - - sk_ipoint_t = record - x: int32_t; - y: int32_t; - end; - psk_ipoint_t = ^sk_ipoint_t; - - sk_irect_t = record - left : int32_t; - top : int32_t; - right : int32_t; - bottom : int32_t; - end; - psk_irect_t = ^sk_irect_t; - - sk_isize_t = record - width : int32_t; - height : int32_t; - end; - psk_isize_t = ^sk_isize_t; - - sk_lattice_t = record - x_divs : pint32_t; - y_divs : pint32_t; - rect_types : psk_latticerecttype_t; - x_count : int32_t; - y_count : int32_t; - bounds : psk_irect_t; - colors : psk_color_t; - end; - psk_lattice_t = ^sk_lattice_t; - - sk_matrix_t = record - m_11: float; - m_12: float; - m_13: float; - m_21: float; - m_22: float; - m_23: float; - m_31: float; - m_32: float; - m_33: float; - end; - psk_matrix_t = ^sk_matrix_t; - - sk_matrix44_t = record - m_11: float; - m_12: float; - m_13: float; - m_14: float; - m_21: float; - m_22: float; - m_23: float; - m_24: float; - m_31: float; - m_32: float; - m_33: float; - m_34: float; - m_41: float; - m_42: float; - m_43: float; - m_44: float; - end; - psk_matrix44_t = ^sk_matrix44_t; - - sk_point_t = record - x: float; - y: float; - end; - psk_point_t = ^sk_point_t; - - sk_pathiteratorelem_t = record - verb : sk_pathverb_t; - points : array[0..3] of sk_point_t; - conic_weight : float; - end; - psk_pathiteratorelem_t = ^sk_pathiteratorelem_t; - - sk_pdfmetadata_t = record - title : MarshaledAString; - author : MarshaledAString; - subject : MarshaledAString; - keywords : MarshaledAString; - creator : MarshaledAString; - producer : MarshaledAString; - creation : sk_datetime_t; - modified : sk_datetime_t; - raster_dpi : float; - pdfa : bool; - encoding_quality : int32_t; - end; - psk_pdfmetadata_t = ^sk_pdfmetadata_t; - - sk_point3_t = record - x: float; - y: float; - z: float; - end; - psk_point3_t = ^sk_point3_t; - - sk_rect_t = record - left : float; - top : float; - right : float; - bottom : float; - end; - psk_rect_t = ^sk_rect_t; - - sk_rotationscalematrix_t = record - s_cos : float; - s_sin : float; - t_x : float; - t_y : float; - end; - psk_rotationscalematrix_t = ^sk_rotationscalematrix_t; - - sk_samplingoptions_t = record - use_cubic : bool; - cubic : sk_cubicresampler_t; - filter : sk_filtermode_t; - mipmap : sk_mipmapmode_t; - end; - psk_samplingoptions_t = ^sk_samplingoptions_t; - - sk_size_t = record - width : float; - height : float; - end; - psk_size_t = ^sk_size_t; - - sk_surfaceprops_t = record - flags : uint32_t; - pixel_geometry : sk_pixelgeometry_t; - end; - psk_surfaceprops_t = ^sk_surfaceprops_t; - - sk_vector_t = sk_point_t; - psk_vector_t = ^sk_vector_t; - - sk_font_path_proc = procedure (const path: sk_path_t; const matrix: psk_matrix_t; context: Pointer); cdecl; - sk_image_raster_release_proc = procedure (const pixels: Pointer; context: Pointer); cdecl; - sk_image_texture_release_proc = procedure (context: Pointer); cdecl; - sk_surface_raster_release_proc = procedure (pixels, context: Pointer); cdecl; - - sk_streamadapter_procs_t = record - get_length : function (context: Pointer): size_t; cdecl; - get_position : function (context: Pointer): size_t; cdecl; - read : function (context: Pointer; buffer: Pointer; size: size_t): size_t; cdecl; - seek : function (context: Pointer; position: size_t): bool; cdecl; - end; - psk_streamadapter_procs_t = ^sk_streamadapter_procs_t; - - sk_wstreamadapter_procs_t = record - write: function (context: Pointer; const buffer: Pointer; size: size_t): bool; cdecl; - end; - psk_wstreamadapter_procs_t = ^sk_wstreamadapter_procs_t; - - sk_tracememorydumpbaseclass_procs_t = record - dump_numeric_value : procedure (context: Pointer; const dump_name, value_name, units: MarshaledAString; value: uint64_t); cdecl; - dump_string_value : procedure (context: Pointer; const dump_name, value_name, value: MarshaledAString); cdecl; - end; - psk_tracememorydumpbaseclass_procs_t = ^sk_tracememorydumpbaseclass_procs_t; - - // GPU - - gr_contextoptions_t = record - buffer_map_threshold : int32_t; - do_manual_mipmapping : bool; - allow_path_mask_caching : bool; - glyph_cache_texture_maximum_bytes : size_t; - avoid_stencil_buffers : bool; - runtime_program_cache_size : int32_t; - end; - pgr_contextoptions_t = ^gr_contextoptions_t; - - // GPU - OpenGL - - gr_gl_interface_t = THandle; - - pgr_gl_interface_t = ^gr_gl_interface_t; - - gl_enum_t = uint32_t; - gl_uint_t = uint32_t; - - pgl_enum_t = ^gl_enum_t; - pgl_uint_t = ^gl_uint_t; - - gr_gl_framebufferinfo_t = record - fboid : gl_uint_t; - format : gl_enum_t; - end; - pgr_gl_framebufferinfo_t = ^gr_gl_framebufferinfo_t; - - gr_gl_textureinfo_t = record - target : gl_enum_t; - id : gl_uint_t; - format : gl_enum_t; - end; - pgr_gl_textureinfo_t = ^gr_gl_textureinfo_t; - - gr_gl_get_proc = function (context: Pointer; const name: MarshaledAString): Pointer; cdecl; - - // GPU - Metal - - gr_mtl_handle_t = Pointer; - - gr_mtl_textureinfo_t = record - texture: gr_mtl_handle_t; - end; - pgr_mtl_textureinfo_t = ^gr_mtl_textureinfo_t; - - gr_mtl_backendcontext_t = record - device : gr_mtl_handle_t; - queue : gr_mtl_handle_t; - binary_archive : gr_mtl_handle_t; - end; - pgr_mtl_backendcontext_t = ^gr_mtl_backendcontext_t; - {$ENDREGION} - - {$REGION 'modules/particles/include/sk4d_particles_types.h'} - sk_particleeffect_t = THandle; - - psk_particleeffect_t = ^sk_particleeffect_t; - - sk_particleuniform_t = record - columns : int32_t; - rows : int32_t; - slot : int32_t; - end; - psk_particleuniform_t = ^sk_particleuniform_t; - {$ENDREGION} - - {$REGION 'modules/skottie/include/sk4d_skottie_types.h'} - sk_skottieanimation_t = THandle; - - psk_skottieanimation_t = ^sk_skottieanimation_t; - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_paragraph_types.h'} - sk_paragraph_t = THandle; - sk_paragraphbuilder_t = THandle; - sk_paragraphstyle_t = THandle; - sk_strutstyle_t = THandle; - sk_textstyle_t = THandle; - sk_typefacefontprovider_t = THandle; - - psk_paragraph_t = ^sk_paragraph_t; - psk_paragraphbuilder_t = ^sk_paragraphbuilder_t; - psk_paragraphstyle_t = ^sk_paragraphstyle_t; - psk_strutstyle_t = ^sk_strutstyle_t; - psk_textstyle_t = ^sk_textstyle_t; - psk_typefacefontprovider_t = ^sk_typefacefontprovider_t; - - sk_affinity_t = ( - UPSTREAM_SK_AFFINITY, - DOWNSTREAM_SK_AFFINITY - ); - psk_affinity_t = ^sk_affinity_t; - - sk_placeholderalignment_t = ( - BASELINE_SK_PLACEHOLDERALIGNMENT, - ABOVE_BASELINE_SK_PLACEHOLDERALIGNMENT, - BELOW_BASELINE_SK_PLACEHOLDERALIGNMENT, - TOP_SK_PLACEHOLDERALIGNMENT, - BOTTOM_SK_PLACEHOLDERALIGNMENT, - MIDDLE_SK_PLACEHOLDERALIGNMENT - ); - psk_placeholderalignment_t = ^sk_placeholderalignment_t; - - sk_rectheightstyle_t = ( - TIGHT_SK_RECTHEIGHTSTYLE, - MAX_SK_RECTHEIGHTSTYLE, - INCLUDE_LINE_SPACING_MIDDLE_SK_RECTHEIGHTSTYLE, - INCLUDE_LINE_SPACING_TOP_SK_RECTHEIGHTSTYLE, - INCLUDE_LINE_SPACING_BOTTOM_SK_RECTHEIGHTSTYLE, - STRUT_SK_RECTHEIGHTSTYLE - ); - psk_rectheightstyle_t = ^sk_rectheightstyle_t; - - sk_rectwidthstyle_t = ( - TIGHT_SK_RECTWIDTHSTYLE, - MAX_SK_RECTWIDTHSTYLE - ); - psk_rectwidthstyle_t = ^sk_rectwidthstyle_t; - - sk_textalign_t = ( - LEFT_SK_TEXTALIGN, - RIGHT_SK_TEXTALIGN, - CENTER_SK_TEXTALIGN, - JUSTIFY_SK_TEXTALIGN, - START_SK_TEXTALIGN, - TERMINATE_SK_TEXTALIGN - ); - psk_textalign_t = ^sk_textalign_t; - - sk_textbaseline_t = ( - ALPHABETIC_SK_TEXTBASELINE, - IDEOGRAPHIC_SK_TEXTBASELINE - ); - psk_textbaseline_t = ^sk_textbaseline_t; - - sk_textdecorationstyle_t = ( - SOLID_SK_TEXTDECORATIONSTYLE, - DOUBLE_SK_TEXTDECORATIONSTYLE, - DOTTED_SK_TEXTDECORATIONSTYLE, - DASHED_SK_TEXTDECORATIONSTYLE, - WAVY_SK_TEXTDECORATIONSTYLE - ); - psk_textdecorationstyle_t = ^sk_textdecorationstyle_t; - - sk_textdirection_t = ( - RIGHT_TO_LEFT_SK_TEXTDIRECTION, - LEFT_TO_RIGHT_SK_TEXTDIRECTION - ); - psk_textdirection_t = ^sk_textdirection_t; - - sk_metrics_t = record - start_index : size_t; - end_index : size_t; - end_excluding_whitespaces : size_t; - end_including_newline : size_t; - is_hard_break : bool; - ascent : double; - descent : double; - height : double; - width : double; - left : double; - baseline : double; - line_number : size_t; - end; - psk_metrics_t = ^sk_metrics_t; - - sk_placeholderstyle_t = record - width : float; - height : float; - alignment : sk_placeholderalignment_t; - baseline : sk_textbaseline_t; - baseline_offset : float; - end; - psk_placeholderstyle_t = ^sk_placeholderstyle_t; - - sk_positionaffinity_t = record - position: int32_t; - affinity: sk_affinity_t; - end; - psk_positionaffinity_t = ^sk_positionaffinity_t; - - sk_textbox_t = record - rect : sk_rect_t; - direction : sk_textdirection_t; - end; - psk_textbox_t = ^sk_textbox_t; - - sk_textshadow_t = record - color : sk_color_t; - offset : sk_point_t; - blur_radius : double; - end; - psk_textshadow_t = ^sk_textshadow_t; - {$ENDREGION} - - {$REGION 'modules/skresources/include/sk4d_resources_types.h'} - sk_resourceprovider_t = THandle; - sk_resourceproviderbaseclass_t = THandle; - - psk_resourceprovider_t = ^sk_resourceprovider_t; - psk_resourceproviderbaseclass_t = ^sk_resourceproviderbaseclass_t; - - sk_resourceproviderbaseclass_procs_t = record - load: function (context: Pointer; const path, name: MarshaledAString): sk_data_t; cdecl; - end; - psk_resourceproviderbaseclass_procs_t = ^sk_resourceproviderbaseclass_procs_t; - {$ENDREGION} - - {$REGION 'modules/skshaper/include/sk4d_shaper_types.h'} - sk_shaper_t = THandle; - - psk_shaper_t = ^sk_shaper_t; - {$ENDREGION} - - {$REGION 'modules/skunicode/include/sk4d_unicode_types.h'} - sk_unicode_t = THandle; - - psk_unicode_t = ^sk_unicode_t; - - sk_breaktype_t = ( - WORDS_SK_BREAKTYPE, - GRAPHEMES_SK_BREAKTYPE, - LINES_SK_BREAKTYPE - ); - psk_breaktype_t = ^sk_breaktype_t; - - sk_direction_t = ( - LEFT_TO_RIGHT_SK_DIRECTION, - RIGHT_TO_LEFT_SK_DIRECTION - ); - psk_direction_t = ^sk_direction_t; - - sk_unicode_bidi_region_proc = procedure (start, &end: int32_t; level: uint8_t; context: Pointer); cdecl; - sk_unicode_break_proc = procedure (position, status: int32_t; context: Pointer); cdecl; - sk_unicode_codepoint_proc = procedure (unichar: sk_unichar_t; start, &end: int32_t; context: Pointer); cdecl; - {$ENDREGION} - - {$REGION 'modules/svg/include/sk4d_svg_types.h'} - sk_svgdom_t = THandle; - sk_svgsvg_t = THandle; - sk_svgnode_t = THandle; - - psk_svgdom_t = ^sk_svgdom_t; - psk_svgsvg_t = ^sk_svgsvg_t; - psk_svgnode_t = ^sk_svgnode_t; - - sk_svglengthunit_t = ( - UNKNOWN_SK_SVGLENGTHUNIT, - NUMBER_SK_SVGLENGTHUNIT, - PERCENTAGE_SK_SVGLENGTHUNIT, - EMS_SK_SVGLENGTHUNIT, - EXS_SK_SVGLENGTHUNIT, - PX_SK_SVGLENGTHUNIT, - CM_SK_SVGLENGTHUNIT, - MM_SK_SVGLENGTHUNIT, - IN_SK_SVGLENGTHUNIT, - PT_SK_SVGLENGTHUNIT, - PC_SK_SVGLENGTHUNIT - ); - psk_svglengthunit_t = ^sk_svglengthunit_t; - - sk_svgaspectalign_t = ( - X_MIN_Y_MIN_SK_SVGASPECTALIGN, - X_MID_Y_MIN_SK_SVGASPECTALIGN, - X_MAX_Y_MIN_SK_SVGASPECTALIGN, - X_MIN_Y_MID_SK_SVGASPECTALIGN = 4, - X_MID_Y_MID_SK_SVGASPECTALIGN, - X_MAX_Y_MID_SK_SVGASPECTALIGN, - X_MIN_Y_MAX_SK_SVGASPECTALIGN = 8, - X_MID_Y_MAX_SK_SVGASPECTALIGN, - X_MAX_Y_MAX_SK_SVGASPECTALIGN, - NONE_SK_SVGASPECTALIGN = 16 - ); - psk_svgaspectalign_t = ^sk_svgaspectalign_t; - - sk_svgaspectscale_t = ( - MEET_SK_SVGASPECTSCALE, - SLICE_SK_SVGASPECTSCALE - ); - psk_svgaspectscale_t = ^sk_svgaspectscale_t; - - sk_svglength_t = record - value: float; - &unit: sk_svglengthunit_t; - end; - psk_svglength_t = ^sk_svglength_t; - - sk_svgpreserveaspectratio_t = record - align: sk_svgaspectalign_t; - scale: sk_svgaspectscale_t; - end; - psk_svgpreserveaspectratio_t = ^sk_svgpreserveaspectratio_t; - {$ENDREGION} - - {$ENDREGION} - - {$REGION 'Skia API'} - - {$IFDEF SK_DYNAMIC_LOADING} - - ESkiaAPI = class(Exception); - - {$ENDIF} - - { TSkiaAPI } - - TSkiaAPI = class sealed - public const - {$IF DEFINED(MSWINDOWS)} - LibName = 'sk4d.dll'; - {$ELSEIF DEFINED(MACOS)} - {$IF DEFINED(IOS) and DEFINED(CPUARM)} - LibName = 'sk4d.a'; - {$ELSE} - LibName = 'sk4d.dylib'; - {$ENDIF} - {$ELSE} - LibName = 'libsk4d.so'; - {$ENDIF} - {$IFDEF SK_DYNAMIC_LOADING} - strict private class var - [Volatile] FRefCount: Integer; - FLibHandle: HMODULE; - {$ENDIF} - strict private - class constructor Create; - {$IFDEF SK_DYNAMIC_LOADING} - class destructor Destroy; - {$ENDIF} - public - class procedure Initialize; - class procedure Terminate; - - {$REGION 'include/c/gr4d_backendsurface.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendrendertarget_create_gl {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(width, height, sample_count, stencil_bits: int32_t; const framebuffer_info: pgr_gl_framebufferinfo_t): gr_backendrendertarget_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendrendertarget_create_mtl {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(width, height: int32_t; const texture_info: pgr_mtl_textureinfo_t): gr_backendrendertarget_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_backendrendertarget_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_backendrendertarget_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendrendertarget_get_backend_api {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendrendertarget_t): gr_backendapi_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendrendertarget_get_height {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendrendertarget_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendrendertarget_get_sample_count {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendrendertarget_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendrendertarget_get_stencil_bits {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendrendertarget_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendrendertarget_get_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendrendertarget_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendrendertarget_is_valid {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendrendertarget_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendtexture_create_gl {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(width, height: int32_t; is_mipmapped: bool; const texture_info: pgr_gl_textureinfo_t): gr_backendtexture_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendtexture_create_mtl {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(width, height: int32_t; is_mipmapped: bool; const texture_info: pgr_mtl_textureinfo_t): gr_backendtexture_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_backendtexture_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_backendtexture_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendtexture_get_backend_api {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendtexture_t): gr_backendapi_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendtexture_get_gl_framebuffer_info{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendtexture_t; out texture_info: gr_gl_textureinfo_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendtexture_get_height {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendtexture_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendtexture_get_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendtexture_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendtexture_has_mipmaps {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendtexture_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_backendtexture_is_valid {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_backendtexture_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/gr4d_directcontext.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_abandon_context {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_dump_memory_statistics {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: gr_directcontext_t; trace_memory_dump: sk_tracememorydump_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_flush {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_flush_and_submit {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t; sync_cpu: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_free_gpu_resources {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_directcontext_get_backend_api {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_directcontext_t): gr_backendapi_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_directcontext_get_max_surface_sample_count_for_color_type{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_directcontext_t; color_type: sk_colortype_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_directcontext_get_resource_cache_limit {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_directcontext_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_get_resource_cache_usage {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: gr_directcontext_t; out resources: int32_t; out resources_bytes: size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_directcontext_is_abandoned {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: gr_directcontext_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_directcontext_make_gl {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const gl_interface: gr_gl_interface_t; const options: pgr_contextoptions_t): gr_directcontext_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_directcontext_make_metal {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const backend_context: pgr_mtl_backendcontext_t; const options: pgr_contextoptions_t): gr_directcontext_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_perform_deferred_cleanup {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t; milliseconds: int64_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_purge_unlocked_resources {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t; scratch_resources_only: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_purge_unlocked_resources2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t; bytes_to_purge: size_t; prefer_scratch_resources: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_release_resources_and_abandon_context {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_reset_context {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}gr4d_directcontext_set_resource_cache_limit {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: gr_directcontext_t; value: size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_directcontext_submit {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: gr_directcontext_t; sync_cpu: bool): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/gr4d_gl_interface.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_gl_interface_has_extension {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_gl_interface_t; const name: MarshaledAString): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_gl_interface_make_assembled {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: Pointer; proc: gr_gl_get_proc): gr_gl_interface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_gl_interface_make_assembled_gl {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: Pointer; proc: gr_gl_get_proc): gr_gl_interface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_gl_interface_make_assembled_gles {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: Pointer; proc: gr_gl_get_proc): gr_gl_interface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_gl_interface_make_assembled_webgl{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: Pointer; proc: gr_gl_get_proc): gr_gl_interface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_gl_interface_make_native {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): gr_gl_interface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}gr4d_gl_interface_validate {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: gr_gl_interface_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_blender.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_blender_make_arithmetic{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(k1, k2, k3, k4: float; enforce_premultiplied_color: bool): sk_blender_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_blender_make_mode {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(mode: sk_blendmode_t): sk_blender_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_canvas.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_clear {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; color: sk_color_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_clear2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const color: psk_color4f_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_discard {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_clip_path {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const path: sk_path_t; op: sk_clipop_t; anti_alias: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_clip_rect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; op: sk_clipop_t; anti_alias: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_clip_region {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const region: sk_region_t; op: sk_clipop_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_clip_rrect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const rrect: sk_rrect_t; op: sk_clipop_t; anti_alias: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_clip_shader {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; shader: sk_shader_t; op: sk_clipop_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_concat {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const matrix: psk_matrix44_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_concat2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const matrix: psk_matrix_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_annotation {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; const key: MarshaledAString; const value: Pointer; size: size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_arc {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const oval: psk_rect_t; start_angle, sweep_angle: float; use_center: bool; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_atlas {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const atlas: sk_image_t; const transforms: psk_rotationscalematrix_t; const sprites: psk_rect_t; const colors: psk_color_t; count: int32_t; blend_mode: sk_blendmode_t; const sampling: psk_samplingoptions_t; const cull_rect: psk_rect_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_circle {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const center: psk_point_t; radius: float; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_color {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; color: sk_color_t; blend_mode: sk_blendmode_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_color2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const color: psk_color4f_t; blend_mode: sk_blendmode_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_glyphs {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; count: int32_t; const glyphs: psk_glyphid_t; const positions: psk_point_t; const origin: psk_point_t; const font: sk_font_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_glyphs2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; count: int32_t; const glyphs: psk_glyphid_t; const matrices: psk_rotationscalematrix_t; const origin: psk_point_t; const font: sk_font_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_image {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const image: sk_image_t; x, y: float; const sampling: psk_samplingoptions_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_image_lattice {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const image: sk_image_t; const lattice: psk_lattice_t; const dest: psk_rect_t; filter_mode: sk_filtermode_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_image_nine {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const image: sk_image_t; const center: psk_irect_t; const dest: psk_rect_t; filter_mode: sk_filtermode_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_image_rect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const image: sk_image_t; const src, dest: psk_rect_t; const sampling: psk_samplingoptions_t; const paint: sk_paint_t; constraint: sk_srcrectconstraint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_line {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const point1, point2: psk_point_t; paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_oval {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const oval: psk_rect_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_paint {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_patch {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const cubics: psk_point_t; const colors: psk_color_t; const tex_coords: psk_point_t; blend_mode: sk_blendmode_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_path {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const path: sk_path_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_picture {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const picture: sk_picture_t; const matrix: psk_matrix_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_point {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const point: psk_point_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_points {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; mode: sk_drawpointsmode_t; count: size_t; const points: psk_point_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_rect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_region {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const region: sk_region_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_rrect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const rrect: sk_rrect_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_rrect2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; radius_x, radius_y: float; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_rrect_difference {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const outer, inner: sk_rrect_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_simple_text {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const text: Pointer; size: size_t; encoding: sk_textencoding_t; x, y: float; const font: sk_font_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_text_blob {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const text_blob: sk_textblob_t; x, y: float; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_draw_vertices {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const vertices: sk_vertices_t; blend_mode: sk_blendmode_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_get_device_clip_bounds {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_irect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_get_local_clip_bounds {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_rect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_get_local_to_device {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_matrix44_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_get_local_to_device_as_3x3{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_matrix_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_canvas_get_save_count {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_canvas_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_canvas_quick_reject {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_canvas_t; const rect: psk_rect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_canvas_quick_reject2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_canvas_t; const path: sk_path_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_reset_matrix {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_restore {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_restore_to_count {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; save_count: int32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_rotate {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; degrees: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_rotate2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; degrees, px, py: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_canvas_save {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_canvas_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_canvas_save_layer {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; const paint: sk_paint_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_canvas_save_layer_alpha {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; alpha: uint8_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_scale {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; sx, sy: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_set_matrix {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const matrix: psk_matrix44_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_set_matrix2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; const matrix: psk_matrix_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_skew {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; kx, ky: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_canvas_translate {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_canvas_t; dx, dy: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_codec.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_codec_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(codec: sk_codec_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_codec_get_dimensions {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_codec_t; out result: sk_isize_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_codec_get_encoded_image_format {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_codec_t): sk_encodedimageformat_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_codec_get_image {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_codec_t; color_type: sk_colortype_t; alpha_type: sk_alphatype_t; color_space: sk_colorspace_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_codec_get_pixels {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_codec_t; pixels: Pointer; row_bytes: size_t; color_type: sk_colortype_t; alpha_type: sk_alphatype_t; color_space: sk_colorspace_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_codec_make_from_file {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const file_name: MarshaledAString): sk_codec_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_codec_make_from_stream {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(stream: sk_stream_t): sk_codec_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_codec_make_with_copy {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const data: Pointer; size: size_t): sk_codec_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_codec_make_without_copy {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const data: Pointer; size: size_t): sk_codec_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_animcodecplayer_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_animcodecplayer_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_animcodecplayer_get_dimensions {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_animcodecplayer_t; out result: sk_isize_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_animcodecplayer_get_duration {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_animcodecplayer_t): uint32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_animcodecplayer_get_frame {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_animcodecplayer_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_animcodecplayer_make_from_file {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const file_name: MarshaledAString): sk_animcodecplayer_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_animcodecplayer_make_from_stream{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(stream: sk_stream_t): sk_animcodecplayer_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_animcodecplayer_seek {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_animcodecplayer_t; milliseconds: uint32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_colorfilter.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_blend {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(color: sk_color_t; mode: sk_blendmode_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_compose {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(outer, inner: sk_colorfilter_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_high_contrast {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const config: psk_highcontrastconfig_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_hsla_matrix {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const matrix: psk_colormatrix_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_lighting {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(multiply, add: sk_color_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_linear_to_srgb_gamma{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_luma_color {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_matrix {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const matrix: psk_colormatrix_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_overdraw {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const colors: psk_color_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorfilter_make_table {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const tablea_a, tablea_r, tablea_g, tablea_b: puint8_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_colorspace.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_gamma_close_to_srgb {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspace_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_gamma_is_linear {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspace_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_is_equal {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, color_space: sk_colorspace_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_is_numerical_transfer_fn {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspace_t; out transfer_function: sk_colorspacetransferfn_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_is_srgb {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspace_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_make {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const profile: sk_colorspaceiccprofile_t): sk_colorspace_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_make_linear_gamma {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspace_t): sk_colorspace_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_make_rgb {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const transfer_function: psk_colorspacetransferfn_t; const xyz: psk_colorspacexyz_t): sk_colorspace_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_make_srgb {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_colorspace_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_make_srgb_gamma {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspace_t): sk_colorspace_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_make_srgb_linear {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_colorspace_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_colorspace_ref {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_colorspace_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_to_profile {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspace_t): sk_colorspaceiccprofile_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspace_to_xyz {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspace_t; out xyz: sk_colorspacexyz_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_colorspace_unref {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_colorspace_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_colorspaceiccprofile_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_colorspaceiccprofile_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspaceiccprofile_get_buffer {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspaceiccprofile_t; size: puint32_t): puint8_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspaceiccprofile_make_with_parse{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const buffer: Pointer; size: size_t): sk_colorspaceiccprofile_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspaceiccprofile_to_xyz {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_colorspaceiccprofile_t; out dest: sk_colorspacexyz_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspaceprimaries_to_xyz {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: psk_colorspaceprimaries_t; out xyz: sk_colorspacexyz_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspacetransferfn_invert {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: psk_colorspacetransferfn_t; out transfer_function: sk_colorspacetransferfn_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_colorspacetransferfn_transform {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: psk_colorspacetransferfn_t; x: float): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_data.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_data_make_empty {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_data_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_data_make_with_copy{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const data: Pointer; size: size_t): sk_data_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_document.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_document_begin_page{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_document_t; width, height: float; const content: psk_rect_t): sk_canvas_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_document_close {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_document_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_document_end_page {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_document_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_document_make_pdf {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(w_stream: sk_wstream_t): sk_document_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_document_make_pdf2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(w_stream: sk_wstream_t; const metadata: psk_pdfmetadata_t): sk_document_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_document_make_xps {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(w_stream: sk_wstream_t; dpi: float): sk_document_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_document_terminate {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_document_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_font.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(typeface: sk_typeface_t; size, sx, kx: float): sk_font_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_create2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const font: sk_font_t): sk_font_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_baseline_snap {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_edging {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): sk_fontedging_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_embedded_bitmaps {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_embolden {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_force_auto_hinting {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_glyphs {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t; const text: Pointer; size: size_t; encoding: sk_textencoding_t; result: psk_glyphid_t; max_count: int32_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_glyphs_count {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t; const text: Pointer; size: size_t; encoding: sk_textencoding_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_hinting {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): sk_fonthinting_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_get_horizontal_positions{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; result: pfloat; origin: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_intercepts {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; const positions: psk_point_t; const bounds: pfloat; result: pfloat; const paint: sk_paint_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_linear_metrics {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_metrics {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t; metrics: psk_fontmetrics_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_path {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t; glyph: sk_glyphid_t): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_get_paths {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; proc: sk_font_path_proc; proc_context: Pointer); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_get_positions {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; result: psk_point_t; const origin: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_scale_x {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_size {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_skew_x {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_subpixel {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_typeface {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): sk_typeface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_get_typeface_or_default {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t): sk_typeface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_get_widths_bounds {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; widths: pfloat; bounds: psk_rect_t; const paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_is_equal {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, font: sk_font_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_measure_text {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t; const text: Pointer; size: size_t; encoding: sk_textencoding_t; bounds: psk_rect_t; const paint: sk_paint_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_baseline_snap {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_edging {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: sk_fontedging_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_embedded_bitmaps {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_embolden {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_force_auto_hinting {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_hinting {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: sk_fonthinting_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_linear_metrics {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_scale_x {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_size {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_skew_x {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_subpixel {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_set_typeface {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_font_t; typeface: sk_typeface_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_font_unichar_to_glyph {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_font_t; unichar: sk_unichar_t): sk_glyphid_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_font_unichars_to_glyphs {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_font_t; const unichars: psk_unichar_t; count: int32_t; result: psk_glyphid_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_graphics.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_graphics_allow_jit {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_graphics_dump_memory_statistics {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(trace_memory_dump: sk_tracememorydump_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_get_font_cache_count_limit {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_get_font_cache_count_used {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_get_font_cache_limit {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_get_font_cache_used {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_get_resource_cache_single_allocation_byte_limit{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_get_resource_cache_total_byte_limit {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_get_resource_cache_total_bytes_used {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_graphics_init {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_graphics_purge_all_caches {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_graphics_purge_font_cache {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_graphics_purge_resource_cache {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_set_font_cache_count_limit {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(value: int32_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_set_font_cache_limit {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(value: size_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_set_resource_cache_single_allocation_byte_limit{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(value: size_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_graphics_set_resource_cache_total_byte_limit {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(value: size_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_image.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_encode_to_file {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; const file_name: MarshaledAString; format: sk_encodedimageformat_t; quality: int32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_encode_to_stream {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; w_stream: sk_wstream_t; format: sk_encodedimageformat_t; quality: int32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_get_alpha_type {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): sk_alphatype_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_get_color_space {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): sk_colorspace_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_get_color_type {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): sk_colortype_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_get_height {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_image_get_image_info {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_image_t; out result: sk_imageinfo_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_get_unique_id {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): uint32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_get_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_is_lazy_generated {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_is_texture_backed {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_is_valid {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; context: gr_directcontext_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_backend_texture {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_image_t; context: gr_directcontext_t): gr_backendtexture_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_from_adopted_texture{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: gr_directcontext_t; const texture: gr_backendtexture_t; origin: gr_surfaceorigin_t; color_type: sk_colortype_t; alpha_type: sk_alphatype_t; color_space: sk_colorspace_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_from_encoded_file {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const file_name: MarshaledAString): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_from_encoded_stream {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(stream: sk_stream_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_from_raster {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const pixmap: sk_pixmap_t; proc: sk_image_raster_release_proc; proc_context: Pointer): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_from_texture {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: gr_directcontext_t; const texture: gr_backendtexture_t; origin: gr_surfaceorigin_t; color_type: sk_colortype_t; alpha_type: sk_alphatype_t; color_space: sk_colorspace_t; proc: sk_image_texture_release_proc; proc_context: Pointer): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_non_texture_image {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_raster_copy {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const pixmap: sk_pixmap_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_raster_image {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_raw_shader {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; tile_mode_x, tile_mode_y: sk_tilemode_t; const sampling: psk_samplingoptions_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_shader {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; tile_mode_x, tile_mode_y: sk_tilemode_t; const sampling: psk_samplingoptions_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_subset {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; const subset: psk_irect_t; context: gr_directcontext_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_texture_image {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; context: gr_directcontext_t; is_mipmapped: bool): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_make_with_filter {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; context: gr_directcontext_t; const filter: sk_imagefilter_t; const subset, clip_bounds: psk_irect_t; out out_subset: sk_irect_t; out offset: sk_ipoint_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_peek_pixels {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t): sk_pixmap_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_read_pixels {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; context: gr_directcontext_t; const dest: sk_pixmap_t; src_x, src_y: int32_t; caching_hint: sk_imagecachinghint_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_image_scale_pixels {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_image_t; const dest: sk_pixmap_t; const sampling: psk_samplingoptions_t; caching_hint: sk_imagecachinghint_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_imageencoder.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imageencoder_encode_to_file {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const file_name: MarshaledAString; const src: sk_pixmap_t; format: sk_encodedimageformat_t; quality: int32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imageencoder_encode_to_stream{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(w_stream: sk_wstream_t; const src: sk_pixmap_t; format: sk_encodedimageformat_t; quality: int32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_imagefilter.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_alpha_threshold {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const region: sk_region_t; inner_min, outer_max: float; input: sk_imagefilter_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_arithmetic {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(k1, k2, k3, k4: float; enforce_premultiplied_color: bool; background, foreground: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_blend {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(mode: sk_blendmode_t; background, foreground: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_blur {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(sigma_x, sigma_y: float; tile_mode: sk_tilemode_t; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_colorfilter {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(color_filter: sk_colorfilter_t; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_compose {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(inner, outer: sk_imagefilter_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_dilate {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(radius_x, radius_y: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_displacement_map {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(x_channel_selector, y_channel_selector: sk_colorchannel_t; scale: float; displacement, input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_distant_lit_diffuse {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const direction: psk_point3_t; light_color: sk_color_t; surface_scale, kd: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_distant_lit_specular{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const direction: psk_point3_t; light_color: sk_color_t; surface_scale, ks, shininess: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_drop_shadow {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(dx, dy, sigma_x, sigma_y: float; color: sk_color_t; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_drop_shadow_only {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(dx, dy, sigma_x, sigma_y: float; color: sk_color_t; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_erode {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(radius_x, radius_y: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_image {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(image: sk_image_t; const src, dest: psk_rect_t; const sampling: psk_samplingoptions_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_magnifier {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const src: psk_rect_t; inset: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_matrix_convolution {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const kernel_size: psk_isize_t; const kernel: pfloat; gain, bias: float; const kernel_offset: psk_ipoint_t; tile_mode: sk_tilemode_t; convolve_alpha: bool; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_matrix_transform {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const matrix: psk_matrix_t; const sampling: psk_samplingoptions_t; input: sk_imagefilter_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_merge {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const filters: psk_imagefilter_t; count: int32_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_offset {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(dx, dy: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_picture {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(picture: sk_picture_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_point_lit_diffuse {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const location: psk_point3_t; light_color: sk_color_t; surface_scale, kd: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_point_lit_specular {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const location: psk_point3_t; light_color: sk_color_t; surface_scale, ks, shininess: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_shader {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(shader: sk_shader_t; dither: bool; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_spot_lit_diffuse {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const location, target: psk_point3_t; falloff_exponent, cutoff_angle: float; light_color: sk_color_t; surface_scale, kd: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_spot_lit_specular {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const location, target: psk_point3_t; falloff_exponent, cutoff_angle: float; light_color: sk_color_t; surface_scale, ks, shininess: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_tile {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const src, dest: psk_rect_t; input: sk_imagefilter_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_imagefilter_make_with_local_matrix {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_imagefilter_t; const local_matrix: psk_matrix_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - - {$ENDREGION} - - {$REGION 'include/c/sk4d_maskfilter.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_maskfilter_make_blur {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(style: sk_blurstyle_t; sigma: float; respect_ctm: bool): sk_maskfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_maskfilter_make_shader {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(shader: sk_shader_t): sk_maskfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_maskfilter_make_table {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const table: puint8_t): sk_maskfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_maskfilter_make_table_clip {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(min, max: uint8_t): sk_maskfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_maskfilter_make_table_gamma{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(gamma: float): sk_maskfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_paint.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_paint_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_create2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const paint: sk_paint_t): sk_paint_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_alpha {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): uint8_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_alphaf {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_anti_alias {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_blender {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_blender_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_color {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_color_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_get_colorf {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_paint_t; out result: sk_color4f_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_color_filter {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_dither {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_fill_path {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t; const path: sk_path_t; const cull_rect: psk_rect_t; res_scale: float): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_image_filter {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_imagefilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_mask_filter {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_maskfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_path_effect {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_shader {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_stroke_cap {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_strokecap_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_stroke_join {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_strokejoin_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_stroke_miter {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_stroke_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paint_get_style {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paint_t): sk_paintstyle_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_reset {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_alpha {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: uint8_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_alphaf {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_antialias {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_argb {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; a, r, g, b: uint8_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_blender {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_blender_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_color {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_color_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_colorf {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; const value: psk_color4f_t; color_space: sk_colorspace_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_color_filter {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_colorfilter_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_dither {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_image_filter {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_imagefilter_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_mask_filter {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_maskfilter_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_path_effect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_patheffect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_shader {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_shader_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_stroke_cap {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_strokecap_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_stroke_join {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_strokejoin_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_stroke_miter {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_stroke_width {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paint_set_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paint_t; value: sk_paintstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_path.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_opbuilder_add {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_opbuilder_t; const path: sk_path_t; op: sk_pathop_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_opbuilder_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_opbuilder_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_opbuilder_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_opbuilder_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_opbuilder_detach {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_opbuilder_t): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_contains {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t; x, y: float): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_convert_conic_to_quads{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const point1, point2, point3: psk_point_t; weight: float; points: psk_point_t; power2: int32_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const svg: MarshaledAString): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_create2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(stream: sk_stream_t): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_path_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_path_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_path_get_bounds {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_path_t; out result: sk_rect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_get_fill_type {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t): sk_pathfilltype_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_get_last_point {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t; out result: sk_point_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_get_segment_masks {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t): uint32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_path_get_tight_bounds {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_path_t; out result: sk_rect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_interpolate {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, cending: sk_path_t; weight: float): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_is_convex {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_is_empty {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_is_finite {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_is_interpolatable {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, path: sk_path_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_is_last_contour_closed{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_is_line {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t; lines: psk_point_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_is_oval {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t; oval: psk_rect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_is_rect {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t; rect: psk_rect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_is_rrect {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t; rrect: sk_rrect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_path_serialize_to_stream {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_path_t; w_stream: sk_wstream_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_to_svg {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t): sk_string_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_path_transform {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_path_t; const matrix: psk_matrix_t): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathiterator_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const path: sk_path_t; force_close: bool): sk_pathiterator_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathiterator_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathiterator_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathiterator_next {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_pathiterator_t; out elem: sk_pathiteratorelem_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_pathbuilder.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_add_arc {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const oval: psk_rect_t; start_angle, sweep_angle: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_add_circle {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; center_x, center_y, radius: float; direction: sk_pathdirection_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_add_oval {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const oval: psk_rect_t; direction: sk_pathdirection_t; start_index: uint32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_add_path {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const path: sk_path_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_add_polygon {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; polygon: psk_point_t; count: int32_t; is_closed: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_add_rect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const rect: psk_rect_t; direction: sk_pathdirection_t; start_index: uint32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_add_rrect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const rrect: sk_rrect_t; direction: sk_pathdirection_t; start_index: uint32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_arc_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const radius: psk_point_t; x_axis_rotate: float; large_arc: sk_patharcsize_t; sweep: sk_pathdirection_t; const xy: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_arc_to2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const oval: psk_rect_t; start_angle, sweep_angle: float; force_move_to: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_arc_to3 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t; radius: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_close {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_conic_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t; weight: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathbuilder_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_pathbuilder_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathbuilder_create2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const path_builder: sk_pathbuilder_t): sk_pathbuilder_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_cubic_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2, point3: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathbuilder_detach {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_pathbuilder_t): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_get_bounds {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_pathbuilder_t; out result: sk_rect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathbuilder_get_fill_type {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pathbuilder_t): sk_pathfilltype_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_inc_reserve {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; extra_point_count, extra_verb_count: int32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_line_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const cpoint: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_move_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const cpoint: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_offset {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; dx, dy: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_polyline_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const points: psk_point_t; count: int32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_quad_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_r_conic_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t; weight: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_r_cubic_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2, point3: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_r_line_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_r_quad_to {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_reset {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_set_filltype {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t; value: sk_pathfilltype_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathbuilder_snapshot {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pathbuilder_t): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathbuilder_toggle_inverse_filltype{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathbuilder_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_patheffect.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_1dpath {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const path: sk_path_t; advance, phase: float; style: sk_patheffect1dstyle_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_2dline {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(width: float; const matrix: psk_matrix_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_2dpath {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const matrix: psk_matrix_t; const path: sk_path_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_compose {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(outer, inner: sk_patheffect_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_corner {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(radius: float): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_dash {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const intervals: pfloat; count: int32_t; phase: float): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_discrete {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(seg_length, deviation: float; seed_assist: uint32_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_matrix {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const matrix: psk_matrix_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_merge {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(effect1, effect2: sk_patheffect_t; op: sk_pathop_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_stroke {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(width: float; join: sk_strokejoin_t; cap: sk_strokecap_t; miter: float): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_stroke_and_fill{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_sum {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(effect1, effect2: sk_patheffect_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_translate {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(dx, dy: float): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_patheffect_make_trim {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(start, stop: float; mode: sk_patheffecttrimmode_t): sk_patheffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_pathmeasure.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathmeasure_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const path: sk_path_t; force_closed: bool; res_scale: float): sk_pathmeasure_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pathmeasure_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pathmeasure_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathmeasure_get_length {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_pathmeasure_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathmeasure_get_matrix {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_pathmeasure_t; distance: float; out matrix: sk_matrix_t; matrix_flags: uint32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathmeasure_get_position_and_tangent{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_pathmeasure_t; distance: float; out position: sk_point_t; out tangent: sk_vector_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathmeasure_get_segment {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_pathmeasure_t; start, stop: float; start_with_move_to: bool): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathmeasure_is_closed {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_pathmeasure_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pathmeasure_next_contour {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_pathmeasure_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_picture.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_picture_get_cull_rect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_picture_t; out result: sk_rect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_picture_make_from_stream {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(stream: sk_stream_t): sk_picture_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_picture_make_shader {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_picture_t; tile_mode_x, tile_mode_y: sk_tilemode_t; filter_mode: sk_filtermode_t; const local_matrix: psk_matrix_t; const tile_rect: psk_rect_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_picture_playback {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_picture_t; canvas: sk_canvas_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_picture_serialize_to_stream{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_picture_t; w_stream: sk_wstream_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_picturerecorder.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_picturerecorder_begin_recording {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_picturerecorder_t; const bounds: psk_rect_t): sk_canvas_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_picturerecorder_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_picturerecorder_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_picturerecorder_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_picturerecorder_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_picturerecorder_finish_recording {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_picturerecorder_t): sk_picture_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_picturerecorder_finish_recording2{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_picturerecorder_t; const cull_rect: psk_rect_t): sk_picture_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_pixmap.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const image_info: psk_imageinfo_t; const pixels: Pointer; row_bytes: size_t): sk_pixmap_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pixmap_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pixmap_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_erase {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t; color: sk_color_t; const area: psk_irect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_erase2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t; const color: psk_color4f_t; color_space: sk_colorspace_t; const area: psk_irect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_extract_subset {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t; dest: sk_pixmap_t; const area: psk_irect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_alpha {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t; x, y: int32_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_alpha_type {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t): sk_alphatype_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_color {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t; x, y: int32_t): sk_color_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_color_space{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t): sk_colorspace_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_color_type {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t): sk_colortype_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_height {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pixmap_get_image_info {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_pixmap_t; out result: sk_imageinfo_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_pixel_addr {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t; x, y: int32_t): Pointer; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_pixels {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t): Pointer; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_row_bytes {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_get_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_pixmap_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_read_pixels {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, dest: sk_pixmap_t; src_x, src_y: int32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_pixmap_scale_pixels {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, dest: sk_pixmap_t; const sampling: psk_samplingoptions_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_pixmap_set_colorspace {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_pixmap_t; value: sk_colorspace_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_refcnt.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_refcnt_ref {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_refcnt_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_refcnt_unref{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_refcnt_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_region.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_contains {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, region: sk_region_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_contains2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_region_t; const rect: psk_irect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_contains3 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_region_t; x, y: int32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_region_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_create2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const region: sk_region_t): sk_region_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_region_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_region_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_get_boundary_path {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_region_t): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_region_get_bounds {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_region_t; out result: sk_irect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_intersects {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, region: sk_region_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_intersects2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_region_t; const rect: psk_irect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_is_complex {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_region_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_is_empty {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_region_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_is_equal {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, region: sk_region_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_is_rect {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_region_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_op {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_region_t; const region: sk_region_t; op: sk_regionop_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_op2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_region_t; const rect: psk_irect_t; op: sk_regionop_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_quick_contains {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_region_t; const rect: psk_irect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_quick_reject {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, region: sk_region_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_quick_reject2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_region_t; const rect: psk_irect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_region_set_empty {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_region_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_set_path {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_region_t; const path: sk_path_t; const clip: sk_region_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_set_rect {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_region_t; const rect: psk_irect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_region_set_rects {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_region_t; const rects: psk_irect_t; count: int32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_region_translate {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_region_t; x, y: int32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_regioncliperator_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const region: sk_region_t; const clip: psk_irect_t): sk_regioncliperator_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_regioncliperator_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_regioncliperator_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_regioncliperator_get_current{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_regioncliperator_t; out result: sk_irect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_regioncliperator_move_next {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_regioncliperator_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_regioniterator_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const region: sk_region_t): sk_regioniterator_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_regioniterator_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_regioniterator_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_regioniterator_get_current {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_regioniterator_t; out result: sk_irect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_regioniterator_move_next {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_regioniterator_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_regioniterator_reset {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_regioniterator_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_regionspanerator_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const region: sk_region_t; y, left, right: int32_t): sk_regionspanerator_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_regionspanerator_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_regionspanerator_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_regionspanerator_next {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_regionspanerator_t; out elem: sk_ipoint_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_rrect.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_contains {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t; const rect: psk_rect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_rrect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_create2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const rrect: sk_rrect_t): sk_rrect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_deflate {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t; dx, dy: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_get_height {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_get_radii {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_rrect_t; corner: sk_rrectcorner_t; out result: sk_vector_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_get_rect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_rrect_t; out result: sk_rect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_get_simple_radii{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_rrect_t; out result: sk_vector_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_get_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_inflate {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t; dx, dy: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_is_complex {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_is_empty {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_is_equal {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, rrect: sk_rrect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_is_nine_patch {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_is_oval {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_is_rect {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_is_simple {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_is_valid {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_offset {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t; dx, dy: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_set_empty {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_set_nine_patch {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t; radius_left, radius_top, radius_right, radius_bottom: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_set_oval {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_set_rect {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_set_rect2 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t; const radii: psk_vector_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_rrect_set_rect3 {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t; radius_x, radius_y: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_rrect_transform {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_rrect_t; const matrix: psk_matrix_t): sk_rrect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_runtimeeffect.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_get_child_count {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_get_child_name {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): MarshaledAString; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_get_child_type {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): sk_runtimeeffectchildtype_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_get_uniform_count {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_get_uniform_data_size {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_get_uniform_name {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): MarshaledAString; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_get_uniform_offset {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_get_uniform_type {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): sk_runtimeeffectuniformtype_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_get_uniform_type_count{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_index_of_child {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; const name: MarshaledAString): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_index_of_uniform {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; const name: MarshaledAString): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_make_blender {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; const uniforms: Pointer; children: psk_blender_t): sk_blender_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_make_color_filter {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; const uniforms: Pointer; children: psk_colorfilter_t): sk_colorfilter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_make_for_blender {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const sksl: MarshaledAString; error_text: sk_string_t): sk_runtimeeffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_make_for_color_filter {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const sksl: MarshaledAString; error_text: sk_string_t): sk_runtimeeffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_make_for_shader {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const sksl: MarshaledAString; error_text: sk_string_t): sk_runtimeeffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_make_image {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; context: gr_directcontext_t; const uniforms: Pointer; children: psk_shader_t; const local_matrix: psk_matrix_t; const image_info: psk_imageinfo_t; is_mipmapped: bool): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_runtimeeffect_make_shader {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_runtimeeffect_t; const uniforms: Pointer; children: psk_shader_t; const local_matrix: psk_matrix_t; opaque: bool): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_shader.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_blend {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(mode: sk_blendmode_t; dest, src: sk_shader_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_color {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(color: sk_color_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_color2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const color: psk_color4f_t; color_space: sk_colorspace_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_gradient_linear {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const points: psk_point_t; const colors: psk_color_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_gradient_linear2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const points: psk_point_t; const colors: psk_color4f_t; color_space: sk_colorspace_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_gradient_radial {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const center: psk_point_t; radius: float; const colors: psk_color_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_gradient_radial2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const center: psk_point_t; radius: float; const colors: psk_color4f_t; color_space: sk_colorspace_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_gradient_sweep {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(center_x, center_y: float; const colors: psk_color_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; start_angle, end_angle: float; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_gradient_sweep2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(center_x, center_y: float; const colors: psk_color4f_t; color_space: sk_colorspace_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; start_angle, end_angle: float; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_gradient_two_point_conical {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const start: psk_point_t; start_radius: float; const &end: psk_point_t; end_radius: float; const colors: psk_color_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_gradient_two_point_conical2{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const start: psk_point_t; start_radius: float; const &end: psk_point_t; end_radius: float; const colors: psk_color4f_t; color_space: sk_colorspace_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_perlin_noise_fractal_noise {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(base_frequency_x, base_frequency_y: float; num_octaves: int32_t; seed: float; const tile_size: psk_isize_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_perlin_noise_turbulence {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(base_frequency_x, base_frequency_y: float; num_octaves: int32_t; seed: float; const tile_size: psk_isize_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_with_color_filter {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_shader_t; color_filter: sk_colorfilter_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shader_make_with_local_matrix {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_shader_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_stream.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_streamadapter_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: Pointer): sk_streamadapter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_streamadapter_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_streamadapter_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_streamadapter_set_procs {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const procs: psk_streamadapter_procs_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_wstreamadapter_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: Pointer): sk_wstreamadapter_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_wstreamadapter_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_wstreamadapter_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_wstreamadapter_set_procs{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const procs: psk_wstreamadapter_procs_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_string.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_string_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_string_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_string_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_string_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_string_get_text{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_string_t): MarshaledAString; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_string_set_text{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_string_t; const value: MarshaledAString); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_surface.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_surface_draw {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_surface_t; canvas: sk_canvas_t; x, y: float; paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_surface_flush {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_surface_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_surface_flush_and_submit {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_surface_t; sync_cpu: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_get_canvas {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_surface_t): sk_canvas_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_surface_get_props {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_surface_t; out result: sk_surfaceprops_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_make_from_ca_metal_layer{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: gr_directcontext_t; layer: gr_mtl_handle_t; origin: gr_surfaceorigin_t; sample_count: int32_t; color_type: sk_colortype_t; color_space: sk_colorspace_t; const props: psk_surfaceprops_t; out drawable: gr_mtl_handle_t): sk_surface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_make_from_mtk_view {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: gr_directcontext_t; layer: gr_mtl_handle_t; origin: gr_surfaceorigin_t; sample_count: int32_t; color_type: sk_colortype_t; color_space: sk_colorspace_t; const props: psk_surfaceprops_t): sk_surface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_make_from_render_target {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: gr_directcontext_t; const render_target: gr_backendrendertarget_t; origin: gr_surfaceorigin_t; color_type: sk_colortype_t; color_space: sk_colorspace_t; const props: psk_surfaceprops_t): sk_surface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_make_from_texture {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: gr_directcontext_t; const texture: gr_backendtexture_t; origin: gr_surfaceorigin_t; sample_count: int32_t; color_type: sk_colortype_t; color_space: sk_colorspace_t; const props: psk_surfaceprops_t): sk_surface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_make_image_snapshot {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_surface_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_make_image_snapshot2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_surface_t; const bounds: psk_irect_t): sk_image_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_make_raster {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const image_info: psk_imageinfo_t; row_bytes: size_t; const props: psk_surfaceprops_t): sk_surface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_make_raster_direct {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const pixmap: sk_pixmap_t; proc: sk_surface_raster_release_proc; proc_context: Pointer; const props: psk_surfaceprops_t): sk_surface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_make_render_target {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(context: gr_directcontext_t; is_budgeted: bool; const image_info: psk_imageinfo_t; sample_count: int32_t; origin: gr_surfaceorigin_t; const props: psk_surfaceprops_t; should_create_with_mips: bool): sk_surface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_peek_pixels {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_surface_t): sk_pixmap_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_surface_read_pixels {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_surface_t; const dest: sk_pixmap_t; src_x, src_y: int32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_svgcanvas.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_svgcanvas_make{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const bounds: psk_rect_t; w_stream: sk_wstream_t; flags: uint32_t): sk_canvas_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_textblob.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textblob_get_intercepts {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textblob_t; const bounds: pfloat; result: pfloat; const paint: sk_paint_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textblob_make_from_text {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const text: Pointer; size: size_t; const font: sk_font_t; encoding: sk_textencoding_t): sk_textblob_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textblob_make_from_text_horizontally_positioned{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const text: Pointer; size: size_t; const x_positions: pfloat; y: float; const font: sk_font_t; encoding: sk_textencoding_t): sk_textblob_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textblob_make_from_text_positioned {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const text: Pointer; size: size_t; const positions: psk_point_t; const font: sk_font_t; encoding: sk_textencoding_t): sk_textblob_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textblob_make_from_text_transform {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const text: Pointer; size: size_t; const matrices: psk_rotationscalematrix_t; const font: sk_font_t; encoding: sk_textencoding_t): sk_textblob_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textblob_ref {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_textblob_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textblob_unref {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_textblob_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_tracememorydump.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_tracememorydumpbaseclass_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(detailed_dump, dump_wrapped_objects: bool; context: Pointer): sk_tracememorydumpbaseclass_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_tracememorydumpbaseclass_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_tracememorydumpbaseclass_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_tracememorydumpbaseclass_set_procs{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const procs: psk_tracememorydumpbaseclass_procs_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_typeface.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_typeface_get_family_name {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_typeface_t): sk_string_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_typeface_get_slant {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_typeface_t): sk_fontslant_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_typeface_get_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_typeface_t; out result: sk_fontstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_typeface_get_weight {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_typeface_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_typeface_get_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_typeface_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_typeface_make_default {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_typeface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_typeface_make_from_file {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const file_name: MarshaledAString; ttc_index: int32_t): sk_typeface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_typeface_make_from_stream{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(stream: sk_stream_t; ttc_index: int32_t): sk_typeface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_typeface_make_from_name {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const family_name: MarshaledAString; const style: psk_fontstyle_t): sk_typeface_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_version.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_library_version_get_build{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_library_version_get_major{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_library_version_get_minor{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_vertices.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_vertices_make_copy{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(vertex_mode: sk_vertexmode_t; vertex_count: int32_t; const positions, textures: psk_point_t; const colors: psk_color_t; index_count: int32_t; const indices: puint16_t): sk_vertices_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_vertices_ref {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_vertices_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_vertices_unref {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_vertices_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/particles/include/sk4d_particleeffect.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_particleeffect_get_position {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_particleeffect_t; out result: sk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_particleeffect_get_rate {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_particleeffect_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_particleeffect_get_uniform {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_particleeffect_t; index: size_t; out result: sk_particleuniform_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_particleeffect_get_uniform_count {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_particleeffect_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_particleeffect_get_uniform_data {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_particleeffect_t): pfloat; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_particleeffect_get_uniform_data_count{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_particleeffect_t): int32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_particleeffect_get_uniform_name {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_particleeffect_t; index: size_t): sk_string_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_particleeffect_init {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_particleeffect_make_from_file {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const file_name: MarshaledAString): sk_particleeffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_particleeffect_make_from_stream {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(stream: sk_stream_t; resource_provider: sk_resourceprovider_t): sk_particleeffect_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_particleeffect_render {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_particleeffect_t; canvas: sk_canvas_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_particleeffect_set_position {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_particleeffect_t; const value: psk_point_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_particleeffect_set_rate {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_particleeffect_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_particleeffect_set_uniform {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_particleeffect_t; const name: MarshaledAString; const data: pfloat; count: int32_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_particleeffect_start {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_particleeffect_t; now: double; looping: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_particleeffect_update {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_particleeffect_t; now: double); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skottie/include/sk4d_skottie.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_skottieanimation_get_duration {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_skottieanimation_t): double; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_skottieanimation_get_fps {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_skottieanimation_t): double; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_skottieanimation_get_in_point {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_skottieanimation_t): double; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_skottieanimation_get_out_point {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_skottieanimation_t): double; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_skottieanimation_get_size {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_skottieanimation_t; out result: sk_size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_skottieanimation_get_version {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_skottieanimation_t): MarshaledAString; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_skottieanimation_make_from_file {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const file_name: MarshaledAString): sk_skottieanimation_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_skottieanimation_make_from_stream{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(stream: sk_stream_t; resource_provider: sk_resourceprovider_t): sk_skottieanimation_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_skottieanimation_ref {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_skottieanimation_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_skottieanimation_render {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_skottieanimation_t; canvas: sk_canvas_t; const dest: psk_rect_t; render_flags: uint32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_skottieanimation_seek_frame {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_skottieanimation_t; tick: double); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_skottieanimation_seek_frame_time {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_skottieanimation_t; tick: double); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_skottieanimation_unref {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_skottieanimation_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_paragraph.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraph_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraph_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_did_exceed_max_lines {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_alphabetic_baseline {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraph_get_glyph_position_at_coordinate{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraph_t; dx, dy: float; out result: sk_positionaffinity_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_height {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_ideographic_baseline {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_line_metrics {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t; result: psk_metrics_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_longest_line {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_max_intrinsic_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_max_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_min_intrinsic_width {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_rects_for_placeholders {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t; result: psk_textbox_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_get_rects_for_range {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t; start, &end: uint32_t; rect_height_style: sk_rectheightstyle_t; rect_width_style: sk_rectwidthstyle_t; result: psk_textbox_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraph_get_word_boundary {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraph_t; offset: uint32_t; out start, &end: uint32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraph_layout {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraph_t; width: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraph_paint {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraph_t; canvas: sk_canvas_t; x, y: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraph_to_path {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraph_t): sk_path_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_paragraphbuilder.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphbuilder_add_placeholder{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphbuilder_t; const placeholder: psk_placeholderstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphbuilder_add_text {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphbuilder_t; const text: pchar; size: size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphbuilder_build {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_paragraphbuilder_t): sk_paragraph_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphbuilder_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const paragraph_style: sk_paragraphstyle_t): sk_paragraphbuilder_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphbuilder_create2 {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const paragraph_style: sk_paragraphstyle_t; font_provider: sk_typefacefontprovider_t; enable_font_fallback: bool): sk_paragraphbuilder_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphbuilder_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphbuilder_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphbuilder_pop {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphbuilder_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphbuilder_push_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphbuilder_t; const text_style: sk_textstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_paragraphstyle.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_paragraphstyle_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_disable_hinting {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_get_ellipsis {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_string_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_get_height {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paragraphstyle_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_get_max_lines {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paragraphstyle_t): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_get_strut_style {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_strutstyle_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_get_text_align {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_textalign_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_get_text_direction {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_textdirection_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_get_text_height_behaviors{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paragraphstyle_t): uint32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_get_text_style {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_textstyle_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_set_ellipsis {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t; const value: MarshaledAString); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_set_height {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_set_max_lines {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_set_strut_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t; const value: sk_strutstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_set_text_align {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: sk_textalign_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_set_text_direction {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: sk_textdirection_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_set_text_height_behaviors{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: uint32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_paragraphstyle_set_text_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: sk_textstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_strutstyle_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_strutstyle_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_strutstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_strutstyle_get_enabled {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_strutstyle_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_strutstyle_get_font_families {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_strutstyle_t; const result: PMarshaledAString): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_strutstyle_get_font_size {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_strutstyle_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_get_font_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_strutstyle_t; out result: sk_fontstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_strutstyle_get_force_height {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_strutstyle_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_strutstyle_get_half_leading {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_strutstyle_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_strutstyle_get_height_multiplier {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_strutstyle_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_strutstyle_get_leading {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_strutstyle_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_strutstyle_is_equal {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_strutstyle_t; const strut_style: sk_strutstyle_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_set_enabled {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_strutstyle_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_set_font_families {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_strutstyle_t; const values: PMarshaledAString; count: size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_set_font_size {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_strutstyle_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_set_font_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_strutstyle_t; value: psk_fontstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_set_force_height {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_strutstyle_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_set_half_leading {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_strutstyle_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_set_height_multiplier {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_strutstyle_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_strutstyle_set_leading {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_strutstyle_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_textstyle.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_add_font_feature {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; const feature: MarshaledAString; value: int32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_add_shadow {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; const shadow: psk_textshadow_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_clear_background_color {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_clear_foreground_color {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_textstyle_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_background {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): sk_paint_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_color {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): sk_color_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_decoration_color {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): sk_color_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_decoration_style {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): sk_textdecorationstyle_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_decoration_thickness{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_decorations {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): uint32_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_font_families {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t; const result: PMarshaledAString): size_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_get_font_metrics {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_textstyle_t; out result: sk_fontmetrics_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_font_size {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_get_font_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_textstyle_t; out result: sk_fontstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_foreground {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): sk_paint_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_half_leading {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_height_multiplier {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_letter_spacing {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_locale {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): sk_string_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_get_word_spacing {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_textstyle_is_equal {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self, text_style: sk_textstyle_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_reset_font_features {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_reset_shadows {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_background_color {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_color {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: sk_color_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_decoration_color {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: sk_color_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_decoration_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: sk_textdecorationstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_decoration_thickness{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_decorations {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: uint32_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_font_families {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; const values: PMarshaledAString; count: size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_font_size {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_font_style {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; const value: psk_fontstyle_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_foreground_color {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; paint: sk_paint_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_half_leading {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: bool); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_height_multiplier {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_letter_spacing {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_locale {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; const value: MarshaledAString); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_textstyle_set_word_spacing {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_typefacefontprovider.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_typefacefontprovider_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_typefacefontprovider_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_typefacefontprovider_register_typeface {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_typefacefontprovider_t; typeface: sk_typeface_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_typefacefontprovider_register_typeface2{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_typefacefontprovider_t; typeface: sk_typeface_t; const family_name: MarshaledAString); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skresources/include/sk4d_resources.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_resourceproviderbaseclass_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(predecode: bool; context: Pointer): sk_resourceproviderbaseclass_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_resourceproviderbaseclass_set_procs{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const procs: psk_resourceproviderbaseclass_procs_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skshaper/include/sk4d_shaper.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shaper_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_shaper_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_shaper_destroy{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_shaper_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_shaper_shape {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_shaper_t; const text: pchar; size: size_t; const font: sk_font_t; left_to_right: bool; width: float; const offset: psk_point_t; end_point: psk_point_t): sk_textblob_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skunicode/include/sk4d_unicode.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_unicode_create {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(): sk_unicode_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_unicode_destroy {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_unicode_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_unicode_for_each_bidi_region{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_unicode_t; const text: puint16_t; units: int32_t; direction: sk_direction_t; proc: sk_unicode_bidi_region_proc; context: Pointer); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_unicode_for_each_break {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_unicode_t; const text: pchar16_t; units: int32_t; &type: sk_breaktype_t; proc: sk_unicode_break_proc; context: Pointer); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_unicode_for_each_codepoint {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_unicode_t; const text: pchar16_t; units: int32_t; proc: sk_unicode_codepoint_proc; context: Pointer); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/svg/include/sk4d_svgdom.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_svgdom_find_node_by_id {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_svgdom_t; const id: MarshaledAString): sk_svgnode_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_svgdom_get_root {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_svgdom_t): sk_svgsvg_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_svgdom_make_from_file {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const file_name: MarshaledAString): sk_svgdom_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_svgdom_make_from_stream {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(stream: sk_stream_t; resource_provider: sk_resourceprovider_t): sk_svgdom_t; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgdom_render {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_svgdom_t; canvas: sk_canvas_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgdom_set_container_size{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_svgdom_t; const size: psk_size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/svg/include/sk4d_svgnode.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_svgnode_set_attribute{$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(self: sk_svgnode_t; const name, value: MarshaledAString): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$REGION 'modules/svg/include/sk4d_svgsvg.h'} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_get_height {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svglength_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_get_intrinsic_size {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_svgsvg_t; const view_port: psk_size_t; dpi: float; out result: sk_size_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_get_preserve_aspect_ratio{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svgpreserveaspectratio_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class function {$ELSE}class var {$ENDIF}sk4d_svgsvg_get_view_box {$IFDEF SK_DYNAMIC_LOADING}: function {$ENDIF}(const self: sk_svgsvg_t; out result: sk_rect_t): bool; cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_get_width {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svglength_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_get_x {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svglength_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_get_y {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svglength_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_set_height {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svglength_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_set_preserve_aspect_ratio{$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svgpreserveaspectratio_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_set_view_box {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_svgsvg_t; view_box: psk_rect_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_set_width {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svglength_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_set_x {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svglength_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$IFNDEF SK_DYNAMIC_LOADING}class procedure {$ELSE}class var {$ENDIF}sk4d_svgsvg_set_y {$IFDEF SK_DYNAMIC_LOADING}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svglength_t); cdecl; {$IFNDEF SK_DYNAMIC_LOADING}static;{$ENDIF} - {$ENDREGION} - - {$IFDEF SK_DYNAMIC_LOADING} - class property LibHandle: HMODULE read FLibHandle; - {$ENDIF} - end; - - {$ENDREGION} - -implementation - -uses - { Delphi } - {$IF DEFINED(ANDROID) and DEFINED(SK_DYNAMIC_LOADING)} - System.IOUtils, - {$ENDIF} - System.Math; - -{$REGION 'Dynamic loading utils'} - -{$IFDEF SK_DYNAMIC_LOADING} - -function GetProcAddress(AModule: HMODULE; AName: System.PChar): Pointer; -begin - {$IFDEF MSWINDOWS} - Result := Winapi.Windows.GetProcAddress(AModule, AName); - {$ELSE} - Result := System.SysUtils.GetProcAddress(AModule, AName); - {$ENDIF} - if Result = nil then - raise ESkiaAPI.CreateFmt('"%s" function address could not be retrieved from Skia library', [AName]) at ReturnAddress; -end; - -{$ENDIF} - -{$ENDREGION} - -{$REGION 'Skia API'} - -{ TSkiaAPI } - -class constructor TSkiaAPI.Create; -begin - SetExceptionMask(exAllArithmeticExceptions); -{$IFDEF SK_DYNAMIC_LOADING} - Initialize; -end; - -class destructor TSkiaAPI.Destroy; -begin - Terminate; -{$ENDIF} -end; - -class procedure TSkiaAPI.Initialize; -begin -{$IFDEF SK_DYNAMIC_LOADING} - if AtomicIncrement(FRefCount) = 1 then - begin - // Some Android devices, normally old, need the full path of the library, - // and other devices, normally new, do not accept the full path. - {$IFDEF ANDROID} - FLibHandle := SafeLoadLibrary(TSkiaAPI.LibName); - if FLibHandle = 0 then - FLibHandle := SafeLoadLibrary(TPath.Combine(TPath.GetLibraryPath, TSkiaAPI.LibName)); - {$ELSE} - FLibHandle := SafeLoadLibrary(TSkiaAPI.LibName); - {$ENDIF} - if FLibHandle = 0 then - raise ESkiaAPI.Create('Skia library could not be loaded'); -{$ELSE} -end; -{$ENDIF} - - {$REGION 'include/c/gr4d_backendsurface.h'} - {$IFDEF SK_DYNAMIC_LOADING} - gr4d_backendrendertarget_create_gl := GetProcAddress(FLibHandle, 'gr4d_backendrendertarget_create_gl'); - gr4d_backendrendertarget_create_mtl := GetProcAddress(FLibHandle, 'gr4d_backendrendertarget_create_mtl'); - gr4d_backendrendertarget_destroy := GetProcAddress(FLibHandle, 'gr4d_backendrendertarget_destroy'); - gr4d_backendrendertarget_get_backend_api := GetProcAddress(FLibHandle, 'gr4d_backendrendertarget_get_backend_api'); - gr4d_backendrendertarget_get_height := GetProcAddress(FLibHandle, 'gr4d_backendrendertarget_get_height'); - gr4d_backendrendertarget_get_sample_count := GetProcAddress(FLibHandle, 'gr4d_backendrendertarget_get_sample_count'); - gr4d_backendrendertarget_get_stencil_bits := GetProcAddress(FLibHandle, 'gr4d_backendrendertarget_get_stencil_bits'); - gr4d_backendrendertarget_get_width := GetProcAddress(FLibHandle, 'gr4d_backendrendertarget_get_width'); - gr4d_backendrendertarget_is_valid := GetProcAddress(FLibHandle, 'gr4d_backendrendertarget_is_valid'); - gr4d_backendtexture_create_gl := GetProcAddress(FLibHandle, 'gr4d_backendtexture_create_gl'); - gr4d_backendtexture_create_mtl := GetProcAddress(FLibHandle, 'gr4d_backendtexture_create_mtl'); - gr4d_backendtexture_destroy := GetProcAddress(FLibHandle, 'gr4d_backendtexture_destroy'); - gr4d_backendtexture_get_backend_api := GetProcAddress(FLibHandle, 'gr4d_backendtexture_get_backend_api'); - gr4d_backendtexture_get_gl_framebuffer_info := GetProcAddress(FLibHandle, 'gr4d_backendtexture_get_gl_framebuffer_info'); - gr4d_backendtexture_get_height := GetProcAddress(FLibHandle, 'gr4d_backendtexture_get_height'); - gr4d_backendtexture_get_width := GetProcAddress(FLibHandle, 'gr4d_backendtexture_get_width'); - gr4d_backendtexture_has_mipmaps := GetProcAddress(FLibHandle, 'gr4d_backendtexture_has_mipmaps'); - gr4d_backendtexture_is_valid := GetProcAddress(FLibHandle, 'gr4d_backendtexture_is_valid'); - {$ELSE} - class function TSkiaAPI.gr4d_backendrendertarget_create_gl; external TSkiaAPI.LibName name 'gr4d_backendrendertarget_create_gl'; - class function TSkiaAPI.gr4d_backendrendertarget_create_mtl; external TSkiaAPI.LibName name 'gr4d_backendrendertarget_create_mtl'; - class procedure TSkiaAPI.gr4d_backendrendertarget_destroy; external TSkiaAPI.LibName name 'gr4d_backendrendertarget_destroy'; - class function TSkiaAPI.gr4d_backendrendertarget_get_backend_api; external TSkiaAPI.LibName name 'gr4d_backendrendertarget_get_backend_api'; - class function TSkiaAPI.gr4d_backendrendertarget_get_height; external TSkiaAPI.LibName name 'gr4d_backendrendertarget_get_height'; - class function TSkiaAPI.gr4d_backendrendertarget_get_sample_count; external TSkiaAPI.LibName name 'gr4d_backendrendertarget_get_sample_count'; - class function TSkiaAPI.gr4d_backendrendertarget_get_stencil_bits; external TSkiaAPI.LibName name 'gr4d_backendrendertarget_get_stencil_bits'; - class function TSkiaAPI.gr4d_backendrendertarget_get_width; external TSkiaAPI.LibName name 'gr4d_backendrendertarget_get_width'; - class function TSkiaAPI.gr4d_backendrendertarget_is_valid; external TSkiaAPI.LibName name 'gr4d_backendrendertarget_is_valid'; - class function TSkiaAPI.gr4d_backendtexture_create_gl; external TSkiaAPI.LibName name 'gr4d_backendtexture_create_gl'; - class function TSkiaAPI.gr4d_backendtexture_create_mtl; external TSkiaAPI.LibName name 'gr4d_backendtexture_create_mtl'; - class procedure TSkiaAPI.gr4d_backendtexture_destroy; external TSkiaAPI.LibName name 'gr4d_backendtexture_destroy'; - class function TSkiaAPI.gr4d_backendtexture_get_backend_api; external TSkiaAPI.LibName name 'gr4d_backendtexture_get_backend_api'; - class function TSkiaAPI.gr4d_backendtexture_get_gl_framebuffer_info; external TSkiaAPI.LibName name 'gr4d_backendtexture_get_gl_framebuffer_info'; - class function TSkiaAPI.gr4d_backendtexture_get_height; external TSkiaAPI.LibName name 'gr4d_backendtexture_get_height'; - class function TSkiaAPI.gr4d_backendtexture_get_width; external TSkiaAPI.LibName name 'gr4d_backendtexture_get_width'; - class function TSkiaAPI.gr4d_backendtexture_has_mipmaps; external TSkiaAPI.LibName name 'gr4d_backendtexture_has_mipmaps'; - class function TSkiaAPI.gr4d_backendtexture_is_valid; external TSkiaAPI.LibName name 'gr4d_backendtexture_is_valid'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/gr4d_directcontext.h'} - {$IFDEF SK_DYNAMIC_LOADING} - gr4d_directcontext_abandon_context := GetProcAddress(FLibHandle, 'gr4d_directcontext_abandon_context'); - gr4d_directcontext_dump_memory_statistics := GetProcAddress(FLibHandle, 'gr4d_directcontext_dump_memory_statistics'); - gr4d_directcontext_flush := GetProcAddress(FLibHandle, 'gr4d_directcontext_flush'); - gr4d_directcontext_flush_and_submit := GetProcAddress(FLibHandle, 'gr4d_directcontext_flush_and_submit'); - gr4d_directcontext_free_gpu_resources := GetProcAddress(FLibHandle, 'gr4d_directcontext_free_gpu_resources'); - gr4d_directcontext_get_backend_api := GetProcAddress(FLibHandle, 'gr4d_directcontext_get_backend_api'); - gr4d_directcontext_get_max_surface_sample_count_for_color_type := GetProcAddress(FLibHandle, 'gr4d_directcontext_get_max_surface_sample_count_for_color_type'); - gr4d_directcontext_get_resource_cache_limit := GetProcAddress(FLibHandle, 'gr4d_directcontext_get_resource_cache_limit'); - gr4d_directcontext_get_resource_cache_usage := GetProcAddress(FLibHandle, 'gr4d_directcontext_get_resource_cache_usage'); - gr4d_directcontext_is_abandoned := GetProcAddress(FLibHandle, 'gr4d_directcontext_is_abandoned'); - gr4d_directcontext_make_gl := GetProcAddress(FLibHandle, 'gr4d_directcontext_make_gl'); - gr4d_directcontext_make_metal := GetProcAddress(FLibHandle, 'gr4d_directcontext_make_metal'); - gr4d_directcontext_perform_deferred_cleanup := GetProcAddress(FLibHandle, 'gr4d_directcontext_perform_deferred_cleanup'); - gr4d_directcontext_purge_unlocked_resources := GetProcAddress(FLibHandle, 'gr4d_directcontext_purge_unlocked_resources'); - gr4d_directcontext_purge_unlocked_resources2 := GetProcAddress(FLibHandle, 'gr4d_directcontext_purge_unlocked_resources2'); - gr4d_directcontext_release_resources_and_abandon_context := GetProcAddress(FLibHandle, 'gr4d_directcontext_release_resources_and_abandon_context'); - gr4d_directcontext_reset_context := GetProcAddress(FLibHandle, 'gr4d_directcontext_reset_context'); - gr4d_directcontext_set_resource_cache_limit := GetProcAddress(FLibHandle, 'gr4d_directcontext_set_resource_cache_limit'); - gr4d_directcontext_submit := GetProcAddress(FLibHandle, 'gr4d_directcontext_submit'); - {$ELSE} - class procedure TSkiaAPI.gr4d_directcontext_abandon_context; external TSkiaAPI.LibName name 'gr4d_directcontext_abandon_context'; - class procedure TSkiaAPI.gr4d_directcontext_dump_memory_statistics; external TSkiaAPI.LibName name 'gr4d_directcontext_dump_memory_statistics'; - class procedure TSkiaAPI.gr4d_directcontext_flush; external TSkiaAPI.LibName name 'gr4d_directcontext_flush'; - class procedure TSkiaAPI.gr4d_directcontext_flush_and_submit; external TSkiaAPI.LibName name 'gr4d_directcontext_flush_and_submit'; - class procedure TSkiaAPI.gr4d_directcontext_free_gpu_resources; external TSkiaAPI.LibName name 'gr4d_directcontext_free_gpu_resources'; - class function TSkiaAPI.gr4d_directcontext_get_backend_api; external TSkiaAPI.LibName name 'gr4d_directcontext_get_backend_api'; - class function TSkiaAPI.gr4d_directcontext_get_max_surface_sample_count_for_color_type; external TSkiaAPI.LibName name 'gr4d_directcontext_get_max_surface_sample_count_for_color_type'; - class function TSkiaAPI.gr4d_directcontext_get_resource_cache_limit; external TSkiaAPI.LibName name 'gr4d_directcontext_get_resource_cache_limit'; - class procedure TSkiaAPI.gr4d_directcontext_get_resource_cache_usage; external TSkiaAPI.LibName name 'gr4d_directcontext_get_resource_cache_usage'; - class function TSkiaAPI.gr4d_directcontext_is_abandoned; external TSkiaAPI.LibName name 'gr4d_directcontext_is_abandoned'; - class function TSkiaAPI.gr4d_directcontext_make_gl; external TSkiaAPI.LibName name 'gr4d_directcontext_make_gl'; - class function TSkiaAPI.gr4d_directcontext_make_metal; external TSkiaAPI.LibName name 'gr4d_directcontext_make_metal'; - class procedure TSkiaAPI.gr4d_directcontext_perform_deferred_cleanup; external TSkiaAPI.LibName name 'gr4d_directcontext_perform_deferred_cleanup'; - class procedure TSkiaAPI.gr4d_directcontext_purge_unlocked_resources; external TSkiaAPI.LibName name 'gr4d_directcontext_purge_unlocked_resources'; - class procedure TSkiaAPI.gr4d_directcontext_purge_unlocked_resources2; external TSkiaAPI.LibName name 'gr4d_directcontext_purge_unlocked_resources2'; - class procedure TSkiaAPI.gr4d_directcontext_release_resources_and_abandon_context; external TSkiaAPI.LibName name 'gr4d_directcontext_release_resources_and_abandon_context'; - class procedure TSkiaAPI.gr4d_directcontext_reset_context; external TSkiaAPI.LibName name 'gr4d_directcontext_reset_context'; - class procedure TSkiaAPI.gr4d_directcontext_set_resource_cache_limit; external TSkiaAPI.LibName name 'gr4d_directcontext_set_resource_cache_limit'; - class function TSkiaAPI.gr4d_directcontext_submit; external TSkiaAPI.LibName name 'gr4d_directcontext_submit'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/gr4d_gl_interface.h'} - {$IFDEF SK_DYNAMIC_LOADING} - gr4d_gl_interface_has_extension := GetProcAddress(FLibHandle, 'gr4d_gl_interface_has_extension'); - gr4d_gl_interface_make_assembled := GetProcAddress(FLibHandle, 'gr4d_gl_interface_make_assembled'); - gr4d_gl_interface_make_assembled_gl := GetProcAddress(FLibHandle, 'gr4d_gl_interface_make_assembled_gl'); - gr4d_gl_interface_make_assembled_gles := GetProcAddress(FLibHandle, 'gr4d_gl_interface_make_assembled_gles'); - gr4d_gl_interface_make_assembled_webgl := GetProcAddress(FLibHandle, 'gr4d_gl_interface_make_assembled_webgl'); - gr4d_gl_interface_make_native := GetProcAddress(FLibHandle, 'gr4d_gl_interface_make_native'); - gr4d_gl_interface_validate := GetProcAddress(FLibHandle, 'gr4d_gl_interface_validate'); - {$ELSE} - class function TSkiaAPI.gr4d_gl_interface_has_extension; external TSkiaAPI.LibName name 'gr4d_gl_interface_has_extension'; - class function TSkiaAPI.gr4d_gl_interface_make_assembled; external TSkiaAPI.LibName name 'gr4d_gl_interface_make_assembled'; - class function TSkiaAPI.gr4d_gl_interface_make_assembled_gl; external TSkiaAPI.LibName name 'gr4d_gl_interface_make_assembled_gl'; - class function TSkiaAPI.gr4d_gl_interface_make_assembled_gles; external TSkiaAPI.LibName name 'gr4d_gl_interface_make_assembled_gles'; - class function TSkiaAPI.gr4d_gl_interface_make_assembled_webgl; external TSkiaAPI.LibName name 'gr4d_gl_interface_make_assembled_webgl'; - class function TSkiaAPI.gr4d_gl_interface_make_native; external TSkiaAPI.LibName name 'gr4d_gl_interface_make_native'; - class function TSkiaAPI.gr4d_gl_interface_validate; external TSkiaAPI.LibName name 'gr4d_gl_interface_validate'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_blender.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_blender_make_arithmetic := GetProcAddress(FLibHandle, 'sk4d_blender_make_arithmetic'); - sk4d_blender_make_mode := GetProcAddress(FLibHandle, 'sk4d_blender_make_mode'); - {$ELSE} - class function TSkiaAPI.sk4d_blender_make_arithmetic; external TSkiaAPI.LibName name 'sk4d_blender_make_arithmetic'; - class function TSkiaAPI.sk4d_blender_make_mode; external TSkiaAPI.LibName name 'sk4d_blender_make_mode'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_canvas.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_canvas_clear := GetProcAddress(FLibHandle, 'sk4d_canvas_clear'); - sk4d_canvas_clear2 := GetProcAddress(FLibHandle, 'sk4d_canvas_clear2'); - sk4d_canvas_destroy := GetProcAddress(FLibHandle, 'sk4d_canvas_destroy'); - sk4d_canvas_discard := GetProcAddress(FLibHandle, 'sk4d_canvas_discard'); - sk4d_canvas_clip_path := GetProcAddress(FLibHandle, 'sk4d_canvas_clip_path'); - sk4d_canvas_clip_rect := GetProcAddress(FLibHandle, 'sk4d_canvas_clip_rect'); - sk4d_canvas_clip_region := GetProcAddress(FLibHandle, 'sk4d_canvas_clip_region'); - sk4d_canvas_clip_rrect := GetProcAddress(FLibHandle, 'sk4d_canvas_clip_rrect'); - sk4d_canvas_clip_shader := GetProcAddress(FLibHandle, 'sk4d_canvas_clip_shader'); - sk4d_canvas_concat := GetProcAddress(FLibHandle, 'sk4d_canvas_concat'); - sk4d_canvas_concat2 := GetProcAddress(FLibHandle, 'sk4d_canvas_concat2'); - sk4d_canvas_draw_annotation := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_annotation'); - sk4d_canvas_draw_arc := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_arc'); - sk4d_canvas_draw_atlas := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_atlas'); - sk4d_canvas_draw_circle := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_circle'); - sk4d_canvas_draw_color := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_color'); - sk4d_canvas_draw_color2 := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_color2'); - sk4d_canvas_draw_glyphs := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_glyphs'); - sk4d_canvas_draw_glyphs2 := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_glyphs2'); - sk4d_canvas_draw_image := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_image'); - sk4d_canvas_draw_image_lattice := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_image_lattice'); - sk4d_canvas_draw_image_nine := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_image_nine'); - sk4d_canvas_draw_image_rect := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_image_rect'); - sk4d_canvas_draw_line := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_line'); - sk4d_canvas_draw_oval := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_oval'); - sk4d_canvas_draw_paint := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_paint'); - sk4d_canvas_draw_patch := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_patch'); - sk4d_canvas_draw_path := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_path'); - sk4d_canvas_draw_picture := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_picture'); - sk4d_canvas_draw_point := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_point'); - sk4d_canvas_draw_points := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_points'); - sk4d_canvas_draw_rect := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_rect'); - sk4d_canvas_draw_region := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_region'); - sk4d_canvas_draw_rrect := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_rrect'); - sk4d_canvas_draw_rrect2 := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_rrect2'); - sk4d_canvas_draw_rrect_difference := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_rrect_difference'); - sk4d_canvas_draw_simple_text := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_simple_text'); - sk4d_canvas_draw_text_blob := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_text_blob'); - sk4d_canvas_draw_vertices := GetProcAddress(FLibHandle, 'sk4d_canvas_draw_vertices'); - sk4d_canvas_get_device_clip_bounds := GetProcAddress(FLibHandle, 'sk4d_canvas_get_device_clip_bounds'); - sk4d_canvas_get_local_clip_bounds := GetProcAddress(FLibHandle, 'sk4d_canvas_get_local_clip_bounds'); - sk4d_canvas_get_local_to_device := GetProcAddress(FLibHandle, 'sk4d_canvas_get_local_to_device'); - sk4d_canvas_get_local_to_device_as_3x3 := GetProcAddress(FLibHandle, 'sk4d_canvas_get_local_to_device_as_3x3'); - sk4d_canvas_get_save_count := GetProcAddress(FLibHandle, 'sk4d_canvas_get_save_count'); - sk4d_canvas_quick_reject := GetProcAddress(FLibHandle, 'sk4d_canvas_quick_reject'); - sk4d_canvas_quick_reject2 := GetProcAddress(FLibHandle, 'sk4d_canvas_quick_reject2'); - sk4d_canvas_reset_matrix := GetProcAddress(FLibHandle, 'sk4d_canvas_reset_matrix'); - sk4d_canvas_restore := GetProcAddress(FLibHandle, 'sk4d_canvas_restore'); - sk4d_canvas_restore_to_count := GetProcAddress(FLibHandle, 'sk4d_canvas_restore_to_count'); - sk4d_canvas_rotate := GetProcAddress(FLibHandle, 'sk4d_canvas_rotate'); - sk4d_canvas_rotate2 := GetProcAddress(FLibHandle, 'sk4d_canvas_rotate2'); - sk4d_canvas_save := GetProcAddress(FLibHandle, 'sk4d_canvas_save'); - sk4d_canvas_save_layer := GetProcAddress(FLibHandle, 'sk4d_canvas_save_layer'); - sk4d_canvas_save_layer_alpha := GetProcAddress(FLibHandle, 'sk4d_canvas_save_layer_alpha'); - sk4d_canvas_scale := GetProcAddress(FLibHandle, 'sk4d_canvas_scale'); - sk4d_canvas_set_matrix := GetProcAddress(FLibHandle, 'sk4d_canvas_set_matrix'); - sk4d_canvas_set_matrix2 := GetProcAddress(FLibHandle, 'sk4d_canvas_set_matrix2'); - sk4d_canvas_skew := GetProcAddress(FLibHandle, 'sk4d_canvas_skew'); - sk4d_canvas_translate := GetProcAddress(FLibHandle, 'sk4d_canvas_translate'); - {$ELSE} - class procedure TSkiaAPI.sk4d_canvas_clear; external TSkiaAPI.LibName name 'sk4d_canvas_clear'; - class procedure TSkiaAPI.sk4d_canvas_clear2; external TSkiaAPI.LibName name 'sk4d_canvas_clear2'; - class procedure TSkiaAPI.sk4d_canvas_destroy; external TSkiaAPI.LibName name 'sk4d_canvas_destroy'; - class procedure TSkiaAPI.sk4d_canvas_discard; external TSkiaAPI.LibName name 'sk4d_canvas_discard'; - class procedure TSkiaAPI.sk4d_canvas_clip_path; external TSkiaAPI.LibName name 'sk4d_canvas_clip_path'; - class procedure TSkiaAPI.sk4d_canvas_clip_rect; external TSkiaAPI.LibName name 'sk4d_canvas_clip_rect'; - class procedure TSkiaAPI.sk4d_canvas_clip_region; external TSkiaAPI.LibName name 'sk4d_canvas_clip_region'; - class procedure TSkiaAPI.sk4d_canvas_clip_rrect; external TSkiaAPI.LibName name 'sk4d_canvas_clip_rrect'; - class procedure TSkiaAPI.sk4d_canvas_clip_shader; external TSkiaAPI.LibName name 'sk4d_canvas_clip_shader'; - class procedure TSkiaAPI.sk4d_canvas_concat; external TSkiaAPI.LibName name 'sk4d_canvas_concat'; - class procedure TSkiaAPI.sk4d_canvas_concat2; external TSkiaAPI.LibName name 'sk4d_canvas_concat2'; - class procedure TSkiaAPI.sk4d_canvas_draw_annotation; external TSkiaAPI.LibName name 'sk4d_canvas_draw_annotation'; - class procedure TSkiaAPI.sk4d_canvas_draw_arc; external TSkiaAPI.LibName name 'sk4d_canvas_draw_arc'; - class procedure TSkiaAPI.sk4d_canvas_draw_atlas; external TSkiaAPI.LibName name 'sk4d_canvas_draw_atlas'; - class procedure TSkiaAPI.sk4d_canvas_draw_circle; external TSkiaAPI.LibName name 'sk4d_canvas_draw_circle'; - class procedure TSkiaAPI.sk4d_canvas_draw_color; external TSkiaAPI.LibName name 'sk4d_canvas_draw_color'; - class procedure TSkiaAPI.sk4d_canvas_draw_color2; external TSkiaAPI.LibName name 'sk4d_canvas_draw_color2'; - class procedure TSkiaAPI.sk4d_canvas_draw_glyphs; external TSkiaAPI.LibName name 'sk4d_canvas_draw_glyphs'; - class procedure TSkiaAPI.sk4d_canvas_draw_glyphs2; external TSkiaAPI.LibName name 'sk4d_canvas_draw_glyphs2'; - class procedure TSkiaAPI.sk4d_canvas_draw_image; external TSkiaAPI.LibName name 'sk4d_canvas_draw_image'; - class procedure TSkiaAPI.sk4d_canvas_draw_image_lattice; external TSkiaAPI.LibName name 'sk4d_canvas_draw_image_lattice'; - class procedure TSkiaAPI.sk4d_canvas_draw_image_nine; external TSkiaAPI.LibName name 'sk4d_canvas_draw_image_nine'; - class procedure TSkiaAPI.sk4d_canvas_draw_image_rect; external TSkiaAPI.LibName name 'sk4d_canvas_draw_image_rect'; - class procedure TSkiaAPI.sk4d_canvas_draw_line; external TSkiaAPI.LibName name 'sk4d_canvas_draw_line'; - class procedure TSkiaAPI.sk4d_canvas_draw_oval; external TSkiaAPI.LibName name 'sk4d_canvas_draw_oval'; - class procedure TSkiaAPI.sk4d_canvas_draw_paint; external TSkiaAPI.LibName name 'sk4d_canvas_draw_paint'; - class procedure TSkiaAPI.sk4d_canvas_draw_patch; external TSkiaAPI.LibName name 'sk4d_canvas_draw_patch'; - class procedure TSkiaAPI.sk4d_canvas_draw_path; external TSkiaAPI.LibName name 'sk4d_canvas_draw_path'; - class procedure TSkiaAPI.sk4d_canvas_draw_picture; external TSkiaAPI.LibName name 'sk4d_canvas_draw_picture'; - class procedure TSkiaAPI.sk4d_canvas_draw_point; external TSkiaAPI.LibName name 'sk4d_canvas_draw_point'; - class procedure TSkiaAPI.sk4d_canvas_draw_points; external TSkiaAPI.LibName name 'sk4d_canvas_draw_points'; - class procedure TSkiaAPI.sk4d_canvas_draw_rect; external TSkiaAPI.LibName name 'sk4d_canvas_draw_rect'; - class procedure TSkiaAPI.sk4d_canvas_draw_region; external TSkiaAPI.LibName name 'sk4d_canvas_draw_region'; - class procedure TSkiaAPI.sk4d_canvas_draw_rrect; external TSkiaAPI.LibName name 'sk4d_canvas_draw_rrect'; - class procedure TSkiaAPI.sk4d_canvas_draw_rrect2; external TSkiaAPI.LibName name 'sk4d_canvas_draw_rrect2'; - class procedure TSkiaAPI.sk4d_canvas_draw_rrect_difference; external TSkiaAPI.LibName name 'sk4d_canvas_draw_rrect_difference'; - class procedure TSkiaAPI.sk4d_canvas_draw_simple_text; external TSkiaAPI.LibName name 'sk4d_canvas_draw_simple_text'; - class procedure TSkiaAPI.sk4d_canvas_draw_text_blob; external TSkiaAPI.LibName name 'sk4d_canvas_draw_text_blob'; - class procedure TSkiaAPI.sk4d_canvas_draw_vertices; external TSkiaAPI.LibName name 'sk4d_canvas_draw_vertices'; - class procedure TSkiaAPI.sk4d_canvas_get_device_clip_bounds; external TSkiaAPI.LibName name 'sk4d_canvas_get_device_clip_bounds'; - class procedure TSkiaAPI.sk4d_canvas_get_local_clip_bounds; external TSkiaAPI.LibName name 'sk4d_canvas_get_local_clip_bounds'; - class procedure TSkiaAPI.sk4d_canvas_get_local_to_device; external TSkiaAPI.LibName name 'sk4d_canvas_get_local_to_device'; - class procedure TSkiaAPI.sk4d_canvas_get_local_to_device_as_3x3; external TSkiaAPI.LibName name 'sk4d_canvas_get_local_to_device_as_3x3'; - class function TSkiaAPI.sk4d_canvas_get_save_count; external TSkiaAPI.LibName name 'sk4d_canvas_get_save_count'; - class function TSkiaAPI.sk4d_canvas_quick_reject; external TSkiaAPI.LibName name 'sk4d_canvas_quick_reject'; - class function TSkiaAPI.sk4d_canvas_quick_reject2; external TSkiaAPI.LibName name 'sk4d_canvas_quick_reject2'; - class procedure TSkiaAPI.sk4d_canvas_reset_matrix; external TSkiaAPI.LibName name 'sk4d_canvas_reset_matrix'; - class procedure TSkiaAPI.sk4d_canvas_restore; external TSkiaAPI.LibName name 'sk4d_canvas_restore'; - class procedure TSkiaAPI.sk4d_canvas_restore_to_count; external TSkiaAPI.LibName name 'sk4d_canvas_restore_to_count'; - class procedure TSkiaAPI.sk4d_canvas_rotate; external TSkiaAPI.LibName name 'sk4d_canvas_rotate'; - class procedure TSkiaAPI.sk4d_canvas_rotate2; external TSkiaAPI.LibName name 'sk4d_canvas_rotate2'; - class function TSkiaAPI.sk4d_canvas_save; external TSkiaAPI.LibName name 'sk4d_canvas_save'; - class function TSkiaAPI.sk4d_canvas_save_layer; external TSkiaAPI.LibName name 'sk4d_canvas_save_layer'; - class function TSkiaAPI.sk4d_canvas_save_layer_alpha; external TSkiaAPI.LibName name 'sk4d_canvas_save_layer_alpha'; - class procedure TSkiaAPI.sk4d_canvas_scale; external TSkiaAPI.LibName name 'sk4d_canvas_scale'; - class procedure TSkiaAPI.sk4d_canvas_set_matrix; external TSkiaAPI.LibName name 'sk4d_canvas_set_matrix'; - class procedure TSkiaAPI.sk4d_canvas_set_matrix2; external TSkiaAPI.LibName name 'sk4d_canvas_set_matrix2'; - class procedure TSkiaAPI.sk4d_canvas_skew; external TSkiaAPI.LibName name 'sk4d_canvas_skew'; - class procedure TSkiaAPI.sk4d_canvas_translate; external TSkiaAPI.LibName name 'sk4d_canvas_translate'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_codec.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_codec_destroy := GetProcAddress(FLibHandle, 'sk4d_codec_destroy'); - sk4d_codec_get_dimensions := GetProcAddress(FLibHandle, 'sk4d_codec_get_dimensions'); - sk4d_codec_get_encoded_image_format := GetProcAddress(FLibHandle, 'sk4d_codec_get_encoded_image_format'); - sk4d_codec_get_image := GetProcAddress(FLibHandle, 'sk4d_codec_get_image'); - sk4d_codec_get_pixels := GetProcAddress(FLibHandle, 'sk4d_codec_get_pixels'); - sk4d_codec_make_from_file := GetProcAddress(FLibHandle, 'sk4d_codec_make_from_file'); - sk4d_codec_make_from_stream := GetProcAddress(FLibHandle, 'sk4d_codec_make_from_stream'); - sk4d_codec_make_with_copy := GetProcAddress(FLibHandle, 'sk4d_codec_make_with_copy'); - sk4d_codec_make_without_copy := GetProcAddress(FLibHandle, 'sk4d_codec_make_without_copy'); - sk4d_animcodecplayer_destroy := GetProcAddress(FLibHandle, 'sk4d_animcodecplayer_destroy'); - sk4d_animcodecplayer_get_dimensions := GetProcAddress(FLibHandle, 'sk4d_animcodecplayer_get_dimensions'); - sk4d_animcodecplayer_get_duration := GetProcAddress(FLibHandle, 'sk4d_animcodecplayer_get_duration'); - sk4d_animcodecplayer_get_frame := GetProcAddress(FLibHandle, 'sk4d_animcodecplayer_get_frame'); - sk4d_animcodecplayer_make_from_file := GetProcAddress(FLibHandle, 'sk4d_animcodecplayer_make_from_file'); - sk4d_animcodecplayer_make_from_stream := GetProcAddress(FLibHandle, 'sk4d_animcodecplayer_make_from_stream'); - sk4d_animcodecplayer_seek := GetProcAddress(FLibHandle, 'sk4d_animcodecplayer_seek'); - {$ELSE} - class procedure TSkiaAPI.sk4d_codec_destroy; external TSkiaAPI.LibName name 'sk4d_codec_destroy'; - class procedure TSkiaAPI.sk4d_codec_get_dimensions; external TSkiaAPI.LibName name 'sk4d_codec_get_dimensions'; - class function TSkiaAPI.sk4d_codec_get_encoded_image_format; external TSkiaAPI.LibName name 'sk4d_codec_get_encoded_image_format'; - class function TSkiaAPI.sk4d_codec_get_image; external TSkiaAPI.LibName name 'sk4d_codec_get_image'; - class function TSkiaAPI.sk4d_codec_get_pixels; external TSkiaAPI.LibName name 'sk4d_codec_get_pixels'; - class function TSkiaAPI.sk4d_codec_make_from_file; external TSkiaAPI.LibName name 'sk4d_codec_make_from_file'; - class function TSkiaAPI.sk4d_codec_make_from_stream; external TSkiaAPI.LibName name 'sk4d_codec_make_from_stream'; - class function TSkiaAPI.sk4d_codec_make_with_copy; external TSkiaAPI.LibName name 'sk4d_codec_make_with_copy'; - class function TSkiaAPI.sk4d_codec_make_without_copy; external TSkiaAPI.LibName name 'sk4d_codec_make_without_copy'; - class procedure TSkiaAPI.sk4d_animcodecplayer_destroy; external TSkiaAPI.LibName name 'sk4d_animcodecplayer_destroy'; - class procedure TSkiaAPI.sk4d_animcodecplayer_get_dimensions; external TSkiaAPI.LibName name 'sk4d_animcodecplayer_get_dimensions'; - class function TSkiaAPI.sk4d_animcodecplayer_get_duration; external TSkiaAPI.LibName name 'sk4d_animcodecplayer_get_duration'; - class function TSkiaAPI.sk4d_animcodecplayer_get_frame; external TSkiaAPI.LibName name 'sk4d_animcodecplayer_get_frame'; - class function TSkiaAPI.sk4d_animcodecplayer_make_from_file; external TSkiaAPI.LibName name 'sk4d_animcodecplayer_make_from_file'; - class function TSkiaAPI.sk4d_animcodecplayer_make_from_stream; external TSkiaAPI.LibName name 'sk4d_animcodecplayer_make_from_stream'; - class function TSkiaAPI.sk4d_animcodecplayer_seek; external TSkiaAPI.LibName name 'sk4d_animcodecplayer_seek'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_colorfilter.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_colorfilter_make_blend := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_blend'); - sk4d_colorfilter_make_compose := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_compose'); - sk4d_colorfilter_make_high_contrast := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_high_contrast'); - sk4d_colorfilter_make_hsla_matrix := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_hsla_matrix'); - sk4d_colorfilter_make_lighting := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_lighting'); - sk4d_colorfilter_make_linear_to_srgb_gamma := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_linear_to_srgb_gamma'); - sk4d_colorfilter_make_luma_color := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_luma_color'); - sk4d_colorfilter_make_matrix := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_matrix'); - sk4d_colorfilter_make_overdraw := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_overdraw'); - sk4d_colorfilter_make_table := GetProcAddress(FLibHandle, 'sk4d_colorfilter_make_table'); - {$ELSE} - class function TSkiaAPI.sk4d_colorfilter_make_blend; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_blend'; - class function TSkiaAPI.sk4d_colorfilter_make_compose; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_compose'; - class function TSkiaAPI.sk4d_colorfilter_make_high_contrast; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_high_contrast'; - class function TSkiaAPI.sk4d_colorfilter_make_hsla_matrix; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_hsla_matrix'; - class function TSkiaAPI.sk4d_colorfilter_make_lighting; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_lighting'; - class function TSkiaAPI.sk4d_colorfilter_make_linear_to_srgb_gamma; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_linear_to_srgb_gamma'; - class function TSkiaAPI.sk4d_colorfilter_make_luma_color; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_luma_color'; - class function TSkiaAPI.sk4d_colorfilter_make_matrix; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_matrix'; - class function TSkiaAPI.sk4d_colorfilter_make_overdraw; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_overdraw'; - class function TSkiaAPI.sk4d_colorfilter_make_table; external TSkiaAPI.LibName name 'sk4d_colorfilter_make_table'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_colorspace.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_colorspace_gamma_close_to_srgb := GetProcAddress(FLibHandle, 'sk4d_colorspace_gamma_close_to_srgb'); - sk4d_colorspace_gamma_is_linear := GetProcAddress(FLibHandle, 'sk4d_colorspace_gamma_is_linear'); - sk4d_colorspace_is_equal := GetProcAddress(FLibHandle, 'sk4d_colorspace_is_equal'); - sk4d_colorspace_is_numerical_transfer_fn := GetProcAddress(FLibHandle, 'sk4d_colorspace_is_numerical_transfer_fn'); - sk4d_colorspace_is_srgb := GetProcAddress(FLibHandle, 'sk4d_colorspace_is_srgb'); - sk4d_colorspace_make := GetProcAddress(FLibHandle, 'sk4d_colorspace_make'); - sk4d_colorspace_make_linear_gamma := GetProcAddress(FLibHandle, 'sk4d_colorspace_make_linear_gamma'); - sk4d_colorspace_make_rgb := GetProcAddress(FLibHandle, 'sk4d_colorspace_make_rgb'); - sk4d_colorspace_make_srgb := GetProcAddress(FLibHandle, 'sk4d_colorspace_make_srgb'); - sk4d_colorspace_make_srgb_gamma := GetProcAddress(FLibHandle, 'sk4d_colorspace_make_srgb_gamma'); - sk4d_colorspace_make_srgb_linear := GetProcAddress(FLibHandle, 'sk4d_colorspace_make_srgb_linear'); - sk4d_colorspace_ref := GetProcAddress(FLibHandle, 'sk4d_colorspace_ref'); - sk4d_colorspace_to_profile := GetProcAddress(FLibHandle, 'sk4d_colorspace_to_profile'); - sk4d_colorspace_to_xyz := GetProcAddress(FLibHandle, 'sk4d_colorspace_to_xyz'); - sk4d_colorspace_unref := GetProcAddress(FLibHandle, 'sk4d_colorspace_unref'); - sk4d_colorspaceiccprofile_destroy := GetProcAddress(FLibHandle, 'sk4d_colorspaceiccprofile_destroy'); - sk4d_colorspaceiccprofile_get_buffer := GetProcAddress(FLibHandle, 'sk4d_colorspaceiccprofile_get_buffer'); - sk4d_colorspaceiccprofile_make_with_parse := GetProcAddress(FLibHandle, 'sk4d_colorspaceiccprofile_make_with_parse'); - sk4d_colorspaceiccprofile_to_xyz := GetProcAddress(FLibHandle, 'sk4d_colorspaceiccprofile_to_xyz'); - sk4d_colorspaceprimaries_to_xyz := GetProcAddress(FLibHandle, 'sk4d_colorspaceprimaries_to_xyz'); - sk4d_colorspacetransferfn_invert := GetProcAddress(FLibHandle, 'sk4d_colorspacetransferfn_invert'); - sk4d_colorspacetransferfn_transform := GetProcAddress(FLibHandle, 'sk4d_colorspacetransferfn_transform'); - {$ELSE} - class function TSkiaAPI.sk4d_colorspace_gamma_close_to_srgb; external TSkiaAPI.LibName name 'sk4d_colorspace_gamma_close_to_srgb'; - class function TSkiaAPI.sk4d_colorspace_gamma_is_linear; external TSkiaAPI.LibName name 'sk4d_colorspace_gamma_is_linear'; - class function TSkiaAPI.sk4d_colorspace_is_equal; external TSkiaAPI.LibName name 'sk4d_colorspace_is_equal'; - class function TSkiaAPI.sk4d_colorspace_is_numerical_transfer_fn; external TSkiaAPI.LibName name 'sk4d_colorspace_is_numerical_transfer_fn'; - class function TSkiaAPI.sk4d_colorspace_is_srgb; external TSkiaAPI.LibName name 'sk4d_colorspace_is_srgb'; - class function TSkiaAPI.sk4d_colorspace_make; external TSkiaAPI.LibName name 'sk4d_colorspace_make'; - class function TSkiaAPI.sk4d_colorspace_make_linear_gamma; external TSkiaAPI.LibName name 'sk4d_colorspace_make_linear_gamma'; - class function TSkiaAPI.sk4d_colorspace_make_rgb; external TSkiaAPI.LibName name 'sk4d_colorspace_make_rgb'; - class function TSkiaAPI.sk4d_colorspace_make_srgb; external TSkiaAPI.LibName name 'sk4d_colorspace_make_srgb'; - class function TSkiaAPI.sk4d_colorspace_make_srgb_gamma; external TSkiaAPI.LibName name 'sk4d_colorspace_make_srgb_gamma'; - class function TSkiaAPI.sk4d_colorspace_make_srgb_linear; external TSkiaAPI.LibName name 'sk4d_colorspace_make_srgb_linear'; - class procedure TSkiaAPI.sk4d_colorspace_ref; external TSkiaAPI.LibName name 'sk4d_colorspace_ref'; - class function TSkiaAPI.sk4d_colorspace_to_profile; external TSkiaAPI.LibName name 'sk4d_colorspace_to_profile'; - class function TSkiaAPI.sk4d_colorspace_to_xyz; external TSkiaAPI.LibName name 'sk4d_colorspace_to_xyz'; - class procedure TSkiaAPI.sk4d_colorspace_unref; external TSkiaAPI.LibName name 'sk4d_colorspace_unref'; - class procedure TSkiaAPI.sk4d_colorspaceiccprofile_destroy; external TSkiaAPI.LibName name 'sk4d_colorspaceiccprofile_destroy'; - class function TSkiaAPI.sk4d_colorspaceiccprofile_get_buffer; external TSkiaAPI.LibName name 'sk4d_colorspaceiccprofile_get_buffer'; - class function TSkiaAPI.sk4d_colorspaceiccprofile_make_with_parse; external TSkiaAPI.LibName name 'sk4d_colorspaceiccprofile_make_with_parse'; - class function TSkiaAPI.sk4d_colorspaceiccprofile_to_xyz; external TSkiaAPI.LibName name 'sk4d_colorspaceiccprofile_to_xyz'; - class function TSkiaAPI.sk4d_colorspaceprimaries_to_xyz; external TSkiaAPI.LibName name 'sk4d_colorspaceprimaries_to_xyz'; - class function TSkiaAPI.sk4d_colorspacetransferfn_invert; external TSkiaAPI.LibName name 'sk4d_colorspacetransferfn_invert'; - class function TSkiaAPI.sk4d_colorspacetransferfn_transform; external TSkiaAPI.LibName name 'sk4d_colorspacetransferfn_transform'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_data.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_data_make_empty := GetProcAddress(FLibHandle, 'sk4d_data_make_empty'); - sk4d_data_make_with_copy := GetProcAddress(FLibHandle, 'sk4d_data_make_with_copy'); - {$ELSE} - class function TSkiaAPI.sk4d_data_make_empty; external TSkiaAPI.LibName name 'sk4d_data_make_empty'; - class function TSkiaAPI.sk4d_data_make_with_copy; external TSkiaAPI.LibName name 'sk4d_data_make_with_copy'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_document.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_document_begin_page := GetProcAddress(FLibHandle, 'sk4d_document_begin_page'); - sk4d_document_close := GetProcAddress(FLibHandle, 'sk4d_document_close'); - sk4d_document_end_page := GetProcAddress(FLibHandle, 'sk4d_document_end_page'); - sk4d_document_make_pdf := GetProcAddress(FLibHandle, 'sk4d_document_make_pdf'); - sk4d_document_make_pdf2 := GetProcAddress(FLibHandle, 'sk4d_document_make_pdf2'); - sk4d_document_make_xps := GetProcAddress(FLibHandle, 'sk4d_document_make_xps'); - sk4d_document_terminate := GetProcAddress(FLibHandle, 'sk4d_document_terminate'); - {$ELSE} - class function TSkiaAPI.sk4d_document_begin_page; external TSkiaAPI.LibName name 'sk4d_document_begin_page'; - class procedure TSkiaAPI.sk4d_document_close; external TSkiaAPI.LibName name 'sk4d_document_close'; - class procedure TSkiaAPI.sk4d_document_end_page; external TSkiaAPI.LibName name 'sk4d_document_end_page'; - class function TSkiaAPI.sk4d_document_make_pdf; external TSkiaAPI.LibName name 'sk4d_document_make_pdf'; - class function TSkiaAPI.sk4d_document_make_pdf2; external TSkiaAPI.LibName name 'sk4d_document_make_pdf2'; - class function TSkiaAPI.sk4d_document_make_xps; external TSkiaAPI.LibName name 'sk4d_document_make_xps'; - class procedure TSkiaAPI.sk4d_document_terminate; external TSkiaAPI.LibName name 'sk4d_document_terminate'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_font.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_font_create := GetProcAddress(FLibHandle, 'sk4d_font_create'); - sk4d_font_create2 := GetProcAddress(FLibHandle, 'sk4d_font_create2'); - sk4d_font_destroy := GetProcAddress(FLibHandle, 'sk4d_font_destroy'); - sk4d_font_get_baseline_snap := GetProcAddress(FLibHandle, 'sk4d_font_get_baseline_snap'); - sk4d_font_get_edging := GetProcAddress(FLibHandle, 'sk4d_font_get_edging'); - sk4d_font_get_embedded_bitmaps := GetProcAddress(FLibHandle, 'sk4d_font_get_embedded_bitmaps'); - sk4d_font_get_embolden := GetProcAddress(FLibHandle, 'sk4d_font_get_embolden'); - sk4d_font_get_force_auto_hinting := GetProcAddress(FLibHandle, 'sk4d_font_get_force_auto_hinting'); - sk4d_font_get_glyphs := GetProcAddress(FLibHandle, 'sk4d_font_get_glyphs'); - sk4d_font_get_glyphs_count := GetProcAddress(FLibHandle, 'sk4d_font_get_glyphs_count'); - sk4d_font_get_hinting := GetProcAddress(FLibHandle, 'sk4d_font_get_hinting'); - sk4d_font_get_horizontal_positions := GetProcAddress(FLibHandle, 'sk4d_font_get_horizontal_positions'); - sk4d_font_get_intercepts := GetProcAddress(FLibHandle, 'sk4d_font_get_intercepts'); - sk4d_font_get_linear_metrics := GetProcAddress(FLibHandle, 'sk4d_font_get_linear_metrics'); - sk4d_font_get_metrics := GetProcAddress(FLibHandle, 'sk4d_font_get_metrics'); - sk4d_font_get_path := GetProcAddress(FLibHandle, 'sk4d_font_get_path'); - sk4d_font_get_paths := GetProcAddress(FLibHandle, 'sk4d_font_get_paths'); - sk4d_font_get_positions := GetProcAddress(FLibHandle, 'sk4d_font_get_positions'); - sk4d_font_get_scale_x := GetProcAddress(FLibHandle, 'sk4d_font_get_scale_x'); - sk4d_font_get_size := GetProcAddress(FLibHandle, 'sk4d_font_get_size'); - sk4d_font_get_skew_x := GetProcAddress(FLibHandle, 'sk4d_font_get_skew_x'); - sk4d_font_get_subpixel := GetProcAddress(FLibHandle, 'sk4d_font_get_subpixel'); - sk4d_font_get_typeface := GetProcAddress(FLibHandle, 'sk4d_font_get_typeface'); - sk4d_font_get_typeface_or_default := GetProcAddress(FLibHandle, 'sk4d_font_get_typeface_or_default'); - sk4d_font_get_widths_bounds := GetProcAddress(FLibHandle, 'sk4d_font_get_widths_bounds'); - sk4d_font_is_equal := GetProcAddress(FLibHandle, 'sk4d_font_is_equal'); - sk4d_font_measure_text := GetProcAddress(FLibHandle, 'sk4d_font_measure_text'); - sk4d_font_set_baseline_snap := GetProcAddress(FLibHandle, 'sk4d_font_set_baseline_snap'); - sk4d_font_set_edging := GetProcAddress(FLibHandle, 'sk4d_font_set_edging'); - sk4d_font_set_embedded_bitmaps := GetProcAddress(FLibHandle, 'sk4d_font_set_embedded_bitmaps'); - sk4d_font_set_embolden := GetProcAddress(FLibHandle, 'sk4d_font_set_embolden'); - sk4d_font_set_force_auto_hinting := GetProcAddress(FLibHandle, 'sk4d_font_set_force_auto_hinting'); - sk4d_font_set_hinting := GetProcAddress(FLibHandle, 'sk4d_font_set_hinting'); - sk4d_font_set_linear_metrics := GetProcAddress(FLibHandle, 'sk4d_font_set_linear_metrics'); - sk4d_font_set_scale_x := GetProcAddress(FLibHandle, 'sk4d_font_set_scale_x'); - sk4d_font_set_size := GetProcAddress(FLibHandle, 'sk4d_font_set_size'); - sk4d_font_set_skew_x := GetProcAddress(FLibHandle, 'sk4d_font_set_skew_x'); - sk4d_font_set_subpixel := GetProcAddress(FLibHandle, 'sk4d_font_set_subpixel'); - sk4d_font_set_typeface := GetProcAddress(FLibHandle, 'sk4d_font_set_typeface'); - sk4d_font_unichar_to_glyph := GetProcAddress(FLibHandle, 'sk4d_font_unichar_to_glyph'); - sk4d_font_unichars_to_glyphs := GetProcAddress(FLibHandle, 'sk4d_font_unichars_to_glyphs'); - {$ELSE} - class function TSkiaAPI.sk4d_font_create; external TSkiaAPI.LibName name 'sk4d_font_create'; - class function TSkiaAPI.sk4d_font_create2; external TSkiaAPI.LibName name 'sk4d_font_create2'; - class procedure TSkiaAPI.sk4d_font_destroy; external TSkiaAPI.LibName name 'sk4d_font_destroy'; - class function TSkiaAPI.sk4d_font_get_baseline_snap; external TSkiaAPI.LibName name 'sk4d_font_get_baseline_snap'; - class function TSkiaAPI.sk4d_font_get_edging; external TSkiaAPI.LibName name 'sk4d_font_get_edging'; - class function TSkiaAPI.sk4d_font_get_embedded_bitmaps; external TSkiaAPI.LibName name 'sk4d_font_get_embedded_bitmaps'; - class function TSkiaAPI.sk4d_font_get_embolden; external TSkiaAPI.LibName name 'sk4d_font_get_embolden'; - class function TSkiaAPI.sk4d_font_get_force_auto_hinting; external TSkiaAPI.LibName name 'sk4d_font_get_force_auto_hinting'; - class function TSkiaAPI.sk4d_font_get_glyphs; external TSkiaAPI.LibName name 'sk4d_font_get_glyphs'; - class function TSkiaAPI.sk4d_font_get_glyphs_count; external TSkiaAPI.LibName name 'sk4d_font_get_glyphs_count'; - class function TSkiaAPI.sk4d_font_get_hinting; external TSkiaAPI.LibName name 'sk4d_font_get_hinting'; - class procedure TSkiaAPI.sk4d_font_get_horizontal_positions; external TSkiaAPI.LibName name 'sk4d_font_get_horizontal_positions'; - class function TSkiaAPI.sk4d_font_get_intercepts; external TSkiaAPI.LibName name 'sk4d_font_get_intercepts'; - class function TSkiaAPI.sk4d_font_get_linear_metrics; external TSkiaAPI.LibName name 'sk4d_font_get_linear_metrics'; - class function TSkiaAPI.sk4d_font_get_metrics; external TSkiaAPI.LibName name 'sk4d_font_get_metrics'; - class function TSkiaAPI.sk4d_font_get_path; external TSkiaAPI.LibName name 'sk4d_font_get_path'; - class procedure TSkiaAPI.sk4d_font_get_paths; external TSkiaAPI.LibName name 'sk4d_font_get_paths'; - class procedure TSkiaAPI.sk4d_font_get_positions; external TSkiaAPI.LibName name 'sk4d_font_get_positions'; - class function TSkiaAPI.sk4d_font_get_scale_x; external TSkiaAPI.LibName name 'sk4d_font_get_scale_x'; - class function TSkiaAPI.sk4d_font_get_size; external TSkiaAPI.LibName name 'sk4d_font_get_size'; - class function TSkiaAPI.sk4d_font_get_skew_x; external TSkiaAPI.LibName name 'sk4d_font_get_skew_x'; - class function TSkiaAPI.sk4d_font_get_subpixel; external TSkiaAPI.LibName name 'sk4d_font_get_subpixel'; - class function TSkiaAPI.sk4d_font_get_typeface; external TSkiaAPI.LibName name 'sk4d_font_get_typeface'; - class function TSkiaAPI.sk4d_font_get_typeface_or_default; external TSkiaAPI.LibName name 'sk4d_font_get_typeface_or_default'; - class procedure TSkiaAPI.sk4d_font_get_widths_bounds; external TSkiaAPI.LibName name 'sk4d_font_get_widths_bounds'; - class function TSkiaAPI.sk4d_font_is_equal; external TSkiaAPI.LibName name 'sk4d_font_is_equal'; - class function TSkiaAPI.sk4d_font_measure_text; external TSkiaAPI.LibName name 'sk4d_font_measure_text'; - class procedure TSkiaAPI.sk4d_font_set_baseline_snap; external TSkiaAPI.LibName name 'sk4d_font_set_baseline_snap'; - class procedure TSkiaAPI.sk4d_font_set_edging; external TSkiaAPI.LibName name 'sk4d_font_set_edging'; - class procedure TSkiaAPI.sk4d_font_set_embedded_bitmaps; external TSkiaAPI.LibName name 'sk4d_font_set_embedded_bitmaps'; - class procedure TSkiaAPI.sk4d_font_set_embolden; external TSkiaAPI.LibName name 'sk4d_font_set_embolden'; - class procedure TSkiaAPI.sk4d_font_set_force_auto_hinting; external TSkiaAPI.LibName name 'sk4d_font_set_force_auto_hinting'; - class procedure TSkiaAPI.sk4d_font_set_hinting; external TSkiaAPI.LibName name 'sk4d_font_set_hinting'; - class procedure TSkiaAPI.sk4d_font_set_linear_metrics; external TSkiaAPI.LibName name 'sk4d_font_set_linear_metrics'; - class procedure TSkiaAPI.sk4d_font_set_scale_x; external TSkiaAPI.LibName name 'sk4d_font_set_scale_x'; - class procedure TSkiaAPI.sk4d_font_set_size; external TSkiaAPI.LibName name 'sk4d_font_set_size'; - class procedure TSkiaAPI.sk4d_font_set_skew_x; external TSkiaAPI.LibName name 'sk4d_font_set_skew_x'; - class procedure TSkiaAPI.sk4d_font_set_subpixel; external TSkiaAPI.LibName name 'sk4d_font_set_subpixel'; - class procedure TSkiaAPI.sk4d_font_set_typeface; external TSkiaAPI.LibName name 'sk4d_font_set_typeface'; - class function TSkiaAPI.sk4d_font_unichar_to_glyph; external TSkiaAPI.LibName name 'sk4d_font_unichar_to_glyph'; - class procedure TSkiaAPI.sk4d_font_unichars_to_glyphs; external TSkiaAPI.LibName name 'sk4d_font_unichars_to_glyphs'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_graphics.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_graphics_allow_jit := GetProcAddress(FLibHandle, 'sk4d_graphics_allow_jit'); - sk4d_graphics_dump_memory_statistics := GetProcAddress(FLibHandle, 'sk4d_graphics_dump_memory_statistics'); - sk4d_graphics_get_font_cache_count_limit := GetProcAddress(FLibHandle, 'sk4d_graphics_get_font_cache_count_limit'); - sk4d_graphics_get_font_cache_count_used := GetProcAddress(FLibHandle, 'sk4d_graphics_get_font_cache_count_used'); - sk4d_graphics_get_font_cache_limit := GetProcAddress(FLibHandle, 'sk4d_graphics_get_font_cache_limit'); - sk4d_graphics_get_font_cache_used := GetProcAddress(FLibHandle, 'sk4d_graphics_get_font_cache_used'); - sk4d_graphics_get_resource_cache_single_allocation_byte_limit := GetProcAddress(FLibHandle, 'sk4d_graphics_get_resource_cache_single_allocation_byte_limit'); - sk4d_graphics_get_resource_cache_total_byte_limit := GetProcAddress(FLibHandle, 'sk4d_graphics_get_resource_cache_total_byte_limit'); - sk4d_graphics_get_resource_cache_total_bytes_used := GetProcAddress(FLibHandle, 'sk4d_graphics_get_resource_cache_total_bytes_used'); - sk4d_graphics_init := GetProcAddress(FLibHandle, 'sk4d_graphics_init'); - sk4d_graphics_purge_all_caches := GetProcAddress(FLibHandle, 'sk4d_graphics_purge_all_caches'); - sk4d_graphics_purge_font_cache := GetProcAddress(FLibHandle, 'sk4d_graphics_purge_font_cache'); - sk4d_graphics_purge_resource_cache := GetProcAddress(FLibHandle, 'sk4d_graphics_purge_resource_cache'); - sk4d_graphics_set_font_cache_count_limit := GetProcAddress(FLibHandle, 'sk4d_graphics_set_font_cache_count_limit'); - sk4d_graphics_set_font_cache_limit := GetProcAddress(FLibHandle, 'sk4d_graphics_set_font_cache_limit'); - sk4d_graphics_set_resource_cache_single_allocation_byte_limit := GetProcAddress(FLibHandle, 'sk4d_graphics_set_resource_cache_single_allocation_byte_limit'); - sk4d_graphics_set_resource_cache_total_byte_limit := GetProcAddress(FLibHandle, 'sk4d_graphics_set_resource_cache_total_byte_limit'); - {$ELSE} - class procedure TSkiaAPI.sk4d_graphics_allow_jit; external TSkiaAPI.LibName name 'sk4d_graphics_allow_jit'; - class procedure TSkiaAPI.sk4d_graphics_dump_memory_statistics; external TSkiaAPI.LibName name 'sk4d_graphics_dump_memory_statistics'; - class function TSkiaAPI.sk4d_graphics_get_font_cache_count_limit; external TSkiaAPI.LibName name 'sk4d_graphics_get_font_cache_count_limit'; - class function TSkiaAPI.sk4d_graphics_get_font_cache_count_used; external TSkiaAPI.LibName name 'sk4d_graphics_get_font_cache_count_used'; - class function TSkiaAPI.sk4d_graphics_get_font_cache_limit; external TSkiaAPI.LibName name 'sk4d_graphics_get_font_cache_limit'; - class function TSkiaAPI.sk4d_graphics_get_font_cache_used; external TSkiaAPI.LibName name 'sk4d_graphics_get_font_cache_used'; - class function TSkiaAPI.sk4d_graphics_get_resource_cache_single_allocation_byte_limit; external TSkiaAPI.LibName name 'sk4d_graphics_get_resource_cache_single_allocation_byte_limit'; - class function TSkiaAPI.sk4d_graphics_get_resource_cache_total_byte_limit; external TSkiaAPI.LibName name 'sk4d_graphics_get_resource_cache_total_byte_limit'; - class function TSkiaAPI.sk4d_graphics_get_resource_cache_total_bytes_used; external TSkiaAPI.LibName name 'sk4d_graphics_get_resource_cache_total_bytes_used'; - class procedure TSkiaAPI.sk4d_graphics_init; external TSkiaAPI.LibName name 'sk4d_graphics_init'; - class procedure TSkiaAPI.sk4d_graphics_purge_all_caches; external TSkiaAPI.LibName name 'sk4d_graphics_purge_all_caches'; - class procedure TSkiaAPI.sk4d_graphics_purge_font_cache; external TSkiaAPI.LibName name 'sk4d_graphics_purge_font_cache'; - class procedure TSkiaAPI.sk4d_graphics_purge_resource_cache; external TSkiaAPI.LibName name 'sk4d_graphics_purge_resource_cache'; - class function TSkiaAPI.sk4d_graphics_set_font_cache_count_limit; external TSkiaAPI.LibName name 'sk4d_graphics_set_font_cache_count_limit'; - class function TSkiaAPI.sk4d_graphics_set_font_cache_limit; external TSkiaAPI.LibName name 'sk4d_graphics_set_font_cache_limit'; - class function TSkiaAPI.sk4d_graphics_set_resource_cache_single_allocation_byte_limit; external TSkiaAPI.LibName name 'sk4d_graphics_set_resource_cache_single_allocation_byte_limit'; - class function TSkiaAPI.sk4d_graphics_set_resource_cache_total_byte_limit; external TSkiaAPI.LibName name 'sk4d_graphics_set_resource_cache_total_byte_limit'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_image.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_image_encode_to_file := GetProcAddress(FLibHandle, 'sk4d_image_encode_to_file'); - sk4d_image_encode_to_stream := GetProcAddress(FLibHandle, 'sk4d_image_encode_to_stream'); - sk4d_image_get_alpha_type := GetProcAddress(FLibHandle, 'sk4d_image_get_alpha_type'); - sk4d_image_get_color_space := GetProcAddress(FLibHandle, 'sk4d_image_get_color_space'); - sk4d_image_get_color_type := GetProcAddress(FLibHandle, 'sk4d_image_get_color_type'); - sk4d_image_get_height := GetProcAddress(FLibHandle, 'sk4d_image_get_height'); - sk4d_image_get_image_info := GetProcAddress(FLibHandle, 'sk4d_image_get_image_info'); - sk4d_image_get_unique_id := GetProcAddress(FLibHandle, 'sk4d_image_get_unique_id'); - sk4d_image_get_width := GetProcAddress(FLibHandle, 'sk4d_image_get_width'); - sk4d_image_is_lazy_generated := GetProcAddress(FLibHandle, 'sk4d_image_is_lazy_generated'); - sk4d_image_is_texture_backed := GetProcAddress(FLibHandle, 'sk4d_image_is_texture_backed'); - sk4d_image_is_valid := GetProcAddress(FLibHandle, 'sk4d_image_is_valid'); - sk4d_image_make_backend_texture := GetProcAddress(FLibHandle, 'sk4d_image_make_backend_texture'); - sk4d_image_make_from_adopted_texture := GetProcAddress(FLibHandle, 'sk4d_image_make_from_adopted_texture'); - sk4d_image_make_from_encoded_file := GetProcAddress(FLibHandle, 'sk4d_image_make_from_encoded_file'); - sk4d_image_make_from_encoded_stream := GetProcAddress(FLibHandle, 'sk4d_image_make_from_encoded_stream'); - sk4d_image_make_from_raster := GetProcAddress(FLibHandle, 'sk4d_image_make_from_raster'); - sk4d_image_make_from_texture := GetProcAddress(FLibHandle, 'sk4d_image_make_from_texture'); - sk4d_image_make_non_texture_image := GetProcAddress(FLibHandle, 'sk4d_image_make_non_texture_image'); - sk4d_image_make_raster_copy := GetProcAddress(FLibHandle, 'sk4d_image_make_raster_copy'); - sk4d_image_make_raster_image := GetProcAddress(FLibHandle, 'sk4d_image_make_raster_image'); - sk4d_image_make_raw_shader := GetProcAddress(FLibHandle, 'sk4d_image_make_raw_shader'); - sk4d_image_make_shader := GetProcAddress(FLibHandle, 'sk4d_image_make_shader'); - sk4d_image_make_subset := GetProcAddress(FLibHandle, 'sk4d_image_make_subset'); - sk4d_image_make_texture_image := GetProcAddress(FLibHandle, 'sk4d_image_make_texture_image'); - sk4d_image_make_with_filter := GetProcAddress(FLibHandle, 'sk4d_image_make_with_filter'); - sk4d_image_peek_pixels := GetProcAddress(FLibHandle, 'sk4d_image_peek_pixels'); - sk4d_image_read_pixels := GetProcAddress(FLibHandle, 'sk4d_image_read_pixels'); - sk4d_image_scale_pixels := GetProcAddress(FLibHandle, 'sk4d_image_scale_pixels'); - {$ELSE} - class function TSkiaAPI.sk4d_image_encode_to_file; external TSkiaAPI.LibName name 'sk4d_image_encode_to_file'; - class function TSkiaAPI.sk4d_image_encode_to_stream; external TSkiaAPI.LibName name 'sk4d_image_encode_to_stream'; - class function TSkiaAPI.sk4d_image_get_alpha_type; external TSkiaAPI.LibName name 'sk4d_image_get_alpha_type'; - class function TSkiaAPI.sk4d_image_get_color_space; external TSkiaAPI.LibName name 'sk4d_image_get_color_space'; - class function TSkiaAPI.sk4d_image_get_color_type; external TSkiaAPI.LibName name 'sk4d_image_get_color_type'; - class function TSkiaAPI.sk4d_image_get_height; external TSkiaAPI.LibName name 'sk4d_image_get_height'; - class procedure TSkiaAPI.sk4d_image_get_image_info; external TSkiaAPI.LibName name 'sk4d_image_get_image_info'; - class function TSkiaAPI.sk4d_image_get_unique_id; external TSkiaAPI.LibName name 'sk4d_image_get_unique_id'; - class function TSkiaAPI.sk4d_image_get_width; external TSkiaAPI.LibName name 'sk4d_image_get_width'; - class function TSkiaAPI.sk4d_image_is_lazy_generated; external TSkiaAPI.LibName name 'sk4d_image_is_lazy_generated'; - class function TSkiaAPI.sk4d_image_is_texture_backed; external TSkiaAPI.LibName name 'sk4d_image_is_texture_backed'; - class function TSkiaAPI.sk4d_image_is_valid; external TSkiaAPI.LibName name 'sk4d_image_is_valid'; - class function TSkiaAPI.sk4d_image_make_backend_texture; external TSkiaAPI.LibName name 'sk4d_image_make_backend_texture'; - class function TSkiaAPI.sk4d_image_make_from_adopted_texture; external TSkiaAPI.LibName name 'sk4d_image_make_from_adopted_texture'; - class function TSkiaAPI.sk4d_image_make_from_encoded_file; external TSkiaAPI.LibName name 'sk4d_image_make_from_encoded_file'; - class function TSkiaAPI.sk4d_image_make_from_encoded_stream; external TSkiaAPI.LibName name 'sk4d_image_make_from_encoded_stream'; - class function TSkiaAPI.sk4d_image_make_from_raster; external TSkiaAPI.LibName name 'sk4d_image_make_from_raster'; - class function TSkiaAPI.sk4d_image_make_from_texture; external TSkiaAPI.LibName name 'sk4d_image_make_from_texture'; - class function TSkiaAPI.sk4d_image_make_non_texture_image; external TSkiaAPI.LibName name 'sk4d_image_make_non_texture_image'; - class function TSkiaAPI.sk4d_image_make_raster_copy; external TSkiaAPI.LibName name 'sk4d_image_make_raster_copy'; - class function TSkiaAPI.sk4d_image_make_raster_image; external TSkiaAPI.LibName name 'sk4d_image_make_raster_image'; - class function TSkiaAPI.sk4d_image_make_raw_shader; external TSkiaAPI.LibName name 'sk4d_image_make_raw_shader'; - class function TSkiaAPI.sk4d_image_make_shader; external TSkiaAPI.LibName name 'sk4d_image_make_shader'; - class function TSkiaAPI.sk4d_image_make_subset; external TSkiaAPI.LibName name 'sk4d_image_make_subset'; - class function TSkiaAPI.sk4d_image_make_texture_image; external TSkiaAPI.LibName name 'sk4d_image_make_texture_image'; - class function TSkiaAPI.sk4d_image_make_with_filter; external TSkiaAPI.LibName name 'sk4d_image_make_with_filter'; - class function TSkiaAPI.sk4d_image_peek_pixels; external TSkiaAPI.LibName name 'sk4d_image_peek_pixels'; - class function TSkiaAPI.sk4d_image_read_pixels; external TSkiaAPI.LibName name 'sk4d_image_read_pixels'; - class function TSkiaAPI.sk4d_image_scale_pixels; external TSkiaAPI.LibName name 'sk4d_image_scale_pixels'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_imageencoder.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_imageencoder_encode_to_file := GetProcAddress(FLibHandle, 'sk4d_imageencoder_encode_to_file'); - sk4d_imageencoder_encode_to_stream := GetProcAddress(FLibHandle, 'sk4d_imageencoder_encode_to_stream'); - {$ELSE} - class function TSkiaAPI.sk4d_imageencoder_encode_to_file; external TSkiaAPI.LibName name 'sk4d_imageencoder_encode_to_file'; - class function TSkiaAPI.sk4d_imageencoder_encode_to_stream; external TSkiaAPI.LibName name 'sk4d_imageencoder_encode_to_stream'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_imagefilter.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_imagefilter_make_alpha_threshold := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_alpha_threshold'); - sk4d_imagefilter_make_arithmetic := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_arithmetic'); - sk4d_imagefilter_make_blend := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_blend'); - sk4d_imagefilter_make_blur := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_blur'); - sk4d_imagefilter_make_colorfilter := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_colorfilter'); - sk4d_imagefilter_make_compose := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_compose'); - sk4d_imagefilter_make_dilate := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_dilate'); - sk4d_imagefilter_make_displacement_map := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_displacement_map'); - sk4d_imagefilter_make_distant_lit_diffuse := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_distant_lit_diffuse'); - sk4d_imagefilter_make_distant_lit_specular := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_distant_lit_specular'); - sk4d_imagefilter_make_drop_shadow := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_drop_shadow'); - sk4d_imagefilter_make_drop_shadow_only := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_drop_shadow_only'); - sk4d_imagefilter_make_erode := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_erode'); - sk4d_imagefilter_make_image := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_image'); - sk4d_imagefilter_make_magnifier := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_magnifier'); - sk4d_imagefilter_make_matrix_convolution := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_matrix_convolution'); - sk4d_imagefilter_make_matrix_transform := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_matrix_transform'); - sk4d_imagefilter_make_merge := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_merge'); - sk4d_imagefilter_make_offset := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_offset'); - sk4d_imagefilter_make_picture := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_picture'); - sk4d_imagefilter_make_point_lit_diffuse := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_point_lit_diffuse'); - sk4d_imagefilter_make_point_lit_specular := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_point_lit_specular'); - sk4d_imagefilter_make_shader := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_shader'); - sk4d_imagefilter_make_spot_lit_diffuse := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_spot_lit_diffuse'); - sk4d_imagefilter_make_spot_lit_specular := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_spot_lit_specular'); - sk4d_imagefilter_make_tile := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_tile'); - sk4d_imagefilter_make_with_local_matrix := GetProcAddress(FLibHandle, 'sk4d_imagefilter_make_with_local_matrix'); - {$ELSE} - class function TSkiaAPI.sk4d_imagefilter_make_alpha_threshold; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_alpha_threshold'; - class function TSkiaAPI.sk4d_imagefilter_make_arithmetic; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_arithmetic'; - class function TSkiaAPI.sk4d_imagefilter_make_blend; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_blend'; - class function TSkiaAPI.sk4d_imagefilter_make_blur; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_blur'; - class function TSkiaAPI.sk4d_imagefilter_make_colorfilter; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_colorfilter'; - class function TSkiaAPI.sk4d_imagefilter_make_compose; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_compose'; - class function TSkiaAPI.sk4d_imagefilter_make_dilate; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_dilate'; - class function TSkiaAPI.sk4d_imagefilter_make_displacement_map; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_displacement_map'; - class function TSkiaAPI.sk4d_imagefilter_make_distant_lit_diffuse; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_distant_lit_diffuse'; - class function TSkiaAPI.sk4d_imagefilter_make_distant_lit_specular; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_distant_lit_specular'; - class function TSkiaAPI.sk4d_imagefilter_make_drop_shadow; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_drop_shadow'; - class function TSkiaAPI.sk4d_imagefilter_make_drop_shadow_only; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_drop_shadow_only'; - class function TSkiaAPI.sk4d_imagefilter_make_erode; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_erode'; - class function TSkiaAPI.sk4d_imagefilter_make_image; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_image'; - class function TSkiaAPI.sk4d_imagefilter_make_magnifier; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_magnifier'; - class function TSkiaAPI.sk4d_imagefilter_make_matrix_convolution; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_matrix_convolution'; - class function TSkiaAPI.sk4d_imagefilter_make_matrix_transform; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_matrix_transform'; - class function TSkiaAPI.sk4d_imagefilter_make_merge; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_merge'; - class function TSkiaAPI.sk4d_imagefilter_make_offset; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_offset'; - class function TSkiaAPI.sk4d_imagefilter_make_picture; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_picture'; - class function TSkiaAPI.sk4d_imagefilter_make_point_lit_diffuse; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_point_lit_diffuse'; - class function TSkiaAPI.sk4d_imagefilter_make_point_lit_specular; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_point_lit_specular'; - class function TSkiaAPI.sk4d_imagefilter_make_shader; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_shader'; - class function TSkiaAPI.sk4d_imagefilter_make_spot_lit_diffuse; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_spot_lit_diffuse'; - class function TSkiaAPI.sk4d_imagefilter_make_spot_lit_specular; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_spot_lit_specular'; - class function TSkiaAPI.sk4d_imagefilter_make_tile; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_tile'; - class function TSkiaAPI.sk4d_imagefilter_make_with_local_matrix; external TSkiaAPI.LibName name 'sk4d_imagefilter_make_with_local_matrix'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_maskfilter.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_maskfilter_make_blur := GetProcAddress(FLibHandle, 'sk4d_maskfilter_make_blur'); - sk4d_maskfilter_make_shader := GetProcAddress(FLibHandle, 'sk4d_maskfilter_make_shader'); - sk4d_maskfilter_make_table := GetProcAddress(FLibHandle, 'sk4d_maskfilter_make_table'); - sk4d_maskfilter_make_table_clip := GetProcAddress(FLibHandle, 'sk4d_maskfilter_make_table_clip'); - sk4d_maskfilter_make_table_gamma := GetProcAddress(FLibHandle, 'sk4d_maskfilter_make_table_gamma'); - {$ELSE} - class function TSkiaAPI.sk4d_maskfilter_make_blur; external TSkiaAPI.LibName name 'sk4d_maskfilter_make_blur'; - class function TSkiaAPI.sk4d_maskfilter_make_shader; external TSkiaAPI.LibName name 'sk4d_maskfilter_make_shader'; - class function TSkiaAPI.sk4d_maskfilter_make_table; external TSkiaAPI.LibName name 'sk4d_maskfilter_make_table'; - class function TSkiaAPI.sk4d_maskfilter_make_table_clip; external TSkiaAPI.LibName name 'sk4d_maskfilter_make_table_clip'; - class function TSkiaAPI.sk4d_maskfilter_make_table_gamma; external TSkiaAPI.LibName name 'sk4d_maskfilter_make_table_gamma'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_paint.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_paint_create := GetProcAddress(FLibHandle, 'sk4d_paint_create'); - sk4d_paint_create2 := GetProcAddress(FLibHandle, 'sk4d_paint_create2'); - sk4d_paint_destroy := GetProcAddress(FLibHandle, 'sk4d_paint_destroy'); - sk4d_paint_get_alpha := GetProcAddress(FLibHandle, 'sk4d_paint_get_alpha'); - sk4d_paint_get_alphaf := GetProcAddress(FLibHandle, 'sk4d_paint_get_alphaf'); - sk4d_paint_get_anti_alias := GetProcAddress(FLibHandle, 'sk4d_paint_get_anti_alias'); - sk4d_paint_get_blender := GetProcAddress(FLibHandle, 'sk4d_paint_get_blender'); - sk4d_paint_get_color := GetProcAddress(FLibHandle, 'sk4d_paint_get_color'); - sk4d_paint_get_colorf := GetProcAddress(FLibHandle, 'sk4d_paint_get_colorf'); - sk4d_paint_get_color_filter := GetProcAddress(FLibHandle, 'sk4d_paint_get_color_filter'); - sk4d_paint_get_dither := GetProcAddress(FLibHandle, 'sk4d_paint_get_dither'); - sk4d_paint_get_fill_path := GetProcAddress(FLibHandle, 'sk4d_paint_get_fill_path'); - sk4d_paint_get_image_filter := GetProcAddress(FLibHandle, 'sk4d_paint_get_image_filter'); - sk4d_paint_get_mask_filter := GetProcAddress(FLibHandle, 'sk4d_paint_get_mask_filter'); - sk4d_paint_get_path_effect := GetProcAddress(FLibHandle, 'sk4d_paint_get_path_effect'); - sk4d_paint_get_shader := GetProcAddress(FLibHandle, 'sk4d_paint_get_shader'); - sk4d_paint_get_stroke_cap := GetProcAddress(FLibHandle, 'sk4d_paint_get_stroke_cap'); - sk4d_paint_get_stroke_join := GetProcAddress(FLibHandle, 'sk4d_paint_get_stroke_join'); - sk4d_paint_get_stroke_miter := GetProcAddress(FLibHandle, 'sk4d_paint_get_stroke_miter'); - sk4d_paint_get_stroke_width := GetProcAddress(FLibHandle, 'sk4d_paint_get_stroke_width'); - sk4d_paint_get_style := GetProcAddress(FLibHandle, 'sk4d_paint_get_style'); - sk4d_paint_reset := GetProcAddress(FLibHandle, 'sk4d_paint_reset'); - sk4d_paint_set_alpha := GetProcAddress(FLibHandle, 'sk4d_paint_set_alpha'); - sk4d_paint_set_alphaf := GetProcAddress(FLibHandle, 'sk4d_paint_set_alphaf'); - sk4d_paint_set_antialias := GetProcAddress(FLibHandle, 'sk4d_paint_set_antialias'); - sk4d_paint_set_argb := GetProcAddress(FLibHandle, 'sk4d_paint_set_argb'); - sk4d_paint_set_blender := GetProcAddress(FLibHandle, 'sk4d_paint_set_blender'); - sk4d_paint_set_color := GetProcAddress(FLibHandle, 'sk4d_paint_set_color'); - sk4d_paint_set_colorf := GetProcAddress(FLibHandle, 'sk4d_paint_set_colorf'); - sk4d_paint_set_color_filter := GetProcAddress(FLibHandle, 'sk4d_paint_set_color_filter'); - sk4d_paint_set_dither := GetProcAddress(FLibHandle, 'sk4d_paint_set_dither'); - sk4d_paint_set_image_filter := GetProcAddress(FLibHandle, 'sk4d_paint_set_image_filter'); - sk4d_paint_set_mask_filter := GetProcAddress(FLibHandle, 'sk4d_paint_set_mask_filter'); - sk4d_paint_set_path_effect := GetProcAddress(FLibHandle, 'sk4d_paint_set_path_effect'); - sk4d_paint_set_shader := GetProcAddress(FLibHandle, 'sk4d_paint_set_shader'); - sk4d_paint_set_stroke_cap := GetProcAddress(FLibHandle, 'sk4d_paint_set_stroke_cap'); - sk4d_paint_set_stroke_join := GetProcAddress(FLibHandle, 'sk4d_paint_set_stroke_join'); - sk4d_paint_set_stroke_miter := GetProcAddress(FLibHandle, 'sk4d_paint_set_stroke_miter'); - sk4d_paint_set_stroke_width := GetProcAddress(FLibHandle, 'sk4d_paint_set_stroke_width'); - sk4d_paint_set_style := GetProcAddress(FLibHandle, 'sk4d_paint_set_style'); - {$ELSE} - class function TSkiaAPI.sk4d_paint_create; external TSkiaAPI.LibName name 'sk4d_paint_create'; - class function TSkiaAPI.sk4d_paint_create2; external TSkiaAPI.LibName name 'sk4d_paint_create2'; - class procedure TSkiaAPI.sk4d_paint_destroy; external TSkiaAPI.LibName name 'sk4d_paint_destroy'; - class function TSkiaAPI.sk4d_paint_get_alpha; external TSkiaAPI.LibName name 'sk4d_paint_get_alpha'; - class function TSkiaAPI.sk4d_paint_get_alphaf; external TSkiaAPI.LibName name 'sk4d_paint_get_alphaf'; - class function TSkiaAPI.sk4d_paint_get_anti_alias; external TSkiaAPI.LibName name 'sk4d_paint_get_anti_alias'; - class function TSkiaAPI.sk4d_paint_get_blender; external TSkiaAPI.LibName name 'sk4d_paint_get_blender'; - class function TSkiaAPI.sk4d_paint_get_color; external TSkiaAPI.LibName name 'sk4d_paint_get_color'; - class procedure TSkiaAPI.sk4d_paint_get_colorf; external TSkiaAPI.LibName name 'sk4d_paint_get_colorf'; - class function TSkiaAPI.sk4d_paint_get_color_filter; external TSkiaAPI.LibName name 'sk4d_paint_get_color_filter'; - class function TSkiaAPI.sk4d_paint_get_dither; external TSkiaAPI.LibName name 'sk4d_paint_get_dither'; - class function TSkiaAPI.sk4d_paint_get_fill_path; external TSkiaAPI.LibName name 'sk4d_paint_get_fill_path'; - class function TSkiaAPI.sk4d_paint_get_image_filter; external TSkiaAPI.LibName name 'sk4d_paint_get_image_filter'; - class function TSkiaAPI.sk4d_paint_get_mask_filter; external TSkiaAPI.LibName name 'sk4d_paint_get_mask_filter'; - class function TSkiaAPI.sk4d_paint_get_path_effect; external TSkiaAPI.LibName name 'sk4d_paint_get_path_effect'; - class function TSkiaAPI.sk4d_paint_get_shader; external TSkiaAPI.LibName name 'sk4d_paint_get_shader'; - class function TSkiaAPI.sk4d_paint_get_stroke_cap; external TSkiaAPI.LibName name 'sk4d_paint_get_stroke_cap'; - class function TSkiaAPI.sk4d_paint_get_stroke_join; external TSkiaAPI.LibName name 'sk4d_paint_get_stroke_join'; - class function TSkiaAPI.sk4d_paint_get_stroke_miter; external TSkiaAPI.LibName name 'sk4d_paint_get_stroke_miter'; - class function TSkiaAPI.sk4d_paint_get_stroke_width; external TSkiaAPI.LibName name 'sk4d_paint_get_stroke_width'; - class function TSkiaAPI.sk4d_paint_get_style; external TSkiaAPI.LibName name 'sk4d_paint_get_style'; - class procedure TSkiaAPI.sk4d_paint_reset; external TSkiaAPI.LibName name 'sk4d_paint_reset'; - class procedure TSkiaAPI.sk4d_paint_set_alpha; external TSkiaAPI.LibName name 'sk4d_paint_set_alpha'; - class procedure TSkiaAPI.sk4d_paint_set_alphaf; external TSkiaAPI.LibName name 'sk4d_paint_set_alphaf'; - class procedure TSkiaAPI.sk4d_paint_set_antialias; external TSkiaAPI.LibName name 'sk4d_paint_set_antialias'; - class procedure TSkiaAPI.sk4d_paint_set_argb; external TSkiaAPI.LibName name 'sk4d_paint_set_argb'; - class procedure TSkiaAPI.sk4d_paint_set_blender; external TSkiaAPI.LibName name 'sk4d_paint_set_blender'; - class procedure TSkiaAPI.sk4d_paint_set_color; external TSkiaAPI.LibName name 'sk4d_paint_set_color'; - class procedure TSkiaAPI.sk4d_paint_set_colorf; external TSkiaAPI.LibName name 'sk4d_paint_set_colorf'; - class procedure TSkiaAPI.sk4d_paint_set_color_filter; external TSkiaAPI.LibName name 'sk4d_paint_set_color_filter'; - class procedure TSkiaAPI.sk4d_paint_set_dither; external TSkiaAPI.LibName name 'sk4d_paint_set_dither'; - class procedure TSkiaAPI.sk4d_paint_set_image_filter; external TSkiaAPI.LibName name 'sk4d_paint_set_image_filter'; - class procedure TSkiaAPI.sk4d_paint_set_mask_filter; external TSkiaAPI.LibName name 'sk4d_paint_set_mask_filter'; - class procedure TSkiaAPI.sk4d_paint_set_path_effect; external TSkiaAPI.LibName name 'sk4d_paint_set_path_effect'; - class procedure TSkiaAPI.sk4d_paint_set_shader; external TSkiaAPI.LibName name 'sk4d_paint_set_shader'; - class procedure TSkiaAPI.sk4d_paint_set_stroke_cap; external TSkiaAPI.LibName name 'sk4d_paint_set_stroke_cap'; - class procedure TSkiaAPI.sk4d_paint_set_stroke_join; external TSkiaAPI.LibName name 'sk4d_paint_set_stroke_join'; - class procedure TSkiaAPI.sk4d_paint_set_stroke_miter; external TSkiaAPI.LibName name 'sk4d_paint_set_stroke_miter'; - class procedure TSkiaAPI.sk4d_paint_set_stroke_width; external TSkiaAPI.LibName name 'sk4d_paint_set_stroke_width'; - class procedure TSkiaAPI.sk4d_paint_set_style; external TSkiaAPI.LibName name 'sk4d_paint_set_style'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_path.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_opbuilder_add := GetProcAddress(FLibHandle, 'sk4d_opbuilder_add'); - sk4d_opbuilder_create := GetProcAddress(FLibHandle, 'sk4d_opbuilder_create'); - sk4d_opbuilder_destroy := GetProcAddress(FLibHandle, 'sk4d_opbuilder_destroy'); - sk4d_opbuilder_detach := GetProcAddress(FLibHandle, 'sk4d_opbuilder_detach'); - sk4d_path_contains := GetProcAddress(FLibHandle, 'sk4d_path_contains'); - sk4d_path_convert_conic_to_quads := GetProcAddress(FLibHandle, 'sk4d_path_convert_conic_to_quads'); - sk4d_path_create := GetProcAddress(FLibHandle, 'sk4d_path_create'); - sk4d_path_create2 := GetProcAddress(FLibHandle, 'sk4d_path_create2'); - sk4d_path_destroy := GetProcAddress(FLibHandle, 'sk4d_path_destroy'); - sk4d_path_get_bounds := GetProcAddress(FLibHandle, 'sk4d_path_get_bounds'); - sk4d_path_get_fill_type := GetProcAddress(FLibHandle, 'sk4d_path_get_fill_type'); - sk4d_path_get_last_point := GetProcAddress(FLibHandle, 'sk4d_path_get_last_point'); - sk4d_path_get_segment_masks := GetProcAddress(FLibHandle, 'sk4d_path_get_segment_masks'); - sk4d_path_get_tight_bounds := GetProcAddress(FLibHandle, 'sk4d_path_get_tight_bounds'); - sk4d_path_interpolate := GetProcAddress(FLibHandle, 'sk4d_path_interpolate'); - sk4d_path_is_convex := GetProcAddress(FLibHandle, 'sk4d_path_is_convex'); - sk4d_path_is_empty := GetProcAddress(FLibHandle, 'sk4d_path_is_empty'); - sk4d_path_is_finite := GetProcAddress(FLibHandle, 'sk4d_path_is_finite'); - sk4d_path_is_interpolatable := GetProcAddress(FLibHandle, 'sk4d_path_is_interpolatable'); - sk4d_path_is_last_contour_closed := GetProcAddress(FLibHandle, 'sk4d_path_is_last_contour_closed'); - sk4d_path_is_line := GetProcAddress(FLibHandle, 'sk4d_path_is_line'); - sk4d_path_is_oval := GetProcAddress(FLibHandle, 'sk4d_path_is_oval'); - sk4d_path_is_rect := GetProcAddress(FLibHandle, 'sk4d_path_is_rect'); - sk4d_path_is_rrect := GetProcAddress(FLibHandle, 'sk4d_path_is_rrect'); - sk4d_path_serialize_to_stream := GetProcAddress(FLibHandle, 'sk4d_path_serialize_to_stream'); - sk4d_path_to_svg := GetProcAddress(FLibHandle, 'sk4d_path_to_svg'); - sk4d_path_transform := GetProcAddress(FLibHandle, 'sk4d_path_transform'); - sk4d_pathiterator_create := GetProcAddress(FLibHandle, 'sk4d_pathiterator_create'); - sk4d_pathiterator_destroy := GetProcAddress(FLibHandle, 'sk4d_pathiterator_destroy'); - sk4d_pathiterator_next := GetProcAddress(FLibHandle, 'sk4d_pathiterator_next'); - {$ELSE} - class procedure TSkiaAPI.sk4d_opbuilder_add; external TSkiaAPI.LibName name 'sk4d_opbuilder_add'; - class function TSkiaAPI.sk4d_opbuilder_create; external TSkiaAPI.LibName name 'sk4d_opbuilder_create'; - class procedure TSkiaAPI.sk4d_opbuilder_destroy; external TSkiaAPI.LibName name 'sk4d_opbuilder_destroy'; - class function TSkiaAPI.sk4d_opbuilder_detach; external TSkiaAPI.LibName name 'sk4d_opbuilder_detach'; - class function TSkiaAPI.sk4d_path_contains; external TSkiaAPI.LibName name 'sk4d_path_contains'; - class function TSkiaAPI.sk4d_path_convert_conic_to_quads; external TSkiaAPI.LibName name 'sk4d_path_convert_conic_to_quads'; - class function TSkiaAPI.sk4d_path_create; external TSkiaAPI.LibName name 'sk4d_path_create'; - class function TSkiaAPI.sk4d_path_create2; external TSkiaAPI.LibName name 'sk4d_path_create2'; - class procedure TSkiaAPI.sk4d_path_destroy; external TSkiaAPI.LibName name 'sk4d_path_destroy'; - class procedure TSkiaAPI.sk4d_path_get_bounds; external TSkiaAPI.LibName name 'sk4d_path_get_bounds'; - class function TSkiaAPI.sk4d_path_get_fill_type; external TSkiaAPI.LibName name 'sk4d_path_get_fill_type'; - class function TSkiaAPI.sk4d_path_get_last_point; external TSkiaAPI.LibName name 'sk4d_path_get_last_point'; - class function TSkiaAPI.sk4d_path_get_segment_masks; external TSkiaAPI.LibName name 'sk4d_path_get_segment_masks'; - class procedure TSkiaAPI.sk4d_path_get_tight_bounds; external TSkiaAPI.LibName name 'sk4d_path_get_tight_bounds'; - class function TSkiaAPI.sk4d_path_interpolate; external TSkiaAPI.LibName name 'sk4d_path_interpolate'; - class function TSkiaAPI.sk4d_path_is_convex; external TSkiaAPI.LibName name 'sk4d_path_is_convex'; - class function TSkiaAPI.sk4d_path_is_empty; external TSkiaAPI.LibName name 'sk4d_path_is_empty'; - class function TSkiaAPI.sk4d_path_is_finite; external TSkiaAPI.LibName name 'sk4d_path_is_finite'; - class function TSkiaAPI.sk4d_path_is_interpolatable; external TSkiaAPI.LibName name 'sk4d_path_is_interpolatable'; - class function TSkiaAPI.sk4d_path_is_last_contour_closed; external TSkiaAPI.LibName name 'sk4d_path_is_last_contour_closed'; - class function TSkiaAPI.sk4d_path_is_line; external TSkiaAPI.LibName name 'sk4d_path_is_line'; - class function TSkiaAPI.sk4d_path_is_oval; external TSkiaAPI.LibName name 'sk4d_path_is_oval'; - class function TSkiaAPI.sk4d_path_is_rect; external TSkiaAPI.LibName name 'sk4d_path_is_rect'; - class function TSkiaAPI.sk4d_path_is_rrect; external TSkiaAPI.LibName name 'sk4d_path_is_rrect'; - class procedure TSkiaAPI.sk4d_path_serialize_to_stream; external TSkiaAPI.LibName name 'sk4d_path_serialize_to_stream'; - class function TSkiaAPI.sk4d_path_to_svg; external TSkiaAPI.LibName name 'sk4d_path_to_svg'; - class function TSkiaAPI.sk4d_path_transform; external TSkiaAPI.LibName name 'sk4d_path_transform'; - class function TSkiaAPI.sk4d_pathiterator_create; external TSkiaAPI.LibName name 'sk4d_pathiterator_create'; - class procedure TSkiaAPI.sk4d_pathiterator_destroy; external TSkiaAPI.LibName name 'sk4d_pathiterator_destroy'; - class function TSkiaAPI.sk4d_pathiterator_next; external TSkiaAPI.LibName name 'sk4d_pathiterator_next'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_pathbuilder.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_pathbuilder_add_arc := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_add_arc'); - sk4d_pathbuilder_add_circle := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_add_circle'); - sk4d_pathbuilder_add_oval := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_add_oval'); - sk4d_pathbuilder_add_path := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_add_path'); - sk4d_pathbuilder_add_polygon := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_add_polygon'); - sk4d_pathbuilder_add_rect := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_add_rect'); - sk4d_pathbuilder_add_rrect := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_add_rrect'); - sk4d_pathbuilder_arc_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_arc_to'); - sk4d_pathbuilder_arc_to2 := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_arc_to2'); - sk4d_pathbuilder_arc_to3 := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_arc_to3'); - sk4d_pathbuilder_close := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_close'); - sk4d_pathbuilder_conic_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_conic_to'); - sk4d_pathbuilder_create := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_create'); - sk4d_pathbuilder_create2 := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_create2'); - sk4d_pathbuilder_cubic_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_cubic_to'); - sk4d_pathbuilder_destroy := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_destroy'); - sk4d_pathbuilder_detach := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_detach'); - sk4d_pathbuilder_get_bounds := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_get_bounds'); - sk4d_pathbuilder_get_fill_type := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_get_fill_type'); - sk4d_pathbuilder_inc_reserve := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_inc_reserve'); - sk4d_pathbuilder_line_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_line_to'); - sk4d_pathbuilder_move_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_move_to'); - sk4d_pathbuilder_offset := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_offset'); - sk4d_pathbuilder_polyline_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_polyline_to'); - sk4d_pathbuilder_quad_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_quad_to'); - sk4d_pathbuilder_r_conic_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_r_conic_to'); - sk4d_pathbuilder_r_cubic_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_r_cubic_to'); - sk4d_pathbuilder_r_line_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_r_line_to'); - sk4d_pathbuilder_r_quad_to := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_r_quad_to'); - sk4d_pathbuilder_reset := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_reset'); - sk4d_pathbuilder_set_filltype := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_set_filltype'); - sk4d_pathbuilder_snapshot := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_snapshot'); - sk4d_pathbuilder_toggle_inverse_filltype := GetProcAddress(FLibHandle, 'sk4d_pathbuilder_toggle_inverse_filltype'); - {$ELSE} - class procedure TSkiaAPI.sk4d_pathbuilder_add_arc; external TSkiaAPI.LibName name 'sk4d_pathbuilder_add_arc'; - class procedure TSkiaAPI.sk4d_pathbuilder_add_circle; external TSkiaAPI.LibName name 'sk4d_pathbuilder_add_circle'; - class procedure TSkiaAPI.sk4d_pathbuilder_add_oval; external TSkiaAPI.LibName name 'sk4d_pathbuilder_add_oval'; - class procedure TSkiaAPI.sk4d_pathbuilder_add_path; external TSkiaAPI.LibName name 'sk4d_pathbuilder_add_path'; - class procedure TSkiaAPI.sk4d_pathbuilder_add_polygon; external TSkiaAPI.LibName name 'sk4d_pathbuilder_add_polygon'; - class procedure TSkiaAPI.sk4d_pathbuilder_add_rect; external TSkiaAPI.LibName name 'sk4d_pathbuilder_add_rect'; - class procedure TSkiaAPI.sk4d_pathbuilder_add_rrect; external TSkiaAPI.LibName name 'sk4d_pathbuilder_add_rrect'; - class procedure TSkiaAPI.sk4d_pathbuilder_arc_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_arc_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_arc_to2; external TSkiaAPI.LibName name 'sk4d_pathbuilder_arc_to2'; - class procedure TSkiaAPI.sk4d_pathbuilder_arc_to3; external TSkiaAPI.LibName name 'sk4d_pathbuilder_arc_to3'; - class procedure TSkiaAPI.sk4d_pathbuilder_close; external TSkiaAPI.LibName name 'sk4d_pathbuilder_close'; - class procedure TSkiaAPI.sk4d_pathbuilder_conic_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_conic_to'; - class function TSkiaAPI.sk4d_pathbuilder_create; external TSkiaAPI.LibName name 'sk4d_pathbuilder_create'; - class function TSkiaAPI.sk4d_pathbuilder_create2; external TSkiaAPI.LibName name 'sk4d_pathbuilder_create2'; - class procedure TSkiaAPI.sk4d_pathbuilder_cubic_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_cubic_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_destroy; external TSkiaAPI.LibName name 'sk4d_pathbuilder_destroy'; - class function TSkiaAPI.sk4d_pathbuilder_detach; external TSkiaAPI.LibName name 'sk4d_pathbuilder_detach'; - class procedure TSkiaAPI.sk4d_pathbuilder_get_bounds; external TSkiaAPI.LibName name 'sk4d_pathbuilder_get_bounds'; - class function TSkiaAPI.sk4d_pathbuilder_get_fill_type; external TSkiaAPI.LibName name 'sk4d_pathbuilder_get_fill_type'; - class procedure TSkiaAPI.sk4d_pathbuilder_inc_reserve; external TSkiaAPI.LibName name 'sk4d_pathbuilder_inc_reserve'; - class procedure TSkiaAPI.sk4d_pathbuilder_line_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_line_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_move_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_move_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_offset; external TSkiaAPI.LibName name 'sk4d_pathbuilder_offset'; - class procedure TSkiaAPI.sk4d_pathbuilder_polyline_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_polyline_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_quad_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_quad_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_r_conic_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_r_conic_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_r_cubic_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_r_cubic_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_r_line_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_r_line_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_r_quad_to; external TSkiaAPI.LibName name 'sk4d_pathbuilder_r_quad_to'; - class procedure TSkiaAPI.sk4d_pathbuilder_reset; external TSkiaAPI.LibName name 'sk4d_pathbuilder_reset'; - class procedure TSkiaAPI.sk4d_pathbuilder_set_filltype; external TSkiaAPI.LibName name 'sk4d_pathbuilder_set_filltype'; - class function TSkiaAPI.sk4d_pathbuilder_snapshot; external TSkiaAPI.LibName name 'sk4d_pathbuilder_snapshot'; - class procedure TSkiaAPI.sk4d_pathbuilder_toggle_inverse_filltype; external TSkiaAPI.LibName name 'sk4d_pathbuilder_toggle_inverse_filltype'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_patheffect.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_patheffect_make_1dpath := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_1dpath'); - sk4d_patheffect_make_2dline := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_2dline'); - sk4d_patheffect_make_2dpath := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_2dpath'); - sk4d_patheffect_make_compose := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_compose'); - sk4d_patheffect_make_corner := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_corner'); - sk4d_patheffect_make_dash := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_dash'); - sk4d_patheffect_make_discrete := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_discrete'); - sk4d_patheffect_make_matrix := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_matrix'); - sk4d_patheffect_make_merge := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_merge'); - sk4d_patheffect_make_stroke := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_stroke'); - sk4d_patheffect_make_stroke_and_fill := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_stroke_and_fill'); - sk4d_patheffect_make_sum := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_sum'); - sk4d_patheffect_make_translate := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_translate'); - sk4d_patheffect_make_trim := GetProcAddress(FLibHandle, 'sk4d_patheffect_make_trim'); - {$ELSE} - class function TSkiaAPI.sk4d_patheffect_make_1dpath; external TSkiaAPI.LibName name 'sk4d_patheffect_make_1dpath'; - class function TSkiaAPI.sk4d_patheffect_make_2dline; external TSkiaAPI.LibName name 'sk4d_patheffect_make_2dline'; - class function TSkiaAPI.sk4d_patheffect_make_2dpath; external TSkiaAPI.LibName name 'sk4d_patheffect_make_2dpath'; - class function TSkiaAPI.sk4d_patheffect_make_compose; external TSkiaAPI.LibName name 'sk4d_patheffect_make_compose'; - class function TSkiaAPI.sk4d_patheffect_make_corner; external TSkiaAPI.LibName name 'sk4d_patheffect_make_corner'; - class function TSkiaAPI.sk4d_patheffect_make_dash; external TSkiaAPI.LibName name 'sk4d_patheffect_make_dash'; - class function TSkiaAPI.sk4d_patheffect_make_discrete; external TSkiaAPI.LibName name 'sk4d_patheffect_make_discrete'; - class function TSkiaAPI.sk4d_patheffect_make_matrix; external TSkiaAPI.LibName name 'sk4d_patheffect_make_matrix'; - class function TSkiaAPI.sk4d_patheffect_make_merge; external TSkiaAPI.LibName name 'sk4d_patheffect_make_merge'; - class function TSkiaAPI.sk4d_patheffect_make_stroke; external TSkiaAPI.LibName name 'sk4d_patheffect_make_stroke'; - class function TSkiaAPI.sk4d_patheffect_make_stroke_and_fill; external TSkiaAPI.LibName name 'sk4d_patheffect_make_stroke_and_fill'; - class function TSkiaAPI.sk4d_patheffect_make_sum; external TSkiaAPI.LibName name 'sk4d_patheffect_make_sum'; - class function TSkiaAPI.sk4d_patheffect_make_translate; external TSkiaAPI.LibName name 'sk4d_patheffect_make_translate'; - class function TSkiaAPI.sk4d_patheffect_make_trim; external TSkiaAPI.LibName name 'sk4d_patheffect_make_trim'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_pathmeasure.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_pathmeasure_create := GetProcAddress(FLibHandle, 'sk4d_pathmeasure_create'); - sk4d_pathmeasure_destroy := GetProcAddress(FLibHandle, 'sk4d_pathmeasure_destroy'); - sk4d_pathmeasure_get_length := GetProcAddress(FLibHandle, 'sk4d_pathmeasure_get_length'); - sk4d_pathmeasure_get_matrix := GetProcAddress(FLibHandle, 'sk4d_pathmeasure_get_matrix'); - sk4d_pathmeasure_get_position_and_tangent := GetProcAddress(FLibHandle, 'sk4d_pathmeasure_get_position_and_tangent'); - sk4d_pathmeasure_get_segment := GetProcAddress(FLibHandle, 'sk4d_pathmeasure_get_segment'); - sk4d_pathmeasure_is_closed := GetProcAddress(FLibHandle, 'sk4d_pathmeasure_is_closed'); - sk4d_pathmeasure_next_contour := GetProcAddress(FLibHandle, 'sk4d_pathmeasure_next_contour'); - {$ELSE} - class function TSkiaAPI.sk4d_pathmeasure_create; external TSkiaAPI.LibName name 'sk4d_pathmeasure_create'; - class procedure TSkiaAPI.sk4d_pathmeasure_destroy; external TSkiaAPI.LibName name 'sk4d_pathmeasure_destroy'; - class function TSkiaAPI.sk4d_pathmeasure_get_length; external TSkiaAPI.LibName name 'sk4d_pathmeasure_get_length'; - class function TSkiaAPI.sk4d_pathmeasure_get_matrix; external TSkiaAPI.LibName name 'sk4d_pathmeasure_get_matrix'; - class function TSkiaAPI.sk4d_pathmeasure_get_position_and_tangent; external TSkiaAPI.LibName name 'sk4d_pathmeasure_get_position_and_tangent'; - class function TSkiaAPI.sk4d_pathmeasure_get_segment; external TSkiaAPI.LibName name 'sk4d_pathmeasure_get_segment'; - class function TSkiaAPI.sk4d_pathmeasure_is_closed; external TSkiaAPI.LibName name 'sk4d_pathmeasure_is_closed'; - class function TSkiaAPI.sk4d_pathmeasure_next_contour; external TSkiaAPI.LibName name 'sk4d_pathmeasure_next_contour'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_picture.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_picture_get_cull_rect := GetProcAddress(FLibHandle, 'sk4d_picture_get_cull_rect'); - sk4d_picture_make_from_stream := GetProcAddress(FLibHandle, 'sk4d_picture_make_from_stream'); - sk4d_picture_make_shader := GetProcAddress(FLibHandle, 'sk4d_picture_make_shader'); - sk4d_picture_playback := GetProcAddress(FLibHandle, 'sk4d_picture_playback'); - sk4d_picture_serialize_to_stream := GetProcAddress(FLibHandle, 'sk4d_picture_serialize_to_stream'); - {$ELSE} - class procedure TSkiaAPI.sk4d_picture_get_cull_rect; external TSkiaAPI.LibName name 'sk4d_picture_get_cull_rect'; - class function TSkiaAPI.sk4d_picture_make_from_stream; external TSkiaAPI.LibName name 'sk4d_picture_make_from_stream'; - class function TSkiaAPI.sk4d_picture_make_shader; external TSkiaAPI.LibName name 'sk4d_picture_make_shader'; - class procedure TSkiaAPI.sk4d_picture_playback; external TSkiaAPI.LibName name 'sk4d_picture_playback'; - class procedure TSkiaAPI.sk4d_picture_serialize_to_stream; external TSkiaAPI.LibName name 'sk4d_picture_serialize_to_stream'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_picturerecorder.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_picturerecorder_begin_recording := GetProcAddress(FLibHandle, 'sk4d_picturerecorder_begin_recording'); - sk4d_picturerecorder_create := GetProcAddress(FLibHandle, 'sk4d_picturerecorder_create'); - sk4d_picturerecorder_destroy := GetProcAddress(FLibHandle, 'sk4d_picturerecorder_destroy'); - sk4d_picturerecorder_finish_recording := GetProcAddress(FLibHandle, 'sk4d_picturerecorder_finish_recording'); - sk4d_picturerecorder_finish_recording2 := GetProcAddress(FLibHandle, 'sk4d_picturerecorder_finish_recording2'); - {$ELSE} - class function TSkiaAPI.sk4d_picturerecorder_begin_recording; external TSkiaAPI.LibName name 'sk4d_picturerecorder_begin_recording'; - class function TSkiaAPI.sk4d_picturerecorder_create; external TSkiaAPI.LibName name 'sk4d_picturerecorder_create'; - class procedure TSkiaAPI.sk4d_picturerecorder_destroy; external TSkiaAPI.LibName name 'sk4d_picturerecorder_destroy'; - class function TSkiaAPI.sk4d_picturerecorder_finish_recording; external TSkiaAPI.LibName name 'sk4d_picturerecorder_finish_recording'; - class function TSkiaAPI.sk4d_picturerecorder_finish_recording2; external TSkiaAPI.LibName name 'sk4d_picturerecorder_finish_recording2'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_pixmap.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_pixmap_create := GetProcAddress(FLibHandle, 'sk4d_pixmap_create'); - sk4d_pixmap_destroy := GetProcAddress(FLibHandle, 'sk4d_pixmap_destroy'); - sk4d_pixmap_erase := GetProcAddress(FLibHandle, 'sk4d_pixmap_erase'); - sk4d_pixmap_erase2 := GetProcAddress(FLibHandle, 'sk4d_pixmap_erase2'); - sk4d_pixmap_extract_subset := GetProcAddress(FLibHandle, 'sk4d_pixmap_extract_subset'); - sk4d_pixmap_get_alpha := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_alpha'); - sk4d_pixmap_get_alpha_type := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_alpha_type'); - sk4d_pixmap_get_color := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_color'); - sk4d_pixmap_get_color_space := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_color_space'); - sk4d_pixmap_get_color_type := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_color_type'); - sk4d_pixmap_get_height := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_height'); - sk4d_pixmap_get_image_info := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_image_info'); - sk4d_pixmap_get_pixel_addr := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_pixel_addr'); - sk4d_pixmap_get_pixels := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_pixels'); - sk4d_pixmap_get_row_bytes := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_row_bytes'); - sk4d_pixmap_get_width := GetProcAddress(FLibHandle, 'sk4d_pixmap_get_width'); - sk4d_pixmap_read_pixels := GetProcAddress(FLibHandle, 'sk4d_pixmap_read_pixels'); - sk4d_pixmap_scale_pixels := GetProcAddress(FLibHandle, 'sk4d_pixmap_scale_pixels'); - sk4d_pixmap_set_colorspace := GetProcAddress(FLibHandle, 'sk4d_pixmap_set_colorspace'); - {$ELSE} - class function TSkiaAPI.sk4d_pixmap_create; external TSkiaAPI.LibName name 'sk4d_pixmap_create'; - class procedure TSkiaAPI.sk4d_pixmap_destroy; external TSkiaAPI.LibName name 'sk4d_pixmap_destroy'; - class function TSkiaAPI.sk4d_pixmap_erase; external TSkiaAPI.LibName name 'sk4d_pixmap_erase'; - class function TSkiaAPI.sk4d_pixmap_erase2; external TSkiaAPI.LibName name 'sk4d_pixmap_erase2'; - class function TSkiaAPI.sk4d_pixmap_extract_subset; external TSkiaAPI.LibName name 'sk4d_pixmap_extract_subset'; - class function TSkiaAPI.sk4d_pixmap_get_alpha; external TSkiaAPI.LibName name 'sk4d_pixmap_get_alpha'; - class function TSkiaAPI.sk4d_pixmap_get_alpha_type; external TSkiaAPI.LibName name 'sk4d_pixmap_get_alpha_type'; - class function TSkiaAPI.sk4d_pixmap_get_color; external TSkiaAPI.LibName name 'sk4d_pixmap_get_color'; - class function TSkiaAPI.sk4d_pixmap_get_color_space; external TSkiaAPI.LibName name 'sk4d_pixmap_get_color_space'; - class function TSkiaAPI.sk4d_pixmap_get_color_type; external TSkiaAPI.LibName name 'sk4d_pixmap_get_color_type'; - class function TSkiaAPI.sk4d_pixmap_get_height; external TSkiaAPI.LibName name 'sk4d_pixmap_get_height'; - class procedure TSkiaAPI.sk4d_pixmap_get_image_info; external TSkiaAPI.LibName name 'sk4d_pixmap_get_image_info'; - class function TSkiaAPI.sk4d_pixmap_get_pixel_addr; external TSkiaAPI.LibName name 'sk4d_pixmap_get_pixel_addr'; - class function TSkiaAPI.sk4d_pixmap_get_pixels; external TSkiaAPI.LibName name 'sk4d_pixmap_get_pixels'; - class function TSkiaAPI.sk4d_pixmap_get_row_bytes; external TSkiaAPI.LibName name 'sk4d_pixmap_get_row_bytes'; - class function TSkiaAPI.sk4d_pixmap_get_width; external TSkiaAPI.LibName name 'sk4d_pixmap_get_width'; - class function TSkiaAPI.sk4d_pixmap_read_pixels; external TSkiaAPI.LibName name 'sk4d_pixmap_read_pixels'; - class function TSkiaAPI.sk4d_pixmap_scale_pixels; external TSkiaAPI.LibName name 'sk4d_pixmap_scale_pixels'; - class procedure TSkiaAPI.sk4d_pixmap_set_colorspace; external TSkiaAPI.LibName name 'sk4d_pixmap_set_colorspace'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_refcnt.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_refcnt_ref := GetProcAddress(FLibHandle, 'sk4d_refcnt_ref'); - sk4d_refcnt_unref := GetProcAddress(FLibHandle, 'sk4d_refcnt_unref'); - {$ELSE} - class procedure TSkiaAPI.sk4d_refcnt_ref; external TSkiaAPI.LibName name 'sk4d_refcnt_ref'; - class procedure TSkiaAPI.sk4d_refcnt_unref; external TSkiaAPI.LibName name 'sk4d_refcnt_unref'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_region.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_region_contains := GetProcAddress(FLibHandle, 'sk4d_region_contains'); - sk4d_region_contains2 := GetProcAddress(FLibHandle, 'sk4d_region_contains2'); - sk4d_region_contains3 := GetProcAddress(FLibHandle, 'sk4d_region_contains3'); - sk4d_region_create := GetProcAddress(FLibHandle, 'sk4d_region_create'); - sk4d_region_create2 := GetProcAddress(FLibHandle, 'sk4d_region_create2'); - sk4d_region_destroy := GetProcAddress(FLibHandle, 'sk4d_region_destroy'); - sk4d_region_get_boundary_path := GetProcAddress(FLibHandle, 'sk4d_region_get_boundary_path'); - sk4d_region_get_bounds := GetProcAddress(FLibHandle, 'sk4d_region_get_bounds'); - sk4d_region_intersects := GetProcAddress(FLibHandle, 'sk4d_region_intersects'); - sk4d_region_intersects2 := GetProcAddress(FLibHandle, 'sk4d_region_intersects2'); - sk4d_region_is_complex := GetProcAddress(FLibHandle, 'sk4d_region_is_complex'); - sk4d_region_is_empty := GetProcAddress(FLibHandle, 'sk4d_region_is_empty'); - sk4d_region_is_equal := GetProcAddress(FLibHandle, 'sk4d_region_is_equal'); - sk4d_region_is_rect := GetProcAddress(FLibHandle, 'sk4d_region_is_rect'); - sk4d_region_op := GetProcAddress(FLibHandle, 'sk4d_region_op'); - sk4d_region_op2 := GetProcAddress(FLibHandle, 'sk4d_region_op2'); - sk4d_region_quick_contains := GetProcAddress(FLibHandle, 'sk4d_region_quick_contains'); - sk4d_region_quick_reject := GetProcAddress(FLibHandle, 'sk4d_region_quick_reject'); - sk4d_region_quick_reject2 := GetProcAddress(FLibHandle, 'sk4d_region_quick_reject2'); - sk4d_region_set_empty := GetProcAddress(FLibHandle, 'sk4d_region_set_empty'); - sk4d_region_set_path := GetProcAddress(FLibHandle, 'sk4d_region_set_path'); - sk4d_region_set_rect := GetProcAddress(FLibHandle, 'sk4d_region_set_rect'); - sk4d_region_set_rects := GetProcAddress(FLibHandle, 'sk4d_region_set_rects'); - sk4d_region_translate := GetProcAddress(FLibHandle, 'sk4d_region_translate'); - sk4d_regioncliperator_create := GetProcAddress(FLibHandle, 'sk4d_regioncliperator_create'); - sk4d_regioncliperator_destroy := GetProcAddress(FLibHandle, 'sk4d_regioncliperator_destroy'); - sk4d_regioncliperator_get_current := GetProcAddress(FLibHandle, 'sk4d_regioncliperator_get_current'); - sk4d_regioncliperator_move_next := GetProcAddress(FLibHandle, 'sk4d_regioncliperator_move_next'); - sk4d_regioniterator_create := GetProcAddress(FLibHandle, 'sk4d_regioniterator_create'); - sk4d_regioniterator_destroy := GetProcAddress(FLibHandle, 'sk4d_regioniterator_destroy'); - sk4d_regioniterator_get_current := GetProcAddress(FLibHandle, 'sk4d_regioniterator_get_current'); - sk4d_regioniterator_move_next := GetProcAddress(FLibHandle, 'sk4d_regioniterator_move_next'); - sk4d_regioniterator_reset := GetProcAddress(FLibHandle, 'sk4d_regioniterator_reset'); - sk4d_regionspanerator_create := GetProcAddress(FLibHandle, 'sk4d_regionspanerator_create'); - sk4d_regionspanerator_destroy := GetProcAddress(FLibHandle, 'sk4d_regionspanerator_destroy'); - sk4d_regionspanerator_next := GetProcAddress(FLibHandle, 'sk4d_regionspanerator_next'); - {$ELSE} - class function TSkiaAPI.sk4d_region_contains; external TSkiaAPI.LibName name 'sk4d_region_contains'; - class function TSkiaAPI.sk4d_region_contains2; external TSkiaAPI.LibName name 'sk4d_region_contains2'; - class function TSkiaAPI.sk4d_region_contains3; external TSkiaAPI.LibName name 'sk4d_region_contains3'; - class function TSkiaAPI.sk4d_region_create; external TSkiaAPI.LibName name 'sk4d_region_create'; - class function TSkiaAPI.sk4d_region_create2; external TSkiaAPI.LibName name 'sk4d_region_create2'; - class procedure TSkiaAPI.sk4d_region_destroy; external TSkiaAPI.LibName name 'sk4d_region_destroy'; - class function TSkiaAPI.sk4d_region_get_boundary_path; external TSkiaAPI.LibName name 'sk4d_region_get_boundary_path'; - class procedure TSkiaAPI.sk4d_region_get_bounds; external TSkiaAPI.LibName name 'sk4d_region_get_bounds'; - class function TSkiaAPI.sk4d_region_intersects; external TSkiaAPI.LibName name 'sk4d_region_intersects'; - class function TSkiaAPI.sk4d_region_intersects2; external TSkiaAPI.LibName name 'sk4d_region_intersects2'; - class function TSkiaAPI.sk4d_region_is_complex; external TSkiaAPI.LibName name 'sk4d_region_is_complex'; - class function TSkiaAPI.sk4d_region_is_empty; external TSkiaAPI.LibName name 'sk4d_region_is_empty'; - class function TSkiaAPI.sk4d_region_is_equal; external TSkiaAPI.LibName name 'sk4d_region_is_equal'; - class function TSkiaAPI.sk4d_region_is_rect; external TSkiaAPI.LibName name 'sk4d_region_is_rect'; - class function TSkiaAPI.sk4d_region_op; external TSkiaAPI.LibName name 'sk4d_region_op'; - class function TSkiaAPI.sk4d_region_op2; external TSkiaAPI.LibName name 'sk4d_region_op2'; - class function TSkiaAPI.sk4d_region_quick_contains; external TSkiaAPI.LibName name 'sk4d_region_quick_contains'; - class function TSkiaAPI.sk4d_region_quick_reject; external TSkiaAPI.LibName name 'sk4d_region_quick_reject'; - class function TSkiaAPI.sk4d_region_quick_reject2; external TSkiaAPI.LibName name 'sk4d_region_quick_reject2'; - class procedure TSkiaAPI.sk4d_region_set_empty; external TSkiaAPI.LibName name 'sk4d_region_set_empty'; - class function TSkiaAPI.sk4d_region_set_path; external TSkiaAPI.LibName name 'sk4d_region_set_path'; - class function TSkiaAPI.sk4d_region_set_rect; external TSkiaAPI.LibName name 'sk4d_region_set_rect'; - class function TSkiaAPI.sk4d_region_set_rects; external TSkiaAPI.LibName name 'sk4d_region_set_rects'; - class procedure TSkiaAPI.sk4d_region_translate; external TSkiaAPI.LibName name 'sk4d_region_translate'; - class function TSkiaAPI.sk4d_regioncliperator_create; external TSkiaAPI.LibName name 'sk4d_regioncliperator_create'; - class procedure TSkiaAPI.sk4d_regioncliperator_destroy; external TSkiaAPI.LibName name 'sk4d_regioncliperator_destroy'; - class procedure TSkiaAPI.sk4d_regioncliperator_get_current; external TSkiaAPI.LibName name 'sk4d_regioncliperator_get_current'; - class function TSkiaAPI.sk4d_regioncliperator_move_next; external TSkiaAPI.LibName name 'sk4d_regioncliperator_move_next'; - class function TSkiaAPI.sk4d_regioniterator_create; external TSkiaAPI.LibName name 'sk4d_regioniterator_create'; - class procedure TSkiaAPI.sk4d_regioniterator_destroy; external TSkiaAPI.LibName name 'sk4d_regioniterator_destroy'; - class procedure TSkiaAPI.sk4d_regioniterator_get_current; external TSkiaAPI.LibName name 'sk4d_regioniterator_get_current'; - class function TSkiaAPI.sk4d_regioniterator_move_next; external TSkiaAPI.LibName name 'sk4d_regioniterator_move_next'; - class procedure TSkiaAPI.sk4d_regioniterator_reset; external TSkiaAPI.LibName name 'sk4d_regioniterator_reset'; - class function TSkiaAPI.sk4d_regionspanerator_create; external TSkiaAPI.LibName name 'sk4d_regionspanerator_create'; - class procedure TSkiaAPI.sk4d_regionspanerator_destroy; external TSkiaAPI.LibName name 'sk4d_regionspanerator_destroy'; - class function TSkiaAPI.sk4d_regionspanerator_next; external TSkiaAPI.LibName name 'sk4d_regionspanerator_next'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_rrect.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_rrect_contains := GetProcAddress(FLibHandle, 'sk4d_rrect_contains'); - sk4d_rrect_create := GetProcAddress(FLibHandle, 'sk4d_rrect_create'); - sk4d_rrect_create2 := GetProcAddress(FLibHandle, 'sk4d_rrect_create2'); - sk4d_rrect_deflate := GetProcAddress(FLibHandle, 'sk4d_rrect_deflate'); - sk4d_rrect_destroy := GetProcAddress(FLibHandle, 'sk4d_rrect_destroy'); - sk4d_rrect_get_height := GetProcAddress(FLibHandle, 'sk4d_rrect_get_height'); - sk4d_rrect_get_radii := GetProcAddress(FLibHandle, 'sk4d_rrect_get_radii'); - sk4d_rrect_get_rect := GetProcAddress(FLibHandle, 'sk4d_rrect_get_rect'); - sk4d_rrect_get_simple_radii := GetProcAddress(FLibHandle, 'sk4d_rrect_get_simple_radii'); - sk4d_rrect_get_width := GetProcAddress(FLibHandle, 'sk4d_rrect_get_width'); - sk4d_rrect_inflate := GetProcAddress(FLibHandle, 'sk4d_rrect_inflate'); - sk4d_rrect_is_complex := GetProcAddress(FLibHandle, 'sk4d_rrect_is_complex'); - sk4d_rrect_is_empty := GetProcAddress(FLibHandle, 'sk4d_rrect_is_empty'); - sk4d_rrect_is_equal := GetProcAddress(FLibHandle, 'sk4d_rrect_is_equal'); - sk4d_rrect_is_nine_patch := GetProcAddress(FLibHandle, 'sk4d_rrect_is_nine_patch'); - sk4d_rrect_is_oval := GetProcAddress(FLibHandle, 'sk4d_rrect_is_oval'); - sk4d_rrect_is_rect := GetProcAddress(FLibHandle, 'sk4d_rrect_is_rect'); - sk4d_rrect_is_simple := GetProcAddress(FLibHandle, 'sk4d_rrect_is_simple'); - sk4d_rrect_is_valid := GetProcAddress(FLibHandle, 'sk4d_rrect_is_valid'); - sk4d_rrect_offset := GetProcAddress(FLibHandle, 'sk4d_rrect_offset'); - sk4d_rrect_set_empty := GetProcAddress(FLibHandle, 'sk4d_rrect_set_empty'); - sk4d_rrect_set_nine_patch := GetProcAddress(FLibHandle, 'sk4d_rrect_set_nine_patch'); - sk4d_rrect_set_oval := GetProcAddress(FLibHandle, 'sk4d_rrect_set_oval'); - sk4d_rrect_set_rect := GetProcAddress(FLibHandle, 'sk4d_rrect_set_rect'); - sk4d_rrect_set_rect2 := GetProcAddress(FLibHandle, 'sk4d_rrect_set_rect2'); - sk4d_rrect_set_rect3 := GetProcAddress(FLibHandle, 'sk4d_rrect_set_rect3'); - sk4d_rrect_transform := GetProcAddress(FLibHandle, 'sk4d_rrect_transform'); - {$ELSE} - class function TSkiaAPI.sk4d_rrect_contains; external TSkiaAPI.LibName name 'sk4d_rrect_contains'; - class function TSkiaAPI.sk4d_rrect_create; external TSkiaAPI.LibName name 'sk4d_rrect_create'; - class function TSkiaAPI.sk4d_rrect_create2; external TSkiaAPI.LibName name 'sk4d_rrect_create2'; - class procedure TSkiaAPI.sk4d_rrect_deflate; external TSkiaAPI.LibName name 'sk4d_rrect_deflate'; - class procedure TSkiaAPI.sk4d_rrect_destroy; external TSkiaAPI.LibName name 'sk4d_rrect_destroy'; - class function TSkiaAPI.sk4d_rrect_get_height; external TSkiaAPI.LibName name 'sk4d_rrect_get_height'; - class procedure TSkiaAPI.sk4d_rrect_get_radii; external TSkiaAPI.LibName name 'sk4d_rrect_get_radii'; - class procedure TSkiaAPI.sk4d_rrect_get_rect; external TSkiaAPI.LibName name 'sk4d_rrect_get_rect'; - class procedure TSkiaAPI.sk4d_rrect_get_simple_radii; external TSkiaAPI.LibName name 'sk4d_rrect_get_simple_radii'; - class function TSkiaAPI.sk4d_rrect_get_width; external TSkiaAPI.LibName name 'sk4d_rrect_get_width'; - class procedure TSkiaAPI.sk4d_rrect_inflate; external TSkiaAPI.LibName name 'sk4d_rrect_inflate'; - class function TSkiaAPI.sk4d_rrect_is_complex; external TSkiaAPI.LibName name 'sk4d_rrect_is_complex'; - class function TSkiaAPI.sk4d_rrect_is_empty; external TSkiaAPI.LibName name 'sk4d_rrect_is_empty'; - class function TSkiaAPI.sk4d_rrect_is_equal; external TSkiaAPI.LibName name 'sk4d_rrect_is_equal'; - class function TSkiaAPI.sk4d_rrect_is_nine_patch; external TSkiaAPI.LibName name 'sk4d_rrect_is_nine_patch'; - class function TSkiaAPI.sk4d_rrect_is_oval; external TSkiaAPI.LibName name 'sk4d_rrect_is_oval'; - class function TSkiaAPI.sk4d_rrect_is_rect; external TSkiaAPI.LibName name 'sk4d_rrect_is_rect'; - class function TSkiaAPI.sk4d_rrect_is_simple; external TSkiaAPI.LibName name 'sk4d_rrect_is_simple'; - class function TSkiaAPI.sk4d_rrect_is_valid; external TSkiaAPI.LibName name 'sk4d_rrect_is_valid'; - class procedure TSkiaAPI.sk4d_rrect_offset; external TSkiaAPI.LibName name 'sk4d_rrect_offset'; - class procedure TSkiaAPI.sk4d_rrect_set_empty; external TSkiaAPI.LibName name 'sk4d_rrect_set_empty'; - class procedure TSkiaAPI.sk4d_rrect_set_nine_patch; external TSkiaAPI.LibName name 'sk4d_rrect_set_nine_patch'; - class procedure TSkiaAPI.sk4d_rrect_set_oval; external TSkiaAPI.LibName name 'sk4d_rrect_set_oval'; - class procedure TSkiaAPI.sk4d_rrect_set_rect; external TSkiaAPI.LibName name 'sk4d_rrect_set_rect'; - class procedure TSkiaAPI.sk4d_rrect_set_rect2; external TSkiaAPI.LibName name 'sk4d_rrect_set_rect2'; - class procedure TSkiaAPI.sk4d_rrect_set_rect3; external TSkiaAPI.LibName name 'sk4d_rrect_set_rect3'; - class function TSkiaAPI.sk4d_rrect_transform; external TSkiaAPI.LibName name 'sk4d_rrect_transform'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_runtimeeffect.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_runtimeeffect_get_child_count := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_get_child_count'); - sk4d_runtimeeffect_get_child_name := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_get_child_name'); - sk4d_runtimeeffect_get_child_type := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_get_child_type'); - sk4d_runtimeeffect_get_uniform_count := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_get_uniform_count'); - sk4d_runtimeeffect_get_uniform_data_size := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_get_uniform_data_size'); - sk4d_runtimeeffect_get_uniform_name := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_get_uniform_name'); - sk4d_runtimeeffect_get_uniform_offset := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_get_uniform_offset'); - sk4d_runtimeeffect_get_uniform_type := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_get_uniform_type'); - sk4d_runtimeeffect_get_uniform_type_count := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_get_uniform_type_count'); - sk4d_runtimeeffect_index_of_child := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_index_of_child'); - sk4d_runtimeeffect_index_of_uniform := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_index_of_uniform'); - sk4d_runtimeeffect_make_blender := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_make_blender'); - sk4d_runtimeeffect_make_color_filter := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_make_color_filter'); - sk4d_runtimeeffect_make_for_blender := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_make_for_blender'); - sk4d_runtimeeffect_make_for_color_filter := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_make_for_color_filter'); - sk4d_runtimeeffect_make_for_shader := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_make_for_shader'); - sk4d_runtimeeffect_make_image := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_make_image'); - sk4d_runtimeeffect_make_shader := GetProcAddress(FLibHandle, 'sk4d_runtimeeffect_make_shader'); - {$ELSE} - class function TSkiaAPI.sk4d_runtimeeffect_get_child_count; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_get_child_count'; - class function TSkiaAPI.sk4d_runtimeeffect_get_child_name; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_get_child_name'; - class function TSkiaAPI.sk4d_runtimeeffect_get_child_type; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_get_child_type'; - class function TSkiaAPI.sk4d_runtimeeffect_get_uniform_count; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_get_uniform_count'; - class function TSkiaAPI.sk4d_runtimeeffect_get_uniform_data_size; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_get_uniform_data_size'; - class function TSkiaAPI.sk4d_runtimeeffect_get_uniform_name; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_get_uniform_name'; - class function TSkiaAPI.sk4d_runtimeeffect_get_uniform_offset; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_get_uniform_offset'; - class function TSkiaAPI.sk4d_runtimeeffect_get_uniform_type; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_get_uniform_type'; - class function TSkiaAPI.sk4d_runtimeeffect_get_uniform_type_count; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_get_uniform_type_count'; - class function TSkiaAPI.sk4d_runtimeeffect_index_of_child; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_index_of_child'; - class function TSkiaAPI.sk4d_runtimeeffect_index_of_uniform; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_index_of_uniform'; - class function TSkiaAPI.sk4d_runtimeeffect_make_blender; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_make_blender'; - class function TSkiaAPI.sk4d_runtimeeffect_make_color_filter; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_make_color_filter'; - class function TSkiaAPI.sk4d_runtimeeffect_make_for_blender; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_make_for_blender'; - class function TSkiaAPI.sk4d_runtimeeffect_make_for_color_filter; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_make_for_color_filter'; - class function TSkiaAPI.sk4d_runtimeeffect_make_for_shader; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_make_for_shader'; - class function TSkiaAPI.sk4d_runtimeeffect_make_image; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_make_image'; - class function TSkiaAPI.sk4d_runtimeeffect_make_shader; external TSkiaAPI.LibName name 'sk4d_runtimeeffect_make_shader'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_shader.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_shader_make_blend := GetProcAddress(FLibHandle, 'sk4d_shader_make_blend'); - sk4d_shader_make_color := GetProcAddress(FLibHandle, 'sk4d_shader_make_color'); - sk4d_shader_make_color2 := GetProcAddress(FLibHandle, 'sk4d_shader_make_color2'); - sk4d_shader_make_gradient_linear := GetProcAddress(FLibHandle, 'sk4d_shader_make_gradient_linear'); - sk4d_shader_make_gradient_linear2 := GetProcAddress(FLibHandle, 'sk4d_shader_make_gradient_linear2'); - sk4d_shader_make_gradient_radial := GetProcAddress(FLibHandle, 'sk4d_shader_make_gradient_radial'); - sk4d_shader_make_gradient_radial2 := GetProcAddress(FLibHandle, 'sk4d_shader_make_gradient_radial2'); - sk4d_shader_make_gradient_sweep := GetProcAddress(FLibHandle, 'sk4d_shader_make_gradient_sweep'); - sk4d_shader_make_gradient_sweep2 := GetProcAddress(FLibHandle, 'sk4d_shader_make_gradient_sweep2'); - sk4d_shader_make_gradient_two_point_conical := GetProcAddress(FLibHandle, 'sk4d_shader_make_gradient_two_point_conical'); - sk4d_shader_make_gradient_two_point_conical2 := GetProcAddress(FLibHandle, 'sk4d_shader_make_gradient_two_point_conical2'); - sk4d_shader_make_perlin_noise_fractal_noise := GetProcAddress(FLibHandle, 'sk4d_shader_make_perlin_noise_fractal_noise'); - sk4d_shader_make_perlin_noise_turbulence := GetProcAddress(FLibHandle, 'sk4d_shader_make_perlin_noise_turbulence'); - sk4d_shader_make_with_color_filter := GetProcAddress(FLibHandle, 'sk4d_shader_make_with_color_filter'); - sk4d_shader_make_with_local_matrix := GetProcAddress(FLibHandle, 'sk4d_shader_make_with_local_matrix'); - {$ELSE} - class function TSkiaAPI.sk4d_shader_make_blend; external TSkiaAPI.LibName name 'sk4d_shader_make_blend'; - class function TSkiaAPI.sk4d_shader_make_color; external TSkiaAPI.LibName name 'sk4d_shader_make_color'; - class function TSkiaAPI.sk4d_shader_make_color2; external TSkiaAPI.LibName name 'sk4d_shader_make_color2'; - class function TSkiaAPI.sk4d_shader_make_gradient_linear; external TSkiaAPI.LibName name 'sk4d_shader_make_gradient_linear'; - class function TSkiaAPI.sk4d_shader_make_gradient_linear2; external TSkiaAPI.LibName name 'sk4d_shader_make_gradient_linear2'; - class function TSkiaAPI.sk4d_shader_make_gradient_radial; external TSkiaAPI.LibName name 'sk4d_shader_make_gradient_radial'; - class function TSkiaAPI.sk4d_shader_make_gradient_radial2; external TSkiaAPI.LibName name 'sk4d_shader_make_gradient_radial2'; - class function TSkiaAPI.sk4d_shader_make_gradient_sweep; external TSkiaAPI.LibName name 'sk4d_shader_make_gradient_sweep'; - class function TSkiaAPI.sk4d_shader_make_gradient_sweep2; external TSkiaAPI.LibName name 'sk4d_shader_make_gradient_sweep2'; - class function TSkiaAPI.sk4d_shader_make_gradient_two_point_conical; external TSkiaAPI.LibName name 'sk4d_shader_make_gradient_two_point_conical'; - class function TSkiaAPI.sk4d_shader_make_gradient_two_point_conical2; external TSkiaAPI.LibName name 'sk4d_shader_make_gradient_two_point_conical2'; - class function TSkiaAPI.sk4d_shader_make_perlin_noise_fractal_noise; external TSkiaAPI.LibName name 'sk4d_shader_make_perlin_noise_fractal_noise'; - class function TSkiaAPI.sk4d_shader_make_perlin_noise_turbulence; external TSkiaAPI.LibName name 'sk4d_shader_make_perlin_noise_turbulence'; - class function TSkiaAPI.sk4d_shader_make_with_color_filter; external TSkiaAPI.LibName name 'sk4d_shader_make_with_color_filter'; - class function TSkiaAPI.sk4d_shader_make_with_local_matrix; external TSkiaAPI.LibName name 'sk4d_shader_make_with_local_matrix'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_stream.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_streamadapter_create := GetProcAddress(FLibHandle, 'sk4d_streamadapter_create'); - sk4d_streamadapter_destroy := GetProcAddress(FLibHandle, 'sk4d_streamadapter_destroy'); - sk4d_streamadapter_set_procs := GetProcAddress(FLibHandle, 'sk4d_streamadapter_set_procs'); - sk4d_wstreamadapter_create := GetProcAddress(FLibHandle, 'sk4d_wstreamadapter_create'); - sk4d_wstreamadapter_destroy := GetProcAddress(FLibHandle, 'sk4d_wstreamadapter_destroy'); - sk4d_wstreamadapter_set_procs := GetProcAddress(FLibHandle, 'sk4d_wstreamadapter_set_procs'); - {$ELSE} - class function TSkiaAPI.sk4d_streamadapter_create; external TSkiaAPI.LibName name 'sk4d_streamadapter_create'; - class procedure TSkiaAPI.sk4d_streamadapter_destroy; external TSkiaAPI.LibName name 'sk4d_streamadapter_destroy'; - class procedure TSkiaAPI.sk4d_streamadapter_set_procs; external TSkiaAPI.LibName name 'sk4d_streamadapter_set_procs'; - class function TSkiaAPI.sk4d_wstreamadapter_create; external TSkiaAPI.LibName name 'sk4d_wstreamadapter_create'; - class procedure TSkiaAPI.sk4d_wstreamadapter_destroy; external TSkiaAPI.LibName name 'sk4d_wstreamadapter_destroy'; - class procedure TSkiaAPI.sk4d_wstreamadapter_set_procs; external TSkiaAPI.LibName name 'sk4d_wstreamadapter_set_procs'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_string.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_string_create := GetProcAddress(FLibHandle, 'sk4d_string_create'); - sk4d_string_destroy := GetProcAddress(FLibHandle, 'sk4d_string_destroy'); - sk4d_string_get_text := GetProcAddress(FLibHandle, 'sk4d_string_get_text'); - sk4d_string_set_text := GetProcAddress(FLibHandle, 'sk4d_string_set_text'); - {$ELSE} - class function TSkiaAPI.sk4d_string_create; external TSkiaAPI.LibName name 'sk4d_string_create'; - class procedure TSkiaAPI.sk4d_string_destroy; external TSkiaAPI.LibName name 'sk4d_string_destroy'; - class function TSkiaAPI.sk4d_string_get_text; external TSkiaAPI.LibName name 'sk4d_string_get_text'; - class procedure TSkiaAPI.sk4d_string_set_text; external TSkiaAPI.LibName name 'sk4d_string_set_text'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_surface.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_surface_draw := GetProcAddress(FLibHandle, 'sk4d_surface_draw'); - sk4d_surface_flush := GetProcAddress(FLibHandle, 'sk4d_surface_flush'); - sk4d_surface_flush_and_submit := GetProcAddress(FLibHandle, 'sk4d_surface_flush_and_submit'); - sk4d_surface_get_canvas := GetProcAddress(FLibHandle, 'sk4d_surface_get_canvas'); - sk4d_surface_get_props := GetProcAddress(FLibHandle, 'sk4d_surface_get_props'); - sk4d_surface_make_from_ca_metal_layer := GetProcAddress(FLibHandle, 'sk4d_surface_make_from_ca_metal_layer'); - sk4d_surface_make_from_mtk_view := GetProcAddress(FLibHandle, 'sk4d_surface_make_from_mtk_view'); - sk4d_surface_make_from_render_target := GetProcAddress(FLibHandle, 'sk4d_surface_make_from_render_target'); - sk4d_surface_make_from_texture := GetProcAddress(FLibHandle, 'sk4d_surface_make_from_texture'); - sk4d_surface_make_image_snapshot := GetProcAddress(FLibHandle, 'sk4d_surface_make_image_snapshot'); - sk4d_surface_make_image_snapshot2 := GetProcAddress(FLibHandle, 'sk4d_surface_make_image_snapshot2'); - sk4d_surface_make_raster := GetProcAddress(FLibHandle, 'sk4d_surface_make_raster'); - sk4d_surface_make_raster_direct := GetProcAddress(FLibHandle, 'sk4d_surface_make_raster_direct'); - sk4d_surface_make_render_target := GetProcAddress(FLibHandle, 'sk4d_surface_make_render_target'); - sk4d_surface_peek_pixels := GetProcAddress(FLibHandle, 'sk4d_surface_peek_pixels'); - sk4d_surface_read_pixels := GetProcAddress(FLibHandle, 'sk4d_surface_read_pixels'); - {$ELSE} - class procedure TSkiaAPI.sk4d_surface_draw; external TSkiaAPI.LibName name 'sk4d_surface_draw'; - class procedure TSkiaAPI.sk4d_surface_flush; external TSkiaAPI.LibName name 'sk4d_surface_flush'; - class procedure TSkiaAPI.sk4d_surface_flush_and_submit; external TSkiaAPI.LibName name 'sk4d_surface_flush_and_submit'; - class function TSkiaAPI.sk4d_surface_get_canvas; external TSkiaAPI.LibName name 'sk4d_surface_get_canvas'; - class procedure TSkiaAPI.sk4d_surface_get_props; external TSkiaAPI.LibName name 'sk4d_surface_get_props'; - class function TSkiaAPI.sk4d_surface_make_from_ca_metal_layer; external TSkiaAPI.LibName name 'sk4d_surface_make_from_ca_metal_layer'; - class function TSkiaAPI.sk4d_surface_make_from_mtk_view; external TSkiaAPI.LibName name 'sk4d_surface_make_from_mtk_view'; - class function TSkiaAPI.sk4d_surface_make_from_render_target; external TSkiaAPI.LibName name 'sk4d_surface_make_from_render_target'; - class function TSkiaAPI.sk4d_surface_make_from_texture; external TSkiaAPI.LibName name 'sk4d_surface_make_from_texture'; - class function TSkiaAPI.sk4d_surface_make_image_snapshot; external TSkiaAPI.LibName name 'sk4d_surface_make_image_snapshot'; - class function TSkiaAPI.sk4d_surface_make_image_snapshot2; external TSkiaAPI.LibName name 'sk4d_surface_make_image_snapshot2'; - class function TSkiaAPI.sk4d_surface_make_raster; external TSkiaAPI.LibName name 'sk4d_surface_make_raster'; - class function TSkiaAPI.sk4d_surface_make_raster_direct; external TSkiaAPI.LibName name 'sk4d_surface_make_raster_direct'; - class function TSkiaAPI.sk4d_surface_make_render_target; external TSkiaAPI.LibName name 'sk4d_surface_make_render_target'; - class function TSkiaAPI.sk4d_surface_peek_pixels; external TSkiaAPI.LibName name 'sk4d_surface_peek_pixels'; - class function TSkiaAPI.sk4d_surface_read_pixels; external TSkiaAPI.LibName name 'sk4d_surface_read_pixels'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_svgcanvas.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_svgcanvas_make := GetProcAddress(FLibHandle, 'sk4d_svgcanvas_make'); - {$ELSE} - class function TSkiaAPI.sk4d_svgcanvas_make; external TSkiaAPI.LibName name 'sk4d_svgcanvas_make'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_textblob.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_textblob_get_intercepts := GetProcAddress(FLibHandle, 'sk4d_textblob_get_intercepts'); - sk4d_textblob_make_from_text := GetProcAddress(FLibHandle, 'sk4d_textblob_make_from_text'); - sk4d_textblob_make_from_text_horizontally_positioned := GetProcAddress(FLibHandle, 'sk4d_textblob_make_from_text_horizontally_positioned'); - sk4d_textblob_make_from_text_positioned := GetProcAddress(FLibHandle, 'sk4d_textblob_make_from_text_positioned'); - sk4d_textblob_make_from_text_transform := GetProcAddress(FLibHandle, 'sk4d_textblob_make_from_text_transform'); - sk4d_textblob_ref := GetProcAddress(FLibHandle, 'sk4d_textblob_ref'); - sk4d_textblob_unref := GetProcAddress(FLibHandle, 'sk4d_textblob_unref'); - {$ELSE} - class function TSkiaAPI.sk4d_textblob_get_intercepts; external TSkiaAPI.LibName name 'sk4d_textblob_get_intercepts'; - class function TSkiaAPI.sk4d_textblob_make_from_text; external TSkiaAPI.LibName name 'sk4d_textblob_make_from_text'; - class function TSkiaAPI.sk4d_textblob_make_from_text_horizontally_positioned; external TSkiaAPI.LibName name 'sk4d_textblob_make_from_text_horizontally_positioned'; - class function TSkiaAPI.sk4d_textblob_make_from_text_positioned; external TSkiaAPI.LibName name 'sk4d_textblob_make_from_text_positioned'; - class function TSkiaAPI.sk4d_textblob_make_from_text_transform; external TSkiaAPI.LibName name 'sk4d_textblob_make_from_text_transform'; - class procedure TSkiaAPI.sk4d_textblob_ref; external TSkiaAPI.LibName name 'sk4d_textblob_ref'; - class procedure TSkiaAPI.sk4d_textblob_unref; external TSkiaAPI.LibName name 'sk4d_textblob_unref'; - - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_tracememorydump.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_tracememorydumpbaseclass_create := GetProcAddress(FLibHandle, 'sk4d_tracememorydumpbaseclass_create'); - sk4d_tracememorydumpbaseclass_destroy := GetProcAddress(FLibHandle, 'sk4d_tracememorydumpbaseclass_destroy'); - sk4d_tracememorydumpbaseclass_set_procs := GetProcAddress(FLibHandle, 'sk4d_tracememorydumpbaseclass_set_procs'); - {$ELSE} - class function TSkiaAPI.sk4d_tracememorydumpbaseclass_create; external TSkiaAPI.LibName name 'sk4d_tracememorydumpbaseclass_create'; - class procedure TSkiaAPI.sk4d_tracememorydumpbaseclass_destroy; external TSkiaAPI.LibName name 'sk4d_tracememorydumpbaseclass_destroy'; - class procedure TSkiaAPI.sk4d_tracememorydumpbaseclass_set_procs; external TSkiaAPI.LibName name 'sk4d_tracememorydumpbaseclass_set_procs'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_typeface.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_typeface_get_family_name := GetProcAddress(FLibHandle, 'sk4d_typeface_get_family_name'); - sk4d_typeface_get_slant := GetProcAddress(FLibHandle, 'sk4d_typeface_get_slant'); - sk4d_typeface_get_style := GetProcAddress(FLibHandle, 'sk4d_typeface_get_style'); - sk4d_typeface_get_weight := GetProcAddress(FLibHandle, 'sk4d_typeface_get_weight'); - sk4d_typeface_get_width := GetProcAddress(FLibHandle, 'sk4d_typeface_get_width'); - sk4d_typeface_make_default := GetProcAddress(FLibHandle, 'sk4d_typeface_make_default'); - sk4d_typeface_make_from_file := GetProcAddress(FLibHandle, 'sk4d_typeface_make_from_file'); - sk4d_typeface_make_from_stream := GetProcAddress(FLibHandle, 'sk4d_typeface_make_from_stream'); - sk4d_typeface_make_from_name := GetProcAddress(FLibHandle, 'sk4d_typeface_make_from_name'); - {$ELSE} - class function TSkiaAPI.sk4d_typeface_get_family_name; external TSkiaAPI.LibName name 'sk4d_typeface_get_family_name'; - class function TSkiaAPI.sk4d_typeface_get_slant; external TSkiaAPI.LibName name 'sk4d_typeface_get_slant'; - class procedure TSkiaAPI.sk4d_typeface_get_style; external TSkiaAPI.LibName name 'sk4d_typeface_get_style'; - class function TSkiaAPI.sk4d_typeface_get_weight; external TSkiaAPI.LibName name 'sk4d_typeface_get_weight'; - class function TSkiaAPI.sk4d_typeface_get_width; external TSkiaAPI.LibName name 'sk4d_typeface_get_width'; - class function TSkiaAPI.sk4d_typeface_make_default; external TSkiaAPI.LibName name 'sk4d_typeface_make_default'; - class function TSkiaAPI.sk4d_typeface_make_from_file; external TSkiaAPI.LibName name 'sk4d_typeface_make_from_file'; - class function TSkiaAPI.sk4d_typeface_make_from_stream; external TSkiaAPI.LibName name 'sk4d_typeface_make_from_stream'; - class function TSkiaAPI.sk4d_typeface_make_from_name; external TSkiaAPI.LibName name 'sk4d_typeface_make_from_name'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_version.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_library_version_get_build := GetProcAddress(FLibHandle, 'sk4d_library_version_get_build'); - sk4d_library_version_get_major := GetProcAddress(FLibHandle, 'sk4d_library_version_get_major'); - sk4d_library_version_get_minor := GetProcAddress(FLibHandle, 'sk4d_library_version_get_minor'); - {$ELSE} - class function TSkiaAPI.sk4d_library_version_get_build; external TSkiaAPI.LibName name 'sk4d_library_version_get_build'; - class function TSkiaAPI.sk4d_library_version_get_major; external TSkiaAPI.LibName name 'sk4d_library_version_get_major'; - class function TSkiaAPI.sk4d_library_version_get_minor; external TSkiaAPI.LibName name 'sk4d_library_version_get_minor'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'include/c/sk4d_vertices.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_vertices_make_copy := GetProcAddress(FLibHandle, 'sk4d_vertices_make_copy'); - sk4d_vertices_ref := GetProcAddress(FLibHandle, 'sk4d_vertices_ref'); - sk4d_vertices_unref := GetProcAddress(FLibHandle, 'sk4d_vertices_unref'); - {$ELSE} - class function TSkiaAPI.sk4d_vertices_make_copy; external TSkiaAPI.LibName name 'sk4d_vertices_make_copy'; - class procedure TSkiaAPI.sk4d_vertices_ref; external TSkiaAPI.LibName name 'sk4d_vertices_ref'; - class procedure TSkiaAPI.sk4d_vertices_unref; external TSkiaAPI.LibName name 'sk4d_vertices_unref'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/particles/include/sk4d_particleeffect.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_particleeffect_get_position := GetProcAddress(FLibHandle, 'sk4d_particleeffect_get_position'); - sk4d_particleeffect_get_rate := GetProcAddress(FLibHandle, 'sk4d_particleeffect_get_rate'); - sk4d_particleeffect_get_uniform := GetProcAddress(FLibHandle, 'sk4d_particleeffect_get_uniform'); - sk4d_particleeffect_get_uniform_count := GetProcAddress(FLibHandle, 'sk4d_particleeffect_get_uniform_count'); - sk4d_particleeffect_get_uniform_data := GetProcAddress(FLibHandle, 'sk4d_particleeffect_get_uniform_data'); - sk4d_particleeffect_get_uniform_data_count := GetProcAddress(FLibHandle, 'sk4d_particleeffect_get_uniform_data_count'); - sk4d_particleeffect_get_uniform_name := GetProcAddress(FLibHandle, 'sk4d_particleeffect_get_uniform_name'); - sk4d_particleeffect_init := GetProcAddress(FLibHandle, 'sk4d_particleeffect_init'); - sk4d_particleeffect_make_from_file := GetProcAddress(FLibHandle, 'sk4d_particleeffect_make_from_file'); - sk4d_particleeffect_make_from_stream := GetProcAddress(FLibHandle, 'sk4d_particleeffect_make_from_stream'); - sk4d_particleeffect_render := GetProcAddress(FLibHandle, 'sk4d_particleeffect_render'); - sk4d_particleeffect_set_position := GetProcAddress(FLibHandle, 'sk4d_particleeffect_set_position'); - sk4d_particleeffect_set_rate := GetProcAddress(FLibHandle, 'sk4d_particleeffect_set_rate'); - sk4d_particleeffect_set_uniform := GetProcAddress(FLibHandle, 'sk4d_particleeffect_set_uniform'); - sk4d_particleeffect_start := GetProcAddress(FLibHandle, 'sk4d_particleeffect_start'); - sk4d_particleeffect_update := GetProcAddress(FLibHandle, 'sk4d_particleeffect_update'); - {$ELSE} - class procedure TSkiaAPI.sk4d_particleeffect_get_position; external TSkiaAPI.LibName name 'sk4d_particleeffect_get_position'; - class function TSkiaAPI.sk4d_particleeffect_get_rate; external TSkiaAPI.LibName name 'sk4d_particleeffect_get_rate'; - class procedure TSkiaAPI.sk4d_particleeffect_get_uniform; external TSkiaAPI.LibName name 'sk4d_particleeffect_get_uniform'; - class function TSkiaAPI.sk4d_particleeffect_get_uniform_count; external TSkiaAPI.LibName name 'sk4d_particleeffect_get_uniform_count'; - class function TSkiaAPI.sk4d_particleeffect_get_uniform_data; external TSkiaAPI.LibName name 'sk4d_particleeffect_get_uniform_data'; - class function TSkiaAPI.sk4d_particleeffect_get_uniform_data_count; external TSkiaAPI.LibName name 'sk4d_particleeffect_get_uniform_data_count'; - class function TSkiaAPI.sk4d_particleeffect_get_uniform_name; external TSkiaAPI.LibName name 'sk4d_particleeffect_get_uniform_name'; - class procedure TSkiaAPI.sk4d_particleeffect_init; external TSkiaAPI.LibName name 'sk4d_particleeffect_init'; - class function TSkiaAPI.sk4d_particleeffect_make_from_file; external TSkiaAPI.LibName name 'sk4d_particleeffect_make_from_file'; - class function TSkiaAPI.sk4d_particleeffect_make_from_stream; external TSkiaAPI.LibName name 'sk4d_particleeffect_make_from_stream'; - class procedure TSkiaAPI.sk4d_particleeffect_render; external TSkiaAPI.LibName name 'sk4d_particleeffect_render'; - class procedure TSkiaAPI.sk4d_particleeffect_set_position; external TSkiaAPI.LibName name 'sk4d_particleeffect_set_position'; - class procedure TSkiaAPI.sk4d_particleeffect_set_rate; external TSkiaAPI.LibName name 'sk4d_particleeffect_set_rate'; - class function TSkiaAPI.sk4d_particleeffect_set_uniform; external TSkiaAPI.LibName name 'sk4d_particleeffect_set_uniform'; - class procedure TSkiaAPI.sk4d_particleeffect_start; external TSkiaAPI.LibName name 'sk4d_particleeffect_start'; - class procedure TSkiaAPI.sk4d_particleeffect_update; external TSkiaAPI.LibName name 'sk4d_particleeffect_update'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skottie/include/sk4d_skottie.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_skottieanimation_get_duration := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_get_duration'); - sk4d_skottieanimation_get_fps := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_get_fps'); - sk4d_skottieanimation_get_in_point := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_get_in_point'); - sk4d_skottieanimation_get_out_point := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_get_out_point'); - sk4d_skottieanimation_get_size := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_get_size'); - sk4d_skottieanimation_get_version := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_get_version'); - sk4d_skottieanimation_make_from_file := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_make_from_file'); - sk4d_skottieanimation_make_from_stream := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_make_from_stream'); - sk4d_skottieanimation_ref := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_ref'); - sk4d_skottieanimation_render := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_render'); - sk4d_skottieanimation_seek_frame := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_seek_frame'); - sk4d_skottieanimation_seek_frame_time := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_seek_frame_time'); - sk4d_skottieanimation_unref := GetProcAddress(FLibHandle, 'sk4d_skottieanimation_unref'); - {$ELSE} - class function TSkiaAPI.sk4d_skottieanimation_get_duration; external TSkiaAPI.LibName name 'sk4d_skottieanimation_get_duration'; - class function TSkiaAPI.sk4d_skottieanimation_get_fps; external TSkiaAPI.LibName name 'sk4d_skottieanimation_get_fps'; - class function TSkiaAPI.sk4d_skottieanimation_get_in_point; external TSkiaAPI.LibName name 'sk4d_skottieanimation_get_in_point'; - class function TSkiaAPI.sk4d_skottieanimation_get_out_point; external TSkiaAPI.LibName name 'sk4d_skottieanimation_get_out_point'; - class procedure TSkiaAPI.sk4d_skottieanimation_get_size; external TSkiaAPI.LibName name 'sk4d_skottieanimation_get_size'; - class function TSkiaAPI.sk4d_skottieanimation_get_version; external TSkiaAPI.LibName name 'sk4d_skottieanimation_get_version'; - class function TSkiaAPI.sk4d_skottieanimation_make_from_file; external TSkiaAPI.LibName name 'sk4d_skottieanimation_make_from_file'; - class function TSkiaAPI.sk4d_skottieanimation_make_from_stream; external TSkiaAPI.LibName name 'sk4d_skottieanimation_make_from_stream'; - class procedure TSkiaAPI.sk4d_skottieanimation_ref; external TSkiaAPI.LibName name 'sk4d_skottieanimation_ref'; - class procedure TSkiaAPI.sk4d_skottieanimation_render; external TSkiaAPI.LibName name 'sk4d_skottieanimation_render'; - class procedure TSkiaAPI.sk4d_skottieanimation_seek_frame; external TSkiaAPI.LibName name 'sk4d_skottieanimation_seek_frame'; - class procedure TSkiaAPI.sk4d_skottieanimation_seek_frame_time; external TSkiaAPI.LibName name 'sk4d_skottieanimation_seek_frame_time'; - class procedure TSkiaAPI.sk4d_skottieanimation_unref; external TSkiaAPI.LibName name 'sk4d_skottieanimation_unref'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_paragraph.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_paragraph_destroy := GetProcAddress(FLibHandle, 'sk4d_paragraph_destroy'); - sk4d_paragraph_did_exceed_max_lines := GetProcAddress(FLibHandle, 'sk4d_paragraph_did_exceed_max_lines'); - sk4d_paragraph_get_alphabetic_baseline := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_alphabetic_baseline'); - sk4d_paragraph_get_glyph_position_at_coordinate := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_glyph_position_at_coordinate'); - sk4d_paragraph_get_height := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_height'); - sk4d_paragraph_get_ideographic_baseline := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_ideographic_baseline'); - sk4d_paragraph_get_line_metrics := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_line_metrics'); - sk4d_paragraph_get_longest_line := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_longest_line'); - sk4d_paragraph_get_max_intrinsic_width := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_max_intrinsic_width'); - sk4d_paragraph_get_max_width := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_max_width'); - sk4d_paragraph_get_min_intrinsic_width := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_min_intrinsic_width'); - sk4d_paragraph_get_rects_for_placeholders := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_rects_for_placeholders'); - sk4d_paragraph_get_rects_for_range := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_rects_for_range'); - sk4d_paragraph_get_word_boundary := GetProcAddress(FLibHandle, 'sk4d_paragraph_get_word_boundary'); - sk4d_paragraph_layout := GetProcAddress(FLibHandle, 'sk4d_paragraph_layout'); - sk4d_paragraph_paint := GetProcAddress(FLibHandle, 'sk4d_paragraph_paint'); - sk4d_paragraph_to_path := GetProcAddress(FLibHandle, 'sk4d_paragraph_to_path'); - {$ELSE} - class procedure TSkiaAPI.sk4d_paragraph_destroy; external TSkiaAPI.LibName name 'sk4d_paragraph_destroy'; - class function TSkiaAPI.sk4d_paragraph_did_exceed_max_lines; external TSkiaAPI.LibName name 'sk4d_paragraph_did_exceed_max_lines'; - class function TSkiaAPI.sk4d_paragraph_get_alphabetic_baseline; external TSkiaAPI.LibName name 'sk4d_paragraph_get_alphabetic_baseline'; - class procedure TSkiaAPI.sk4d_paragraph_get_glyph_position_at_coordinate; external TSkiaAPI.LibName name 'sk4d_paragraph_get_glyph_position_at_coordinate'; - class function TSkiaAPI.sk4d_paragraph_get_height; external TSkiaAPI.LibName name 'sk4d_paragraph_get_height'; - class function TSkiaAPI.sk4d_paragraph_get_ideographic_baseline; external TSkiaAPI.LibName name 'sk4d_paragraph_get_ideographic_baseline'; - class function TSkiaAPI.sk4d_paragraph_get_line_metrics; external TSkiaAPI.LibName name 'sk4d_paragraph_get_line_metrics'; - class function TSkiaAPI.sk4d_paragraph_get_longest_line; external TSkiaAPI.LibName name 'sk4d_paragraph_get_longest_line'; - class function TSkiaAPI.sk4d_paragraph_get_max_intrinsic_width; external TSkiaAPI.LibName name 'sk4d_paragraph_get_max_intrinsic_width'; - class function TSkiaAPI.sk4d_paragraph_get_max_width; external TSkiaAPI.LibName name 'sk4d_paragraph_get_max_width'; - class function TSkiaAPI.sk4d_paragraph_get_min_intrinsic_width; external TSkiaAPI.LibName name 'sk4d_paragraph_get_min_intrinsic_width'; - class function TSkiaAPI.sk4d_paragraph_get_rects_for_placeholders; external TSkiaAPI.LibName name 'sk4d_paragraph_get_rects_for_placeholders'; - class function TSkiaAPI.sk4d_paragraph_get_rects_for_range; external TSkiaAPI.LibName name 'sk4d_paragraph_get_rects_for_range'; - class procedure TSkiaAPI.sk4d_paragraph_get_word_boundary; external TSkiaAPI.LibName name 'sk4d_paragraph_get_word_boundary'; - class procedure TSkiaAPI.sk4d_paragraph_layout; external TSkiaAPI.LibName name 'sk4d_paragraph_layout'; - class procedure TSkiaAPI.sk4d_paragraph_paint; external TSkiaAPI.LibName name 'sk4d_paragraph_paint'; - class function TSkiaAPI.sk4d_paragraph_to_path; external TSkiaAPI.LibName name 'sk4d_paragraph_to_path'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_paragraphbuilder.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_paragraphbuilder_add_placeholder := GetProcAddress(FLibHandle, 'sk4d_paragraphbuilder_add_placeholder'); - sk4d_paragraphbuilder_add_text := GetProcAddress(FLibHandle, 'sk4d_paragraphbuilder_add_text'); - sk4d_paragraphbuilder_build := GetProcAddress(FLibHandle, 'sk4d_paragraphbuilder_build'); - sk4d_paragraphbuilder_create := GetProcAddress(FLibHandle, 'sk4d_paragraphbuilder_create'); - sk4d_paragraphbuilder_create2 := GetProcAddress(FLibHandle, 'sk4d_paragraphbuilder_create2'); - sk4d_paragraphbuilder_destroy := GetProcAddress(FLibHandle, 'sk4d_paragraphbuilder_destroy'); - sk4d_paragraphbuilder_pop := GetProcAddress(FLibHandle, 'sk4d_paragraphbuilder_pop'); - sk4d_paragraphbuilder_push_style := GetProcAddress(FLibHandle, 'sk4d_paragraphbuilder_push_style'); - {$ELSE} - class procedure TSkiaAPI.sk4d_paragraphbuilder_add_placeholder; external TSkiaAPI.LibName name 'sk4d_paragraphbuilder_add_placeholder'; - class procedure TSkiaAPI.sk4d_paragraphbuilder_add_text; external TSkiaAPI.LibName name 'sk4d_paragraphbuilder_add_text'; - class function TSkiaAPI.sk4d_paragraphbuilder_build; external TSkiaAPI.LibName name 'sk4d_paragraphbuilder_build'; - class function TSkiaAPI.sk4d_paragraphbuilder_create; external TSkiaAPI.LibName name 'sk4d_paragraphbuilder_create'; - class function TSkiaAPI.sk4d_paragraphbuilder_create2; external TSkiaAPI.LibName name 'sk4d_paragraphbuilder_create2'; - class procedure TSkiaAPI.sk4d_paragraphbuilder_destroy; external TSkiaAPI.LibName name 'sk4d_paragraphbuilder_destroy'; - class procedure TSkiaAPI.sk4d_paragraphbuilder_pop; external TSkiaAPI.LibName name 'sk4d_paragraphbuilder_pop'; - class procedure TSkiaAPI.sk4d_paragraphbuilder_push_style; external TSkiaAPI.LibName name 'sk4d_paragraphbuilder_push_style'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_paragraphstyle.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_paragraphstyle_create := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_create'); - sk4d_paragraphstyle_destroy := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_destroy'); - sk4d_paragraphstyle_disable_hinting := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_disable_hinting'); - sk4d_paragraphstyle_get_ellipsis := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_get_ellipsis'); - sk4d_paragraphstyle_get_height := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_get_height'); - sk4d_paragraphstyle_get_max_lines := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_get_max_lines'); - sk4d_paragraphstyle_get_strut_style := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_get_strut_style'); - sk4d_paragraphstyle_get_text_align := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_get_text_align'); - sk4d_paragraphstyle_get_text_direction := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_get_text_direction'); - sk4d_paragraphstyle_get_text_height_behaviors := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_get_text_height_behaviors'); - sk4d_paragraphstyle_get_text_style := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_get_text_style'); - sk4d_paragraphstyle_set_ellipsis := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_set_ellipsis'); - sk4d_paragraphstyle_set_height := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_set_height'); - sk4d_paragraphstyle_set_max_lines := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_set_max_lines'); - sk4d_paragraphstyle_set_strut_style := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_set_strut_style'); - sk4d_paragraphstyle_set_text_align := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_set_text_align'); - sk4d_paragraphstyle_set_text_direction := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_set_text_direction'); - sk4d_paragraphstyle_set_text_height_behaviors := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_set_text_height_behaviors'); - sk4d_paragraphstyle_set_text_style := GetProcAddress(FLibHandle, 'sk4d_paragraphstyle_set_text_style'); - sk4d_strutstyle_create := GetProcAddress(FLibHandle, 'sk4d_strutstyle_create'); - sk4d_strutstyle_destroy := GetProcAddress(FLibHandle, 'sk4d_strutstyle_destroy'); - sk4d_strutstyle_get_enabled := GetProcAddress(FLibHandle, 'sk4d_strutstyle_get_enabled'); - sk4d_strutstyle_get_font_families := GetProcAddress(FLibHandle, 'sk4d_strutstyle_get_font_families'); - sk4d_strutstyle_get_font_size := GetProcAddress(FLibHandle, 'sk4d_strutstyle_get_font_size'); - sk4d_strutstyle_get_font_style := GetProcAddress(FLibHandle, 'sk4d_strutstyle_get_font_style'); - sk4d_strutstyle_get_force_height := GetProcAddress(FLibHandle, 'sk4d_strutstyle_get_force_height'); - sk4d_strutstyle_get_half_leading := GetProcAddress(FLibHandle, 'sk4d_strutstyle_get_half_leading'); - sk4d_strutstyle_get_height_multiplier := GetProcAddress(FLibHandle, 'sk4d_strutstyle_get_height_multiplier'); - sk4d_strutstyle_get_leading := GetProcAddress(FLibHandle, 'sk4d_strutstyle_get_leading'); - sk4d_strutstyle_is_equal := GetProcAddress(FLibHandle, 'sk4d_strutstyle_is_equal'); - sk4d_strutstyle_set_enabled := GetProcAddress(FLibHandle, 'sk4d_strutstyle_set_enabled'); - sk4d_strutstyle_set_font_families := GetProcAddress(FLibHandle, 'sk4d_strutstyle_set_font_families'); - sk4d_strutstyle_set_font_size := GetProcAddress(FLibHandle, 'sk4d_strutstyle_set_font_size'); - sk4d_strutstyle_set_font_style := GetProcAddress(FLibHandle, 'sk4d_strutstyle_set_font_style'); - sk4d_strutstyle_set_force_height := GetProcAddress(FLibHandle, 'sk4d_strutstyle_set_force_height'); - sk4d_strutstyle_set_half_leading := GetProcAddress(FLibHandle, 'sk4d_strutstyle_set_half_leading'); - sk4d_strutstyle_set_height_multiplier := GetProcAddress(FLibHandle, 'sk4d_strutstyle_set_height_multiplier'); - sk4d_strutstyle_set_leading := GetProcAddress(FLibHandle, 'sk4d_strutstyle_set_leading'); - {$ELSE} - class function TSkiaAPI.sk4d_paragraphstyle_create; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_create'; - class procedure TSkiaAPI.sk4d_paragraphstyle_destroy; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_destroy'; - class procedure TSkiaAPI.sk4d_paragraphstyle_disable_hinting; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_disable_hinting'; - class function TSkiaAPI.sk4d_paragraphstyle_get_ellipsis; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_get_ellipsis'; - class function TSkiaAPI.sk4d_paragraphstyle_get_height; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_get_height'; - class function TSkiaAPI.sk4d_paragraphstyle_get_max_lines; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_get_max_lines'; - class function TSkiaAPI.sk4d_paragraphstyle_get_strut_style; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_get_strut_style'; - class function TSkiaAPI.sk4d_paragraphstyle_get_text_align; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_get_text_align'; - class function TSkiaAPI.sk4d_paragraphstyle_get_text_direction; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_get_text_direction'; - class function TSkiaAPI.sk4d_paragraphstyle_get_text_height_behaviors; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_get_text_height_behaviors'; - class function TSkiaAPI.sk4d_paragraphstyle_get_text_style; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_get_text_style'; - class procedure TSkiaAPI.sk4d_paragraphstyle_set_ellipsis; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_set_ellipsis'; - class procedure TSkiaAPI.sk4d_paragraphstyle_set_height; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_set_height'; - class procedure TSkiaAPI.sk4d_paragraphstyle_set_max_lines; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_set_max_lines'; - class procedure TSkiaAPI.sk4d_paragraphstyle_set_strut_style; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_set_strut_style'; - class procedure TSkiaAPI.sk4d_paragraphstyle_set_text_align; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_set_text_align'; - class procedure TSkiaAPI.sk4d_paragraphstyle_set_text_direction; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_set_text_direction'; - class procedure TSkiaAPI.sk4d_paragraphstyle_set_text_height_behaviors; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_set_text_height_behaviors'; - class procedure TSkiaAPI.sk4d_paragraphstyle_set_text_style; external TSkiaAPI.LibName name 'sk4d_paragraphstyle_set_text_style'; - class function TSkiaAPI.sk4d_strutstyle_create; external TSkiaAPI.LibName name 'sk4d_strutstyle_create'; - class procedure TSkiaAPI.sk4d_strutstyle_destroy; external TSkiaAPI.LibName name 'sk4d_strutstyle_destroy'; - class function TSkiaAPI.sk4d_strutstyle_get_enabled; external TSkiaAPI.LibName name 'sk4d_strutstyle_get_enabled'; - class function TSkiaAPI.sk4d_strutstyle_get_font_families; external TSkiaAPI.LibName name 'sk4d_strutstyle_get_font_families'; - class function TSkiaAPI.sk4d_strutstyle_get_font_size; external TSkiaAPI.LibName name 'sk4d_strutstyle_get_font_size'; - class procedure TSkiaAPI.sk4d_strutstyle_get_font_style; external TSkiaAPI.LibName name 'sk4d_strutstyle_get_font_style'; - class function TSkiaAPI.sk4d_strutstyle_get_force_height; external TSkiaAPI.LibName name 'sk4d_strutstyle_get_force_height'; - class function TSkiaAPI.sk4d_strutstyle_get_half_leading; external TSkiaAPI.LibName name 'sk4d_strutstyle_get_half_leading'; - class function TSkiaAPI.sk4d_strutstyle_get_height_multiplier; external TSkiaAPI.LibName name 'sk4d_strutstyle_get_height_multiplier'; - class function TSkiaAPI.sk4d_strutstyle_get_leading; external TSkiaAPI.LibName name 'sk4d_strutstyle_get_leading'; - class function TSkiaAPI.sk4d_strutstyle_is_equal; external TSkiaAPI.LibName name 'sk4d_strutstyle_is_equal'; - class procedure TSkiaAPI.sk4d_strutstyle_set_enabled; external TSkiaAPI.LibName name 'sk4d_strutstyle_set_enabled'; - class procedure TSkiaAPI.sk4d_strutstyle_set_font_families; external TSkiaAPI.LibName name 'sk4d_strutstyle_set_font_families'; - class procedure TSkiaAPI.sk4d_strutstyle_set_font_size; external TSkiaAPI.LibName name 'sk4d_strutstyle_set_font_size'; - class procedure TSkiaAPI.sk4d_strutstyle_set_font_style; external TSkiaAPI.LibName name 'sk4d_strutstyle_set_font_style'; - class procedure TSkiaAPI.sk4d_strutstyle_set_force_height; external TSkiaAPI.LibName name 'sk4d_strutstyle_set_force_height'; - class procedure TSkiaAPI.sk4d_strutstyle_set_half_leading; external TSkiaAPI.LibName name 'sk4d_strutstyle_set_half_leading'; - class procedure TSkiaAPI.sk4d_strutstyle_set_height_multiplier; external TSkiaAPI.LibName name 'sk4d_strutstyle_set_height_multiplier'; - class procedure TSkiaAPI.sk4d_strutstyle_set_leading; external TSkiaAPI.LibName name 'sk4d_strutstyle_set_leading'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_textstyle.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_textstyle_add_font_feature := GetProcAddress(FLibHandle, 'sk4d_textstyle_add_font_feature'); - sk4d_textstyle_add_shadow := GetProcAddress(FLibHandle, 'sk4d_textstyle_add_shadow'); - sk4d_textstyle_clear_background_color := GetProcAddress(FLibHandle, 'sk4d_textstyle_clear_background_color'); - sk4d_textstyle_clear_foreground_color := GetProcAddress(FLibHandle, 'sk4d_textstyle_clear_foreground_color'); - sk4d_textstyle_create := GetProcAddress(FLibHandle, 'sk4d_textstyle_create'); - sk4d_textstyle_destroy := GetProcAddress(FLibHandle, 'sk4d_textstyle_destroy'); - sk4d_textstyle_get_background := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_background'); - sk4d_textstyle_get_color := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_color'); - sk4d_textstyle_get_decoration_color := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_decoration_color'); - sk4d_textstyle_get_decoration_style := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_decoration_style'); - sk4d_textstyle_get_decoration_thickness := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_decoration_thickness'); - sk4d_textstyle_get_decorations := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_decorations'); - sk4d_textstyle_get_font_families := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_font_families'); - sk4d_textstyle_get_font_metrics := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_font_metrics'); - sk4d_textstyle_get_font_size := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_font_size'); - sk4d_textstyle_get_font_style := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_font_style'); - sk4d_textstyle_get_foreground := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_foreground'); - sk4d_textstyle_get_half_leading := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_half_leading'); - sk4d_textstyle_get_height_multiplier := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_height_multiplier'); - sk4d_textstyle_get_letter_spacing := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_letter_spacing'); - sk4d_textstyle_get_locale := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_locale'); - sk4d_textstyle_get_word_spacing := GetProcAddress(FLibHandle, 'sk4d_textstyle_get_word_spacing'); - sk4d_textstyle_is_equal := GetProcAddress(FLibHandle, 'sk4d_textstyle_is_equal'); - sk4d_textstyle_reset_font_features := GetProcAddress(FLibHandle, 'sk4d_textstyle_reset_font_features'); - sk4d_textstyle_reset_shadows := GetProcAddress(FLibHandle, 'sk4d_textstyle_reset_shadows'); - sk4d_textstyle_set_background_color := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_background_color'); - sk4d_textstyle_set_color := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_color'); - sk4d_textstyle_set_decoration_color := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_decoration_color'); - sk4d_textstyle_set_decoration_style := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_decoration_style'); - sk4d_textstyle_set_decoration_thickness := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_decoration_thickness'); - sk4d_textstyle_set_decorations := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_decorations'); - sk4d_textstyle_set_font_families := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_font_families'); - sk4d_textstyle_set_font_size := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_font_size'); - sk4d_textstyle_set_font_style := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_font_style'); - sk4d_textstyle_set_foreground_color := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_foreground_color'); - sk4d_textstyle_set_half_leading := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_half_leading'); - sk4d_textstyle_set_height_multiplier := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_height_multiplier'); - sk4d_textstyle_set_letter_spacing := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_letter_spacing'); - sk4d_textstyle_set_locale := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_locale'); - sk4d_textstyle_set_word_spacing := GetProcAddress(FLibHandle, 'sk4d_textstyle_set_word_spacing'); - {$ELSE} - class procedure TSkiaAPI.sk4d_textstyle_add_font_feature; external TSkiaAPI.LibName name 'sk4d_textstyle_add_font_feature'; - class procedure TSkiaAPI.sk4d_textstyle_add_shadow; external TSkiaAPI.LibName name 'sk4d_textstyle_add_shadow'; - class procedure TSkiaAPI.sk4d_textstyle_clear_background_color; external TSkiaAPI.LibName name 'sk4d_textstyle_clear_background_color'; - class procedure TSkiaAPI.sk4d_textstyle_clear_foreground_color; external TSkiaAPI.LibName name 'sk4d_textstyle_clear_foreground_color'; - class function TSkiaAPI.sk4d_textstyle_create; external TSkiaAPI.LibName name 'sk4d_textstyle_create'; - class procedure TSkiaAPI.sk4d_textstyle_destroy; external TSkiaAPI.LibName name 'sk4d_textstyle_destroy'; - class function TSkiaAPI.sk4d_textstyle_get_background; external TSkiaAPI.LibName name 'sk4d_textstyle_get_background'; - class function TSkiaAPI.sk4d_textstyle_get_color; external TSkiaAPI.LibName name 'sk4d_textstyle_get_color'; - class function TSkiaAPI.sk4d_textstyle_get_decoration_color; external TSkiaAPI.LibName name 'sk4d_textstyle_get_decoration_color'; - class function TSkiaAPI.sk4d_textstyle_get_decoration_style; external TSkiaAPI.LibName name 'sk4d_textstyle_get_decoration_style'; - class function TSkiaAPI.sk4d_textstyle_get_decoration_thickness; external TSkiaAPI.LibName name 'sk4d_textstyle_get_decoration_thickness'; - class function TSkiaAPI.sk4d_textstyle_get_decorations; external TSkiaAPI.LibName name 'sk4d_textstyle_get_decorations'; - class function TSkiaAPI.sk4d_textstyle_get_font_families; external TSkiaAPI.LibName name 'sk4d_textstyle_get_font_families'; - class procedure TSkiaAPI.sk4d_textstyle_get_font_metrics; external TSkiaAPI.LibName name 'sk4d_textstyle_get_font_metrics'; - class function TSkiaAPI.sk4d_textstyle_get_font_size; external TSkiaAPI.LibName name 'sk4d_textstyle_get_font_size'; - class procedure TSkiaAPI.sk4d_textstyle_get_font_style; external TSkiaAPI.LibName name 'sk4d_textstyle_get_font_style'; - class function TSkiaAPI.sk4d_textstyle_get_foreground; external TSkiaAPI.LibName name 'sk4d_textstyle_get_foreground'; - class function TSkiaAPI.sk4d_textstyle_get_half_leading; external TSkiaAPI.LibName name 'sk4d_textstyle_get_half_leading'; - class function TSkiaAPI.sk4d_textstyle_get_height_multiplier; external TSkiaAPI.LibName name 'sk4d_textstyle_get_height_multiplier'; - class function TSkiaAPI.sk4d_textstyle_get_letter_spacing; external TSkiaAPI.LibName name 'sk4d_textstyle_get_letter_spacing'; - class function TSkiaAPI.sk4d_textstyle_get_locale; external TSkiaAPI.LibName name 'sk4d_textstyle_get_locale'; - class function TSkiaAPI.sk4d_textstyle_get_word_spacing; external TSkiaAPI.LibName name 'sk4d_textstyle_get_word_spacing'; - class function TSkiaAPI.sk4d_textstyle_is_equal; external TSkiaAPI.LibName name 'sk4d_textstyle_is_equal'; - class procedure TSkiaAPI.sk4d_textstyle_reset_font_features; external TSkiaAPI.LibName name 'sk4d_textstyle_reset_font_features'; - class procedure TSkiaAPI.sk4d_textstyle_reset_shadows; external TSkiaAPI.LibName name 'sk4d_textstyle_reset_shadows'; - class procedure TSkiaAPI.sk4d_textstyle_set_background_color; external TSkiaAPI.LibName name 'sk4d_textstyle_set_background_color'; - class procedure TSkiaAPI.sk4d_textstyle_set_color; external TSkiaAPI.LibName name 'sk4d_textstyle_set_color'; - class procedure TSkiaAPI.sk4d_textstyle_set_decoration_color; external TSkiaAPI.LibName name 'sk4d_textstyle_set_decoration_color'; - class procedure TSkiaAPI.sk4d_textstyle_set_decoration_style; external TSkiaAPI.LibName name 'sk4d_textstyle_set_decoration_style'; - class procedure TSkiaAPI.sk4d_textstyle_set_decoration_thickness; external TSkiaAPI.LibName name 'sk4d_textstyle_set_decoration_thickness'; - class procedure TSkiaAPI.sk4d_textstyle_set_decorations; external TSkiaAPI.LibName name 'sk4d_textstyle_set_decorations'; - class procedure TSkiaAPI.sk4d_textstyle_set_font_families; external TSkiaAPI.LibName name 'sk4d_textstyle_set_font_families'; - class procedure TSkiaAPI.sk4d_textstyle_set_font_size; external TSkiaAPI.LibName name 'sk4d_textstyle_set_font_size'; - class procedure TSkiaAPI.sk4d_textstyle_set_font_style; external TSkiaAPI.LibName name 'sk4d_textstyle_set_font_style'; - class procedure TSkiaAPI.sk4d_textstyle_set_foreground_color; external TSkiaAPI.LibName name 'sk4d_textstyle_set_foreground_color'; - class procedure TSkiaAPI.sk4d_textstyle_set_half_leading; external TSkiaAPI.LibName name 'sk4d_textstyle_set_half_leading'; - class procedure TSkiaAPI.sk4d_textstyle_set_height_multiplier; external TSkiaAPI.LibName name 'sk4d_textstyle_set_height_multiplier'; - class procedure TSkiaAPI.sk4d_textstyle_set_letter_spacing; external TSkiaAPI.LibName name 'sk4d_textstyle_set_letter_spacing'; - class procedure TSkiaAPI.sk4d_textstyle_set_locale; external TSkiaAPI.LibName name 'sk4d_textstyle_set_locale'; - class procedure TSkiaAPI.sk4d_textstyle_set_word_spacing; external TSkiaAPI.LibName name 'sk4d_textstyle_set_word_spacing'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skparagraph/include/sk4d_typefacefontprovider.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_typefacefontprovider_create := GetProcAddress(FLibHandle, 'sk4d_typefacefontprovider_create'); - sk4d_typefacefontprovider_register_typeface := GetProcAddress(FLibHandle, 'sk4d_typefacefontprovider_register_typeface'); - sk4d_typefacefontprovider_register_typeface2 := GetProcAddress(FLibHandle, 'sk4d_typefacefontprovider_register_typeface2'); - {$ELSE} - class function TSkiaAPI.sk4d_typefacefontprovider_create; external TSkiaAPI.LibName name 'sk4d_typefacefontprovider_create'; - class procedure TSkiaAPI.sk4d_typefacefontprovider_register_typeface; external TSkiaAPI.LibName name 'sk4d_typefacefontprovider_register_typeface'; - class procedure TSkiaAPI.sk4d_typefacefontprovider_register_typeface2; external TSkiaAPI.LibName name 'sk4d_typefacefontprovider_register_typeface2'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skresources/include/sk4d_resources.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_resourceproviderbaseclass_create := GetProcAddress(FLibHandle, 'sk4d_resourceproviderbaseclass_create'); - sk4d_resourceproviderbaseclass_set_procs := GetProcAddress(FLibHandle, 'sk4d_resourceproviderbaseclass_set_procs'); - {$ELSE} - class function TSkiaAPI.sk4d_resourceproviderbaseclass_create; external TSkiaAPI.LibName name 'sk4d_resourceproviderbaseclass_create'; - class procedure TSkiaAPI.sk4d_resourceproviderbaseclass_set_procs; external TSkiaAPI.LibName name 'sk4d_resourceproviderbaseclass_set_procs'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skshaper/include/sk4d_shaper.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_shaper_create := GetProcAddress(FLibHandle, 'sk4d_shaper_create'); - sk4d_shaper_destroy := GetProcAddress(FLibHandle, 'sk4d_shaper_destroy'); - sk4d_shaper_shape := GetProcAddress(FLibHandle, 'sk4d_shaper_shape'); - {$ELSE} - class function TSkiaAPI.sk4d_shaper_create; external TSkiaAPI.LibName name 'sk4d_shaper_create'; - class procedure TSkiaAPI.sk4d_shaper_destroy; external TSkiaAPI.LibName name 'sk4d_shaper_destroy'; - class function TSkiaAPI.sk4d_shaper_shape; external TSkiaAPI.LibName name 'sk4d_shaper_shape'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/skunicode/include/sk4d_unicode.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_unicode_create := GetProcAddress(FLibHandle, 'sk4d_unicode_create'); - sk4d_unicode_destroy := GetProcAddress(FLibHandle, 'sk4d_unicode_destroy'); - sk4d_unicode_for_each_bidi_region := GetProcAddress(FLibHandle, 'sk4d_unicode_for_each_bidi_region'); - sk4d_unicode_for_each_break := GetProcAddress(FLibHandle, 'sk4d_unicode_for_each_break'); - sk4d_unicode_for_each_codepoint := GetProcAddress(FLibHandle, 'sk4d_unicode_for_each_codepoint'); - {$ELSE} - class function TSkiaAPI.sk4d_unicode_create; external TSkiaAPI.LibName name 'sk4d_unicode_create'; - class procedure TSkiaAPI.sk4d_unicode_destroy; external TSkiaAPI.LibName name 'sk4d_unicode_destroy'; - class procedure TSkiaAPI.sk4d_unicode_for_each_bidi_region; external TSkiaAPI.LibName name 'sk4d_unicode_for_each_bidi_region'; - class procedure TSkiaAPI.sk4d_unicode_for_each_break; external TSkiaAPI.LibName name 'sk4d_unicode_for_each_break'; - class procedure TSkiaAPI.sk4d_unicode_for_each_codepoint; external TSkiaAPI.LibName name 'sk4d_unicode_for_each_codepoint'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/svg/include/sk4d_svgdom.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_svgdom_find_node_by_id := GetProcAddress(FLibHandle, 'sk4d_svgdom_find_node_by_id'); - sk4d_svgdom_get_root := GetProcAddress(FLibHandle, 'sk4d_svgdom_get_root'); - sk4d_svgdom_make_from_file := GetProcAddress(FLibHandle, 'sk4d_svgdom_make_from_file'); - sk4d_svgdom_make_from_stream := GetProcAddress(FLibHandle, 'sk4d_svgdom_make_from_stream'); - sk4d_svgdom_render := GetProcAddress(FLibHandle, 'sk4d_svgdom_render'); - sk4d_svgdom_set_container_size := GetProcAddress(FLibHandle, 'sk4d_svgdom_set_container_size'); - {$ELSE} - class function TSkiaAPI.sk4d_svgdom_find_node_by_id; external TSkiaAPI.LibName name 'sk4d_svgdom_find_node_by_id'; - class function TSkiaAPI.sk4d_svgdom_get_root; external TSkiaAPI.LibName name 'sk4d_svgdom_get_root'; - class function TSkiaAPI.sk4d_svgdom_make_from_file; external TSkiaAPI.LibName name 'sk4d_svgdom_make_from_file'; - class function TSkiaAPI.sk4d_svgdom_make_from_stream; external TSkiaAPI.LibName name 'sk4d_svgdom_make_from_stream'; - class procedure TSkiaAPI.sk4d_svgdom_render; external TSkiaAPI.LibName name 'sk4d_svgdom_render'; - class procedure TSkiaAPI.sk4d_svgdom_set_container_size; external TSkiaAPI.LibName name 'sk4d_svgdom_set_container_size'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/svg/include/sk4d_svgnode.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_svgnode_set_attribute := GetProcAddress(FLibHandle, 'sk4d_svgnode_set_attribute'); - {$ELSE} - class function TSkiaAPI.sk4d_svgnode_set_attribute; external TSkiaAPI.LibName name 'sk4d_svgnode_set_attribute'; - {$ENDIF} - {$ENDREGION} - - {$REGION 'modules/svg/include/sk4d_svgsvg.h'} - {$IFDEF SK_DYNAMIC_LOADING} - sk4d_svgsvg_get_height := GetProcAddress(FLibHandle, 'sk4d_svgsvg_get_height'); - sk4d_svgsvg_get_intrinsic_size := GetProcAddress(FLibHandle, 'sk4d_svgsvg_get_intrinsic_size'); - sk4d_svgsvg_get_preserve_aspect_ratio := GetProcAddress(FLibHandle, 'sk4d_svgsvg_get_preserve_aspect_ratio'); - sk4d_svgsvg_get_view_box := GetProcAddress(FLibHandle, 'sk4d_svgsvg_get_view_box'); - sk4d_svgsvg_get_width := GetProcAddress(FLibHandle, 'sk4d_svgsvg_get_width'); - sk4d_svgsvg_get_x := GetProcAddress(FLibHandle, 'sk4d_svgsvg_get_x'); - sk4d_svgsvg_get_y := GetProcAddress(FLibHandle, 'sk4d_svgsvg_get_y'); - sk4d_svgsvg_set_height := GetProcAddress(FLibHandle, 'sk4d_svgsvg_set_height'); - sk4d_svgsvg_set_preserve_aspect_ratio := GetProcAddress(FLibHandle, 'sk4d_svgsvg_set_preserve_aspect_ratio'); - sk4d_svgsvg_set_view_box := GetProcAddress(FLibHandle, 'sk4d_svgsvg_set_view_box'); - sk4d_svgsvg_set_width := GetProcAddress(FLibHandle, 'sk4d_svgsvg_set_width'); - sk4d_svgsvg_set_x := GetProcAddress(FLibHandle, 'sk4d_svgsvg_set_x'); - sk4d_svgsvg_set_y := GetProcAddress(FLibHandle, 'sk4d_svgsvg_set_y'); - {$ELSE} - class procedure TSkiaAPI.sk4d_svgsvg_get_height; external TSkiaAPI.LibName name 'sk4d_svgsvg_get_height'; - class procedure TSkiaAPI.sk4d_svgsvg_get_intrinsic_size; external TSkiaAPI.LibName name 'sk4d_svgsvg_get_intrinsic_size'; - class procedure TSkiaAPI.sk4d_svgsvg_get_preserve_aspect_ratio; external TSkiaAPI.LibName name 'sk4d_svgsvg_get_preserve_aspect_ratio'; - class function TSkiaAPI.sk4d_svgsvg_get_view_box; external TSkiaAPI.LibName name 'sk4d_svgsvg_get_view_box'; - class procedure TSkiaAPI.sk4d_svgsvg_get_width; external TSkiaAPI.LibName name 'sk4d_svgsvg_get_width'; - class procedure TSkiaAPI.sk4d_svgsvg_get_x; external TSkiaAPI.LibName name 'sk4d_svgsvg_get_x'; - class procedure TSkiaAPI.sk4d_svgsvg_get_y; external TSkiaAPI.LibName name 'sk4d_svgsvg_get_y'; - class procedure TSkiaAPI.sk4d_svgsvg_set_height; external TSkiaAPI.LibName name 'sk4d_svgsvg_set_height'; - class procedure TSkiaAPI.sk4d_svgsvg_set_preserve_aspect_ratio; external TSkiaAPI.LibName name 'sk4d_svgsvg_set_preserve_aspect_ratio'; - class procedure TSkiaAPI.sk4d_svgsvg_set_view_box; external TSkiaAPI.LibName name 'sk4d_svgsvg_set_view_box'; - class procedure TSkiaAPI.sk4d_svgsvg_set_width; external TSkiaAPI.LibName name 'sk4d_svgsvg_set_width'; - class procedure TSkiaAPI.sk4d_svgsvg_set_x; external TSkiaAPI.LibName name 'sk4d_svgsvg_set_x'; - class procedure TSkiaAPI.sk4d_svgsvg_set_y; external TSkiaAPI.LibName name 'sk4d_svgsvg_set_y'; - {$ENDIF} - {$ENDREGION} - -{$IFDEF SK_DYNAMIC_LOADING} - end; -end; -{$ENDIF} - -class procedure TSkiaAPI.Terminate; -begin - {$IFDEF SK_DYNAMIC_LOADING} - if AtomicDecrement(FRefCount) = 0 then - FreeLibrary(FLibHandle); - {$ENDIF} -end; - -{$ENDREGION} - -{$REGION 'Static linking loaders'} - -{$IFDEF IOS} - procedure libcpp; external '/usr/lib/libc++.dylib'; - procedure libcompiler_rt; external '/usr/lib/clang/lib/darwin/libclang_rt.ios.a'; -{$ENDIF} - -{$ENDREGION} - -end. +{************************************************************************} +{ } +{ Skia4Delphi } +{ } +{ Copyright (c) 2011-2022 Google LLC. } +{ Copyright (c) 2021-2022 Skia4Delphi Project. } +{ } +{ Use of this source code is governed by a BSD-style license that can be } +{ found in the LICENSE file. } +{ } +{************************************************************************} +unit Skia.API; + +interface + +{$HPPEMIT NOUSINGNAMESPACE} +{$IFDEF MSWINDOWS} + {$HPPEMIT '#ifdef USEPACKAGES'} + {$HPPEMIT ' #pragma link "Skia.Package.RTL.bpi"'} + {$HPPEMIT '#elif defined(__WIN32__)'} + {$HPPEMIT ' #pragma link "Skia.Package.RTL.lib"'} + {$HPPEMIT '#elif defined(_WIN64)'} + {$HPPEMIT ' #pragma link "Skia.Package.RTL.a"'} + {$HPPEMIT '#endif'} +{$ENDIF} + +{.$DEFINE SK_DEBUG} + +{$ALIGN ON} +{$MINENUMSIZE 4} + +{$IF DEFINED(IOS) and NOT DEFINED(IOSSIMULATOR)} + {$DEFINE SK_STATIC_LIBRARY} +{$ENDIF} + +type + _bool = Boolean; + {$IF CompilerVersion < 31} + _char = AnsiChar; + {$ELSE} + _char = UTF8Char; + {$ENDIF} + char16_t = Char; + _double = Double; + float = Single; + int16_t = SmallInt; + int32_t = Integer; + int64_t = Int64; + int8_t = ShortInt; + intptr_t = NativeInt; + long = LongInt; + size_t = NativeUInt; + uint16_t = Word; + uint32_t = Cardinal; + uint64_t = UInt64; + uint8_t = Byte; + uintptr_t = NativeUInt; + + _pbool = ^_bool; + _pchar = ^_char; + pchar16_t = ^char16_t; + _pdouble = ^_double; + pfloat = ^float; + pint16_t = ^int16_t; + pint32_t = ^int32_t; + pint64_t = ^int64_t; + pint8_t = ^int8_t; + pintptr_t = ^intptr_t; + plong = ^long; + psize_t = ^size_t; + puint16_t = ^uint16_t; + puint32_t = ^uint32_t; + puint64_t = ^uint64_t; + puint8_t = ^uint8_t; + puintptr_t = ^uintptr_t; + + + { include/c/sk4d_types.h } + + sk_animcodecplayer_t = THandle; + sk_blender_t = THandle; + sk_canvas_t = THandle; + sk_codec_t = THandle; + sk_colorfilter_t = THandle; + sk_colorspace_t = THandle; + sk_colorspaceiccprofile_t = THandle; + sk_data_t = THandle; + sk_document_t = THandle; + sk_font_t = THandle; + sk_image_t = THandle; + sk_imagefilter_t = THandle; + sk_maskfilter_t = THandle; + sk_opbuilder_t = THandle; + sk_paint_t = THandle; + sk_path_t = THandle; + sk_pathbuilder_t = THandle; + sk_patheffect_t = THandle; + sk_pathiterator_t = THandle; + sk_pathmeasure_t = THandle; + sk_pathrawiter_t = THandle; + sk_picture_t = THandle; + sk_picturerecorder_t = THandle; + sk_pixmap_t = THandle; + sk_refcnt_t = THandle; + sk_region_t = THandle; + sk_regioncliperator_t = THandle; + sk_regioniterator_t = THandle; + sk_regionspanerator_t = THandle; + sk_rrect_t = THandle; + sk_runtimeeffect_t = THandle; + sk_shader_t = THandle; + sk_stream_t = THandle; + sk_streamadapter_t = THandle; + sk_string_t = THandle; + sk_surface_t = THandle; + sk_textblob_t = THandle; + sk_tracememorydump_t = THandle; + sk_tracememorydumpbaseclass_t = THandle; + sk_typeface_t = THandle; + sk_vertices_t = THandle; + sk_wstream_t = THandle; + sk_wstreamadapter_t = THandle; + + psk_animcodecplayer_t = ^sk_animcodecplayer_t; + psk_blender_t = ^sk_blender_t; + psk_canvas_t = ^sk_canvas_t; + psk_codec_t = ^sk_codec_t; + psk_colorfilter_t = ^sk_colorfilter_t; + psk_colorspace_t = ^sk_colorspace_t; + psk_colorspaceiccprofile_t = ^sk_colorspaceiccprofile_t; + psk_data_t = ^sk_data_t; + psk_document_t = ^sk_document_t; + psk_font_t = ^sk_font_t; + psk_image_t = ^sk_image_t; + psk_imagefilter_t = ^sk_imagefilter_t; + psk_maskfilter_t = ^sk_maskfilter_t; + psk_opbuilder_t = ^sk_opbuilder_t; + psk_paint_t = ^sk_paint_t; + psk_path_t = ^sk_path_t; + psk_pathbuilder_t = ^sk_pathbuilder_t; + psk_patheffect_t = ^sk_patheffect_t; + psk_pathiterator_t = ^sk_pathiterator_t; + psk_pathmeasure_t = ^sk_pathmeasure_t; + psk_pathrawiter_t = ^sk_pathrawiter_t; + psk_picture_t = ^sk_picture_t; + psk_picturerecorder_t = ^sk_picturerecorder_t; + psk_pixmap_t = ^sk_pixmap_t; + psk_refcnt_t = ^sk_refcnt_t; + psk_region_t = ^sk_region_t; + psk_regioncliperator_t = ^sk_regioncliperator_t; + psk_regioniterator_t = ^sk_regioniterator_t; + psk_regionspanerator_t = ^sk_regionspanerator_t; + psk_rrect_t = ^sk_rrect_t; + psk_runtimeeffect_t = ^sk_runtimeeffect_t; + psk_shader_t = ^sk_shader_t; + psk_stream_t = ^sk_stream_t; + psk_streamadapter_t = ^sk_streamadapter_t; + psk_string_t = ^sk_string_t; + psk_surface_t = ^sk_surface_t; + psk_textblob_t = ^sk_textblob_t; + psk_tracememorydump_t = ^sk_tracememorydump_t; + psk_tracememorydumpbaseclass_t = ^sk_tracememorydumpbaseclass_t; + psk_typeface_t = ^sk_typeface_t; + psk_vertices_t = ^sk_vertices_t; + psk_wstream_t = ^sk_wstream_t; + psk_wstreamadapter_t = ^sk_wstreamadapter_t; + + sk_alphatype_t = ( + UNKNOWN_SK_ALPHATYPE, + OPAQUE_SK_ALPHATYPE, + PREMUL_SK_ALPHATYPE, + UNPREMUL_SK_ALPHATYPE + ); + psk_alphatype_t = ^sk_alphatype_t; + + sk_blendmode_t = ( + CLEAR_SK_BLENDMODE, + SRC_SK_BLENDMODE, + DEST_SK_BLENDMODE, + SRC_OVER_SK_BLENDMODE, + DEST_OVER_SK_BLENDMODE, + SRC_IN_SK_BLENDMODE, + DEST_IN_SK_BLENDMODE, + SRC_OUT_SK_BLENDMODE, + DEST_OUT_SK_BLENDMODE, + SRC_A_TOP_SK_BLENDMODE, + DEST_A_TOP_SK_BLENDMODE, + XOR_SK_BLENDMODE, + PLUS_SK_BLENDMODE, + MODULATE_SK_BLENDMODE, + SCREEN_SK_BLENDMODE, + OVERLAY_SK_BLENDMODE, + DARKEN_SK_BLENDMODE, + LIGHTEN_SK_BLENDMODE, + COLOR_DODGE_SK_BLENDMODE, + COLOR_BURN_SK_BLENDMODE, + HARD_LIGHT_SK_BLENDMODE, + SOFT_LIGHT_SK_BLENDMODE, + DIFFERENCE_SK_BLENDMODE, + EXCLUSION_SK_BLENDMODE, + MULTIPLY_SK_BLENDMODE, + HUE_SK_BLENDMODE, + SATURATION_SK_BLENDMODE, + COLOR_SK_BLENDMODE, + LUMINOSITY_SK_BLENDMODE + ); + psk_blendmode_t = ^sk_blendmode_t; + + sk_blurstyle_t = ( + NORMAL_SK_BLURSTYLE, + SOLID_SK_BLURSTYLE, + OUTER_SK_BLURSTYLE, + INNER_SK_BLURSTYLE + ); + psk_blurstyle_t = ^sk_blurstyle_t; + + sk_clipop_t = ( + DIFFERENCE_SK_CLIPOP, + INTERSECT_SK_CLIPOP + ); + psk_clipop_t = ^sk_clipop_t; + + sk_colorchannel_t = ( + R_SK_COLORCHANNEL, + G_SK_COLORCHANNEL, + B_SK_COLORCHANNEL, + A_SK_COLORCHANNEL + ); + psk_colorchannel_t = ^sk_colorchannel_t; + + sk_colortype_t = ( + UNKNOWN_SK_COLORTYPE, + ALPHA8_SK_COLORTYPE, + RGB565_SK_COLORTYPE, + ARGB4444_SK_COLORTYPE, + RGBA8888_SK_COLORTYPE, + RGB888X_SK_COLORTYPE, + BGRA8888_SK_COLORTYPE, + RGBA1010102_SK_COLORTYPE, + BGRA1010102_SK_COLORTYPE, + RGB101010X_SK_COLORTYPE, + BGR101010X_SK_COLORTYPE, + GRAY8_SK_COLORTYPE, + RGBAF16_SK_COLORTYPE, + RGBAF16CLAMPED_SK_COLORTYPE, + RGBAF32_SK_COLORTYPE, + RG88_SK_COLORTYPE, + ALPHAF16_SK_COLORTYPE, + RGF16_SK_COLORTYPE, + ALPHA16_SK_COLORTYPE, + RG1616_SK_COLORTYPE, + RGBA16161616_SK_COLORTYPE, + SRGBA8888_SK_COLORTYPE, + R8_SK_COLORTYPE + ); + psk_colortype_t = ^sk_colortype_t; + + sk_drawpointsmode_t = ( + POINTS_SK_DRAWPOINTSMODE, + LINES_SK_DRAWPOINTSMODE, + POLYGON_DRAWPOINTSMODE + ); + psk_drawpointsmode_t = ^sk_drawpointsmode_t; + + sk_encodedimageformat_t = ( + BMP_SK_ENCODEDIMAGEFORMAT, + GIF_SK_ENCODEDIMAGEFORMAT, + ICO_SK_ENCODEDIMAGEFORMAT, + JPEG_SK_ENCODEDIMAGEFORMAT, + PNG_SK_ENCODEDIMAGEFORMAT, + WBMP_SK_ENCODEDIMAGEFORMAT, + WEBP_SK_ENCODEDIMAGEFORMAT, + PKM_SK_ENCODEDIMAGEFORMAT, + KTX_SK_ENCODEDIMAGEFORMAT, + ASTC_SK_ENCODEDIMAGEFORMAT, + DNG_SK_ENCODEDIMAGEFORMAT, + HEIF_SK_ENCODEDIMAGEFORMAT, + AVIF_SK_ENCODEDIMAGEFORMAT + ); + psk_encodedimageformat_t = ^sk_encodedimageformat_t; + + sk_filtermode_t = ( + NEAREST_SK_FILTERMODE, + LINEAR_SK_FILTERMODE + ); + psk_filtermode_t = ^sk_filtermode_t; + + sk_fontedging_t = ( + ALIAS_SK_FONTEDGING, + ANTI_ALIAS_SK_FONTEDGING, + SUBPIXEL_ANTI_ALIAS_SK_FONTEDGING + ); + psk_fontedging_t = ^sk_fontedging_t; + + sk_fonthinting_t = ( + NONE_SK_FONTHINTING, + SLIGHT_SK_FONTHINTING, + NORMAL_SK_FONTHINTING, + FULL_SK_FONTHINTING + ); + psk_fonthinting_t = ^sk_fonthinting_t; + + sk_fontslant_t = ( + UPRIGHT_SK_FONTSLANT, + ITALIC_SK_FONTSLANT, + OBLIQUE_SK_FONTSLANT + ); + psk_fontslant_t = ^sk_fontslant_t; + + sk_contrastinvertstyle_t = ( + NO_INVERT_SK_CONTRASTINVERTSTYLE, + INVERT_BRIGHTNESS_SK_CONTRASTINVERTSTYLE, + INVERT_LIGHTNESS_SK_CONTRASTINVERTSTYLE + ); + psk_contrastinvertstyle_t = ^sk_contrastinvertstyle_t; + + sk_imagecachinghint_t = ( + ALLOW_SK_IMAGECACHINGHINT, + DISALLOW_SK_IMAGECACHINGHINT + ); + psk_imagecachinghint_t = ^sk_imagecachinghint_t; + + sk_latticerecttype_t = ( + DEFAULT_SK_LATTICERECTTYPE, + TRANSPARENT_SK_LATTICERECTTYPE, + FIXED_COLOR_SK_LATTICERECTTYPE + ); + psk_latticerecttype_t = ^sk_latticerecttype_t; + + sk_mipmapmode_t = ( + NONE_SK_MIPMAPMODE, + NEAREST_SK_MIPMAPMODE, + LINEAR_SK_MIPMAPMODE + ); + psk_mipmapmode_t = ^sk_mipmapmode_t; + + sk_paintstyle_t = ( + FILL_SK_PAINTSTYLE, + STROKE_SK_PAINTSTYLE, + STROKE_AND_FILL_SK_PAINTSTYLE + ); + psk_paintstyle_t = ^sk_paintstyle_t; + + sk_patharcsize_t = ( + SMALL_SK_ARCSIZE, + LARGE_SK_ARCSIZE + ); + psk_patharcsize_t = ^sk_patharcsize_t; + + sk_pathdirection_t = ( + CW_SK_PATHDIRECTION, + CCW_SK_PATHDIRECTION + ); + psk_pathdirection_t = ^sk_pathdirection_t; + + sk_patheffect1dstyle_t = ( + TRANSLATE_SK_PATHEFFECT1DSTYLE, + ROTATE_SK_PATHEFFECT1DSTYLE, + MORPH_SK_PATHEFFECT1DSTYLE + ); + psk_patheffect1dstyle_t = ^sk_patheffect1dstyle_t; + + sk_patheffecttrimmode_t = ( + NORMAL_SK_PATHEFFECTTRIMMODE, + INVERTED_SK_PATHEFFECTTRIMMODE + ); + psk_patheffecttrimmode_t = ^sk_patheffecttrimmode_t; + + sk_pathfilltype_t = ( + WINDING_SK_PATHFILLTYPE, + EVEN_ODD_SK_PATHFILLTYPE, + INVERSE_WINDING_SK_PATHFILLTYPE, + INVERSE_EVEN_ODD_SK_PATHFILLTYPE + ); + psk_pathfilltype_t = ^sk_pathfilltype_t; + + sk_pathop_t = ( + DIFFERENCE_SK_PATHOP, + INTERSECT_SK_PATHOP, + UNION_SK_PATHOP, + XOR_SK_PATHOP, + REVERSE_DIFFERENCE_SK_PATHOP + ); + psk_pathop_t = ^sk_pathop_t; + + sk_pathverb_t = ( + MOVE_SK_PATHVERB, + LINE_SK_PATHVERB, + QUAD_SK_PATHVERB, + CONIC_SK_PATHVERB, + CUBIC_SK_PATHVERB, + CLOSE_SK_PATHVERB + ); + psk_pathverb_t = ^sk_pathverb_t; + + sk_pixelgeometry_t = ( + UNKNOWN_SK_PIXELGEOMETRY, + RGB_HORIZONTAL_SK_PIXELGEOMETRY, + BGR_HORIZONTAL_SK_PIXELGEOMETRY, + RGB_VERTICAL_SK_PIXELGEOMETRY, + BGR_VERTICAL_SK_PIXELGEOMETRY + ); + psk_pixelgeometry_t = ^sk_pixelgeometry_t; + + sk_regionop_t = ( + DIFFERENCE_SK_REGIONOP, + INTERSECT_SK_REGIONOP, + UNION_SK_REGIONOP, + XOR_SK_REGIONOP, + REVERSE_DIFFERENCE_SK_REGIONOP, + REPLACE_SK_REGIONOP + ); + psk_regionop_t = ^sk_regionop_t; + + sk_rrectcorner_t = ( + UPPER_LEFT_SK_RRECTCORNER, + UPPER_RIGHT_SK_RRECTCORNER, + LOWER_RIGHT_SK_RRECTCORNER, + LOWER_LEFT_SK_RRECTCORNER + ); + psk_rrectcorner_t = ^sk_rrectcorner_t; + + sk_runtimeeffectchildtype_t = ( + SHADER_SK_RUNTIMEEFFECTCHILDTYPE, + COLOR_FILTER_SK_RUNTIMEEFFECTCHILDTYPE, + BLENDER_FILTER_SK_RUNTIMEEFFECTCHILDTYPE + ); + psk_runtimeeffectchildtype_t = ^sk_runtimeeffectchildtype_t; + + sk_runtimeeffectuniformtype_t = ( + FLOAT_SK_RUNTIMEEFFECTUNIFORMTYPE, + FLOAT2_SK_RUNTIMEEFFECTUNIFORMTYPE, + FLOAT3_SK_RUNTIMEEFFECTUNIFORMTYPE, + FLOAT4_SK_RUNTIMEEFFECTUNIFORMTYPE, + FLOAT2X2_SK_RUNTIMEEFFECTUNIFORMTYPE, + FLOAT3X3_SK_RUNTIMEEFFECTUNIFORMTYPE, + FLOAT4X4_SK_RUNTIMEEFFECTUNIFORMTYPE, + INT_SK_RUNTIMEEFFECTUNIFORMTYPE, + INT2_SK_RUNTIMEEFFECTUNIFORMTYPE, + INT3_SK_RUNTIMEEFFECTUNIFORMTYPE, + INT4_SK_RUNTIMEEFFECTUNIFORMTYPE + ); + psk_runtimeeffectuniformtype_t = ^sk_runtimeeffectuniformtype_t; + + sk_srcrectconstraint_t = ( + CLOSE_SK_SRCRECTCONSTRAINT, + FAST_SK_SRCRECTCONSTRAINT + ); + psk_srcrectconstraint_t = ^sk_srcrectconstraint_t; + + sk_strokecap_t = ( + BUTT_SK_STROKECAP, + ROUND_SK_STROKECAP, + SQUARE_SK_STROKECAP + ); + psk_strokecap_t = ^sk_strokecap_t; + + sk_strokejoin_t = ( + MITER_SK_STROKEJOIN, + ROUND_SK_STROKEJOIN, + BEVEL_SK_STROKEJOIN + ); + psk_strokejoin_t = ^sk_strokejoin_t; + + sk_textencoding_t = ( + UTF8_SK_TEXTENCODING, + UTF16_SK_TEXTENCODING, + UTF32_SK_TEXTENCODING, + GLYPH_ID_SK_TEXTENCODING + ); + psk_textencoding_t = ^sk_textencoding_t; + + sk_tilemode_t = ( + CLAMP_SK_TILEMODE, + REPEAT_SK_TILEMODE, + MIRROR_SK_TILEMODE, + DECAL_SK_TILEMODE + ); + psk_tilemode_t = ^sk_tilemode_t; + + sk_vertexmode_t = ( + TRIANGLES_SK_VERTEXMODE, + TRIANGLE_STRIP_SK_VERTEXMODE, + TRIANGLE_FAN_SK_VERTEXMODE + ); + psk_vertexmode_t = ^sk_vertexmode_t; + + sk_color_t = uint32_t; + sk_glyphid_t = uint16_t; + sk_unichar_t = int32_t; + + psk_color_t = ^sk_color_t; + psk_glyphid_t = ^sk_glyphid_t; + psk_unichar_t = ^sk_unichar_t; + + sk_color4f_t = record + r: float; + g: float; + b: float; + a: float; + end; + psk_color4f_t = ^sk_color4f_t; + + sk_colormatrix_t = record + m_11: float; + m_12: float; + m_13: float; + m_14: float; + m_15: float; + m_21: float; + m_22: float; + m_23: float; + m_24: float; + m_25: float; + m_31: float; + m_32: float; + m_33: float; + m_34: float; + m_35: float; + m_41: float; + m_42: float; + m_43: float; + m_44: float; + m_45: float; + end; + psk_colormatrix_t = ^sk_colormatrix_t; + + sk_colorspaceprimaries_t = record + rx: float; + ry: float; + gx: float; + gy: float; + bx: float; + by: float; + wx: float; + wy: float; + end; + psk_colorspaceprimaries_t = ^sk_colorspaceprimaries_t; + + sk_colorspacetransferfn_t = record + g: float; + a: float; + b: float; + c: float; + d: float; + e: float; + f: float; + end; + psk_colorspacetransferfn_t = ^sk_colorspacetransferfn_t; + + sk_colorspacexyz_t = record + m_11: float; + m_12: float; + m_13: float; + m_21: float; + m_22: float; + m_23: float; + m_31: float; + m_32: float; + m_33: float; + end; + psk_colorspacexyz_t = ^sk_colorspacexyz_t; + + sk_cubicresampler_t = record + b: float; + c: float; + end; + psk_cubicresampler_t = ^sk_cubicresampler_t; + + sk_datetime_t = record + time_zone_minutes : int16_t; + year : uint16_t; + month : uint8_t; + day_of_week : uint8_t; + day : uint8_t; + hour : uint8_t; + minute : uint8_t; + second : uint8_t; + end; + psk_datetime_t = ^sk_datetime_t; + + sk_fontmetrics_t = record + flags : uint32_t; + top : float; + ascent : float; + descent : float; + bottom : float; + leading : float; + avg_char_width : float; + max_char_width : float; + x_min : float; + x_max : float; + x_height : float; + cap_height : float; + underline_thickness : float; + underline_position : float; + strikeout_thickness : float; + strikeout_position : float; + end; + psk_fontmetrics_t = ^sk_fontmetrics_t; + + sk_fontstyle_t = record + weight : int32_t; + width : int32_t; + slant : sk_fontslant_t; + end; + psk_fontstyle_t = ^sk_fontstyle_t; + + sk_highcontrastconfig_t = record + grayscale : _bool; + invert_style : sk_contrastinvertstyle_t; + contrast : float; + end; + psk_highcontrastconfig_t = ^sk_highcontrastconfig_t; + + sk_imageinfo_t = record + width : int32_t; + height : int32_t; + color_type : sk_colortype_t; + alpha_type : sk_alphatype_t; + color_space : sk_colorspace_t; + end; + psk_imageinfo_t = ^sk_imageinfo_t; + + sk_ipoint_t = record + x: int32_t; + y: int32_t; + end; + psk_ipoint_t = ^sk_ipoint_t; + + sk_irect_t = record + left : int32_t; + top : int32_t; + right : int32_t; + bottom : int32_t; + end; + psk_irect_t = ^sk_irect_t; + + sk_isize_t = record + width : int32_t; + height : int32_t; + end; + psk_isize_t = ^sk_isize_t; + + sk_lattice_t = record + x_divs : pint32_t; + y_divs : pint32_t; + rect_types : psk_latticerecttype_t; + x_count : int32_t; + y_count : int32_t; + bounds : psk_irect_t; + colors : psk_color_t; + end; + psk_lattice_t = ^sk_lattice_t; + + sk_matrix_t = record + m_11: float; + m_12: float; + m_13: float; + m_21: float; + m_22: float; + m_23: float; + m_31: float; + m_32: float; + m_33: float; + end; + psk_matrix_t = ^sk_matrix_t; + + sk_matrix44_t = record + m_11: float; + m_12: float; + m_13: float; + m_14: float; + m_21: float; + m_22: float; + m_23: float; + m_24: float; + m_31: float; + m_32: float; + m_33: float; + m_34: float; + m_41: float; + m_42: float; + m_43: float; + m_44: float; + end; + psk_matrix44_t = ^sk_matrix44_t; + + sk_point_t = record + x: float; + y: float; + end; + psk_point_t = ^sk_point_t; + + sk_pathiteratorelem_t = record + verb : sk_pathverb_t; + points : array[0..3] of sk_point_t; + conic_weight : float; + end; + psk_pathiteratorelem_t = ^sk_pathiteratorelem_t; + + sk_pdfmetadata_t = record + title : MarshaledAString; + author : MarshaledAString; + subject : MarshaledAString; + keywords : MarshaledAString; + creator : MarshaledAString; + producer : MarshaledAString; + creation : sk_datetime_t; + modified : sk_datetime_t; + raster_dpi : float; + pdfa : _bool; + encoding_quality : int32_t; + end; + psk_pdfmetadata_t = ^sk_pdfmetadata_t; + + sk_point3_t = record + x: float; + y: float; + z: float; + end; + psk_point3_t = ^sk_point3_t; + + sk_rect_t = record + left : float; + top : float; + right : float; + bottom : float; + end; + psk_rect_t = ^sk_rect_t; + + sk_rotationscalematrix_t = record + s_cos : float; + s_sin : float; + t_x : float; + t_y : float; + end; + psk_rotationscalematrix_t = ^sk_rotationscalematrix_t; + + sk_samplingoptions_t = record + max_anisotropic : int32_t; + use_cubic : _bool; + cubic : sk_cubicresampler_t; + filter : sk_filtermode_t; + mipmap : sk_mipmapmode_t; + end; + psk_samplingoptions_t = ^sk_samplingoptions_t; + + sk_size_t = record + width : float; + height : float; + end; + psk_size_t = ^sk_size_t; + + sk_surfaceprops_t = record + flags : uint32_t; + pixel_geometry : sk_pixelgeometry_t; + end; + psk_surfaceprops_t = ^sk_surfaceprops_t; + + sk_vector_t = sk_point_t; + psk_vector_t = ^sk_vector_t; + + sk_font_path_proc = procedure (const path: sk_path_t; const matrix: psk_matrix_t; context: Pointer); cdecl; + sk_image_raster_release_proc = procedure (const pixels: Pointer; context: Pointer); cdecl; + sk_image_texture_release_proc = procedure (context: Pointer); cdecl; + sk_surface_raster_release_proc = procedure (pixels, context: Pointer); cdecl; + + sk_streamadapter_procs_t = record + get_length : function (context: Pointer): size_t; cdecl; + get_position : function (context: Pointer): size_t; cdecl; + read : function (context: Pointer; buffer: Pointer; size: size_t): size_t; cdecl; + seek : function (context: Pointer; position: size_t): _bool; cdecl; + end; + psk_streamadapter_procs_t = ^sk_streamadapter_procs_t; + + sk_wstreamadapter_procs_t = record + write: function (context: Pointer; const buffer: Pointer; size: size_t): _bool; cdecl; + end; + psk_wstreamadapter_procs_t = ^sk_wstreamadapter_procs_t; + + sk_tracememorydumpbaseclass_procs_t = record + dump_numeric_value : procedure (context: Pointer; const dump_name, value_name, units: MarshaledAString; value: uint64_t); cdecl; + dump_string_value : procedure (context: Pointer; const dump_name, value_name, value: MarshaledAString); cdecl; + end; + psk_tracememorydumpbaseclass_procs_t = ^sk_tracememorydumpbaseclass_procs_t; + + // Ganesh + + gr_backendrendertarget_t = THandle; + gr_backendtexture_t = THandle; + gr_directcontext_t = THandle; + gr_persistentcache_t = THandle; + gr_persistentcachebaseclass_t = THandle; + gr_shadererrorhandler_t = THandle; + gr_shadererrorhandlerbaseclass_t = THandle; + + pgr_backendrendertarget_t = ^gr_backendrendertarget_t; + pgr_backendtexture_t = ^gr_backendtexture_t; + pgr_directcontext_t = ^gr_directcontext_t; + pgr_persistentcache_t = ^gr_persistentcache_t; + pgr_persistentcachebaseclass_t = ^gr_persistentcachebaseclass_t; + pgr_shadererrorhandler_t = ^gr_shadererrorhandler_t; + pgr_shadererrorhandlerbaseclass_t = ^gr_shadererrorhandlerbaseclass_t; + + gr_backendapi_t = ( + OPEN_GL_GR_BACKENDAPI, + VULKAN_GR_BACKENDAPI, + METAL_GR_BACKENDAPI + ); + pgr_backendapi_t = ^gr_backendapi_t; + + gr_shadercachestrategy_t = ( + SKSL_GR_SHADERCACHESTRATEGY, + BACKEND_SOURCE_GR_SHADERCACHESTRATEGY, + BACKEND_BINARY_GR_SHADERCACHESTRATEGY + ); + pgr_shadercachestrategy_t = ^gr_shadercachestrategy_t; + + gr_surfaceorigin_t = ( + TOP_LEFT_GR_SURFACEORIGIN, + BOTTOM_LEFT_GR_SURFACEORIGIN + ); + pgr_surfaceorigin_t = ^gr_surfaceorigin_t; + + gr_contextoptions_t = record + buffer_map_threshold : int32_t; + do_manual_mipmapping : _bool; + allow_path_mask_caching : _bool; + glyph_cache_texture_maximum_bytes : size_t; + avoid_stencil_buffers : _bool; + runtime_program_cache_size : int32_t; + persistent_cache : gr_persistentcache_t; + shader_cache_strategy : gr_shadercachestrategy_t; + shader_error_handler : gr_shadererrorhandler_t; + end; + pgr_contextoptions_t = ^gr_contextoptions_t; + + gr_persistentcachebaseclass_procs_t = record + load : function (context: Pointer; const key_data: Pointer; key_size: size_t): sk_data_t; cdecl; + store : procedure (context: Pointer; const key_data: Pointer; key_size: size_t; const data: Pointer; size: size_t); cdecl; + end; + pgr_persistentcachebaseclass_procs_t = ^gr_persistentcachebaseclass_procs_t; + + gr_shadererrorhandlerbaseclass_procs_t = record + compile_error : procedure (context: Pointer; const shader, errors: MarshaledAString); cdecl; + end; + pgr_shadererrorhandlerbaseclass_procs_t = ^gr_shadererrorhandlerbaseclass_procs_t; + + // Ganesh - OpenGL + + gr_gl_interface_t = THandle; + + pgr_gl_interface_t = ^gr_gl_interface_t; + + gl_enum_t = uint32_t; + gl_uint_t = uint32_t; + + pgl_enum_t = ^gl_enum_t; + pgl_uint_t = ^gl_uint_t; + + gr_gl_framebufferinfo_t = record + fboid : gl_uint_t; + format : gl_enum_t; + end; + pgr_gl_framebufferinfo_t = ^gr_gl_framebufferinfo_t; + + gr_gl_textureinfo_t = record + target : gl_enum_t; + id : gl_uint_t; + format : gl_enum_t; + end; + pgr_gl_textureinfo_t = ^gr_gl_textureinfo_t; + + gr_gl_get_proc = function (context: Pointer; const name: MarshaledAString): Pointer; cdecl; + + // Ganesh - Metal + + gr_mtl_handle_t = Pointer; + + gr_mtl_textureinfo_t = record + texture: gr_mtl_handle_t; + end; + pgr_mtl_textureinfo_t = ^gr_mtl_textureinfo_t; + + gr_mtl_backendcontext_t = record + device : gr_mtl_handle_t; + queue : gr_mtl_handle_t; + binary_archive : gr_mtl_handle_t; + end; + pgr_mtl_backendcontext_t = ^gr_mtl_backendcontext_t; + + // Ganesh - Vulkan + + gr_vk_extensions_t = THandle; + gr_vk_physicaldevicefeatures_t = THandle; + gr_vk_physicaldevicefeatures2_t = THandle; + + pgr_vk_extensions_t = ^gr_vk_extensions_t; + pgr_vk_physicaldevicefeatures_t = ^gr_vk_physicaldevicefeatures_t; + pgr_vk_physicaldevicefeatures2_t = ^gr_vk_physicaldevicefeatures2_t; + + gr_vk_bool32_t = uint32_t; + gr_vk_chromalocation_t = int32_t; + gr_vk_device_t = Pointer; + gr_vk_devicememory_t = uint64_t; + gr_vk_devicesize_t = uint64_t; + gr_vk_filter_t = int32_t; + gr_vk_format_t = int32_t; + gr_vk_formatfeatureflags_t = uint32_t; + gr_vk_image_t = uint64_t; + gr_vk_imagelayout_t = int32_t; + gr_vk_imagetiling_t = int32_t; + gr_vk_imageusageflags_t = uint32_t; + gr_vk_instance_t = Pointer; + gr_vk_physicaldevice_t = Pointer; + gr_vk_queue_t = Pointer; + gr_vk_samplerycbcrmodelconversion_t = int32_t; + gr_vk_samplerycbcrrange_t = int32_t; + gr_vk_sharingmode_t = int32_t; + + pgr_vk_bool32_t = ^gr_vk_bool32_t; + pgr_vk_chromalocation_t = ^gr_vk_chromalocation_t; + pgr_vk_device_t = ^gr_vk_device_t; + pgr_vk_devicememory_t = ^gr_vk_devicememory_t; + pgr_vk_devicesize_t = ^gr_vk_devicesize_t; + pgr_vk_filter_t = ^gr_vk_filter_t; + pgr_vk_format_t = ^gr_vk_format_t; + pgr_vk_formatfeatureflags_t = ^gr_vk_formatfeatureflags_t; + pgr_vk_image_t = ^gr_vk_image_t; + pgr_vk_imagelayout_t = ^gr_vk_imagelayout_t; + pgr_vk_imagetiling_t = ^gr_vk_imagetiling_t; + pgr_vk_imageusageflags_t = ^gr_vk_imageusageflags_t; + pgr_vk_instance_t = ^gr_vk_instance_t; + pgr_vk_physicaldevice_t = ^gr_vk_physicaldevice_t; + pgr_vk_queue_t = ^gr_vk_queue_t; + pgr_vk_samplerycbcrmodelconversion_t = ^gr_vk_samplerycbcrmodelconversion_t; + pgr_vk_samplerycbcrrange_t = ^gr_vk_samplerycbcrrange_t; + pgr_vk_sharingmode_t = ^gr_vk_sharingmode_t; + + gr_vk_get_proc = function (context: Pointer; const name: MarshaledAString; instance: gr_vk_instance_t; device: gr_vk_device_t): Pointer; cdecl; + + gr_vk_alloc_t = record + device_memory : gr_vk_devicememory_t; + offset : gr_vk_devicesize_t; + size : gr_vk_devicesize_t; + flags : uint32_t; + memory : intptr_t; + end; + pgr_vk_alloc_t = ^gr_vk_alloc_t; + + + gr_vk_backendcontext_t = record + instance : gr_vk_instance_t; + physical_device : gr_vk_physicaldevice_t; + device : gr_vk_device_t; + queue : gr_vk_queue_t; + graphics_queue_index : uint32_t; + max_version : uint32_t; + extensions : gr_vk_extensions_t; + physical_device_features : gr_vk_physicaldevicefeatures_t; + physical_device_features2 : gr_vk_physicaldevicefeatures2_t; + get_context : Pointer; + get_proc : gr_vk_get_proc; + protected_context : _bool; + end; + pgr_vk_backendcontext_t = ^gr_vk_backendcontext_t; + + gr_vk_ycbcrconversioninfo_t = record + format : gr_vk_format_t; + external_format : uint64_t; + ycbcr_model : gr_vk_samplerycbcrmodelconversion_t; + ycbcr_range : gr_vk_samplerycbcrrange_t; + x_chroma_offset : gr_vk_chromalocation_t; + y_chroma_offset : gr_vk_chromalocation_t; + chroma_filter : gr_vk_filter_t; + force_explicit_reconstruction : gr_vk_bool32_t; + format_features : gr_vk_formatfeatureflags_t; + end; + pgr_vk_ycbcrconversioninfo_t = ^gr_vk_ycbcrconversioninfo_t; + + gr_vk_imageinfo_t = record + image : gr_vk_image_t; + alloc : gr_vk_alloc_t; + image_tiling : gr_vk_imagetiling_t; + image_layout : gr_vk_imagetiling_t; + format : gr_vk_format_t; + image_usage_flags : gr_vk_imageusageflags_t; + sample_count : uint32_t; + level_count : uint32_t; + current_queue_family : uint32_t; + protected_image : _bool; + ycbcr_conversion_info : gr_vk_ycbcrconversioninfo_t; + sharing_mode : gr_vk_sharingmode_t; + end; + pgr_vk_imageinfo_t = ^gr_vk_imageinfo_t; + + { modules/particles/include/sk4d_particles_types.h } + + sk_particleeffect_t = THandle; + + psk_particleeffect_t = ^sk_particleeffect_t; + + sk_particleuniform_t = record + columns : int32_t; + rows : int32_t; + slot : int32_t; + end; + psk_particleuniform_t = ^sk_particleuniform_t; + + + { modules/skottie/include/sk4d_skottie_types.h } + + sk_skottieanimation_t = THandle; + + psk_skottieanimation_t = ^sk_skottieanimation_t; + + + { modules/skparagraph/include/sk4d_paragraph_types.h } + + sk_paragraph_t = THandle; + sk_paragraphbuilder_t = THandle; + sk_paragraphstyle_t = THandle; + sk_strutstyle_t = THandle; + sk_textstyle_t = THandle; + sk_typefacefontprovider_t = THandle; + + psk_paragraph_t = ^sk_paragraph_t; + psk_paragraphbuilder_t = ^sk_paragraphbuilder_t; + psk_paragraphstyle_t = ^sk_paragraphstyle_t; + psk_strutstyle_t = ^sk_strutstyle_t; + psk_textstyle_t = ^sk_textstyle_t; + psk_typefacefontprovider_t = ^sk_typefacefontprovider_t; + + sk_affinity_t = ( + UPSTREAM_SK_AFFINITY, + DOWNSTREAM_SK_AFFINITY + ); + psk_affinity_t = ^sk_affinity_t; + + sk_placeholderalignment_t = ( + BASELINE_SK_PLACEHOLDERALIGNMENT, + ABOVE_BASELINE_SK_PLACEHOLDERALIGNMENT, + BELOW_BASELINE_SK_PLACEHOLDERALIGNMENT, + TOP_SK_PLACEHOLDERALIGNMENT, + BOTTOM_SK_PLACEHOLDERALIGNMENT, + MIDDLE_SK_PLACEHOLDERALIGNMENT + ); + psk_placeholderalignment_t = ^sk_placeholderalignment_t; + + sk_rectheightstyle_t = ( + TIGHT_SK_RECTHEIGHTSTYLE, + MAX_SK_RECTHEIGHTSTYLE, + INCLUDE_LINE_SPACING_MIDDLE_SK_RECTHEIGHTSTYLE, + INCLUDE_LINE_SPACING_TOP_SK_RECTHEIGHTSTYLE, + INCLUDE_LINE_SPACING_BOTTOM_SK_RECTHEIGHTSTYLE, + STRUT_SK_RECTHEIGHTSTYLE + ); + psk_rectheightstyle_t = ^sk_rectheightstyle_t; + + sk_rectwidthstyle_t = ( + TIGHT_SK_RECTWIDTHSTYLE, + MAX_SK_RECTWIDTHSTYLE + ); + psk_rectwidthstyle_t = ^sk_rectwidthstyle_t; + + sk_textalign_t = ( + LEFT_SK_TEXTALIGN, + RIGHT_SK_TEXTALIGN, + CENTER_SK_TEXTALIGN, + JUSTIFY_SK_TEXTALIGN, + START_SK_TEXTALIGN, + TERMINATE_SK_TEXTALIGN + ); + psk_textalign_t = ^sk_textalign_t; + + sk_textbaseline_t = ( + ALPHABETIC_SK_TEXTBASELINE, + IDEOGRAPHIC_SK_TEXTBASELINE + ); + psk_textbaseline_t = ^sk_textbaseline_t; + + sk_textdecorationstyle_t = ( + SOLID_SK_TEXTDECORATIONSTYLE, + DOUBLE_SK_TEXTDECORATIONSTYLE, + DOTTED_SK_TEXTDECORATIONSTYLE, + DASHED_SK_TEXTDECORATIONSTYLE, + WAVY_SK_TEXTDECORATIONSTYLE + ); + psk_textdecorationstyle_t = ^sk_textdecorationstyle_t; + + sk_textdirection_t = ( + RIGHT_TO_LEFT_SK_TEXTDIRECTION, + LEFT_TO_RIGHT_SK_TEXTDIRECTION + ); + psk_textdirection_t = ^sk_textdirection_t; + + sk_metrics_t = record + start_index : size_t; + end_index : size_t; + end_excluding_whitespaces : size_t; + end_including_newline : size_t; + is_hard_break : _bool; + ascent : _double; + descent : _double; + height : _double; + width : _double; + left : _double; + baseline : _double; + line_number : size_t; + end; + psk_metrics_t = ^sk_metrics_t; + + sk_paragraphvisitorinfo_t = record + font : sk_font_t; + origin : sk_point_t; + advance_x : float; + count : int32_t; + glyphs : puint16_t; + positions : psk_point_t; + utf8_starts : puint32_t; + flags : uint32_t; + end; + psk_paragraphvisitorinfo_t = ^sk_paragraphvisitorinfo_t; + + sk_placeholderstyle_t = record + width : float; + height : float; + alignment : sk_placeholderalignment_t; + baseline : sk_textbaseline_t; + baseline_offset : float; + end; + psk_placeholderstyle_t = ^sk_placeholderstyle_t; + + sk_positionaffinity_t = record + position: int32_t; + affinity: sk_affinity_t; + end; + psk_positionaffinity_t = ^sk_positionaffinity_t; + + sk_textbox_t = record + rect : sk_rect_t; + direction : sk_textdirection_t; + end; + psk_textbox_t = ^sk_textbox_t; + + sk_textshadow_t = record + color : sk_color_t; + offset : sk_point_t; + blur_radius : _double; + end; + psk_textshadow_t = ^sk_textshadow_t; + + sk_paragraph_visit_proc = procedure (line_number: int32_t; const info: psk_paragraphvisitorinfo_t; context: Pointer); cdecl; + + + { modules/skresources/include/sk4d_resources_types.h } + + sk_resourceprovider_t = THandle; + sk_resourceproviderbaseclass_t = THandle; + + psk_resourceprovider_t = ^sk_resourceprovider_t; + psk_resourceproviderbaseclass_t = ^sk_resourceproviderbaseclass_t; + + sk_resourceproviderbaseclass_procs_t = record + load: function (context: Pointer; const path, name: MarshaledAString): sk_data_t; cdecl; + end; + psk_resourceproviderbaseclass_procs_t = ^sk_resourceproviderbaseclass_procs_t; + + + { modules/skshaper/include/sk4d_shaper_types.h } + + sk_shaper_t = THandle; + + psk_shaper_t = ^sk_shaper_t; + + + { modules/skunicode/include/sk4d_unicode_types.h } + + sk_unicode_t = THandle; + sk_unicodebreakiterator_t = THandle; + + psk_unicode_t = ^sk_unicode_t; + psk_unicodebreakiterator_t = ^sk_unicodebreakiterator_t; + + sk_breaktype_t = ( + WORDS_SK_BREAKTYPE, + GRAPHEMES_SK_BREAKTYPE, + LINES_SK_BREAKTYPE + ); + psk_breaktype_t = ^sk_breaktype_t; + + sk_direction_t = ( + LEFT_TO_RIGHT_SK_DIRECTION, + RIGHT_TO_LEFT_SK_DIRECTION + ); + psk_direction_t = ^sk_direction_t; + + sk_unicodebreakiteratorelem_t = record + position: int32_t; + status: int32_t; + end; + psk_unicodebreakiteratorelem_t = ^sk_unicodebreakiteratorelem_t; + + sk_unicode_bidi_region_proc = procedure (start, &end: int32_t; level: uint8_t; context: Pointer); cdecl; + sk_unicode_break_proc = procedure (position, status: int32_t; context: Pointer); cdecl; + sk_unicode_codepoint_proc = procedure (uni_char: sk_unichar_t; start, &end: int32_t; context: Pointer); cdecl; + + + { modules/svg/include/sk4d_svg_types.h } + + sk_svgdom_t = THandle; + sk_svgsvg_t = THandle; + sk_svgnode_t = THandle; + + psk_svgdom_t = ^sk_svgdom_t; + psk_svgsvg_t = ^sk_svgsvg_t; + psk_svgnode_t = ^sk_svgnode_t; + + sk_svglengthunit_t = ( + UNKNOWN_SK_SVGLENGTHUNIT, + NUMBER_SK_SVGLENGTHUNIT, + PERCENTAGE_SK_SVGLENGTHUNIT, + EMS_SK_SVGLENGTHUNIT, + EXS_SK_SVGLENGTHUNIT, + PX_SK_SVGLENGTHUNIT, + CM_SK_SVGLENGTHUNIT, + MM_SK_SVGLENGTHUNIT, + IN_SK_SVGLENGTHUNIT, + PT_SK_SVGLENGTHUNIT, + PC_SK_SVGLENGTHUNIT + ); + psk_svglengthunit_t = ^sk_svglengthunit_t; + + sk_svgaspectalign_t = ( + X_MIN_Y_MIN_SK_SVGASPECTALIGN, + X_MID_Y_MIN_SK_SVGASPECTALIGN, + X_MAX_Y_MIN_SK_SVGASPECTALIGN, + X_MIN_Y_MID_SK_SVGASPECTALIGN = 4, + X_MID_Y_MID_SK_SVGASPECTALIGN, + X_MAX_Y_MID_SK_SVGASPECTALIGN, + X_MIN_Y_MAX_SK_SVGASPECTALIGN = 8, + X_MID_Y_MAX_SK_SVGASPECTALIGN, + X_MAX_Y_MAX_SK_SVGASPECTALIGN, + NONE_SK_SVGASPECTALIGN = 16 + ); + psk_svgaspectalign_t = ^sk_svgaspectalign_t; + + sk_svgaspectscale_t = ( + MEET_SK_SVGASPECTSCALE, + SLICE_SK_SVGASPECTSCALE + ); + psk_svgaspectscale_t = ^sk_svgaspectscale_t; + + sk_svglength_t = record + value: float; + &unit: sk_svglengthunit_t; + end; + psk_svglength_t = ^sk_svglength_t; + + sk_svgpreserveaspectratio_t = record + align: sk_svgaspectalign_t; + scale: sk_svgaspectscale_t; + end; + psk_svgpreserveaspectratio_t = ^sk_svgpreserveaspectratio_t; + + + +{$IFNDEF SK_STATIC_LIBRARY} +var +{$ENDIF} + + { include/c/gr4d_backendsurface.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendrendertarget_create_gl {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(width, height, sample_count, stencil_bits: int32_t; const framebuffer_info: pgr_gl_framebufferinfo_t): gr_backendrendertarget_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendrendertarget_create_mtl {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(width, height: int32_t; const texture_info: pgr_mtl_textureinfo_t): gr_backendrendertarget_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendrendertarget_create_vk {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(width, height: int32_t; const image_info: pgr_vk_imageinfo_t): gr_backendrendertarget_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_backendrendertarget_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_backendrendertarget_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendrendertarget_get_backend_api {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendrendertarget_t): gr_backendapi_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendrendertarget_get_height {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendrendertarget_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendrendertarget_get_sample_count {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendrendertarget_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendrendertarget_get_stencil_bits {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendrendertarget_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendrendertarget_get_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendrendertarget_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendrendertarget_is_valid {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendrendertarget_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendtexture_create_gl {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(width, height: int32_t; is_mipmapped: _bool; const texture_info: pgr_gl_textureinfo_t): gr_backendtexture_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendtexture_create_mtl {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(width, height: int32_t; is_mipmapped: _bool; const texture_info: pgr_mtl_textureinfo_t): gr_backendtexture_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendtexture_create_vk {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(width, height: int32_t; const image_info: pgr_vk_imageinfo_t): gr_backendtexture_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_backendtexture_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_backendtexture_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendtexture_get_backend_api {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendtexture_t): gr_backendapi_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendtexture_get_gl_framebuffer_info{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendtexture_t; out texture_info: gr_gl_textureinfo_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendtexture_get_height {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendtexture_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendtexture_get_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendtexture_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendtexture_has_mipmaps {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendtexture_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_backendtexture_is_valid {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_backendtexture_t): _bool; cdecl; + + + { include/c/gr4d_contextoptions.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_persistentcachebaseclass_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: Pointer): gr_persistentcachebaseclass_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_persistentcachebaseclass_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_persistentcachebaseclass_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_persistentcachebaseclass_set_procs{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const procs: pgr_persistentcachebaseclass_procs_t); cdecl; + + + { include/c/gr4d_directcontext.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_abandon_context {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_dump_memory_statistics {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: gr_directcontext_t; trace_memory_dump: sk_tracememorydump_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_flush {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_flush_and_submit {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t; sync_cpu: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_free_gpu_resources {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_directcontext_get_backend_api {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_directcontext_t): gr_backendapi_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_directcontext_get_max_surface_sample_count_for_color_type{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_directcontext_t; color_type: sk_colortype_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_directcontext_get_resource_cache_limit {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_directcontext_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_get_resource_cache_usage {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: gr_directcontext_t; out resources: int32_t; out resources_bytes: size_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_directcontext_is_abandoned {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: gr_directcontext_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_directcontext_make_gl {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const gl_interface: gr_gl_interface_t; const options: pgr_contextoptions_t): gr_directcontext_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_directcontext_make_metal {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const backend_context: pgr_mtl_backendcontext_t; const options: pgr_contextoptions_t): gr_directcontext_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_directcontext_make_vulkan {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const backend_context: pgr_vk_backendcontext_t; const options: pgr_contextoptions_t): gr_directcontext_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_perform_deferred_cleanup {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t; milliseconds: int64_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_purge_unlocked_resources {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t; scratch_resources_only: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_purge_unlocked_resources2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t; bytes_to_purge: size_t; prefer_scratch_resources: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_release_resources_and_abandon_context {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_reset_context {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_directcontext_set_resource_cache_limit {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_directcontext_t; value: size_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_directcontext_submit {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: gr_directcontext_t; sync_cpu: _bool): _bool; cdecl; + + + { include/c/gr4d_gl_interface.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_gl_interface_has_extension {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_gl_interface_t; const name: MarshaledAString): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_gl_interface_make_assembled {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: Pointer; proc: gr_gl_get_proc): gr_gl_interface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_gl_interface_make_assembled_gl {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: Pointer; proc: gr_gl_get_proc): gr_gl_interface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_gl_interface_make_assembled_gles {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: Pointer; proc: gr_gl_get_proc): gr_gl_interface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_gl_interface_make_assembled_webgl{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: Pointer; proc: gr_gl_get_proc): gr_gl_interface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_gl_interface_make_native {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): gr_gl_interface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_gl_interface_validate {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_gl_interface_t): _bool; cdecl; + + + { include/c/gr4d_shadererrorhandler.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_shadererrorhandlerbaseclass_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: Pointer): gr_shadererrorhandlerbaseclass_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_shadererrorhandlerbaseclass_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_shadererrorhandlerbaseclass_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_shadererrorhandlerbaseclass_set_procs{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const procs: pgr_shadererrorhandlerbaseclass_procs_t); cdecl; + + + { include/c/gr4d_vk_extensions.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_vk_extensions_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): gr_vk_extensions_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_vk_extensions_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_vk_extensions_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}gr4d_vk_extensions_has_extension{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: gr_vk_extensions_t; const name: MarshaledAString; min_version: uint32_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}gr4d_vk_extensions_init {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: gr_vk_extensions_t; context: Pointer; proc: gr_vk_get_proc; instance: gr_vk_instance_t; physical_device: gr_vk_physicaldevice_t; const instance_extensions: PMarshaledAString; instance_extension_count: int32_t; const device_extensions: PMarshaledAString; device_extension_count: int32_t); cdecl; + + + { include/c/sk4d_blender.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_blender_make_arithmetic{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(k1, k2, k3, k4: float; enforce_premultiplied_color: _bool): sk_blender_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_blender_make_mode {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(mode: sk_blendmode_t): sk_blender_t; cdecl; + + + { include/c/sk4d_canvas.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_clear {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; color: sk_color_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_clear2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const color: psk_color4f_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_discard {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_clip_path {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const path: sk_path_t; op: sk_clipop_t; anti_alias: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_clip_rect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; op: sk_clipop_t; anti_alias: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_clip_region {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const region: sk_region_t; op: sk_clipop_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_clip_rrect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const rrect: sk_rrect_t; op: sk_clipop_t; anti_alias: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_clip_shader {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; shader: sk_shader_t; op: sk_clipop_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_concat {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const matrix: psk_matrix44_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_concat2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const matrix: psk_matrix_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_annotation {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; const key: MarshaledAString; const value: Pointer; size: size_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_arc {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const oval: psk_rect_t; start_angle, sweep_angle: float; use_center: _bool; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_atlas {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const atlas: sk_image_t; const transforms: psk_rotationscalematrix_t; const sprites: psk_rect_t; const colors: psk_color_t; count: int32_t; blend_mode: sk_blendmode_t; const sampling: psk_samplingoptions_t; const cull_rect: psk_rect_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_circle {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const center: psk_point_t; radius: float; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_color {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; color: sk_color_t; blend_mode: sk_blendmode_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_color2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const color: psk_color4f_t; blend_mode: sk_blendmode_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_glyphs {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; count: int32_t; const glyphs: psk_glyphid_t; const positions: psk_point_t; const origin: psk_point_t; const font: sk_font_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_glyphs2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; count: int32_t; const glyphs: psk_glyphid_t; const matrices: psk_rotationscalematrix_t; const origin: psk_point_t; const font: sk_font_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_image {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const image: sk_image_t; x, y: float; const sampling: psk_samplingoptions_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_image_lattice {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const image: sk_image_t; const lattice: psk_lattice_t; const dest: psk_rect_t; filter_mode: sk_filtermode_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_image_nine {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const image: sk_image_t; const center: psk_irect_t; const dest: psk_rect_t; filter_mode: sk_filtermode_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_image_rect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const image: sk_image_t; const src, dest: psk_rect_t; const sampling: psk_samplingoptions_t; const paint: sk_paint_t; constraint: sk_srcrectconstraint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_line {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const point1, point2: psk_point_t; paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_oval {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const oval: psk_rect_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_paint {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_patch {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const cubics: psk_point_t; const colors: psk_color_t; const tex_coords: psk_point_t; blend_mode: sk_blendmode_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_path {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const path: sk_path_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_picture {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const picture: sk_picture_t; const matrix: psk_matrix_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_point {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const point: psk_point_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_points {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; mode: sk_drawpointsmode_t; count: size_t; const points: psk_point_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_rect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_region {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const region: sk_region_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_rrect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const rrect: sk_rrect_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_rrect2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; radius_x, radius_y: float; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_rrect_difference {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const outer, inner: sk_rrect_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_simple_text {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const text: Pointer; size: size_t; encoding: sk_textencoding_t; x, y: float; const font: sk_font_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_text_blob {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const text_blob: sk_textblob_t; x, y: float; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_draw_vertices {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const vertices: sk_vertices_t; blend_mode: sk_blendmode_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_get_base_props {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_surfaceprops_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_get_device_clip_bounds {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_irect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_get_local_clip_bounds {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_rect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_get_local_to_device {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_matrix44_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_get_local_to_device_as_3x3{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_matrix_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_get_top_props {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_canvas_t; out result: sk_surfaceprops_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_canvas_get_save_count {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_canvas_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_canvas_make_surface {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_canvas_t; const image_info: psk_imageinfo_t; const props: psk_surfaceprops_t): sk_surface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_canvas_quick_reject {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_canvas_t; const rect: psk_rect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_canvas_quick_reject2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_canvas_t; const path: sk_path_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_reset_matrix {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_restore {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_restore_to_count {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; save_count: int32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_rotate {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; degrees: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_rotate2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; degrees, px, py: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_canvas_save {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_canvas_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_canvas_save_layer {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; const paint: sk_paint_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_canvas_save_layer_alpha {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_canvas_t; const rect: psk_rect_t; alpha: uint8_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_scale {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; sx, sy: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_set_matrix {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const matrix: psk_matrix44_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_set_matrix2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; const matrix: psk_matrix_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_skew {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; kx, ky: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_canvas_translate {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_canvas_t; dx, dy: float); cdecl; + + + { include/c/sk4d_codec.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_codec_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(codec: sk_codec_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_codec_get_dimensions {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_codec_t; out result: sk_isize_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_codec_get_encoded_image_format {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_codec_t): sk_encodedimageformat_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_codec_get_image {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_codec_t; color_type: sk_colortype_t; alpha_type: sk_alphatype_t; color_space: sk_colorspace_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_codec_get_pixels {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_codec_t; pixels: Pointer; row_bytes: size_t; color_type: sk_colortype_t; alpha_type: sk_alphatype_t; color_space: sk_colorspace_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_codec_make_from_file {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const file_name: MarshaledAString): sk_codec_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_codec_make_from_stream {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(stream: sk_stream_t): sk_codec_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_codec_make_with_copy {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const data: Pointer; size: size_t): sk_codec_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_codec_make_without_copy {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const data: Pointer; size: size_t): sk_codec_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_animcodecplayer_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_animcodecplayer_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_animcodecplayer_get_dimensions {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_animcodecplayer_t; out result: sk_isize_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_animcodecplayer_get_duration {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_animcodecplayer_t): uint32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_animcodecplayer_get_frame {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_animcodecplayer_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_animcodecplayer_make_from_file {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const file_name: MarshaledAString): sk_animcodecplayer_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_animcodecplayer_make_from_stream{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(stream: sk_stream_t): sk_animcodecplayer_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_animcodecplayer_seek {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_animcodecplayer_t; milliseconds: uint32_t): _bool; cdecl; + + + { include/c/sk4d_colorfilter.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_blend {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(color: sk_color_t; mode: sk_blendmode_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_blend2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const color: psk_color4f_t; color_space: sk_colorspace_t; mode: sk_blendmode_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_compose {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(outer, inner: sk_colorfilter_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_high_contrast {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const config: psk_highcontrastconfig_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_hsla_matrix {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const matrix: psk_colormatrix_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_lighting {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(multiply, add: sk_color_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_linear_to_srgb_gamma{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_luma_color {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_matrix {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const matrix: psk_colormatrix_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_overdraw {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const colors: psk_color_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorfilter_make_table {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const tablea_a, tablea_r, tablea_g, tablea_b: puint8_t): sk_colorfilter_t; cdecl; + + + { include/c/sk4d_colorspace.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_gamma_close_to_srgb {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspace_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_gamma_is_linear {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspace_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_is_equal {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, color_space: sk_colorspace_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_is_numerical_transfer_fn {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspace_t; out transfer_function: sk_colorspacetransferfn_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_is_srgb {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspace_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_make {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const profile: sk_colorspaceiccprofile_t): sk_colorspace_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_make_linear_gamma {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspace_t): sk_colorspace_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_make_rgb {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const transfer_function: psk_colorspacetransferfn_t; const xyz: psk_colorspacexyz_t): sk_colorspace_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_make_srgb {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_colorspace_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_make_srgb_gamma {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspace_t): sk_colorspace_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_make_srgb_linear {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_colorspace_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_colorspace_ref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_colorspace_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_to_profile {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspace_t): sk_colorspaceiccprofile_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspace_to_xyz {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspace_t; out xyz: sk_colorspacexyz_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_colorspace_unref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_colorspace_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_colorspaceiccprofile_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_colorspaceiccprofile_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspaceiccprofile_get_buffer {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspaceiccprofile_t; size: puint32_t): puint8_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspaceiccprofile_make_with_parse{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const buffer: Pointer; size: size_t): sk_colorspaceiccprofile_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspaceiccprofile_to_xyz {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_colorspaceiccprofile_t; out dest: sk_colorspacexyz_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspaceprimaries_to_xyz {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: psk_colorspaceprimaries_t; out xyz: sk_colorspacexyz_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspacetransferfn_invert {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: psk_colorspacetransferfn_t; out transfer_function: sk_colorspacetransferfn_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_colorspacetransferfn_transform {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: psk_colorspacetransferfn_t; x: float): float; cdecl; + + + { include/c/sk4d_data.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_data_make_empty {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_data_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_data_make_with_copy{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const data: Pointer; size: size_t): sk_data_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_data_ref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_data_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_data_unref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_data_t); cdecl; + + + { include/c/sk4d_document.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_document_begin_page{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_document_t; width, height: float; const content: psk_rect_t): sk_canvas_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_document_close {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_document_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_document_end_page {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_document_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_document_make_pdf {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(w_stream: sk_wstream_t): sk_document_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_document_make_pdf2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(w_stream: sk_wstream_t; const metadata: psk_pdfmetadata_t): sk_document_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_document_make_xps {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(w_stream: sk_wstream_t; dpi: float): sk_document_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_document_terminate {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_document_t); cdecl; + + + { include/c/sk4d_font.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(typeface: sk_typeface_t; size, sx, kx: float): sk_font_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_create2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const font: sk_font_t): sk_font_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_baseline_snap {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_edging {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): sk_fontedging_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_embedded_bitmaps {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_embolden {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_force_auto_hinting {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_glyphs {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t; const text: Pointer; size: size_t; encoding: sk_textencoding_t; result: psk_glyphid_t; max_count: int32_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_glyphs_count {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t; const text: Pointer; size: size_t; encoding: sk_textencoding_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_hinting {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): sk_fonthinting_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_get_horizontal_positions{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; result: pfloat; origin: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_intercepts {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; const positions: psk_point_t; const bounds: pfloat; result: pfloat; const paint: sk_paint_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_linear_metrics {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_metrics {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t; metrics: psk_fontmetrics_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_path {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t; glyph: sk_glyphid_t): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_get_paths {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; proc: sk_font_path_proc; proc_context: Pointer); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_get_positions {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; result: psk_point_t; const origin: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_scale_x {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_size {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_skew_x {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_subpixel {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_typeface {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): sk_typeface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_get_typeface_or_default {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t): sk_typeface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_get_widths_bounds {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_font_t; const glyphs: psk_glyphid_t; count: int32_t; widths: pfloat; bounds: psk_rect_t; const paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_is_equal {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, font: sk_font_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_measure_text {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t; const text: Pointer; size: size_t; encoding: sk_textencoding_t; bounds: psk_rect_t; const paint: sk_paint_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_baseline_snap {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_edging {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: sk_fontedging_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_embedded_bitmaps {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_embolden {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_force_auto_hinting {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_hinting {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: sk_fonthinting_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_linear_metrics {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_scale_x {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_size {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_skew_x {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_subpixel {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_set_typeface {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_font_t; typeface: sk_typeface_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_font_unichar_to_glyph {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_font_t; uni_char: sk_unichar_t): sk_glyphid_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_font_unichars_to_glyphs {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_font_t; const uni_chars: psk_unichar_t; count: int32_t; result: psk_glyphid_t); cdecl; + + + { include/c/sk4d_graphics.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_graphics_allow_jit {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_graphics_dump_memory_statistics {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(trace_memory_dump: sk_tracememorydump_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_get_font_cache_count_limit {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_get_font_cache_count_used {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_get_font_cache_limit {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_get_font_cache_used {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_get_resource_cache_single_allocation_byte_limit{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_get_resource_cache_total_byte_limit {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_get_resource_cache_total_bytes_used {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_graphics_init {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_graphics_purge_all_caches {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_graphics_purge_font_cache {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_graphics_purge_resource_cache {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_set_font_cache_count_limit {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(value: int32_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_set_font_cache_limit {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(value: size_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_set_resource_cache_single_allocation_byte_limit{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(value: size_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_graphics_set_resource_cache_total_byte_limit {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(value: size_t): size_t; cdecl; + + + { include/c/sk4d_image.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_encode_to_file {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; const file_name: MarshaledAString; format: sk_encodedimageformat_t; quality: int32_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_encode_to_stream {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; w_stream: sk_wstream_t; format: sk_encodedimageformat_t; quality: int32_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_get_alpha_type {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): sk_alphatype_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_get_color_space {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): sk_colorspace_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_get_color_type {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): sk_colortype_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_get_height {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_image_get_image_info {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_image_t; out result: sk_imageinfo_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_get_unique_id {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): uint32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_get_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_is_lazy_generated {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_is_texture_backed {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_is_valid {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; context: gr_directcontext_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_cross_context {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: gr_directcontext_t; const pixmap: sk_pixmap_t; build_mips, limit_to_max_texture_size: _bool): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_from_adopted_texture{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: gr_directcontext_t; const texture: gr_backendtexture_t; origin: gr_surfaceorigin_t; color_type: sk_colortype_t; alpha_type: sk_alphatype_t; color_space: sk_colorspace_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_from_encoded_file {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const file_name: MarshaledAString): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_from_encoded_stream {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(stream: sk_stream_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_from_picture {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(picture: sk_picture_t; const dimensions: psk_isize_t; const matrix: psk_matrix_t; const paint: sk_paint_t; color_space: sk_colorspace_t; const props: psk_surfaceprops_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_from_raster {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const pixmap: sk_pixmap_t; proc: sk_image_raster_release_proc; proc_context: Pointer): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_from_texture {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: gr_directcontext_t; const texture: gr_backendtexture_t; origin: gr_surfaceorigin_t; color_type: sk_colortype_t; alpha_type: sk_alphatype_t; color_space: sk_colorspace_t; proc: sk_image_texture_release_proc; proc_context: Pointer): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_non_texture_image {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_raster_copy {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const pixmap: sk_pixmap_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_raster_image {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_raw_shader {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; tile_mode_x, tile_mode_y: sk_tilemode_t; const sampling: psk_samplingoptions_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_shader {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; tile_mode_x, tile_mode_y: sk_tilemode_t; const sampling: psk_samplingoptions_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_subset {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; const subset: psk_irect_t; context: gr_directcontext_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_texture_image {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; context: gr_directcontext_t; is_mipmapped: _bool): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_make_with_filter {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; context: gr_directcontext_t; const filter: sk_imagefilter_t; const subset, clip_bounds: psk_irect_t; out out_subset: sk_irect_t; out offset: sk_ipoint_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_peek_pixels {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t): sk_pixmap_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_read_pixels {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; context: gr_directcontext_t; const dest: sk_pixmap_t; src_x, src_y: int32_t; caching_hint: sk_imagecachinghint_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_image_scale_pixels {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_image_t; const dest: sk_pixmap_t; const sampling: psk_samplingoptions_t; caching_hint: sk_imagecachinghint_t): _bool; cdecl; + + + { include/c/sk4d_imageencoder.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imageencoder_encode_to_file {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const file_name: MarshaledAString; const src: sk_pixmap_t; format: sk_encodedimageformat_t; quality: int32_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imageencoder_encode_to_stream{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(w_stream: sk_wstream_t; const src: sk_pixmap_t; format: sk_encodedimageformat_t; quality: int32_t): _bool; cdecl; + + + { include/c/sk4d_imagefilter.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_alpha_threshold {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const region: sk_region_t; inner_min, outer_max: float; input: sk_imagefilter_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_arithmetic {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(k1, k2, k3, k4: float; enforce_premultiplied_color: _bool; background, foreground: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_blend {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(mode: sk_blendmode_t; background, foreground: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_blur {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(sigma_x, sigma_y: float; tile_mode: sk_tilemode_t; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_colorfilter {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(color_filter: sk_colorfilter_t; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_compose {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(inner, outer: sk_imagefilter_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_dilate {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(radius_x, radius_y: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_displacement_map {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(x_channel_selector, y_channel_selector: sk_colorchannel_t; scale: float; displacement, input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_distant_lit_diffuse {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const direction: psk_point3_t; light_color: sk_color_t; surface_scale, kd: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_distant_lit_specular{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const direction: psk_point3_t; light_color: sk_color_t; surface_scale, ks, shininess: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_drop_shadow {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(dx, dy, sigma_x, sigma_y: float; color: sk_color_t; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_drop_shadow_only {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(dx, dy, sigma_x, sigma_y: float; color: sk_color_t; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_erode {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(radius_x, radius_y: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_image {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(image: sk_image_t; const src, dest: psk_rect_t; const sampling: psk_samplingoptions_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_magnifier {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const src: psk_rect_t; inset: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_matrix_convolution {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const kernel_size: psk_isize_t; const kernel: pfloat; gain, bias: float; const kernel_offset: psk_ipoint_t; tile_mode: sk_tilemode_t; convolve_alpha: _bool; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_matrix_transform {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const matrix: psk_matrix_t; const sampling: psk_samplingoptions_t; input: sk_imagefilter_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_merge {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const filters: psk_imagefilter_t; count: int32_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_offset {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(dx, dy: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_picture {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(picture: sk_picture_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_point_lit_diffuse {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const location: psk_point3_t; light_color: sk_color_t; surface_scale, kd: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_point_lit_specular {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const location: psk_point3_t; light_color: sk_color_t; surface_scale, ks, shininess: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_shader {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(shader: sk_shader_t; dither: _bool; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_spot_lit_diffuse {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const location, target: psk_point3_t; falloff_exponent, cutoff_angle: float; light_color: sk_color_t; surface_scale, kd: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_spot_lit_specular {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const location, target: psk_point3_t; falloff_exponent, cutoff_angle: float; light_color: sk_color_t; surface_scale, ks, shininess: float; input: sk_imagefilter_t; const crop_rect: psk_rect_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_tile {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const src, dest: psk_rect_t; input: sk_imagefilter_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_imagefilter_make_with_local_matrix {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_imagefilter_t; const local_matrix: psk_matrix_t): sk_imagefilter_t; cdecl; + + + + { include/c/sk4d_maskfilter.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_maskfilter_make_blur {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(style: sk_blurstyle_t; sigma: float; respect_ctm: _bool): sk_maskfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_maskfilter_make_shader {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(shader: sk_shader_t): sk_maskfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_maskfilter_make_table {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const table: puint8_t): sk_maskfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_maskfilter_make_table_clip {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(min, max: uint8_t): sk_maskfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_maskfilter_make_table_gamma{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(gamma: float): sk_maskfilter_t; cdecl; + + + { include/c/sk4d_paint.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_paint_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_create2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const paint: sk_paint_t): sk_paint_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_alpha {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): uint8_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_alphaf {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_anti_alias {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_blender {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_blender_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_color {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_color_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_get_colorf {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_paint_t; out result: sk_color4f_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_color_filter {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_dither {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_fill_path {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t; const path: sk_path_t; const cull_rect: psk_rect_t; res_scale: float): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_image_filter {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_imagefilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_mask_filter {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_maskfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_path_effect {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_shader {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_stroke_cap {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_strokecap_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_stroke_join {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_strokejoin_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_stroke_miter {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_stroke_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paint_get_style {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paint_t): sk_paintstyle_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_reset {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_alpha {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: uint8_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_alphaf {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_antialias {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_argb {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; a, r, g, b: uint8_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_blender {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_blender_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_color {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_color_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_colorf {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; const value: psk_color4f_t; color_space: sk_colorspace_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_color_filter {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_colorfilter_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_dither {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_image_filter {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_imagefilter_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_mask_filter {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_maskfilter_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_path_effect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_patheffect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_shader {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_shader_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_stroke_cap {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_strokecap_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_stroke_join {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_strokejoin_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_stroke_miter {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_stroke_width {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paint_set_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paint_t; value: sk_paintstyle_t); cdecl; + + + { include/c/sk4d_path.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_opbuilder_add {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_opbuilder_t; const path: sk_path_t; op: sk_pathop_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_opbuilder_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_opbuilder_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_opbuilder_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_opbuilder_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_opbuilder_detach {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_opbuilder_t): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_contains {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t; x, y: float): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_convert_conic_to_quads{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const point1, point2, point3: psk_point_t; weight: float; points: psk_point_t; power2: int32_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const svg: MarshaledAString): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_create2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(stream: sk_stream_t): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_path_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_path_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_path_get_bounds {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_path_t; out result: sk_rect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_get_fill_type {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t): sk_pathfilltype_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_get_last_point {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t; out result: sk_point_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_get_segment_masks {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t): uint32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_path_get_tight_bounds {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_path_t; out result: sk_rect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_interpolate {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, ending: sk_path_t; weight: float): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_is_convex {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_is_empty {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_is_finite {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_is_interpolatable {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, path: sk_path_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_is_last_contour_closed{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_is_line {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t; lines: psk_point_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_is_oval {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t; oval: psk_rect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_is_rect {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t; rect: psk_rect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_is_rrect {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t; rrect: sk_rrect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_op {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, path: sk_path_t; op: sk_pathop_t): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_path_serialize_to_stream {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_path_t; w_stream: sk_wstream_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_to_svg {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t): sk_string_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_path_transform {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_path_t; const matrix: psk_matrix_t): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathiterator_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const path: sk_path_t; force_close: _bool): sk_pathiterator_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathiterator_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathiterator_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathiterator_next {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_pathiterator_t; out elem: sk_pathiteratorelem_t): _bool; cdecl; + + + { include/c/sk4d_pathbuilder.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_add_arc {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const oval: psk_rect_t; start_angle, sweep_angle: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_add_circle {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; center_x, center_y, radius: float; direction: sk_pathdirection_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_add_oval {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const oval: psk_rect_t; direction: sk_pathdirection_t; start_index: uint32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_add_path {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const path: sk_path_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_add_polygon {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; polygon: psk_point_t; count: int32_t; is_closed: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_add_rect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const rect: psk_rect_t; direction: sk_pathdirection_t; start_index: uint32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_add_rrect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const rrect: sk_rrect_t; direction: sk_pathdirection_t; start_index: uint32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_arc_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const radius: psk_point_t; x_axis_rotate: float; large_arc: sk_patharcsize_t; sweep: sk_pathdirection_t; const xy: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_arc_to2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const oval: psk_rect_t; start_angle, sweep_angle: float; force_move_to: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_arc_to3 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t; radius: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_close {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_conic_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t; weight: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathbuilder_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_pathbuilder_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathbuilder_create2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const path_builder: sk_pathbuilder_t): sk_pathbuilder_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_cubic_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2, point3: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathbuilder_detach {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_pathbuilder_t): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_get_bounds {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_pathbuilder_t; out result: sk_rect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathbuilder_get_fill_type {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pathbuilder_t): sk_pathfilltype_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_inc_reserve {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; extra_point_count, extra_verb_count: int32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_line_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const cpoint: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_move_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const cpoint: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_offset {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; dx, dy: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_polyline_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const points: psk_point_t; count: int32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_quad_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_r_conic_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t; weight: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_r_cubic_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2, point3: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_r_line_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_r_quad_to {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; const point1, point2: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_reset {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_set_filltype {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t; value: sk_pathfilltype_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathbuilder_snapshot {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pathbuilder_t): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathbuilder_toggle_inverse_filltype{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathbuilder_t); cdecl; + + + { include/c/sk4d_patheffect.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_1dpath {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const path: sk_path_t; advance, phase: float; style: sk_patheffect1dstyle_t): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_2dline {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(width: float; const matrix: psk_matrix_t): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_2dpath {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const matrix: psk_matrix_t; const path: sk_path_t): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_compose {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(outer, inner: sk_patheffect_t): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_corner {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(radius: float): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_dash {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const intervals: pfloat; count: int32_t; phase: float): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_discrete {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(seg_length, deviation: float; seed_assist: uint32_t): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_matrix {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const matrix: psk_matrix_t): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_merge {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(effect1, effect2: sk_patheffect_t; op: sk_pathop_t): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_stroke {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(width: float; join: sk_strokejoin_t; cap: sk_strokecap_t; miter: float): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_stroke_and_fill{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_sum {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(effect1, effect2: sk_patheffect_t): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_translate {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(dx, dy: float): sk_patheffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_patheffect_make_trim {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(start, stop: float; mode: sk_patheffecttrimmode_t): sk_patheffect_t; cdecl; + + + { include/c/sk4d_pathmeasure.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathmeasure_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const path: sk_path_t; force_closed: _bool; res_scale: float): sk_pathmeasure_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pathmeasure_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pathmeasure_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathmeasure_get_length {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_pathmeasure_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathmeasure_get_matrix {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_pathmeasure_t; distance: float; out matrix: sk_matrix_t; matrix_flags: uint32_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathmeasure_get_position_and_tangent{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_pathmeasure_t; distance: float; out position: sk_point_t; out tangent: sk_vector_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathmeasure_get_segment {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_pathmeasure_t; start, stop: float; start_with_move_to: _bool): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathmeasure_is_closed {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_pathmeasure_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pathmeasure_next_contour {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_pathmeasure_t): _bool; cdecl; + + + { include/c/sk4d_picture.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_picture_get_cull_rect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_picture_t; out result: sk_rect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_picture_make_from_stream {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(stream: sk_stream_t): sk_picture_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_picture_make_shader {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_picture_t; tile_mode_x, tile_mode_y: sk_tilemode_t; filter_mode: sk_filtermode_t; const local_matrix: psk_matrix_t; const tile_rect: psk_rect_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_picture_playback {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_picture_t; canvas: sk_canvas_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_picture_serialize_to_stream{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_picture_t; w_stream: sk_wstream_t); cdecl; + + + { include/c/sk4d_picturerecorder.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_picturerecorder_begin_recording {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_picturerecorder_t; const bounds: psk_rect_t): sk_canvas_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_picturerecorder_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_picturerecorder_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_picturerecorder_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_picturerecorder_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_picturerecorder_finish_recording {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_picturerecorder_t): sk_picture_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_picturerecorder_finish_recording2{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_picturerecorder_t; const cull_rect: psk_rect_t): sk_picture_t; cdecl; + + + { include/c/sk4d_pixmap.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const image_info: psk_imageinfo_t; const pixels: Pointer; row_bytes: size_t): sk_pixmap_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pixmap_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pixmap_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_erase {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t; color: sk_color_t; const area: psk_irect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_erase2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t; const color: psk_color4f_t; color_space: sk_colorspace_t; const area: psk_irect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_extract_subset {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t; dest: sk_pixmap_t; const area: psk_irect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_alpha {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t; x, y: int32_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_alpha_type {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t): sk_alphatype_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_color {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t; x, y: int32_t): sk_color_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_color_space{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t): sk_colorspace_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_color_type {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t): sk_colortype_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pixmap_get_colorf {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_pixmap_t; x, y: int32_t; out result: sk_color4f_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_height {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pixmap_get_image_info {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_pixmap_t; out result: sk_imageinfo_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_pixel_addr {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t; x, y: int32_t): Pointer; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_pixels {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t): Pointer; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_row_bytes {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_get_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_pixmap_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_read_pixels {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, dest: sk_pixmap_t; src_x, src_y: int32_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_pixmap_scale_pixels {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, dest: sk_pixmap_t; const sampling: psk_samplingoptions_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_pixmap_set_colorspace {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_pixmap_t; value: sk_colorspace_t); cdecl; + + + { include/c/sk4d_refcnt.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_refcnt_ref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_refcnt_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_refcnt_unref{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_refcnt_t); cdecl; + + + { include/c/sk4d_region.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_contains {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, region: sk_region_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_contains2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_region_t; const rect: psk_irect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_contains3 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_region_t; x, y: int32_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_region_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_create2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const region: sk_region_t): sk_region_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_region_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_region_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_get_boundary_path {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_region_t): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_region_get_bounds {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_region_t; out result: sk_irect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_intersects {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, region: sk_region_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_intersects2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_region_t; const rect: psk_irect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_is_complex {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_region_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_is_empty {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_region_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_is_equal {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, region: sk_region_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_is_rect {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_region_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_op {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_region_t; const region: sk_region_t; op: sk_regionop_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_op2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_region_t; const rect: psk_irect_t; op: sk_regionop_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_quick_contains {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_region_t; const rect: psk_irect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_quick_reject {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, region: sk_region_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_quick_reject2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_region_t; const rect: psk_irect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_region_set_empty {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_region_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_set_path {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_region_t; const path: sk_path_t; const clip: sk_region_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_set_rect {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_region_t; const rect: psk_irect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_region_set_rects {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_region_t; const rects: psk_irect_t; count: int32_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_region_translate {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_region_t; x, y: int32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_regioncliperator_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const region: sk_region_t; const clip: psk_irect_t): sk_regioncliperator_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_regioncliperator_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_regioncliperator_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_regioncliperator_get_current{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_regioncliperator_t; out result: sk_irect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_regioncliperator_move_next {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_regioncliperator_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_regioniterator_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const region: sk_region_t): sk_regioniterator_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_regioniterator_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_regioniterator_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_regioniterator_get_current {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_regioniterator_t; out result: sk_irect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_regioniterator_move_next {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_regioniterator_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_regionspanerator_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const region: sk_region_t; y, left, right: int32_t): sk_regionspanerator_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_regionspanerator_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_regionspanerator_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_regionspanerator_next {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_regionspanerator_t; out elem: sk_ipoint_t): _bool; cdecl; + + + { include/c/sk4d_rrect.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_contains {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t; const rect: psk_rect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_rrect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_create2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const rrect: sk_rrect_t): sk_rrect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_deflate {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t; dx, dy: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_get_height {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_get_radii {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_rrect_t; corner: sk_rrectcorner_t; out result: sk_vector_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_get_rect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_rrect_t; out result: sk_rect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_get_simple_radii{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_rrect_t; out result: sk_vector_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_get_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_inflate {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t; dx, dy: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_is_complex {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_is_empty {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_is_equal {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, rrect: sk_rrect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_is_nine_patch {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_is_oval {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_is_rect {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_is_simple {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_is_valid {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_offset {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t; dx, dy: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_set_empty {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_set_nine_patch {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t; radius_left, radius_top, radius_right, radius_bottom: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_set_oval {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_set_rect {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_set_rect2 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t; const radii: psk_vector_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_rrect_set_rect3 {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_rrect_t; const rect: psk_rect_t; radius_x, radius_y: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_rrect_transform {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_rrect_t; const matrix: psk_matrix_t): sk_rrect_t; cdecl; + + + { include/c/sk4d_runtimeeffect.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_get_child_count {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_get_child_name {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): MarshaledAString; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_get_child_type {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): sk_runtimeeffectchildtype_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_get_uniform_count {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_get_uniform_data_size {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_get_uniform_name {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): MarshaledAString; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_get_uniform_offset {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_get_uniform_type {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): sk_runtimeeffectuniformtype_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_get_uniform_type_count{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; index: int32_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_index_of_child {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; const name: MarshaledAString): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_index_of_uniform {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; const name: MarshaledAString): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_make_blender {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; const uniforms: Pointer; children: psk_blender_t): sk_blender_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_make_color_filter {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; const uniforms: Pointer; children: psk_colorfilter_t): sk_colorfilter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_make_for_blender {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const sksl: MarshaledAString; error_text: sk_string_t): sk_runtimeeffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_make_for_color_filter {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const sksl: MarshaledAString; error_text: sk_string_t): sk_runtimeeffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_make_for_shader {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const sksl: MarshaledAString; error_text: sk_string_t): sk_runtimeeffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_make_image {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; context: gr_directcontext_t; const uniforms: Pointer; children: psk_shader_t; const local_matrix: psk_matrix_t; const image_info: psk_imageinfo_t; mipmapped: _bool): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_runtimeeffect_make_shader {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_runtimeeffect_t; const uniforms: Pointer; children: psk_shader_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + + + { include/c/sk4d_shader.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_blend {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(mode: sk_blendmode_t; dest, src: sk_shader_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_color {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(color: sk_color_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_color2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const color: psk_color4f_t; color_space: sk_colorspace_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_gradient_linear {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const points: psk_point_t; const colors: psk_color_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_gradient_linear2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const points: psk_point_t; const colors: psk_color4f_t; color_space: sk_colorspace_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_gradient_radial {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const center: psk_point_t; radius: float; const colors: psk_color_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_gradient_radial2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const center: psk_point_t; radius: float; const colors: psk_color4f_t; color_space: sk_colorspace_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_gradient_sweep {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(center_x, center_y: float; const colors: psk_color_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; start_angle, end_angle: float; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_gradient_sweep2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(center_x, center_y: float; const colors: psk_color4f_t; color_space: sk_colorspace_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; start_angle, end_angle: float; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_gradient_two_point_conical {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const start: psk_point_t; start_radius: float; const &end: psk_point_t; end_radius: float; const colors: psk_color_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_gradient_two_point_conical2{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const start: psk_point_t; start_radius: float; const &end: psk_point_t; end_radius: float; const colors: psk_color4f_t; color_space: sk_colorspace_t; const positions: pfloat; count: int32_t; tile_mode: sk_tilemode_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_perlin_noise_fractal_noise {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(base_frequency_x, base_frequency_y: float; num_octaves: int32_t; seed: float; const tile_size: psk_isize_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_perlin_noise_turbulence {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(base_frequency_x, base_frequency_y: float; num_octaves: int32_t; seed: float; const tile_size: psk_isize_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_with_color_filter {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_shader_t; color_filter: sk_colorfilter_t): sk_shader_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shader_make_with_local_matrix {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_shader_t; const local_matrix: psk_matrix_t): sk_shader_t; cdecl; + + + { include/c/sk4d_stream.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_streamadapter_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: Pointer): sk_streamadapter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_streamadapter_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_streamadapter_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_streamadapter_set_procs {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const procs: psk_streamadapter_procs_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_wstreamadapter_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: Pointer): sk_wstreamadapter_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_wstreamadapter_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_wstreamadapter_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_wstreamadapter_set_procs{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const procs: psk_wstreamadapter_procs_t); cdecl; + + + { include/c/sk4d_string.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_string_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_string_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_string_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_string_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_string_get_text{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_string_t): MarshaledAString; cdecl; + + + { include/c/sk4d_surface.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_surface_draw {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_surface_t; canvas: sk_canvas_t; x, y: float; paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_surface_flush {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_surface_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_surface_flush_and_submit {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_surface_t; sync_cpu: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_get_canvas {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_surface_t): sk_canvas_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_surface_get_props {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_surface_t; out result: sk_surfaceprops_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_make_from_mtk_view {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: gr_directcontext_t; layer: gr_mtl_handle_t; origin: gr_surfaceorigin_t; sample_count: int32_t; color_type: sk_colortype_t; color_space: sk_colorspace_t; const props: psk_surfaceprops_t): sk_surface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_make_from_render_target {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: gr_directcontext_t; const render_target: gr_backendrendertarget_t; origin: gr_surfaceorigin_t; color_type: sk_colortype_t; color_space: sk_colorspace_t; const props: psk_surfaceprops_t): sk_surface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_make_from_texture {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: gr_directcontext_t; const texture: gr_backendtexture_t; origin: gr_surfaceorigin_t; sample_count: int32_t; color_type: sk_colortype_t; color_space: sk_colorspace_t; const props: psk_surfaceprops_t): sk_surface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_make_image_snapshot {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_surface_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_make_image_snapshot2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_surface_t; const bounds: psk_irect_t): sk_image_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_make_raster {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const image_info: psk_imageinfo_t; row_bytes: size_t; const props: psk_surfaceprops_t): sk_surface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_make_raster_direct {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const pixmap: sk_pixmap_t; proc: sk_surface_raster_release_proc; proc_context: Pointer; const props: psk_surfaceprops_t): sk_surface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_make_render_target {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(context: gr_directcontext_t; is_budgeted: _bool; const image_info: psk_imageinfo_t; sample_count: int32_t; origin: gr_surfaceorigin_t; const props: psk_surfaceprops_t; should_create_with_mips: _bool): sk_surface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_peek_pixels {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_surface_t): sk_pixmap_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_surface_read_pixels {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_surface_t; const dest: sk_pixmap_t; src_x, src_y: int32_t): _bool; cdecl; + + + { include/c/sk4d_svgcanvas.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_svgcanvas_make{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const bounds: psk_rect_t; w_stream: sk_wstream_t; flags: uint32_t): sk_canvas_t; cdecl; + + + { include/c/sk4d_textblob.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textblob_get_intercepts {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textblob_t; const bounds: pfloat; result: pfloat; const paint: sk_paint_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textblob_make_from_text {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const text: Pointer; size: size_t; const font: sk_font_t; encoding: sk_textencoding_t): sk_textblob_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textblob_make_from_text_horizontally_positioned{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const text: Pointer; size: size_t; const x_positions: pfloat; y: float; const font: sk_font_t; encoding: sk_textencoding_t): sk_textblob_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textblob_make_from_text_positioned {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const text: Pointer; size: size_t; const positions: psk_point_t; const font: sk_font_t; encoding: sk_textencoding_t): sk_textblob_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textblob_make_from_text_transform {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const text: Pointer; size: size_t; const matrices: psk_rotationscalematrix_t; const font: sk_font_t; encoding: sk_textencoding_t): sk_textblob_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textblob_ref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_textblob_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textblob_unref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_textblob_t); cdecl; + + + { include/c/sk4d_tracememorydump.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_tracememorydumpbaseclass_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(detailed_dump, dump_wrapped_objects: _bool; context: Pointer): sk_tracememorydumpbaseclass_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_tracememorydumpbaseclass_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_tracememorydumpbaseclass_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_tracememorydumpbaseclass_set_procs{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const procs: psk_tracememorydumpbaseclass_procs_t); cdecl; + + + { include/c/sk4d_typeface.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_typeface_get_family_name {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_typeface_t): sk_string_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_typeface_get_slant {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_typeface_t): sk_fontslant_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_typeface_get_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_typeface_t; out result: sk_fontstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_typeface_get_weight {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_typeface_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_typeface_get_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_typeface_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_typeface_make_default {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_typeface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_typeface_make_from_file {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const file_name: MarshaledAString; ttc_index: int32_t): sk_typeface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_typeface_make_from_stream{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(stream: sk_stream_t; ttc_index: int32_t): sk_typeface_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_typeface_make_from_name {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const family_name: MarshaledAString; const style: psk_fontstyle_t): sk_typeface_t; cdecl; + + + { include/c/sk4d_vertices.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_vertices_make_copy{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(vertex_mode: sk_vertexmode_t; vertex_count: int32_t; const positions, textures: psk_point_t; const colors: psk_color_t; index_count: int32_t; const indices: puint16_t): sk_vertices_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_vertices_ref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_vertices_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_vertices_unref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_vertices_t); cdecl; + + + { modules/particles/include/sk4d_particleeffect.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_particleeffect_get_position {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_particleeffect_t; out result: sk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_particleeffect_get_rate {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_particleeffect_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_particleeffect_get_uniform {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_particleeffect_t; index: size_t; out result: sk_particleuniform_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_particleeffect_get_uniform_count {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_particleeffect_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_particleeffect_get_uniform_data {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_particleeffect_t): pfloat; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_particleeffect_get_uniform_data_count{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_particleeffect_t): int32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_particleeffect_get_uniform_name {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_particleeffect_t; index: size_t): sk_string_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_particleeffect_init {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_particleeffect_make_from_file {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const file_name: MarshaledAString): sk_particleeffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_particleeffect_make_from_stream {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(stream: sk_stream_t; resource_provider: sk_resourceprovider_t): sk_particleeffect_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_particleeffect_render {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_particleeffect_t; canvas: sk_canvas_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_particleeffect_set_position {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_particleeffect_t; const value: psk_point_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_particleeffect_set_rate {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_particleeffect_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_particleeffect_set_uniform {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_particleeffect_t; const name: MarshaledAString; const data: pfloat; count: int32_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_particleeffect_start {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_particleeffect_t; now: _double; looping: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_particleeffect_update {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_particleeffect_t; now: _double); cdecl; + + + { modules/skottie/include/sk4d_skottie.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_skottieanimation_get_duration {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_skottieanimation_t): _double; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_skottieanimation_get_fps {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_skottieanimation_t): _double; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_skottieanimation_get_in_point {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_skottieanimation_t): _double; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_skottieanimation_get_out_point {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_skottieanimation_t): _double; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_skottieanimation_get_size {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_skottieanimation_t; out result: sk_size_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_skottieanimation_get_version {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_skottieanimation_t): MarshaledAString; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_skottieanimation_make_from_file {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const file_name: MarshaledAString): sk_skottieanimation_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_skottieanimation_make_from_stream{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(stream: sk_stream_t; resource_provider: sk_resourceprovider_t): sk_skottieanimation_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_skottieanimation_ref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_skottieanimation_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_skottieanimation_render {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_skottieanimation_t; canvas: sk_canvas_t; const dest: psk_rect_t; render_flags: uint32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_skottieanimation_seek_frame {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_skottieanimation_t; tick: _double); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_skottieanimation_seek_frame_time {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_skottieanimation_t; tick: _double); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_skottieanimation_unref {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_skottieanimation_t); cdecl; + + + { modules/skparagraph/include/sk4d_paragraph.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraph_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraph_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_did_exceed_max_lines {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_alphabetic_baseline {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraph_get_glyph_position_at_coordinate{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraph_t; dx, dy: float; out result: sk_positionaffinity_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_height {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_ideographic_baseline {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_line_metrics {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t; result: psk_metrics_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_longest_line {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_max_intrinsic_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_max_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_min_intrinsic_width {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_rects_for_placeholders {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t; result: psk_textbox_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_get_rects_for_range {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t; start, &end: uint32_t; rect_height_style: sk_rectheightstyle_t; rect_width_style: sk_rectwidthstyle_t; result: psk_textbox_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraph_get_word_boundary {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraph_t; offset: uint32_t; out start, &end: uint32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraph_layout {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraph_t; width: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraph_paint {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraph_t; canvas: sk_canvas_t; x, y: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraph_to_path {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraph_t): sk_path_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraph_visit {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraph_t; proc: sk_paragraph_visit_proc; proc_context: Pointer); cdecl; + + + { modules/skparagraph/include/sk4d_paragraphbuilder.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphbuilder_add_placeholder{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphbuilder_t; const placeholder: psk_placeholderstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphbuilder_add_text {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphbuilder_t; const text: MarshaledAString); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphbuilder_build {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_paragraphbuilder_t): sk_paragraph_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphbuilder_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const paragraph_style: sk_paragraphstyle_t): sk_paragraphbuilder_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphbuilder_create2 {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const paragraph_style: sk_paragraphstyle_t; font_provider: sk_typefacefontprovider_t; enable_font_fallback: _bool): sk_paragraphbuilder_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphbuilder_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphbuilder_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphbuilder_pop {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphbuilder_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphbuilder_push_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphbuilder_t; const text_style: sk_textstyle_t); cdecl; + + + { modules/skparagraph/include/sk4d_paragraphstyle.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphstyle_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_paragraphstyle_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_disable_hinting {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphstyle_get_ellipsis {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_string_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphstyle_get_height {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paragraphstyle_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphstyle_get_max_lines {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paragraphstyle_t): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphstyle_get_strut_style {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_strutstyle_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphstyle_get_text_align {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_textalign_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphstyle_get_text_direction {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_textdirection_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphstyle_get_text_height_behaviors{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paragraphstyle_t): uint32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_paragraphstyle_get_text_style {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_paragraphstyle_t): sk_textstyle_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_set_ellipsis {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t; const value: MarshaledAString); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_set_height {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_set_max_lines {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: size_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_set_strut_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t; const value: sk_strutstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_set_text_align {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: sk_textalign_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_set_text_direction {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: sk_textdirection_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_set_text_height_behaviors{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: uint32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_paragraphstyle_set_text_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_paragraphstyle_t; value: sk_textstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_strutstyle_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_strutstyle_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_strutstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_strutstyle_get_enabled {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_strutstyle_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_strutstyle_get_font_families {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_strutstyle_t; const result: PMarshaledAString): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_strutstyle_get_font_size {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_strutstyle_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_get_font_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_strutstyle_t; out result: sk_fontstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_strutstyle_get_force_height {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_strutstyle_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_strutstyle_get_half_leading {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_strutstyle_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_strutstyle_get_height_multiplier {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_strutstyle_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_strutstyle_get_leading {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_strutstyle_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_strutstyle_is_equal {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_strutstyle_t; const strut_style: sk_strutstyle_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_set_enabled {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_strutstyle_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_set_font_families {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_strutstyle_t; const values: PMarshaledAString; count: size_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_set_font_size {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_strutstyle_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_set_font_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_strutstyle_t; value: psk_fontstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_set_force_height {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_strutstyle_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_set_half_leading {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_strutstyle_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_set_height_multiplier {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_strutstyle_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_strutstyle_set_leading {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_strutstyle_t; value: float); cdecl; + + + { modules/skparagraph/include/sk4d_textstyle.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_add_font_feature {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; const feature: MarshaledAString; value: int32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_add_shadow {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; const shadow: psk_textshadow_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_clear_background_color {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_clear_foreground_color {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_textstyle_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_background {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): sk_paint_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_color {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): sk_color_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_decoration_color {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): sk_color_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_decoration_style {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): sk_textdecorationstyle_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_decoration_thickness{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_decorations {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): uint32_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_font_families {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t; const result: PMarshaledAString): size_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_get_font_metrics {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_textstyle_t; out result: sk_fontmetrics_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_font_size {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_get_font_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_textstyle_t; out result: sk_fontstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_foreground {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): sk_paint_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_half_leading {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_height_multiplier {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_letter_spacing {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_locale {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): sk_string_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_get_word_spacing {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_textstyle_t): float; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_textstyle_is_equal {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self, text_style: sk_textstyle_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_reset_font_features {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_reset_shadows {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_background_color {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_color {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: sk_color_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_decoration_color {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: sk_color_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_decoration_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: sk_textdecorationstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_decoration_thickness{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_decorations {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: uint32_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_font_families {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; const values: PMarshaledAString; count: size_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_font_size {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_font_style {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; const value: psk_fontstyle_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_foreground_color {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; paint: sk_paint_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_half_leading {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: _bool); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_height_multiplier {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_letter_spacing {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_locale {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; const value: MarshaledAString); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_textstyle_set_word_spacing {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_textstyle_t; value: float); cdecl; + + + { modules/skparagraph/include/sk4d_typefacefontprovider.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_typefacefontprovider_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_typefacefontprovider_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_typefacefontprovider_register_typeface {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_typefacefontprovider_t; typeface: sk_typeface_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_typefacefontprovider_register_typeface2{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_typefacefontprovider_t; typeface: sk_typeface_t; const family_name: MarshaledAString); cdecl; + + + { modules/skresources/include/sk4d_resources.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_resourceproviderbaseclass_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(predecode: _bool; context: Pointer): sk_resourceproviderbaseclass_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_resourceproviderbaseclass_set_procs{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const procs: psk_resourceproviderbaseclass_procs_t); cdecl; + + + { modules/skshaper/include/sk4d_shaper.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shaper_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_shaper_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_shaper_destroy{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_shaper_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_shaper_shape {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_shaper_t; const text: MarshaledAString; const font: sk_font_t; left_to_right: _bool; width: float; const offset: psk_point_t; end_point: psk_point_t): sk_textblob_t; cdecl; + + + { modules/skunicode/include/sk4d_unicode.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_unicode_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(): sk_unicode_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_unicode_destroy {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_unicode_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_unicode_for_each_bidi_region{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_unicode_t; const utf16_text: puint16_t; utf16_units: int32_t; direction: sk_direction_t; proc: sk_unicode_bidi_region_proc; context: Pointer); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_unicode_for_each_break {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_unicode_t; const utf16_text: pchar16_t; utf16_units: int32_t; &type: sk_breaktype_t; proc: sk_unicode_break_proc; context: Pointer); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_unicode_for_each_codepoint {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_unicode_t; const utf16_text: pchar16_t; utf16_units: int32_t; proc: sk_unicode_codepoint_proc; context: Pointer); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_unicodebreakiterator_create {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(unicode: sk_unicode_t; &type: sk_breaktype_t; const text: _pchar; units: int32_t): sk_unicodebreakiterator_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_unicodebreakiterator_create2{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(unicode: sk_unicode_t; &type: sk_breaktype_t; const utf16_text: pchar16_t; utf16_units: int32_t): sk_unicodebreakiterator_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_unicodebreakiterator_destroy{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_unicodebreakiterator_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_unicodebreakiterator_next {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_unicodebreakiterator_t; out elem: sk_unicodebreakiteratorelem_t): _bool; cdecl; + + { modules/svg/include/sk4d_svgdom.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_svgdom_find_node_by_id {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_svgdom_t; const id: MarshaledAString): sk_svgnode_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_svgdom_get_root {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_svgdom_t): sk_svgsvg_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_svgdom_make_from_file {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const file_name: MarshaledAString): sk_svgdom_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_svgdom_make_from_stream {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(stream: sk_stream_t; resource_provider: sk_resourceprovider_t): sk_svgdom_t; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgdom_render {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_svgdom_t; canvas: sk_canvas_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgdom_set_container_size{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_svgdom_t; const size: psk_size_t); cdecl; + + + { modules/svg/include/sk4d_svgnode.h } + + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_svgnode_set_attribute{$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(self: sk_svgnode_t; const name, value: MarshaledAString): _bool; cdecl; + + + { modules/svg/include/sk4d_svgsvg.h } + + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_get_height {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svglength_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_get_intrinsic_size {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_svgsvg_t; const view_port: psk_size_t; dpi: float; out result: sk_size_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_get_preserve_aspect_ratio{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svgpreserveaspectratio_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}function {$ENDIF}sk4d_svgsvg_get_view_box {$IFNDEF SK_STATIC_LIBRARY}: function {$ENDIF}(const self: sk_svgsvg_t; out result: sk_rect_t): _bool; cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_get_width {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svglength_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_get_x {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svglength_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_get_y {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(const self: sk_svgsvg_t; out result: sk_svglength_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_set_height {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svglength_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_set_preserve_aspect_ratio{$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svgpreserveaspectratio_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_set_view_box {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_svgsvg_t; view_box: psk_rect_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_set_width {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svglength_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_set_x {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svglength_t); cdecl; + {$IFDEF SK_STATIC_LIBRARY}procedure {$ENDIF}sk4d_svgsvg_set_y {$IFNDEF SK_STATIC_LIBRARY}: procedure {$ENDIF}(self: sk_svgsvg_t; value: psk_svglength_t); cdecl; + +procedure SkInitialize; +procedure SkFinalize; + +implementation + +uses + { Delphi } +{$IF DEFINED(MSWINDOWS)} + System.Math, + Winapi.Windows, +{$ELSEIF DEFINED(ANDROID)} + System.IOUtils, +{$ENDIF} + System.SysUtils; + +const +{$IFDEF SK_STATIC_LIBRARY} + {$IF DEFINED(IOS) and NOT DEFINED(IOSSIMULATOR)} + LibraryName = 'libsk4d.a'; + {$ENDIF} +{$ELSE} + {$IF DEFINED(MSWINDOWS)} + LibraryName = 'sk4d.dll'; + {$ELSEIF DEFINED(MACOS)} + LibraryName = 'libsk4d.dylib'; + {$ELSE} + LibraryName = 'libsk4d.so'; + {$ENDIF} +{$ENDIF} + +{$IFNDEF SK_STATIC_LIBRARY} +var + InitCount: Integer; + LibraryHandle: HMODULE; +{$ENDIF} + +{$IF DEFINED(SK_DEBUG) and DEFINED(MSWINDOWS)} +function GetProcAddress(AModule: HMODULE; AProcName: PChar): Pointer; +begin + Result := Winapi.Windows.GetProcAddress(AModule, AProcName); + if Result = nil then + raise Exception.CreateFmt('Function "%s" not found in Skia library.', [AProcName]); +end; +{$ENDIF} + +{$IFNDEF SK_STATIC_LIBRARY} +procedure SkInitialize; +begin + if AtomicIncrement(InitCount) <> 1 then + Exit; + {$IF DEFINED(ANDROID)} + // Some Android devices, normally old, need the full path of the library, + // and other devices, normally new, do not accept the full path. + LibraryHandle := SafeLoadLibrary(LibraryName); + if LibraryHandle = 0 then + LibraryHandle := SafeLoadLibrary(TPath.Combine(TPath.GetLibraryPath, LibraryName)); + {$ELSE} + LibraryHandle := SafeLoadLibrary(LibraryName); + {$ENDIF} + if LibraryHandle = 0 then + Abort; + {$IFDEF MSWINDOWS} + SetExceptionMask(exAllArithmeticExceptions); + {$ENDIF} +{$ENDIF} + +{ include/c/gr4d_backendsurface.h } + +{$IFNDEF SK_STATIC_LIBRARY} + gr4d_backendrendertarget_create_gl := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_create_gl')); + gr4d_backendrendertarget_create_mtl := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_create_mtl')); + gr4d_backendrendertarget_create_vk := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_create_vk')); + gr4d_backendrendertarget_destroy := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_destroy')); + gr4d_backendrendertarget_get_backend_api := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_get_backend_api')); + gr4d_backendrendertarget_get_height := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_get_height')); + gr4d_backendrendertarget_get_sample_count := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_get_sample_count')); + gr4d_backendrendertarget_get_stencil_bits := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_get_stencil_bits')); + gr4d_backendrendertarget_get_width := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_get_width')); + gr4d_backendrendertarget_is_valid := GetProcAddress(LibraryHandle, PChar('gr4d_backendrendertarget_is_valid')); + gr4d_backendtexture_create_gl := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_create_gl')); + gr4d_backendtexture_create_mtl := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_create_mtl')); + gr4d_backendtexture_create_vk := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_create_vk')); + gr4d_backendtexture_destroy := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_destroy')); + gr4d_backendtexture_get_backend_api := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_get_backend_api')); + gr4d_backendtexture_get_gl_framebuffer_info := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_get_gl_framebuffer_info')); + gr4d_backendtexture_get_height := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_get_height')); + gr4d_backendtexture_get_width := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_get_width')); + gr4d_backendtexture_has_mipmaps := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_has_mipmaps')); + gr4d_backendtexture_is_valid := GetProcAddress(LibraryHandle, PChar('gr4d_backendtexture_is_valid')); +{$ELSE} +function gr4d_backendrendertarget_create_gl; external LibraryName name 'gr4d_backendrendertarget_create_gl'; +function gr4d_backendrendertarget_create_mtl; external LibraryName name 'gr4d_backendrendertarget_create_mtl'; +function gr4d_backendrendertarget_create_vk; external LibraryName name 'gr4d_backendrendertarget_create_vk'; +procedure gr4d_backendrendertarget_destroy; external LibraryName name 'gr4d_backendrendertarget_destroy'; +function gr4d_backendrendertarget_get_backend_api; external LibraryName name 'gr4d_backendrendertarget_get_backend_api'; +function gr4d_backendrendertarget_get_height; external LibraryName name 'gr4d_backendrendertarget_get_height'; +function gr4d_backendrendertarget_get_sample_count; external LibraryName name 'gr4d_backendrendertarget_get_sample_count'; +function gr4d_backendrendertarget_get_stencil_bits; external LibraryName name 'gr4d_backendrendertarget_get_stencil_bits'; +function gr4d_backendrendertarget_get_width; external LibraryName name 'gr4d_backendrendertarget_get_width'; +function gr4d_backendrendertarget_is_valid; external LibraryName name 'gr4d_backendrendertarget_is_valid'; +function gr4d_backendtexture_create_gl; external LibraryName name 'gr4d_backendtexture_create_gl'; +function gr4d_backendtexture_create_mtl; external LibraryName name 'gr4d_backendtexture_create_mtl'; +function gr4d_backendtexture_create_vk; external LibraryName name 'gr4d_backendtexture_create_vk'; +procedure gr4d_backendtexture_destroy; external LibraryName name 'gr4d_backendtexture_destroy'; +function gr4d_backendtexture_get_backend_api; external LibraryName name 'gr4d_backendtexture_get_backend_api'; +function gr4d_backendtexture_get_gl_framebuffer_info; external LibraryName name 'gr4d_backendtexture_get_gl_framebuffer_info'; +function gr4d_backendtexture_get_height; external LibraryName name 'gr4d_backendtexture_get_height'; +function gr4d_backendtexture_get_width; external LibraryName name 'gr4d_backendtexture_get_width'; +function gr4d_backendtexture_has_mipmaps; external LibraryName name 'gr4d_backendtexture_has_mipmaps'; +function gr4d_backendtexture_is_valid; external LibraryName name 'gr4d_backendtexture_is_valid'; +{$ENDIF} + + +{ include/c/gr4d_contextoptions.h } + +{$IFNDEF SK_STATIC_LIBRARY} +gr4d_persistentcachebaseclass_create := GetProcAddress(LibraryHandle, PChar('gr4d_persistentcachebaseclass_create')); +gr4d_persistentcachebaseclass_destroy := GetProcAddress(LibraryHandle, PChar('gr4d_persistentcachebaseclass_destroy')); +gr4d_persistentcachebaseclass_set_procs := GetProcAddress(LibraryHandle, PChar('gr4d_persistentcachebaseclass_set_procs')); +{$ELSE} +function gr4d_persistentcachebaseclass_create; external LibraryName name 'gr4d_persistentcachebaseclass_create'; +procedure gr4d_persistentcachebaseclass_destroy; external LibraryName name 'gr4d_persistentcachebaseclass_destroy'; +procedure gr4d_persistentcachebaseclass_set_procs; external LibraryName name 'gr4d_persistentcachebaseclass_set_procs'; +{$ENDIF} + + +{ include/c/gr4d_directcontext.h } + +{$IFNDEF SK_STATIC_LIBRARY} + gr4d_directcontext_abandon_context := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_abandon_context')); + gr4d_directcontext_dump_memory_statistics := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_dump_memory_statistics')); + gr4d_directcontext_flush := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_flush')); + gr4d_directcontext_flush_and_submit := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_flush_and_submit')); + gr4d_directcontext_free_gpu_resources := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_free_gpu_resources')); + gr4d_directcontext_get_backend_api := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_get_backend_api')); + gr4d_directcontext_get_max_surface_sample_count_for_color_type := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_get_max_surface_sample_count_for_color_type')); + gr4d_directcontext_get_resource_cache_limit := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_get_resource_cache_limit')); + gr4d_directcontext_get_resource_cache_usage := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_get_resource_cache_usage')); + gr4d_directcontext_is_abandoned := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_is_abandoned')); + gr4d_directcontext_make_gl := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_make_gl')); + gr4d_directcontext_make_metal := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_make_metal')); + gr4d_directcontext_make_vulkan := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_make_vulkan')); + gr4d_directcontext_perform_deferred_cleanup := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_perform_deferred_cleanup')); + gr4d_directcontext_purge_unlocked_resources := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_purge_unlocked_resources')); + gr4d_directcontext_purge_unlocked_resources2 := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_purge_unlocked_resources2')); + gr4d_directcontext_release_resources_and_abandon_context := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_release_resources_and_abandon_context')); + gr4d_directcontext_reset_context := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_reset_context')); + gr4d_directcontext_set_resource_cache_limit := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_set_resource_cache_limit')); + gr4d_directcontext_submit := GetProcAddress(LibraryHandle, PChar('gr4d_directcontext_submit')); +{$ELSE} +procedure gr4d_directcontext_abandon_context; external LibraryName name 'gr4d_directcontext_abandon_context'; +procedure gr4d_directcontext_dump_memory_statistics; external LibraryName name 'gr4d_directcontext_dump_memory_statistics'; +procedure gr4d_directcontext_flush; external LibraryName name 'gr4d_directcontext_flush'; +procedure gr4d_directcontext_flush_and_submit; external LibraryName name 'gr4d_directcontext_flush_and_submit'; +procedure gr4d_directcontext_free_gpu_resources; external LibraryName name 'gr4d_directcontext_free_gpu_resources'; +function gr4d_directcontext_get_backend_api; external LibraryName name 'gr4d_directcontext_get_backend_api'; +function gr4d_directcontext_get_max_surface_sample_count_for_color_type; external LibraryName name 'gr4d_directcontext_get_max_surface_sample_count_for_color_type'; +function gr4d_directcontext_get_resource_cache_limit; external LibraryName name 'gr4d_directcontext_get_resource_cache_limit'; +procedure gr4d_directcontext_get_resource_cache_usage; external LibraryName name 'gr4d_directcontext_get_resource_cache_usage'; +function gr4d_directcontext_is_abandoned; external LibraryName name 'gr4d_directcontext_is_abandoned'; +function gr4d_directcontext_make_gl; external LibraryName name 'gr4d_directcontext_make_gl'; +function gr4d_directcontext_make_metal; external LibraryName name 'gr4d_directcontext_make_metal'; +function gr4d_directcontext_make_vulkan; external LibraryName name 'gr4d_directcontext_make_vulkan'; +procedure gr4d_directcontext_perform_deferred_cleanup; external LibraryName name 'gr4d_directcontext_perform_deferred_cleanup'; +procedure gr4d_directcontext_purge_unlocked_resources; external LibraryName name 'gr4d_directcontext_purge_unlocked_resources'; +procedure gr4d_directcontext_purge_unlocked_resources2; external LibraryName name 'gr4d_directcontext_purge_unlocked_resources2'; +procedure gr4d_directcontext_release_resources_and_abandon_context; external LibraryName name 'gr4d_directcontext_release_resources_and_abandon_context'; +procedure gr4d_directcontext_reset_context; external LibraryName name 'gr4d_directcontext_reset_context'; +procedure gr4d_directcontext_set_resource_cache_limit; external LibraryName name 'gr4d_directcontext_set_resource_cache_limit'; +function gr4d_directcontext_submit; external LibraryName name 'gr4d_directcontext_submit'; +{$ENDIF} + + +{ include/c/gr4d_gl_interface.h } + +{$IFNDEF SK_STATIC_LIBRARY} + gr4d_gl_interface_has_extension := GetProcAddress(LibraryHandle, PChar('gr4d_gl_interface_has_extension')); + gr4d_gl_interface_make_assembled := GetProcAddress(LibraryHandle, PChar('gr4d_gl_interface_make_assembled')); + gr4d_gl_interface_make_assembled_gl := GetProcAddress(LibraryHandle, PChar('gr4d_gl_interface_make_assembled_gl')); + gr4d_gl_interface_make_assembled_gles := GetProcAddress(LibraryHandle, PChar('gr4d_gl_interface_make_assembled_gles')); + gr4d_gl_interface_make_assembled_webgl := GetProcAddress(LibraryHandle, PChar('gr4d_gl_interface_make_assembled_webgl')); + gr4d_gl_interface_make_native := GetProcAddress(LibraryHandle, PChar('gr4d_gl_interface_make_native')); + gr4d_gl_interface_validate := GetProcAddress(LibraryHandle, PChar('gr4d_gl_interface_validate')); +{$ELSE} +function gr4d_gl_interface_has_extension; external LibraryName name 'gr4d_gl_interface_has_extension'; +function gr4d_gl_interface_make_assembled; external LibraryName name 'gr4d_gl_interface_make_assembled'; +function gr4d_gl_interface_make_assembled_gl; external LibraryName name 'gr4d_gl_interface_make_assembled_gl'; +function gr4d_gl_interface_make_assembled_gles; external LibraryName name 'gr4d_gl_interface_make_assembled_gles'; +function gr4d_gl_interface_make_assembled_webgl; external LibraryName name 'gr4d_gl_interface_make_assembled_webgl'; +function gr4d_gl_interface_make_native; external LibraryName name 'gr4d_gl_interface_make_native'; +function gr4d_gl_interface_validate; external LibraryName name 'gr4d_gl_interface_validate'; +{$ENDIF} + + +{ include/c/gr4d_shadererrorhandler.h } + +{$IFNDEF SK_STATIC_LIBRARY} +gr4d_shadererrorhandlerbaseclass_create := GetProcAddress(LibraryHandle, PChar('gr4d_shadererrorhandlerbaseclass_create')); +gr4d_shadererrorhandlerbaseclass_destroy := GetProcAddress(LibraryHandle, PChar('gr4d_shadererrorhandlerbaseclass_destroy')); +gr4d_shadererrorhandlerbaseclass_set_procs := GetProcAddress(LibraryHandle, PChar('gr4d_shadererrorhandlerbaseclass_set_procs')); +{$ELSE} +function gr4d_shadererrorhandlerbaseclass_create; external LibraryName name 'gr4d_shadererrorhandlerbaseclass_create'; +procedure gr4d_shadererrorhandlerbaseclass_destroy; external LibraryName name 'gr4d_shadererrorhandlerbaseclass_destroy'; +procedure gr4d_shadererrorhandlerbaseclass_set_procs; external LibraryName name 'gr4d_shadererrorhandlerbaseclass_set_procs'; +{$ENDIF} + + +{ include/c/gr4d_vk_extensions.h } + +{$IFNDEF SK_STATIC_LIBRARY} +gr4d_vk_extensions_create := GetProcAddress(LibraryHandle, PChar('gr4d_vk_extensions_create')); +gr4d_vk_extensions_destroy := GetProcAddress(LibraryHandle, PChar('gr4d_vk_extensions_destroy')); +gr4d_vk_extensions_has_extension := GetProcAddress(LibraryHandle, PChar('gr4d_vk_extensions_has_extension')); +gr4d_vk_extensions_init := GetProcAddress(LibraryHandle, PChar('gr4d_vk_extensions_init')); +{$ELSE} +function gr4d_vk_extensions_create; external LibraryName name 'gr4d_vk_extensions_create'; +procedure gr4d_vk_extensions_destroy; external LibraryName name 'gr4d_vk_extensions_destroy'; +function gr4d_vk_extensions_has_extension; external LibraryName name 'gr4d_vk_extensions_has_extension'; +procedure gr4d_vk_extensions_init; external LibraryName name 'gr4d_vk_extensions_init'; +{$ENDIF} + + +{ include/c/sk4d_blender.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_blender_make_arithmetic := GetProcAddress(LibraryHandle, PChar('sk4d_blender_make_arithmetic')); + sk4d_blender_make_mode := GetProcAddress(LibraryHandle, PChar('sk4d_blender_make_mode')); +{$ELSE} +function sk4d_blender_make_arithmetic; external LibraryName name 'sk4d_blender_make_arithmetic'; +function sk4d_blender_make_mode; external LibraryName name 'sk4d_blender_make_mode'; +{$ENDIF} + + +{ include/c/sk4d_canvas.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_canvas_clear := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_clear')); + sk4d_canvas_clear2 := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_clear2')); + sk4d_canvas_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_destroy')); + sk4d_canvas_discard := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_discard')); + sk4d_canvas_clip_path := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_clip_path')); + sk4d_canvas_clip_rect := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_clip_rect')); + sk4d_canvas_clip_region := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_clip_region')); + sk4d_canvas_clip_rrect := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_clip_rrect')); + sk4d_canvas_clip_shader := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_clip_shader')); + sk4d_canvas_concat := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_concat')); + sk4d_canvas_concat2 := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_concat2')); + sk4d_canvas_draw_annotation := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_annotation')); + sk4d_canvas_draw_arc := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_arc')); + sk4d_canvas_draw_atlas := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_atlas')); + sk4d_canvas_draw_circle := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_circle')); + sk4d_canvas_draw_color := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_color')); + sk4d_canvas_draw_color2 := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_color2')); + sk4d_canvas_draw_glyphs := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_glyphs')); + sk4d_canvas_draw_glyphs2 := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_glyphs2')); + sk4d_canvas_draw_image := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_image')); + sk4d_canvas_draw_image_lattice := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_image_lattice')); + sk4d_canvas_draw_image_nine := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_image_nine')); + sk4d_canvas_draw_image_rect := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_image_rect')); + sk4d_canvas_draw_line := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_line')); + sk4d_canvas_draw_oval := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_oval')); + sk4d_canvas_draw_paint := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_paint')); + sk4d_canvas_draw_patch := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_patch')); + sk4d_canvas_draw_path := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_path')); + sk4d_canvas_draw_picture := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_picture')); + sk4d_canvas_draw_point := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_point')); + sk4d_canvas_draw_points := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_points')); + sk4d_canvas_draw_rect := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_rect')); + sk4d_canvas_draw_region := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_region')); + sk4d_canvas_draw_rrect := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_rrect')); + sk4d_canvas_draw_rrect2 := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_rrect2')); + sk4d_canvas_draw_rrect_difference := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_rrect_difference')); + sk4d_canvas_draw_simple_text := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_simple_text')); + sk4d_canvas_draw_text_blob := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_text_blob')); + sk4d_canvas_draw_vertices := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_draw_vertices')); + sk4d_canvas_get_base_props := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_get_base_props')); + sk4d_canvas_get_device_clip_bounds := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_get_device_clip_bounds')); + sk4d_canvas_get_local_clip_bounds := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_get_local_clip_bounds')); + sk4d_canvas_get_local_to_device := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_get_local_to_device')); + sk4d_canvas_get_local_to_device_as_3x3 := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_get_local_to_device_as_3x3')); + sk4d_canvas_get_top_props := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_get_top_props')); + sk4d_canvas_get_save_count := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_get_save_count')); + sk4d_canvas_make_surface := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_make_surface')); + sk4d_canvas_quick_reject := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_quick_reject')); + sk4d_canvas_quick_reject2 := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_quick_reject2')); + sk4d_canvas_reset_matrix := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_reset_matrix')); + sk4d_canvas_restore := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_restore')); + sk4d_canvas_restore_to_count := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_restore_to_count')); + sk4d_canvas_rotate := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_rotate')); + sk4d_canvas_rotate2 := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_rotate2')); + sk4d_canvas_save := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_save')); + sk4d_canvas_save_layer := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_save_layer')); + sk4d_canvas_save_layer_alpha := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_save_layer_alpha')); + sk4d_canvas_scale := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_scale')); + sk4d_canvas_set_matrix := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_set_matrix')); + sk4d_canvas_set_matrix2 := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_set_matrix2')); + sk4d_canvas_skew := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_skew')); + sk4d_canvas_translate := GetProcAddress(LibraryHandle, PChar('sk4d_canvas_translate')); +{$ELSE} +procedure sk4d_canvas_clear; external LibraryName name 'sk4d_canvas_clear'; +procedure sk4d_canvas_clear2; external LibraryName name 'sk4d_canvas_clear2'; +procedure sk4d_canvas_destroy; external LibraryName name 'sk4d_canvas_destroy'; +procedure sk4d_canvas_discard; external LibraryName name 'sk4d_canvas_discard'; +procedure sk4d_canvas_clip_path; external LibraryName name 'sk4d_canvas_clip_path'; +procedure sk4d_canvas_clip_rect; external LibraryName name 'sk4d_canvas_clip_rect'; +procedure sk4d_canvas_clip_region; external LibraryName name 'sk4d_canvas_clip_region'; +procedure sk4d_canvas_clip_rrect; external LibraryName name 'sk4d_canvas_clip_rrect'; +procedure sk4d_canvas_clip_shader; external LibraryName name 'sk4d_canvas_clip_shader'; +procedure sk4d_canvas_concat; external LibraryName name 'sk4d_canvas_concat'; +procedure sk4d_canvas_concat2; external LibraryName name 'sk4d_canvas_concat2'; +procedure sk4d_canvas_draw_annotation; external LibraryName name 'sk4d_canvas_draw_annotation'; +procedure sk4d_canvas_draw_arc; external LibraryName name 'sk4d_canvas_draw_arc'; +procedure sk4d_canvas_draw_atlas; external LibraryName name 'sk4d_canvas_draw_atlas'; +procedure sk4d_canvas_draw_circle; external LibraryName name 'sk4d_canvas_draw_circle'; +procedure sk4d_canvas_draw_color; external LibraryName name 'sk4d_canvas_draw_color'; +procedure sk4d_canvas_draw_color2; external LibraryName name 'sk4d_canvas_draw_color2'; +procedure sk4d_canvas_draw_glyphs; external LibraryName name 'sk4d_canvas_draw_glyphs'; +procedure sk4d_canvas_draw_glyphs2; external LibraryName name 'sk4d_canvas_draw_glyphs2'; +procedure sk4d_canvas_draw_image; external LibraryName name 'sk4d_canvas_draw_image'; +procedure sk4d_canvas_draw_image_lattice; external LibraryName name 'sk4d_canvas_draw_image_lattice'; +procedure sk4d_canvas_draw_image_nine; external LibraryName name 'sk4d_canvas_draw_image_nine'; +procedure sk4d_canvas_draw_image_rect; external LibraryName name 'sk4d_canvas_draw_image_rect'; +procedure sk4d_canvas_draw_line; external LibraryName name 'sk4d_canvas_draw_line'; +procedure sk4d_canvas_draw_oval; external LibraryName name 'sk4d_canvas_draw_oval'; +procedure sk4d_canvas_draw_paint; external LibraryName name 'sk4d_canvas_draw_paint'; +procedure sk4d_canvas_draw_patch; external LibraryName name 'sk4d_canvas_draw_patch'; +procedure sk4d_canvas_draw_path; external LibraryName name 'sk4d_canvas_draw_path'; +procedure sk4d_canvas_draw_picture; external LibraryName name 'sk4d_canvas_draw_picture'; +procedure sk4d_canvas_draw_point; external LibraryName name 'sk4d_canvas_draw_point'; +procedure sk4d_canvas_draw_points; external LibraryName name 'sk4d_canvas_draw_points'; +procedure sk4d_canvas_draw_rect; external LibraryName name 'sk4d_canvas_draw_rect'; +procedure sk4d_canvas_draw_region; external LibraryName name 'sk4d_canvas_draw_region'; +procedure sk4d_canvas_draw_rrect; external LibraryName name 'sk4d_canvas_draw_rrect'; +procedure sk4d_canvas_draw_rrect2; external LibraryName name 'sk4d_canvas_draw_rrect2'; +procedure sk4d_canvas_draw_rrect_difference; external LibraryName name 'sk4d_canvas_draw_rrect_difference'; +procedure sk4d_canvas_draw_simple_text; external LibraryName name 'sk4d_canvas_draw_simple_text'; +procedure sk4d_canvas_draw_text_blob; external LibraryName name 'sk4d_canvas_draw_text_blob'; +procedure sk4d_canvas_draw_vertices; external LibraryName name 'sk4d_canvas_draw_vertices'; +procedure sk4d_canvas_get_base_props; external LibraryName name 'sk4d_canvas_get_base_props'; +procedure sk4d_canvas_get_device_clip_bounds; external LibraryName name 'sk4d_canvas_get_device_clip_bounds'; +procedure sk4d_canvas_get_local_clip_bounds; external LibraryName name 'sk4d_canvas_get_local_clip_bounds'; +procedure sk4d_canvas_get_local_to_device; external LibraryName name 'sk4d_canvas_get_local_to_device'; +procedure sk4d_canvas_get_local_to_device_as_3x3; external LibraryName name 'sk4d_canvas_get_local_to_device_as_3x3'; +procedure sk4d_canvas_get_top_props; external LibraryName name 'sk4d_canvas_get_top_props'; +function sk4d_canvas_get_save_count; external LibraryName name 'sk4d_canvas_get_save_count'; +function sk4d_canvas_make_surface; external LibraryName name 'sk4d_canvas_make_surface'; +function sk4d_canvas_quick_reject; external LibraryName name 'sk4d_canvas_quick_reject'; +function sk4d_canvas_quick_reject2; external LibraryName name 'sk4d_canvas_quick_reject2'; +procedure sk4d_canvas_reset_matrix; external LibraryName name 'sk4d_canvas_reset_matrix'; +procedure sk4d_canvas_restore; external LibraryName name 'sk4d_canvas_restore'; +procedure sk4d_canvas_restore_to_count; external LibraryName name 'sk4d_canvas_restore_to_count'; +procedure sk4d_canvas_rotate; external LibraryName name 'sk4d_canvas_rotate'; +procedure sk4d_canvas_rotate2; external LibraryName name 'sk4d_canvas_rotate2'; +function sk4d_canvas_save; external LibraryName name 'sk4d_canvas_save'; +function sk4d_canvas_save_layer; external LibraryName name 'sk4d_canvas_save_layer'; +function sk4d_canvas_save_layer_alpha; external LibraryName name 'sk4d_canvas_save_layer_alpha'; +procedure sk4d_canvas_scale; external LibraryName name 'sk4d_canvas_scale'; +procedure sk4d_canvas_set_matrix; external LibraryName name 'sk4d_canvas_set_matrix'; +procedure sk4d_canvas_set_matrix2; external LibraryName name 'sk4d_canvas_set_matrix2'; +procedure sk4d_canvas_skew; external LibraryName name 'sk4d_canvas_skew'; +procedure sk4d_canvas_translate; external LibraryName name 'sk4d_canvas_translate'; +{$ENDIF} + + +{ include/c/sk4d_codec.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_codec_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_codec_destroy')); + sk4d_codec_get_dimensions := GetProcAddress(LibraryHandle, PChar('sk4d_codec_get_dimensions')); + sk4d_codec_get_encoded_image_format := GetProcAddress(LibraryHandle, PChar('sk4d_codec_get_encoded_image_format')); + sk4d_codec_get_image := GetProcAddress(LibraryHandle, PChar('sk4d_codec_get_image')); + sk4d_codec_get_pixels := GetProcAddress(LibraryHandle, PChar('sk4d_codec_get_pixels')); + sk4d_codec_make_from_file := GetProcAddress(LibraryHandle, PChar('sk4d_codec_make_from_file')); + sk4d_codec_make_from_stream := GetProcAddress(LibraryHandle, PChar('sk4d_codec_make_from_stream')); + sk4d_codec_make_with_copy := GetProcAddress(LibraryHandle, PChar('sk4d_codec_make_with_copy')); + sk4d_codec_make_without_copy := GetProcAddress(LibraryHandle, PChar('sk4d_codec_make_without_copy')); + sk4d_animcodecplayer_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_animcodecplayer_destroy')); + sk4d_animcodecplayer_get_dimensions := GetProcAddress(LibraryHandle, PChar('sk4d_animcodecplayer_get_dimensions')); + sk4d_animcodecplayer_get_duration := GetProcAddress(LibraryHandle, PChar('sk4d_animcodecplayer_get_duration')); + sk4d_animcodecplayer_get_frame := GetProcAddress(LibraryHandle, PChar('sk4d_animcodecplayer_get_frame')); + sk4d_animcodecplayer_make_from_file := GetProcAddress(LibraryHandle, PChar('sk4d_animcodecplayer_make_from_file')); + sk4d_animcodecplayer_make_from_stream := GetProcAddress(LibraryHandle, PChar('sk4d_animcodecplayer_make_from_stream')); + sk4d_animcodecplayer_seek := GetProcAddress(LibraryHandle, PChar('sk4d_animcodecplayer_seek')); +{$ELSE} +procedure sk4d_codec_destroy; external LibraryName name 'sk4d_codec_destroy'; +procedure sk4d_codec_get_dimensions; external LibraryName name 'sk4d_codec_get_dimensions'; +function sk4d_codec_get_encoded_image_format; external LibraryName name 'sk4d_codec_get_encoded_image_format'; +function sk4d_codec_get_image; external LibraryName name 'sk4d_codec_get_image'; +function sk4d_codec_get_pixels; external LibraryName name 'sk4d_codec_get_pixels'; +function sk4d_codec_make_from_file; external LibraryName name 'sk4d_codec_make_from_file'; +function sk4d_codec_make_from_stream; external LibraryName name 'sk4d_codec_make_from_stream'; +function sk4d_codec_make_with_copy; external LibraryName name 'sk4d_codec_make_with_copy'; +function sk4d_codec_make_without_copy; external LibraryName name 'sk4d_codec_make_without_copy'; +procedure sk4d_animcodecplayer_destroy; external LibraryName name 'sk4d_animcodecplayer_destroy'; +procedure sk4d_animcodecplayer_get_dimensions; external LibraryName name 'sk4d_animcodecplayer_get_dimensions'; +function sk4d_animcodecplayer_get_duration; external LibraryName name 'sk4d_animcodecplayer_get_duration'; +function sk4d_animcodecplayer_get_frame; external LibraryName name 'sk4d_animcodecplayer_get_frame'; +function sk4d_animcodecplayer_make_from_file; external LibraryName name 'sk4d_animcodecplayer_make_from_file'; +function sk4d_animcodecplayer_make_from_stream; external LibraryName name 'sk4d_animcodecplayer_make_from_stream'; +function sk4d_animcodecplayer_seek; external LibraryName name 'sk4d_animcodecplayer_seek'; +{$ENDIF} + + +{ include/c/sk4d_colorfilter.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_colorfilter_make_blend := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_blend')); + sk4d_colorfilter_make_blend2 := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_blend2')); + sk4d_colorfilter_make_compose := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_compose')); + sk4d_colorfilter_make_high_contrast := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_high_contrast')); + sk4d_colorfilter_make_hsla_matrix := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_hsla_matrix')); + sk4d_colorfilter_make_lighting := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_lighting')); + sk4d_colorfilter_make_linear_to_srgb_gamma := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_linear_to_srgb_gamma')); + sk4d_colorfilter_make_luma_color := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_luma_color')); + sk4d_colorfilter_make_matrix := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_matrix')); + sk4d_colorfilter_make_overdraw := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_overdraw')); + sk4d_colorfilter_make_table := GetProcAddress(LibraryHandle, PChar('sk4d_colorfilter_make_table')); +{$ELSE} +function sk4d_colorfilter_make_blend; external LibraryName name 'sk4d_colorfilter_make_blend'; +function sk4d_colorfilter_make_blend2; external LibraryName name 'sk4d_colorfilter_make_blend2'; +function sk4d_colorfilter_make_compose; external LibraryName name 'sk4d_colorfilter_make_compose'; +function sk4d_colorfilter_make_high_contrast; external LibraryName name 'sk4d_colorfilter_make_high_contrast'; +function sk4d_colorfilter_make_hsla_matrix; external LibraryName name 'sk4d_colorfilter_make_hsla_matrix'; +function sk4d_colorfilter_make_lighting; external LibraryName name 'sk4d_colorfilter_make_lighting'; +function sk4d_colorfilter_make_linear_to_srgb_gamma; external LibraryName name 'sk4d_colorfilter_make_linear_to_srgb_gamma'; +function sk4d_colorfilter_make_luma_color; external LibraryName name 'sk4d_colorfilter_make_luma_color'; +function sk4d_colorfilter_make_matrix; external LibraryName name 'sk4d_colorfilter_make_matrix'; +function sk4d_colorfilter_make_overdraw; external LibraryName name 'sk4d_colorfilter_make_overdraw'; +function sk4d_colorfilter_make_table; external LibraryName name 'sk4d_colorfilter_make_table'; +{$ENDIF} + + +{ include/c/sk4d_colorspace.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_colorspace_gamma_close_to_srgb := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_gamma_close_to_srgb')); + sk4d_colorspace_gamma_is_linear := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_gamma_is_linear')); + sk4d_colorspace_is_equal := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_is_equal')); + sk4d_colorspace_is_numerical_transfer_fn := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_is_numerical_transfer_fn')); + sk4d_colorspace_is_srgb := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_is_srgb')); + sk4d_colorspace_make := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_make')); + sk4d_colorspace_make_linear_gamma := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_make_linear_gamma')); + sk4d_colorspace_make_rgb := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_make_rgb')); + sk4d_colorspace_make_srgb := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_make_srgb')); + sk4d_colorspace_make_srgb_gamma := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_make_srgb_gamma')); + sk4d_colorspace_make_srgb_linear := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_make_srgb_linear')); + sk4d_colorspace_ref := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_ref')); + sk4d_colorspace_to_profile := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_to_profile')); + sk4d_colorspace_to_xyz := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_to_xyz')); + sk4d_colorspace_unref := GetProcAddress(LibraryHandle, PChar('sk4d_colorspace_unref')); + sk4d_colorspaceiccprofile_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_colorspaceiccprofile_destroy')); + sk4d_colorspaceiccprofile_get_buffer := GetProcAddress(LibraryHandle, PChar('sk4d_colorspaceiccprofile_get_buffer')); + sk4d_colorspaceiccprofile_make_with_parse := GetProcAddress(LibraryHandle, PChar('sk4d_colorspaceiccprofile_make_with_parse')); + sk4d_colorspaceiccprofile_to_xyz := GetProcAddress(LibraryHandle, PChar('sk4d_colorspaceiccprofile_to_xyz')); + sk4d_colorspaceprimaries_to_xyz := GetProcAddress(LibraryHandle, PChar('sk4d_colorspaceprimaries_to_xyz')); + sk4d_colorspacetransferfn_invert := GetProcAddress(LibraryHandle, PChar('sk4d_colorspacetransferfn_invert')); + sk4d_colorspacetransferfn_transform := GetProcAddress(LibraryHandle, PChar('sk4d_colorspacetransferfn_transform')); +{$ELSE} +function sk4d_colorspace_gamma_close_to_srgb; external LibraryName name 'sk4d_colorspace_gamma_close_to_srgb'; +function sk4d_colorspace_gamma_is_linear; external LibraryName name 'sk4d_colorspace_gamma_is_linear'; +function sk4d_colorspace_is_equal; external LibraryName name 'sk4d_colorspace_is_equal'; +function sk4d_colorspace_is_numerical_transfer_fn; external LibraryName name 'sk4d_colorspace_is_numerical_transfer_fn'; +function sk4d_colorspace_is_srgb; external LibraryName name 'sk4d_colorspace_is_srgb'; +function sk4d_colorspace_make; external LibraryName name 'sk4d_colorspace_make'; +function sk4d_colorspace_make_linear_gamma; external LibraryName name 'sk4d_colorspace_make_linear_gamma'; +function sk4d_colorspace_make_rgb; external LibraryName name 'sk4d_colorspace_make_rgb'; +function sk4d_colorspace_make_srgb; external LibraryName name 'sk4d_colorspace_make_srgb'; +function sk4d_colorspace_make_srgb_gamma; external LibraryName name 'sk4d_colorspace_make_srgb_gamma'; +function sk4d_colorspace_make_srgb_linear; external LibraryName name 'sk4d_colorspace_make_srgb_linear'; +procedure sk4d_colorspace_ref; external LibraryName name 'sk4d_colorspace_ref'; +function sk4d_colorspace_to_profile; external LibraryName name 'sk4d_colorspace_to_profile'; +function sk4d_colorspace_to_xyz; external LibraryName name 'sk4d_colorspace_to_xyz'; +procedure sk4d_colorspace_unref; external LibraryName name 'sk4d_colorspace_unref'; +procedure sk4d_colorspaceiccprofile_destroy; external LibraryName name 'sk4d_colorspaceiccprofile_destroy'; +function sk4d_colorspaceiccprofile_get_buffer; external LibraryName name 'sk4d_colorspaceiccprofile_get_buffer'; +function sk4d_colorspaceiccprofile_make_with_parse; external LibraryName name 'sk4d_colorspaceiccprofile_make_with_parse'; +function sk4d_colorspaceiccprofile_to_xyz; external LibraryName name 'sk4d_colorspaceiccprofile_to_xyz'; +function sk4d_colorspaceprimaries_to_xyz; external LibraryName name 'sk4d_colorspaceprimaries_to_xyz'; +function sk4d_colorspacetransferfn_invert; external LibraryName name 'sk4d_colorspacetransferfn_invert'; +function sk4d_colorspacetransferfn_transform; external LibraryName name 'sk4d_colorspacetransferfn_transform'; +{$ENDIF} + + +{ include/c/sk4d_data.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_data_make_empty := GetProcAddress(LibraryHandle, PChar('sk4d_data_make_empty')); + sk4d_data_make_with_copy := GetProcAddress(LibraryHandle, PChar('sk4d_data_make_with_copy')); + sk4d_data_ref := GetProcAddress(LibraryHandle, PChar('sk4d_data_ref')); + sk4d_data_unref := GetProcAddress(LibraryHandle, PChar('sk4d_data_unref')); +{$ELSE} +function sk4d_data_make_empty; external LibraryName name 'sk4d_data_make_empty'; +function sk4d_data_make_with_copy; external LibraryName name 'sk4d_data_make_with_copy'; +procedure sk4d_data_ref; external LibraryName name 'sk4d_data_ref'; +procedure sk4d_data_unref; external LibraryName name 'sk4d_data_unref'; +{$ENDIF} + + +{ include/c/sk4d_document.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_document_begin_page := GetProcAddress(LibraryHandle, PChar('sk4d_document_begin_page')); + sk4d_document_close := GetProcAddress(LibraryHandle, PChar('sk4d_document_close')); + sk4d_document_end_page := GetProcAddress(LibraryHandle, PChar('sk4d_document_end_page')); + sk4d_document_make_pdf := GetProcAddress(LibraryHandle, PChar('sk4d_document_make_pdf')); + sk4d_document_make_pdf2 := GetProcAddress(LibraryHandle, PChar('sk4d_document_make_pdf2')); + sk4d_document_make_xps := GetProcAddress(LibraryHandle, PChar('sk4d_document_make_xps')); + sk4d_document_terminate := GetProcAddress(LibraryHandle, PChar('sk4d_document_terminate')); +{$ELSE} +function sk4d_document_begin_page; external LibraryName name 'sk4d_document_begin_page'; +procedure sk4d_document_close; external LibraryName name 'sk4d_document_close'; +procedure sk4d_document_end_page; external LibraryName name 'sk4d_document_end_page'; +function sk4d_document_make_pdf; external LibraryName name 'sk4d_document_make_pdf'; +function sk4d_document_make_pdf2; external LibraryName name 'sk4d_document_make_pdf2'; +function sk4d_document_make_xps; external LibraryName name 'sk4d_document_make_xps'; +procedure sk4d_document_terminate; external LibraryName name 'sk4d_document_terminate'; +{$ENDIF} + + +{ include/c/sk4d_font.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_font_create := GetProcAddress(LibraryHandle, PChar('sk4d_font_create')); + sk4d_font_create2 := GetProcAddress(LibraryHandle, PChar('sk4d_font_create2')); + sk4d_font_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_font_destroy')); + sk4d_font_get_baseline_snap := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_baseline_snap')); + sk4d_font_get_edging := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_edging')); + sk4d_font_get_embedded_bitmaps := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_embedded_bitmaps')); + sk4d_font_get_embolden := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_embolden')); + sk4d_font_get_force_auto_hinting := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_force_auto_hinting')); + sk4d_font_get_glyphs := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_glyphs')); + sk4d_font_get_glyphs_count := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_glyphs_count')); + sk4d_font_get_hinting := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_hinting')); + sk4d_font_get_horizontal_positions := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_horizontal_positions')); + sk4d_font_get_intercepts := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_intercepts')); + sk4d_font_get_linear_metrics := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_linear_metrics')); + sk4d_font_get_metrics := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_metrics')); + sk4d_font_get_path := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_path')); + sk4d_font_get_paths := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_paths')); + sk4d_font_get_positions := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_positions')); + sk4d_font_get_scale_x := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_scale_x')); + sk4d_font_get_size := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_size')); + sk4d_font_get_skew_x := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_skew_x')); + sk4d_font_get_subpixel := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_subpixel')); + sk4d_font_get_typeface := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_typeface')); + sk4d_font_get_typeface_or_default := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_typeface_or_default')); + sk4d_font_get_widths_bounds := GetProcAddress(LibraryHandle, PChar('sk4d_font_get_widths_bounds')); + sk4d_font_is_equal := GetProcAddress(LibraryHandle, PChar('sk4d_font_is_equal')); + sk4d_font_measure_text := GetProcAddress(LibraryHandle, PChar('sk4d_font_measure_text')); + sk4d_font_set_baseline_snap := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_baseline_snap')); + sk4d_font_set_edging := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_edging')); + sk4d_font_set_embedded_bitmaps := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_embedded_bitmaps')); + sk4d_font_set_embolden := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_embolden')); + sk4d_font_set_force_auto_hinting := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_force_auto_hinting')); + sk4d_font_set_hinting := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_hinting')); + sk4d_font_set_linear_metrics := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_linear_metrics')); + sk4d_font_set_scale_x := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_scale_x')); + sk4d_font_set_size := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_size')); + sk4d_font_set_skew_x := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_skew_x')); + sk4d_font_set_subpixel := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_subpixel')); + sk4d_font_set_typeface := GetProcAddress(LibraryHandle, PChar('sk4d_font_set_typeface')); + sk4d_font_unichar_to_glyph := GetProcAddress(LibraryHandle, PChar('sk4d_font_unichar_to_glyph')); + sk4d_font_unichars_to_glyphs := GetProcAddress(LibraryHandle, PChar('sk4d_font_unichars_to_glyphs')); +{$ELSE} +function sk4d_font_create; external LibraryName name 'sk4d_font_create'; +function sk4d_font_create2; external LibraryName name 'sk4d_font_create2'; +procedure sk4d_font_destroy; external LibraryName name 'sk4d_font_destroy'; +function sk4d_font_get_baseline_snap; external LibraryName name 'sk4d_font_get_baseline_snap'; +function sk4d_font_get_edging; external LibraryName name 'sk4d_font_get_edging'; +function sk4d_font_get_embedded_bitmaps; external LibraryName name 'sk4d_font_get_embedded_bitmaps'; +function sk4d_font_get_embolden; external LibraryName name 'sk4d_font_get_embolden'; +function sk4d_font_get_force_auto_hinting; external LibraryName name 'sk4d_font_get_force_auto_hinting'; +function sk4d_font_get_glyphs; external LibraryName name 'sk4d_font_get_glyphs'; +function sk4d_font_get_glyphs_count; external LibraryName name 'sk4d_font_get_glyphs_count'; +function sk4d_font_get_hinting; external LibraryName name 'sk4d_font_get_hinting'; +procedure sk4d_font_get_horizontal_positions; external LibraryName name 'sk4d_font_get_horizontal_positions'; +function sk4d_font_get_intercepts; external LibraryName name 'sk4d_font_get_intercepts'; +function sk4d_font_get_linear_metrics; external LibraryName name 'sk4d_font_get_linear_metrics'; +function sk4d_font_get_metrics; external LibraryName name 'sk4d_font_get_metrics'; +function sk4d_font_get_path; external LibraryName name 'sk4d_font_get_path'; +procedure sk4d_font_get_paths; external LibraryName name 'sk4d_font_get_paths'; +procedure sk4d_font_get_positions; external LibraryName name 'sk4d_font_get_positions'; +function sk4d_font_get_scale_x; external LibraryName name 'sk4d_font_get_scale_x'; +function sk4d_font_get_size; external LibraryName name 'sk4d_font_get_size'; +function sk4d_font_get_skew_x; external LibraryName name 'sk4d_font_get_skew_x'; +function sk4d_font_get_subpixel; external LibraryName name 'sk4d_font_get_subpixel'; +function sk4d_font_get_typeface; external LibraryName name 'sk4d_font_get_typeface'; +function sk4d_font_get_typeface_or_default; external LibraryName name 'sk4d_font_get_typeface_or_default'; +procedure sk4d_font_get_widths_bounds; external LibraryName name 'sk4d_font_get_widths_bounds'; +function sk4d_font_is_equal; external LibraryName name 'sk4d_font_is_equal'; +function sk4d_font_measure_text; external LibraryName name 'sk4d_font_measure_text'; +procedure sk4d_font_set_baseline_snap; external LibraryName name 'sk4d_font_set_baseline_snap'; +procedure sk4d_font_set_edging; external LibraryName name 'sk4d_font_set_edging'; +procedure sk4d_font_set_embedded_bitmaps; external LibraryName name 'sk4d_font_set_embedded_bitmaps'; +procedure sk4d_font_set_embolden; external LibraryName name 'sk4d_font_set_embolden'; +procedure sk4d_font_set_force_auto_hinting; external LibraryName name 'sk4d_font_set_force_auto_hinting'; +procedure sk4d_font_set_hinting; external LibraryName name 'sk4d_font_set_hinting'; +procedure sk4d_font_set_linear_metrics; external LibraryName name 'sk4d_font_set_linear_metrics'; +procedure sk4d_font_set_scale_x; external LibraryName name 'sk4d_font_set_scale_x'; +procedure sk4d_font_set_size; external LibraryName name 'sk4d_font_set_size'; +procedure sk4d_font_set_skew_x; external LibraryName name 'sk4d_font_set_skew_x'; +procedure sk4d_font_set_subpixel; external LibraryName name 'sk4d_font_set_subpixel'; +procedure sk4d_font_set_typeface; external LibraryName name 'sk4d_font_set_typeface'; +function sk4d_font_unichar_to_glyph; external LibraryName name 'sk4d_font_unichar_to_glyph'; +procedure sk4d_font_unichars_to_glyphs; external LibraryName name 'sk4d_font_unichars_to_glyphs'; +{$ENDIF} + + +{ include/c/sk4d_graphics.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_graphics_allow_jit := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_allow_jit')); + sk4d_graphics_dump_memory_statistics := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_dump_memory_statistics')); + sk4d_graphics_get_font_cache_count_limit := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_get_font_cache_count_limit')); + sk4d_graphics_get_font_cache_count_used := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_get_font_cache_count_used')); + sk4d_graphics_get_font_cache_limit := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_get_font_cache_limit')); + sk4d_graphics_get_font_cache_used := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_get_font_cache_used')); + sk4d_graphics_get_resource_cache_single_allocation_byte_limit := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_get_resource_cache_single_allocation_byte_limit')); + sk4d_graphics_get_resource_cache_total_byte_limit := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_get_resource_cache_total_byte_limit')); + sk4d_graphics_get_resource_cache_total_bytes_used := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_get_resource_cache_total_bytes_used')); + sk4d_graphics_init := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_init')); + sk4d_graphics_purge_all_caches := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_purge_all_caches')); + sk4d_graphics_purge_font_cache := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_purge_font_cache')); + sk4d_graphics_purge_resource_cache := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_purge_resource_cache')); + sk4d_graphics_set_font_cache_count_limit := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_set_font_cache_count_limit')); + sk4d_graphics_set_font_cache_limit := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_set_font_cache_limit')); + sk4d_graphics_set_resource_cache_single_allocation_byte_limit := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_set_resource_cache_single_allocation_byte_limit')); + sk4d_graphics_set_resource_cache_total_byte_limit := GetProcAddress(LibraryHandle, PChar('sk4d_graphics_set_resource_cache_total_byte_limit')); +{$ELSE} +procedure sk4d_graphics_allow_jit; external LibraryName name 'sk4d_graphics_allow_jit'; +procedure sk4d_graphics_dump_memory_statistics; external LibraryName name 'sk4d_graphics_dump_memory_statistics'; +function sk4d_graphics_get_font_cache_count_limit; external LibraryName name 'sk4d_graphics_get_font_cache_count_limit'; +function sk4d_graphics_get_font_cache_count_used; external LibraryName name 'sk4d_graphics_get_font_cache_count_used'; +function sk4d_graphics_get_font_cache_limit; external LibraryName name 'sk4d_graphics_get_font_cache_limit'; +function sk4d_graphics_get_font_cache_used; external LibraryName name 'sk4d_graphics_get_font_cache_used'; +function sk4d_graphics_get_resource_cache_single_allocation_byte_limit; external LibraryName name 'sk4d_graphics_get_resource_cache_single_allocation_byte_limit'; +function sk4d_graphics_get_resource_cache_total_byte_limit; external LibraryName name 'sk4d_graphics_get_resource_cache_total_byte_limit'; +function sk4d_graphics_get_resource_cache_total_bytes_used; external LibraryName name 'sk4d_graphics_get_resource_cache_total_bytes_used'; +procedure sk4d_graphics_init; external LibraryName name 'sk4d_graphics_init'; +procedure sk4d_graphics_purge_all_caches; external LibraryName name 'sk4d_graphics_purge_all_caches'; +procedure sk4d_graphics_purge_font_cache; external LibraryName name 'sk4d_graphics_purge_font_cache'; +procedure sk4d_graphics_purge_resource_cache; external LibraryName name 'sk4d_graphics_purge_resource_cache'; +function sk4d_graphics_set_font_cache_count_limit; external LibraryName name 'sk4d_graphics_set_font_cache_count_limit'; +function sk4d_graphics_set_font_cache_limit; external LibraryName name 'sk4d_graphics_set_font_cache_limit'; +function sk4d_graphics_set_resource_cache_single_allocation_byte_limit; external LibraryName name 'sk4d_graphics_set_resource_cache_single_allocation_byte_limit'; +function sk4d_graphics_set_resource_cache_total_byte_limit; external LibraryName name 'sk4d_graphics_set_resource_cache_total_byte_limit'; +{$ENDIF} + + +{ include/c/sk4d_image.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_image_encode_to_file := GetProcAddress(LibraryHandle, PChar('sk4d_image_encode_to_file')); + sk4d_image_encode_to_stream := GetProcAddress(LibraryHandle, PChar('sk4d_image_encode_to_stream')); + sk4d_image_get_alpha_type := GetProcAddress(LibraryHandle, PChar('sk4d_image_get_alpha_type')); + sk4d_image_get_color_space := GetProcAddress(LibraryHandle, PChar('sk4d_image_get_color_space')); + sk4d_image_get_color_type := GetProcAddress(LibraryHandle, PChar('sk4d_image_get_color_type')); + sk4d_image_get_height := GetProcAddress(LibraryHandle, PChar('sk4d_image_get_height')); + sk4d_image_get_image_info := GetProcAddress(LibraryHandle, PChar('sk4d_image_get_image_info')); + sk4d_image_get_unique_id := GetProcAddress(LibraryHandle, PChar('sk4d_image_get_unique_id')); + sk4d_image_get_width := GetProcAddress(LibraryHandle, PChar('sk4d_image_get_width')); + sk4d_image_is_lazy_generated := GetProcAddress(LibraryHandle, PChar('sk4d_image_is_lazy_generated')); + sk4d_image_is_texture_backed := GetProcAddress(LibraryHandle, PChar('sk4d_image_is_texture_backed')); + sk4d_image_is_valid := GetProcAddress(LibraryHandle, PChar('sk4d_image_is_valid')); + sk4d_image_make_cross_context := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_cross_context')); + sk4d_image_make_from_adopted_texture := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_from_adopted_texture')); + sk4d_image_make_from_encoded_file := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_from_encoded_file')); + sk4d_image_make_from_encoded_stream := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_from_encoded_stream')); + sk4d_image_make_from_picture := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_from_picture')); + sk4d_image_make_from_raster := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_from_raster')); + sk4d_image_make_from_texture := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_from_texture')); + sk4d_image_make_non_texture_image := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_non_texture_image')); + sk4d_image_make_raster_copy := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_raster_copy')); + sk4d_image_make_raster_image := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_raster_image')); + sk4d_image_make_raw_shader := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_raw_shader')); + sk4d_image_make_shader := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_shader')); + sk4d_image_make_subset := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_subset')); + sk4d_image_make_texture_image := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_texture_image')); + sk4d_image_make_with_filter := GetProcAddress(LibraryHandle, PChar('sk4d_image_make_with_filter')); + sk4d_image_peek_pixels := GetProcAddress(LibraryHandle, PChar('sk4d_image_peek_pixels')); + sk4d_image_read_pixels := GetProcAddress(LibraryHandle, PChar('sk4d_image_read_pixels')); + sk4d_image_scale_pixels := GetProcAddress(LibraryHandle, PChar('sk4d_image_scale_pixels')); +{$ELSE} +function sk4d_image_encode_to_file; external LibraryName name 'sk4d_image_encode_to_file'; +function sk4d_image_encode_to_stream; external LibraryName name 'sk4d_image_encode_to_stream'; +function sk4d_image_get_alpha_type; external LibraryName name 'sk4d_image_get_alpha_type'; +function sk4d_image_get_color_space; external LibraryName name 'sk4d_image_get_color_space'; +function sk4d_image_get_color_type; external LibraryName name 'sk4d_image_get_color_type'; +function sk4d_image_get_height; external LibraryName name 'sk4d_image_get_height'; +procedure sk4d_image_get_image_info; external LibraryName name 'sk4d_image_get_image_info'; +function sk4d_image_get_unique_id; external LibraryName name 'sk4d_image_get_unique_id'; +function sk4d_image_get_width; external LibraryName name 'sk4d_image_get_width'; +function sk4d_image_is_lazy_generated; external LibraryName name 'sk4d_image_is_lazy_generated'; +function sk4d_image_is_texture_backed; external LibraryName name 'sk4d_image_is_texture_backed'; +function sk4d_image_is_valid; external LibraryName name 'sk4d_image_is_valid'; +function sk4d_image_make_cross_context; external LibraryName name 'sk4d_image_make_cross_context'; +function sk4d_image_make_from_adopted_texture; external LibraryName name 'sk4d_image_make_from_adopted_texture'; +function sk4d_image_make_from_encoded_file; external LibraryName name 'sk4d_image_make_from_encoded_file'; +function sk4d_image_make_from_encoded_stream; external LibraryName name 'sk4d_image_make_from_encoded_stream'; +function sk4d_image_make_from_picture; external LibraryName name 'sk4d_image_make_from_picture'; +function sk4d_image_make_from_raster; external LibraryName name 'sk4d_image_make_from_raster'; +function sk4d_image_make_from_texture; external LibraryName name 'sk4d_image_make_from_texture'; +function sk4d_image_make_non_texture_image; external LibraryName name 'sk4d_image_make_non_texture_image'; +function sk4d_image_make_raster_copy; external LibraryName name 'sk4d_image_make_raster_copy'; +function sk4d_image_make_raster_image; external LibraryName name 'sk4d_image_make_raster_image'; +function sk4d_image_make_raw_shader; external LibraryName name 'sk4d_image_make_raw_shader'; +function sk4d_image_make_shader; external LibraryName name 'sk4d_image_make_shader'; +function sk4d_image_make_subset; external LibraryName name 'sk4d_image_make_subset'; +function sk4d_image_make_texture_image; external LibraryName name 'sk4d_image_make_texture_image'; +function sk4d_image_make_with_filter; external LibraryName name 'sk4d_image_make_with_filter'; +function sk4d_image_peek_pixels; external LibraryName name 'sk4d_image_peek_pixels'; +function sk4d_image_read_pixels; external LibraryName name 'sk4d_image_read_pixels'; +function sk4d_image_scale_pixels; external LibraryName name 'sk4d_image_scale_pixels'; +{$ENDIF} + + +{ include/c/sk4d_imageencoder.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_imageencoder_encode_to_file := GetProcAddress(LibraryHandle, PChar('sk4d_imageencoder_encode_to_file')); + sk4d_imageencoder_encode_to_stream := GetProcAddress(LibraryHandle, PChar('sk4d_imageencoder_encode_to_stream')); +{$ELSE} +function sk4d_imageencoder_encode_to_file; external LibraryName name 'sk4d_imageencoder_encode_to_file'; +function sk4d_imageencoder_encode_to_stream; external LibraryName name 'sk4d_imageencoder_encode_to_stream'; +{$ENDIF} + + +{ include/c/sk4d_imagefilter.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_imagefilter_make_alpha_threshold := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_alpha_threshold')); + sk4d_imagefilter_make_arithmetic := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_arithmetic')); + sk4d_imagefilter_make_blend := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_blend')); + sk4d_imagefilter_make_blur := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_blur')); + sk4d_imagefilter_make_colorfilter := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_colorfilter')); + sk4d_imagefilter_make_compose := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_compose')); + sk4d_imagefilter_make_dilate := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_dilate')); + sk4d_imagefilter_make_displacement_map := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_displacement_map')); + sk4d_imagefilter_make_distant_lit_diffuse := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_distant_lit_diffuse')); + sk4d_imagefilter_make_distant_lit_specular := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_distant_lit_specular')); + sk4d_imagefilter_make_drop_shadow := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_drop_shadow')); + sk4d_imagefilter_make_drop_shadow_only := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_drop_shadow_only')); + sk4d_imagefilter_make_erode := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_erode')); + sk4d_imagefilter_make_image := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_image')); + sk4d_imagefilter_make_magnifier := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_magnifier')); + sk4d_imagefilter_make_matrix_convolution := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_matrix_convolution')); + sk4d_imagefilter_make_matrix_transform := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_matrix_transform')); + sk4d_imagefilter_make_merge := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_merge')); + sk4d_imagefilter_make_offset := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_offset')); + sk4d_imagefilter_make_picture := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_picture')); + sk4d_imagefilter_make_point_lit_diffuse := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_point_lit_diffuse')); + sk4d_imagefilter_make_point_lit_specular := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_point_lit_specular')); + sk4d_imagefilter_make_shader := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_shader')); + sk4d_imagefilter_make_spot_lit_diffuse := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_spot_lit_diffuse')); + sk4d_imagefilter_make_spot_lit_specular := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_spot_lit_specular')); + sk4d_imagefilter_make_tile := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_tile')); + sk4d_imagefilter_make_with_local_matrix := GetProcAddress(LibraryHandle, PChar('sk4d_imagefilter_make_with_local_matrix')); +{$ELSE} +function sk4d_imagefilter_make_alpha_threshold; external LibraryName name 'sk4d_imagefilter_make_alpha_threshold'; +function sk4d_imagefilter_make_arithmetic; external LibraryName name 'sk4d_imagefilter_make_arithmetic'; +function sk4d_imagefilter_make_blend; external LibraryName name 'sk4d_imagefilter_make_blend'; +function sk4d_imagefilter_make_blur; external LibraryName name 'sk4d_imagefilter_make_blur'; +function sk4d_imagefilter_make_colorfilter; external LibraryName name 'sk4d_imagefilter_make_colorfilter'; +function sk4d_imagefilter_make_compose; external LibraryName name 'sk4d_imagefilter_make_compose'; +function sk4d_imagefilter_make_dilate; external LibraryName name 'sk4d_imagefilter_make_dilate'; +function sk4d_imagefilter_make_displacement_map; external LibraryName name 'sk4d_imagefilter_make_displacement_map'; +function sk4d_imagefilter_make_distant_lit_diffuse; external LibraryName name 'sk4d_imagefilter_make_distant_lit_diffuse'; +function sk4d_imagefilter_make_distant_lit_specular; external LibraryName name 'sk4d_imagefilter_make_distant_lit_specular'; +function sk4d_imagefilter_make_drop_shadow; external LibraryName name 'sk4d_imagefilter_make_drop_shadow'; +function sk4d_imagefilter_make_drop_shadow_only; external LibraryName name 'sk4d_imagefilter_make_drop_shadow_only'; +function sk4d_imagefilter_make_erode; external LibraryName name 'sk4d_imagefilter_make_erode'; +function sk4d_imagefilter_make_image; external LibraryName name 'sk4d_imagefilter_make_image'; +function sk4d_imagefilter_make_magnifier; external LibraryName name 'sk4d_imagefilter_make_magnifier'; +function sk4d_imagefilter_make_matrix_convolution; external LibraryName name 'sk4d_imagefilter_make_matrix_convolution'; +function sk4d_imagefilter_make_matrix_transform; external LibraryName name 'sk4d_imagefilter_make_matrix_transform'; +function sk4d_imagefilter_make_merge; external LibraryName name 'sk4d_imagefilter_make_merge'; +function sk4d_imagefilter_make_offset; external LibraryName name 'sk4d_imagefilter_make_offset'; +function sk4d_imagefilter_make_picture; external LibraryName name 'sk4d_imagefilter_make_picture'; +function sk4d_imagefilter_make_point_lit_diffuse; external LibraryName name 'sk4d_imagefilter_make_point_lit_diffuse'; +function sk4d_imagefilter_make_point_lit_specular; external LibraryName name 'sk4d_imagefilter_make_point_lit_specular'; +function sk4d_imagefilter_make_shader; external LibraryName name 'sk4d_imagefilter_make_shader'; +function sk4d_imagefilter_make_spot_lit_diffuse; external LibraryName name 'sk4d_imagefilter_make_spot_lit_diffuse'; +function sk4d_imagefilter_make_spot_lit_specular; external LibraryName name 'sk4d_imagefilter_make_spot_lit_specular'; +function sk4d_imagefilter_make_tile; external LibraryName name 'sk4d_imagefilter_make_tile'; +function sk4d_imagefilter_make_with_local_matrix; external LibraryName name 'sk4d_imagefilter_make_with_local_matrix'; +{$ENDIF} + + +{ include/c/sk4d_maskfilter.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_maskfilter_make_blur := GetProcAddress(LibraryHandle, PChar('sk4d_maskfilter_make_blur')); + sk4d_maskfilter_make_shader := GetProcAddress(LibraryHandle, PChar('sk4d_maskfilter_make_shader')); + sk4d_maskfilter_make_table := GetProcAddress(LibraryHandle, PChar('sk4d_maskfilter_make_table')); + sk4d_maskfilter_make_table_clip := GetProcAddress(LibraryHandle, PChar('sk4d_maskfilter_make_table_clip')); + sk4d_maskfilter_make_table_gamma := GetProcAddress(LibraryHandle, PChar('sk4d_maskfilter_make_table_gamma')); +{$ELSE} +function sk4d_maskfilter_make_blur; external LibraryName name 'sk4d_maskfilter_make_blur'; +function sk4d_maskfilter_make_shader; external LibraryName name 'sk4d_maskfilter_make_shader'; +function sk4d_maskfilter_make_table; external LibraryName name 'sk4d_maskfilter_make_table'; +function sk4d_maskfilter_make_table_clip; external LibraryName name 'sk4d_maskfilter_make_table_clip'; +function sk4d_maskfilter_make_table_gamma; external LibraryName name 'sk4d_maskfilter_make_table_gamma'; +{$ENDIF} + + +{ include/c/sk4d_paint.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_paint_create := GetProcAddress(LibraryHandle, PChar('sk4d_paint_create')); + sk4d_paint_create2 := GetProcAddress(LibraryHandle, PChar('sk4d_paint_create2')); + sk4d_paint_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_paint_destroy')); + sk4d_paint_get_alpha := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_alpha')); + sk4d_paint_get_alphaf := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_alphaf')); + sk4d_paint_get_anti_alias := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_anti_alias')); + sk4d_paint_get_blender := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_blender')); + sk4d_paint_get_color := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_color')); + sk4d_paint_get_colorf := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_colorf')); + sk4d_paint_get_color_filter := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_color_filter')); + sk4d_paint_get_dither := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_dither')); + sk4d_paint_get_fill_path := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_fill_path')); + sk4d_paint_get_image_filter := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_image_filter')); + sk4d_paint_get_mask_filter := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_mask_filter')); + sk4d_paint_get_path_effect := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_path_effect')); + sk4d_paint_get_shader := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_shader')); + sk4d_paint_get_stroke_cap := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_stroke_cap')); + sk4d_paint_get_stroke_join := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_stroke_join')); + sk4d_paint_get_stroke_miter := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_stroke_miter')); + sk4d_paint_get_stroke_width := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_stroke_width')); + sk4d_paint_get_style := GetProcAddress(LibraryHandle, PChar('sk4d_paint_get_style')); + sk4d_paint_reset := GetProcAddress(LibraryHandle, PChar('sk4d_paint_reset')); + sk4d_paint_set_alpha := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_alpha')); + sk4d_paint_set_alphaf := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_alphaf')); + sk4d_paint_set_antialias := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_antialias')); + sk4d_paint_set_argb := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_argb')); + sk4d_paint_set_blender := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_blender')); + sk4d_paint_set_color := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_color')); + sk4d_paint_set_colorf := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_colorf')); + sk4d_paint_set_color_filter := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_color_filter')); + sk4d_paint_set_dither := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_dither')); + sk4d_paint_set_image_filter := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_image_filter')); + sk4d_paint_set_mask_filter := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_mask_filter')); + sk4d_paint_set_path_effect := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_path_effect')); + sk4d_paint_set_shader := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_shader')); + sk4d_paint_set_stroke_cap := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_stroke_cap')); + sk4d_paint_set_stroke_join := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_stroke_join')); + sk4d_paint_set_stroke_miter := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_stroke_miter')); + sk4d_paint_set_stroke_width := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_stroke_width')); + sk4d_paint_set_style := GetProcAddress(LibraryHandle, PChar('sk4d_paint_set_style')); +{$ELSE} +function sk4d_paint_create; external LibraryName name 'sk4d_paint_create'; +function sk4d_paint_create2; external LibraryName name 'sk4d_paint_create2'; +procedure sk4d_paint_destroy; external LibraryName name 'sk4d_paint_destroy'; +function sk4d_paint_get_alpha; external LibraryName name 'sk4d_paint_get_alpha'; +function sk4d_paint_get_alphaf; external LibraryName name 'sk4d_paint_get_alphaf'; +function sk4d_paint_get_anti_alias; external LibraryName name 'sk4d_paint_get_anti_alias'; +function sk4d_paint_get_blender; external LibraryName name 'sk4d_paint_get_blender'; +function sk4d_paint_get_color; external LibraryName name 'sk4d_paint_get_color'; +procedure sk4d_paint_get_colorf; external LibraryName name 'sk4d_paint_get_colorf'; +function sk4d_paint_get_color_filter; external LibraryName name 'sk4d_paint_get_color_filter'; +function sk4d_paint_get_dither; external LibraryName name 'sk4d_paint_get_dither'; +function sk4d_paint_get_fill_path; external LibraryName name 'sk4d_paint_get_fill_path'; +function sk4d_paint_get_image_filter; external LibraryName name 'sk4d_paint_get_image_filter'; +function sk4d_paint_get_mask_filter; external LibraryName name 'sk4d_paint_get_mask_filter'; +function sk4d_paint_get_path_effect; external LibraryName name 'sk4d_paint_get_path_effect'; +function sk4d_paint_get_shader; external LibraryName name 'sk4d_paint_get_shader'; +function sk4d_paint_get_stroke_cap; external LibraryName name 'sk4d_paint_get_stroke_cap'; +function sk4d_paint_get_stroke_join; external LibraryName name 'sk4d_paint_get_stroke_join'; +function sk4d_paint_get_stroke_miter; external LibraryName name 'sk4d_paint_get_stroke_miter'; +function sk4d_paint_get_stroke_width; external LibraryName name 'sk4d_paint_get_stroke_width'; +function sk4d_paint_get_style; external LibraryName name 'sk4d_paint_get_style'; +procedure sk4d_paint_reset; external LibraryName name 'sk4d_paint_reset'; +procedure sk4d_paint_set_alpha; external LibraryName name 'sk4d_paint_set_alpha'; +procedure sk4d_paint_set_alphaf; external LibraryName name 'sk4d_paint_set_alphaf'; +procedure sk4d_paint_set_antialias; external LibraryName name 'sk4d_paint_set_antialias'; +procedure sk4d_paint_set_argb; external LibraryName name 'sk4d_paint_set_argb'; +procedure sk4d_paint_set_blender; external LibraryName name 'sk4d_paint_set_blender'; +procedure sk4d_paint_set_color; external LibraryName name 'sk4d_paint_set_color'; +procedure sk4d_paint_set_colorf; external LibraryName name 'sk4d_paint_set_colorf'; +procedure sk4d_paint_set_color_filter; external LibraryName name 'sk4d_paint_set_color_filter'; +procedure sk4d_paint_set_dither; external LibraryName name 'sk4d_paint_set_dither'; +procedure sk4d_paint_set_image_filter; external LibraryName name 'sk4d_paint_set_image_filter'; +procedure sk4d_paint_set_mask_filter; external LibraryName name 'sk4d_paint_set_mask_filter'; +procedure sk4d_paint_set_path_effect; external LibraryName name 'sk4d_paint_set_path_effect'; +procedure sk4d_paint_set_shader; external LibraryName name 'sk4d_paint_set_shader'; +procedure sk4d_paint_set_stroke_cap; external LibraryName name 'sk4d_paint_set_stroke_cap'; +procedure sk4d_paint_set_stroke_join; external LibraryName name 'sk4d_paint_set_stroke_join'; +procedure sk4d_paint_set_stroke_miter; external LibraryName name 'sk4d_paint_set_stroke_miter'; +procedure sk4d_paint_set_stroke_width; external LibraryName name 'sk4d_paint_set_stroke_width'; +procedure sk4d_paint_set_style; external LibraryName name 'sk4d_paint_set_style'; +{$ENDIF} + + +{ include/c/sk4d_path.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_opbuilder_add := GetProcAddress(LibraryHandle, PChar('sk4d_opbuilder_add')); + sk4d_opbuilder_create := GetProcAddress(LibraryHandle, PChar('sk4d_opbuilder_create')); + sk4d_opbuilder_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_opbuilder_destroy')); + sk4d_opbuilder_detach := GetProcAddress(LibraryHandle, PChar('sk4d_opbuilder_detach')); + sk4d_path_contains := GetProcAddress(LibraryHandle, PChar('sk4d_path_contains')); + sk4d_path_convert_conic_to_quads := GetProcAddress(LibraryHandle, PChar('sk4d_path_convert_conic_to_quads')); + sk4d_path_create := GetProcAddress(LibraryHandle, PChar('sk4d_path_create')); + sk4d_path_create2 := GetProcAddress(LibraryHandle, PChar('sk4d_path_create2')); + sk4d_path_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_path_destroy')); + sk4d_path_get_bounds := GetProcAddress(LibraryHandle, PChar('sk4d_path_get_bounds')); + sk4d_path_get_fill_type := GetProcAddress(LibraryHandle, PChar('sk4d_path_get_fill_type')); + sk4d_path_get_last_point := GetProcAddress(LibraryHandle, PChar('sk4d_path_get_last_point')); + sk4d_path_get_segment_masks := GetProcAddress(LibraryHandle, PChar('sk4d_path_get_segment_masks')); + sk4d_path_get_tight_bounds := GetProcAddress(LibraryHandle, PChar('sk4d_path_get_tight_bounds')); + sk4d_path_interpolate := GetProcAddress(LibraryHandle, PChar('sk4d_path_interpolate')); + sk4d_path_is_convex := GetProcAddress(LibraryHandle, PChar('sk4d_path_is_convex')); + sk4d_path_is_empty := GetProcAddress(LibraryHandle, PChar('sk4d_path_is_empty')); + sk4d_path_is_finite := GetProcAddress(LibraryHandle, PChar('sk4d_path_is_finite')); + sk4d_path_is_interpolatable := GetProcAddress(LibraryHandle, PChar('sk4d_path_is_interpolatable')); + sk4d_path_is_last_contour_closed := GetProcAddress(LibraryHandle, PChar('sk4d_path_is_last_contour_closed')); + sk4d_path_is_line := GetProcAddress(LibraryHandle, PChar('sk4d_path_is_line')); + sk4d_path_is_oval := GetProcAddress(LibraryHandle, PChar('sk4d_path_is_oval')); + sk4d_path_is_rect := GetProcAddress(LibraryHandle, PChar('sk4d_path_is_rect')); + sk4d_path_is_rrect := GetProcAddress(LibraryHandle, PChar('sk4d_path_is_rrect')); + sk4d_path_op := GetProcAddress(LibraryHandle, PChar('sk4d_path_op')); + sk4d_path_serialize_to_stream := GetProcAddress(LibraryHandle, PChar('sk4d_path_serialize_to_stream')); + sk4d_path_to_svg := GetProcAddress(LibraryHandle, PChar('sk4d_path_to_svg')); + sk4d_path_transform := GetProcAddress(LibraryHandle, PChar('sk4d_path_transform')); + sk4d_pathiterator_create := GetProcAddress(LibraryHandle, PChar('sk4d_pathiterator_create')); + sk4d_pathiterator_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_pathiterator_destroy')); + sk4d_pathiterator_next := GetProcAddress(LibraryHandle, PChar('sk4d_pathiterator_next')); +{$ELSE} +procedure sk4d_opbuilder_add; external LibraryName name 'sk4d_opbuilder_add'; +function sk4d_opbuilder_create; external LibraryName name 'sk4d_opbuilder_create'; +procedure sk4d_opbuilder_destroy; external LibraryName name 'sk4d_opbuilder_destroy'; +function sk4d_opbuilder_detach; external LibraryName name 'sk4d_opbuilder_detach'; +function sk4d_path_contains; external LibraryName name 'sk4d_path_contains'; +function sk4d_path_convert_conic_to_quads; external LibraryName name 'sk4d_path_convert_conic_to_quads'; +function sk4d_path_create; external LibraryName name 'sk4d_path_create'; +function sk4d_path_create2; external LibraryName name 'sk4d_path_create2'; +procedure sk4d_path_destroy; external LibraryName name 'sk4d_path_destroy'; +procedure sk4d_path_get_bounds; external LibraryName name 'sk4d_path_get_bounds'; +function sk4d_path_get_fill_type; external LibraryName name 'sk4d_path_get_fill_type'; +function sk4d_path_get_last_point; external LibraryName name 'sk4d_path_get_last_point'; +function sk4d_path_get_segment_masks; external LibraryName name 'sk4d_path_get_segment_masks'; +procedure sk4d_path_get_tight_bounds; external LibraryName name 'sk4d_path_get_tight_bounds'; +function sk4d_path_interpolate; external LibraryName name 'sk4d_path_interpolate'; +function sk4d_path_is_convex; external LibraryName name 'sk4d_path_is_convex'; +function sk4d_path_is_empty; external LibraryName name 'sk4d_path_is_empty'; +function sk4d_path_is_finite; external LibraryName name 'sk4d_path_is_finite'; +function sk4d_path_is_interpolatable; external LibraryName name 'sk4d_path_is_interpolatable'; +function sk4d_path_is_last_contour_closed; external LibraryName name 'sk4d_path_is_last_contour_closed'; +function sk4d_path_is_line; external LibraryName name 'sk4d_path_is_line'; +function sk4d_path_is_oval; external LibraryName name 'sk4d_path_is_oval'; +function sk4d_path_is_rect; external LibraryName name 'sk4d_path_is_rect'; +function sk4d_path_is_rrect; external LibraryName name 'sk4d_path_is_rrect'; +function sk4d_path_op; external LibraryName name 'sk4d_path_op'; +procedure sk4d_path_serialize_to_stream; external LibraryName name 'sk4d_path_serialize_to_stream'; +function sk4d_path_to_svg; external LibraryName name 'sk4d_path_to_svg'; +function sk4d_path_transform; external LibraryName name 'sk4d_path_transform'; +function sk4d_pathiterator_create; external LibraryName name 'sk4d_pathiterator_create'; +procedure sk4d_pathiterator_destroy; external LibraryName name 'sk4d_pathiterator_destroy'; +function sk4d_pathiterator_next; external LibraryName name 'sk4d_pathiterator_next'; +{$ENDIF} + + +{ include/c/sk4d_pathbuilder.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_pathbuilder_add_arc := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_add_arc')); + sk4d_pathbuilder_add_circle := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_add_circle')); + sk4d_pathbuilder_add_oval := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_add_oval')); + sk4d_pathbuilder_add_path := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_add_path')); + sk4d_pathbuilder_add_polygon := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_add_polygon')); + sk4d_pathbuilder_add_rect := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_add_rect')); + sk4d_pathbuilder_add_rrect := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_add_rrect')); + sk4d_pathbuilder_arc_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_arc_to')); + sk4d_pathbuilder_arc_to2 := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_arc_to2')); + sk4d_pathbuilder_arc_to3 := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_arc_to3')); + sk4d_pathbuilder_close := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_close')); + sk4d_pathbuilder_conic_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_conic_to')); + sk4d_pathbuilder_create := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_create')); + sk4d_pathbuilder_create2 := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_create2')); + sk4d_pathbuilder_cubic_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_cubic_to')); + sk4d_pathbuilder_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_destroy')); + sk4d_pathbuilder_detach := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_detach')); + sk4d_pathbuilder_get_bounds := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_get_bounds')); + sk4d_pathbuilder_get_fill_type := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_get_fill_type')); + sk4d_pathbuilder_inc_reserve := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_inc_reserve')); + sk4d_pathbuilder_line_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_line_to')); + sk4d_pathbuilder_move_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_move_to')); + sk4d_pathbuilder_offset := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_offset')); + sk4d_pathbuilder_polyline_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_polyline_to')); + sk4d_pathbuilder_quad_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_quad_to')); + sk4d_pathbuilder_r_conic_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_r_conic_to')); + sk4d_pathbuilder_r_cubic_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_r_cubic_to')); + sk4d_pathbuilder_r_line_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_r_line_to')); + sk4d_pathbuilder_r_quad_to := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_r_quad_to')); + sk4d_pathbuilder_reset := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_reset')); + sk4d_pathbuilder_set_filltype := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_set_filltype')); + sk4d_pathbuilder_snapshot := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_snapshot')); + sk4d_pathbuilder_toggle_inverse_filltype := GetProcAddress(LibraryHandle, PChar('sk4d_pathbuilder_toggle_inverse_filltype')); +{$ELSE} +procedure sk4d_pathbuilder_add_arc; external LibraryName name 'sk4d_pathbuilder_add_arc'; +procedure sk4d_pathbuilder_add_circle; external LibraryName name 'sk4d_pathbuilder_add_circle'; +procedure sk4d_pathbuilder_add_oval; external LibraryName name 'sk4d_pathbuilder_add_oval'; +procedure sk4d_pathbuilder_add_path; external LibraryName name 'sk4d_pathbuilder_add_path'; +procedure sk4d_pathbuilder_add_polygon; external LibraryName name 'sk4d_pathbuilder_add_polygon'; +procedure sk4d_pathbuilder_add_rect; external LibraryName name 'sk4d_pathbuilder_add_rect'; +procedure sk4d_pathbuilder_add_rrect; external LibraryName name 'sk4d_pathbuilder_add_rrect'; +procedure sk4d_pathbuilder_arc_to; external LibraryName name 'sk4d_pathbuilder_arc_to'; +procedure sk4d_pathbuilder_arc_to2; external LibraryName name 'sk4d_pathbuilder_arc_to2'; +procedure sk4d_pathbuilder_arc_to3; external LibraryName name 'sk4d_pathbuilder_arc_to3'; +procedure sk4d_pathbuilder_close; external LibraryName name 'sk4d_pathbuilder_close'; +procedure sk4d_pathbuilder_conic_to; external LibraryName name 'sk4d_pathbuilder_conic_to'; +function sk4d_pathbuilder_create; external LibraryName name 'sk4d_pathbuilder_create'; +function sk4d_pathbuilder_create2; external LibraryName name 'sk4d_pathbuilder_create2'; +procedure sk4d_pathbuilder_cubic_to; external LibraryName name 'sk4d_pathbuilder_cubic_to'; +procedure sk4d_pathbuilder_destroy; external LibraryName name 'sk4d_pathbuilder_destroy'; +function sk4d_pathbuilder_detach; external LibraryName name 'sk4d_pathbuilder_detach'; +procedure sk4d_pathbuilder_get_bounds; external LibraryName name 'sk4d_pathbuilder_get_bounds'; +function sk4d_pathbuilder_get_fill_type; external LibraryName name 'sk4d_pathbuilder_get_fill_type'; +procedure sk4d_pathbuilder_inc_reserve; external LibraryName name 'sk4d_pathbuilder_inc_reserve'; +procedure sk4d_pathbuilder_line_to; external LibraryName name 'sk4d_pathbuilder_line_to'; +procedure sk4d_pathbuilder_move_to; external LibraryName name 'sk4d_pathbuilder_move_to'; +procedure sk4d_pathbuilder_offset; external LibraryName name 'sk4d_pathbuilder_offset'; +procedure sk4d_pathbuilder_polyline_to; external LibraryName name 'sk4d_pathbuilder_polyline_to'; +procedure sk4d_pathbuilder_quad_to; external LibraryName name 'sk4d_pathbuilder_quad_to'; +procedure sk4d_pathbuilder_r_conic_to; external LibraryName name 'sk4d_pathbuilder_r_conic_to'; +procedure sk4d_pathbuilder_r_cubic_to; external LibraryName name 'sk4d_pathbuilder_r_cubic_to'; +procedure sk4d_pathbuilder_r_line_to; external LibraryName name 'sk4d_pathbuilder_r_line_to'; +procedure sk4d_pathbuilder_r_quad_to; external LibraryName name 'sk4d_pathbuilder_r_quad_to'; +procedure sk4d_pathbuilder_reset; external LibraryName name 'sk4d_pathbuilder_reset'; +procedure sk4d_pathbuilder_set_filltype; external LibraryName name 'sk4d_pathbuilder_set_filltype'; +function sk4d_pathbuilder_snapshot; external LibraryName name 'sk4d_pathbuilder_snapshot'; +procedure sk4d_pathbuilder_toggle_inverse_filltype; external LibraryName name 'sk4d_pathbuilder_toggle_inverse_filltype'; +{$ENDIF} + + +{ include/c/sk4d_patheffect.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_patheffect_make_1dpath := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_1dpath')); + sk4d_patheffect_make_2dline := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_2dline')); + sk4d_patheffect_make_2dpath := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_2dpath')); + sk4d_patheffect_make_compose := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_compose')); + sk4d_patheffect_make_corner := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_corner')); + sk4d_patheffect_make_dash := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_dash')); + sk4d_patheffect_make_discrete := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_discrete')); + sk4d_patheffect_make_matrix := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_matrix')); + sk4d_patheffect_make_merge := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_merge')); + sk4d_patheffect_make_stroke := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_stroke')); + sk4d_patheffect_make_stroke_and_fill := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_stroke_and_fill')); + sk4d_patheffect_make_sum := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_sum')); + sk4d_patheffect_make_translate := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_translate')); + sk4d_patheffect_make_trim := GetProcAddress(LibraryHandle, PChar('sk4d_patheffect_make_trim')); +{$ELSE} +function sk4d_patheffect_make_1dpath; external LibraryName name 'sk4d_patheffect_make_1dpath'; +function sk4d_patheffect_make_2dline; external LibraryName name 'sk4d_patheffect_make_2dline'; +function sk4d_patheffect_make_2dpath; external LibraryName name 'sk4d_patheffect_make_2dpath'; +function sk4d_patheffect_make_compose; external LibraryName name 'sk4d_patheffect_make_compose'; +function sk4d_patheffect_make_corner; external LibraryName name 'sk4d_patheffect_make_corner'; +function sk4d_patheffect_make_dash; external LibraryName name 'sk4d_patheffect_make_dash'; +function sk4d_patheffect_make_discrete; external LibraryName name 'sk4d_patheffect_make_discrete'; +function sk4d_patheffect_make_matrix; external LibraryName name 'sk4d_patheffect_make_matrix'; +function sk4d_patheffect_make_merge; external LibraryName name 'sk4d_patheffect_make_merge'; +function sk4d_patheffect_make_stroke; external LibraryName name 'sk4d_patheffect_make_stroke'; +function sk4d_patheffect_make_stroke_and_fill; external LibraryName name 'sk4d_patheffect_make_stroke_and_fill'; +function sk4d_patheffect_make_sum; external LibraryName name 'sk4d_patheffect_make_sum'; +function sk4d_patheffect_make_translate; external LibraryName name 'sk4d_patheffect_make_translate'; +function sk4d_patheffect_make_trim; external LibraryName name 'sk4d_patheffect_make_trim'; +{$ENDIF} + + +{ include/c/sk4d_pathmeasure.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_pathmeasure_create := GetProcAddress(LibraryHandle, PChar('sk4d_pathmeasure_create')); + sk4d_pathmeasure_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_pathmeasure_destroy')); + sk4d_pathmeasure_get_length := GetProcAddress(LibraryHandle, PChar('sk4d_pathmeasure_get_length')); + sk4d_pathmeasure_get_matrix := GetProcAddress(LibraryHandle, PChar('sk4d_pathmeasure_get_matrix')); + sk4d_pathmeasure_get_position_and_tangent := GetProcAddress(LibraryHandle, PChar('sk4d_pathmeasure_get_position_and_tangent')); + sk4d_pathmeasure_get_segment := GetProcAddress(LibraryHandle, PChar('sk4d_pathmeasure_get_segment')); + sk4d_pathmeasure_is_closed := GetProcAddress(LibraryHandle, PChar('sk4d_pathmeasure_is_closed')); + sk4d_pathmeasure_next_contour := GetProcAddress(LibraryHandle, PChar('sk4d_pathmeasure_next_contour')); +{$ELSE} +function sk4d_pathmeasure_create; external LibraryName name 'sk4d_pathmeasure_create'; +procedure sk4d_pathmeasure_destroy; external LibraryName name 'sk4d_pathmeasure_destroy'; +function sk4d_pathmeasure_get_length; external LibraryName name 'sk4d_pathmeasure_get_length'; +function sk4d_pathmeasure_get_matrix; external LibraryName name 'sk4d_pathmeasure_get_matrix'; +function sk4d_pathmeasure_get_position_and_tangent; external LibraryName name 'sk4d_pathmeasure_get_position_and_tangent'; +function sk4d_pathmeasure_get_segment; external LibraryName name 'sk4d_pathmeasure_get_segment'; +function sk4d_pathmeasure_is_closed; external LibraryName name 'sk4d_pathmeasure_is_closed'; +function sk4d_pathmeasure_next_contour; external LibraryName name 'sk4d_pathmeasure_next_contour'; +{$ENDIF} + + +{ include/c/sk4d_picture.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_picture_get_cull_rect := GetProcAddress(LibraryHandle, PChar('sk4d_picture_get_cull_rect')); + sk4d_picture_make_from_stream := GetProcAddress(LibraryHandle, PChar('sk4d_picture_make_from_stream')); + sk4d_picture_make_shader := GetProcAddress(LibraryHandle, PChar('sk4d_picture_make_shader')); + sk4d_picture_playback := GetProcAddress(LibraryHandle, PChar('sk4d_picture_playback')); + sk4d_picture_serialize_to_stream := GetProcAddress(LibraryHandle, PChar('sk4d_picture_serialize_to_stream')); +{$ELSE} +procedure sk4d_picture_get_cull_rect; external LibraryName name 'sk4d_picture_get_cull_rect'; +function sk4d_picture_make_from_stream; external LibraryName name 'sk4d_picture_make_from_stream'; +function sk4d_picture_make_shader; external LibraryName name 'sk4d_picture_make_shader'; +procedure sk4d_picture_playback; external LibraryName name 'sk4d_picture_playback'; +procedure sk4d_picture_serialize_to_stream; external LibraryName name 'sk4d_picture_serialize_to_stream'; +{$ENDIF} + + +{ include/c/sk4d_picturerecorder.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_picturerecorder_begin_recording := GetProcAddress(LibraryHandle, PChar('sk4d_picturerecorder_begin_recording')); + sk4d_picturerecorder_create := GetProcAddress(LibraryHandle, PChar('sk4d_picturerecorder_create')); + sk4d_picturerecorder_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_picturerecorder_destroy')); + sk4d_picturerecorder_finish_recording := GetProcAddress(LibraryHandle, PChar('sk4d_picturerecorder_finish_recording')); + sk4d_picturerecorder_finish_recording2 := GetProcAddress(LibraryHandle, PChar('sk4d_picturerecorder_finish_recording2')); +{$ELSE} +function sk4d_picturerecorder_begin_recording; external LibraryName name 'sk4d_picturerecorder_begin_recording'; +function sk4d_picturerecorder_create; external LibraryName name 'sk4d_picturerecorder_create'; +procedure sk4d_picturerecorder_destroy; external LibraryName name 'sk4d_picturerecorder_destroy'; +function sk4d_picturerecorder_finish_recording; external LibraryName name 'sk4d_picturerecorder_finish_recording'; +function sk4d_picturerecorder_finish_recording2; external LibraryName name 'sk4d_picturerecorder_finish_recording2'; +{$ENDIF} + + +{ include/c/sk4d_pixmap.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_pixmap_create := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_create')); + sk4d_pixmap_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_destroy')); + sk4d_pixmap_erase := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_erase')); + sk4d_pixmap_erase2 := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_erase2')); + sk4d_pixmap_extract_subset := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_extract_subset')); + sk4d_pixmap_get_alpha := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_alpha')); + sk4d_pixmap_get_alpha_type := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_alpha_type')); + sk4d_pixmap_get_color := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_color')); + sk4d_pixmap_get_color_space := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_color_space')); + sk4d_pixmap_get_color_type := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_color_type')); + sk4d_pixmap_get_colorf := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_colorf')); + sk4d_pixmap_get_height := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_height')); + sk4d_pixmap_get_image_info := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_image_info')); + sk4d_pixmap_get_pixel_addr := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_pixel_addr')); + sk4d_pixmap_get_pixels := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_pixels')); + sk4d_pixmap_get_row_bytes := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_row_bytes')); + sk4d_pixmap_get_width := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_get_width')); + sk4d_pixmap_read_pixels := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_read_pixels')); + sk4d_pixmap_scale_pixels := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_scale_pixels')); + sk4d_pixmap_set_colorspace := GetProcAddress(LibraryHandle, PChar('sk4d_pixmap_set_colorspace')); +{$ELSE} +function sk4d_pixmap_create; external LibraryName name 'sk4d_pixmap_create'; +procedure sk4d_pixmap_destroy; external LibraryName name 'sk4d_pixmap_destroy'; +function sk4d_pixmap_erase; external LibraryName name 'sk4d_pixmap_erase'; +function sk4d_pixmap_erase2; external LibraryName name 'sk4d_pixmap_erase2'; +function sk4d_pixmap_extract_subset; external LibraryName name 'sk4d_pixmap_extract_subset'; +function sk4d_pixmap_get_alpha; external LibraryName name 'sk4d_pixmap_get_alpha'; +function sk4d_pixmap_get_alpha_type; external LibraryName name 'sk4d_pixmap_get_alpha_type'; +function sk4d_pixmap_get_color; external LibraryName name 'sk4d_pixmap_get_color'; +function sk4d_pixmap_get_color_space; external LibraryName name 'sk4d_pixmap_get_color_space'; +function sk4d_pixmap_get_color_type; external LibraryName name 'sk4d_pixmap_get_color_type'; +procedure sk4d_pixmap_get_colorf; external LibraryName name 'sk4d_pixmap_get_colorf'; +function sk4d_pixmap_get_height; external LibraryName name 'sk4d_pixmap_get_height'; +procedure sk4d_pixmap_get_image_info; external LibraryName name 'sk4d_pixmap_get_image_info'; +function sk4d_pixmap_get_pixel_addr; external LibraryName name 'sk4d_pixmap_get_pixel_addr'; +function sk4d_pixmap_get_pixels; external LibraryName name 'sk4d_pixmap_get_pixels'; +function sk4d_pixmap_get_row_bytes; external LibraryName name 'sk4d_pixmap_get_row_bytes'; +function sk4d_pixmap_get_width; external LibraryName name 'sk4d_pixmap_get_width'; +function sk4d_pixmap_read_pixels; external LibraryName name 'sk4d_pixmap_read_pixels'; +function sk4d_pixmap_scale_pixels; external LibraryName name 'sk4d_pixmap_scale_pixels'; +procedure sk4d_pixmap_set_colorspace; external LibraryName name 'sk4d_pixmap_set_colorspace'; +{$ENDIF} + + +{ include/c/sk4d_refcnt.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_refcnt_ref := GetProcAddress(LibraryHandle, PChar('sk4d_refcnt_ref')); + sk4d_refcnt_unref := GetProcAddress(LibraryHandle, PChar('sk4d_refcnt_unref')); +{$ELSE} +procedure sk4d_refcnt_ref; external LibraryName name 'sk4d_refcnt_ref'; +procedure sk4d_refcnt_unref; external LibraryName name 'sk4d_refcnt_unref'; +{$ENDIF} + + +{ include/c/sk4d_region.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_region_contains := GetProcAddress(LibraryHandle, PChar('sk4d_region_contains')); + sk4d_region_contains2 := GetProcAddress(LibraryHandle, PChar('sk4d_region_contains2')); + sk4d_region_contains3 := GetProcAddress(LibraryHandle, PChar('sk4d_region_contains3')); + sk4d_region_create := GetProcAddress(LibraryHandle, PChar('sk4d_region_create')); + sk4d_region_create2 := GetProcAddress(LibraryHandle, PChar('sk4d_region_create2')); + sk4d_region_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_region_destroy')); + sk4d_region_get_boundary_path := GetProcAddress(LibraryHandle, PChar('sk4d_region_get_boundary_path')); + sk4d_region_get_bounds := GetProcAddress(LibraryHandle, PChar('sk4d_region_get_bounds')); + sk4d_region_intersects := GetProcAddress(LibraryHandle, PChar('sk4d_region_intersects')); + sk4d_region_intersects2 := GetProcAddress(LibraryHandle, PChar('sk4d_region_intersects2')); + sk4d_region_is_complex := GetProcAddress(LibraryHandle, PChar('sk4d_region_is_complex')); + sk4d_region_is_empty := GetProcAddress(LibraryHandle, PChar('sk4d_region_is_empty')); + sk4d_region_is_equal := GetProcAddress(LibraryHandle, PChar('sk4d_region_is_equal')); + sk4d_region_is_rect := GetProcAddress(LibraryHandle, PChar('sk4d_region_is_rect')); + sk4d_region_op := GetProcAddress(LibraryHandle, PChar('sk4d_region_op')); + sk4d_region_op2 := GetProcAddress(LibraryHandle, PChar('sk4d_region_op2')); + sk4d_region_quick_contains := GetProcAddress(LibraryHandle, PChar('sk4d_region_quick_contains')); + sk4d_region_quick_reject := GetProcAddress(LibraryHandle, PChar('sk4d_region_quick_reject')); + sk4d_region_quick_reject2 := GetProcAddress(LibraryHandle, PChar('sk4d_region_quick_reject2')); + sk4d_region_set_empty := GetProcAddress(LibraryHandle, PChar('sk4d_region_set_empty')); + sk4d_region_set_path := GetProcAddress(LibraryHandle, PChar('sk4d_region_set_path')); + sk4d_region_set_rect := GetProcAddress(LibraryHandle, PChar('sk4d_region_set_rect')); + sk4d_region_set_rects := GetProcAddress(LibraryHandle, PChar('sk4d_region_set_rects')); + sk4d_region_translate := GetProcAddress(LibraryHandle, PChar('sk4d_region_translate')); + sk4d_regioncliperator_create := GetProcAddress(LibraryHandle, PChar('sk4d_regioncliperator_create')); + sk4d_regioncliperator_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_regioncliperator_destroy')); + sk4d_regioncliperator_get_current := GetProcAddress(LibraryHandle, PChar('sk4d_regioncliperator_get_current')); + sk4d_regioncliperator_move_next := GetProcAddress(LibraryHandle, PChar('sk4d_regioncliperator_move_next')); + sk4d_regioniterator_create := GetProcAddress(LibraryHandle, PChar('sk4d_regioniterator_create')); + sk4d_regioniterator_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_regioniterator_destroy')); + sk4d_regioniterator_get_current := GetProcAddress(LibraryHandle, PChar('sk4d_regioniterator_get_current')); + sk4d_regioniterator_move_next := GetProcAddress(LibraryHandle, PChar('sk4d_regioniterator_move_next')); + sk4d_regionspanerator_create := GetProcAddress(LibraryHandle, PChar('sk4d_regionspanerator_create')); + sk4d_regionspanerator_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_regionspanerator_destroy')); + sk4d_regionspanerator_next := GetProcAddress(LibraryHandle, PChar('sk4d_regionspanerator_next')); +{$ELSE} +function sk4d_region_contains; external LibraryName name 'sk4d_region_contains'; +function sk4d_region_contains2; external LibraryName name 'sk4d_region_contains2'; +function sk4d_region_contains3; external LibraryName name 'sk4d_region_contains3'; +function sk4d_region_create; external LibraryName name 'sk4d_region_create'; +function sk4d_region_create2; external LibraryName name 'sk4d_region_create2'; +procedure sk4d_region_destroy; external LibraryName name 'sk4d_region_destroy'; +function sk4d_region_get_boundary_path; external LibraryName name 'sk4d_region_get_boundary_path'; +procedure sk4d_region_get_bounds; external LibraryName name 'sk4d_region_get_bounds'; +function sk4d_region_intersects; external LibraryName name 'sk4d_region_intersects'; +function sk4d_region_intersects2; external LibraryName name 'sk4d_region_intersects2'; +function sk4d_region_is_complex; external LibraryName name 'sk4d_region_is_complex'; +function sk4d_region_is_empty; external LibraryName name 'sk4d_region_is_empty'; +function sk4d_region_is_equal; external LibraryName name 'sk4d_region_is_equal'; +function sk4d_region_is_rect; external LibraryName name 'sk4d_region_is_rect'; +function sk4d_region_op; external LibraryName name 'sk4d_region_op'; +function sk4d_region_op2; external LibraryName name 'sk4d_region_op2'; +function sk4d_region_quick_contains; external LibraryName name 'sk4d_region_quick_contains'; +function sk4d_region_quick_reject; external LibraryName name 'sk4d_region_quick_reject'; +function sk4d_region_quick_reject2; external LibraryName name 'sk4d_region_quick_reject2'; +procedure sk4d_region_set_empty; external LibraryName name 'sk4d_region_set_empty'; +function sk4d_region_set_path; external LibraryName name 'sk4d_region_set_path'; +function sk4d_region_set_rect; external LibraryName name 'sk4d_region_set_rect'; +function sk4d_region_set_rects; external LibraryName name 'sk4d_region_set_rects'; +procedure sk4d_region_translate; external LibraryName name 'sk4d_region_translate'; +function sk4d_regioncliperator_create; external LibraryName name 'sk4d_regioncliperator_create'; +procedure sk4d_regioncliperator_destroy; external LibraryName name 'sk4d_regioncliperator_destroy'; +procedure sk4d_regioncliperator_get_current; external LibraryName name 'sk4d_regioncliperator_get_current'; +function sk4d_regioncliperator_move_next; external LibraryName name 'sk4d_regioncliperator_move_next'; +function sk4d_regioniterator_create; external LibraryName name 'sk4d_regioniterator_create'; +procedure sk4d_regioniterator_destroy; external LibraryName name 'sk4d_regioniterator_destroy'; +procedure sk4d_regioniterator_get_current; external LibraryName name 'sk4d_regioniterator_get_current'; +function sk4d_regioniterator_move_next; external LibraryName name 'sk4d_regioniterator_move_next'; +function sk4d_regionspanerator_create; external LibraryName name 'sk4d_regionspanerator_create'; +procedure sk4d_regionspanerator_destroy; external LibraryName name 'sk4d_regionspanerator_destroy'; +function sk4d_regionspanerator_next; external LibraryName name 'sk4d_regionspanerator_next'; +{$ENDIF} + + +{ include/c/sk4d_rrect.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_rrect_contains := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_contains')); + sk4d_rrect_create := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_create')); + sk4d_rrect_create2 := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_create2')); + sk4d_rrect_deflate := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_deflate')); + sk4d_rrect_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_destroy')); + sk4d_rrect_get_height := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_get_height')); + sk4d_rrect_get_radii := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_get_radii')); + sk4d_rrect_get_rect := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_get_rect')); + sk4d_rrect_get_simple_radii := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_get_simple_radii')); + sk4d_rrect_get_width := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_get_width')); + sk4d_rrect_inflate := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_inflate')); + sk4d_rrect_is_complex := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_is_complex')); + sk4d_rrect_is_empty := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_is_empty')); + sk4d_rrect_is_equal := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_is_equal')); + sk4d_rrect_is_nine_patch := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_is_nine_patch')); + sk4d_rrect_is_oval := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_is_oval')); + sk4d_rrect_is_rect := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_is_rect')); + sk4d_rrect_is_simple := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_is_simple')); + sk4d_rrect_is_valid := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_is_valid')); + sk4d_rrect_offset := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_offset')); + sk4d_rrect_set_empty := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_set_empty')); + sk4d_rrect_set_nine_patch := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_set_nine_patch')); + sk4d_rrect_set_oval := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_set_oval')); + sk4d_rrect_set_rect := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_set_rect')); + sk4d_rrect_set_rect2 := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_set_rect2')); + sk4d_rrect_set_rect3 := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_set_rect3')); + sk4d_rrect_transform := GetProcAddress(LibraryHandle, PChar('sk4d_rrect_transform')); +{$ELSE} +function sk4d_rrect_contains; external LibraryName name 'sk4d_rrect_contains'; +function sk4d_rrect_create; external LibraryName name 'sk4d_rrect_create'; +function sk4d_rrect_create2; external LibraryName name 'sk4d_rrect_create2'; +procedure sk4d_rrect_deflate; external LibraryName name 'sk4d_rrect_deflate'; +procedure sk4d_rrect_destroy; external LibraryName name 'sk4d_rrect_destroy'; +function sk4d_rrect_get_height; external LibraryName name 'sk4d_rrect_get_height'; +procedure sk4d_rrect_get_radii; external LibraryName name 'sk4d_rrect_get_radii'; +procedure sk4d_rrect_get_rect; external LibraryName name 'sk4d_rrect_get_rect'; +procedure sk4d_rrect_get_simple_radii; external LibraryName name 'sk4d_rrect_get_simple_radii'; +function sk4d_rrect_get_width; external LibraryName name 'sk4d_rrect_get_width'; +procedure sk4d_rrect_inflate; external LibraryName name 'sk4d_rrect_inflate'; +function sk4d_rrect_is_complex; external LibraryName name 'sk4d_rrect_is_complex'; +function sk4d_rrect_is_empty; external LibraryName name 'sk4d_rrect_is_empty'; +function sk4d_rrect_is_equal; external LibraryName name 'sk4d_rrect_is_equal'; +function sk4d_rrect_is_nine_patch; external LibraryName name 'sk4d_rrect_is_nine_patch'; +function sk4d_rrect_is_oval; external LibraryName name 'sk4d_rrect_is_oval'; +function sk4d_rrect_is_rect; external LibraryName name 'sk4d_rrect_is_rect'; +function sk4d_rrect_is_simple; external LibraryName name 'sk4d_rrect_is_simple'; +function sk4d_rrect_is_valid; external LibraryName name 'sk4d_rrect_is_valid'; +procedure sk4d_rrect_offset; external LibraryName name 'sk4d_rrect_offset'; +procedure sk4d_rrect_set_empty; external LibraryName name 'sk4d_rrect_set_empty'; +procedure sk4d_rrect_set_nine_patch; external LibraryName name 'sk4d_rrect_set_nine_patch'; +procedure sk4d_rrect_set_oval; external LibraryName name 'sk4d_rrect_set_oval'; +procedure sk4d_rrect_set_rect; external LibraryName name 'sk4d_rrect_set_rect'; +procedure sk4d_rrect_set_rect2; external LibraryName name 'sk4d_rrect_set_rect2'; +procedure sk4d_rrect_set_rect3; external LibraryName name 'sk4d_rrect_set_rect3'; +function sk4d_rrect_transform; external LibraryName name 'sk4d_rrect_transform'; +{$ENDIF} + + +{ include/c/sk4d_runtimeeffect.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_runtimeeffect_get_child_count := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_get_child_count')); + sk4d_runtimeeffect_get_child_name := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_get_child_name')); + sk4d_runtimeeffect_get_child_type := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_get_child_type')); + sk4d_runtimeeffect_get_uniform_count := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_get_uniform_count')); + sk4d_runtimeeffect_get_uniform_data_size := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_get_uniform_data_size')); + sk4d_runtimeeffect_get_uniform_name := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_get_uniform_name')); + sk4d_runtimeeffect_get_uniform_offset := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_get_uniform_offset')); + sk4d_runtimeeffect_get_uniform_type := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_get_uniform_type')); + sk4d_runtimeeffect_get_uniform_type_count := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_get_uniform_type_count')); + sk4d_runtimeeffect_index_of_child := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_index_of_child')); + sk4d_runtimeeffect_index_of_uniform := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_index_of_uniform')); + sk4d_runtimeeffect_make_blender := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_make_blender')); + sk4d_runtimeeffect_make_color_filter := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_make_color_filter')); + sk4d_runtimeeffect_make_for_blender := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_make_for_blender')); + sk4d_runtimeeffect_make_for_color_filter := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_make_for_color_filter')); + sk4d_runtimeeffect_make_for_shader := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_make_for_shader')); + sk4d_runtimeeffect_make_image := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_make_image')); + sk4d_runtimeeffect_make_shader := GetProcAddress(LibraryHandle, PChar('sk4d_runtimeeffect_make_shader')); +{$ELSE} +function sk4d_runtimeeffect_get_child_count; external LibraryName name 'sk4d_runtimeeffect_get_child_count'; +function sk4d_runtimeeffect_get_child_name; external LibraryName name 'sk4d_runtimeeffect_get_child_name'; +function sk4d_runtimeeffect_get_child_type; external LibraryName name 'sk4d_runtimeeffect_get_child_type'; +function sk4d_runtimeeffect_get_uniform_count; external LibraryName name 'sk4d_runtimeeffect_get_uniform_count'; +function sk4d_runtimeeffect_get_uniform_data_size; external LibraryName name 'sk4d_runtimeeffect_get_uniform_data_size'; +function sk4d_runtimeeffect_get_uniform_name; external LibraryName name 'sk4d_runtimeeffect_get_uniform_name'; +function sk4d_runtimeeffect_get_uniform_offset; external LibraryName name 'sk4d_runtimeeffect_get_uniform_offset'; +function sk4d_runtimeeffect_get_uniform_type; external LibraryName name 'sk4d_runtimeeffect_get_uniform_type'; +function sk4d_runtimeeffect_get_uniform_type_count; external LibraryName name 'sk4d_runtimeeffect_get_uniform_type_count'; +function sk4d_runtimeeffect_index_of_child; external LibraryName name 'sk4d_runtimeeffect_index_of_child'; +function sk4d_runtimeeffect_index_of_uniform; external LibraryName name 'sk4d_runtimeeffect_index_of_uniform'; +function sk4d_runtimeeffect_make_blender; external LibraryName name 'sk4d_runtimeeffect_make_blender'; +function sk4d_runtimeeffect_make_color_filter; external LibraryName name 'sk4d_runtimeeffect_make_color_filter'; +function sk4d_runtimeeffect_make_for_blender; external LibraryName name 'sk4d_runtimeeffect_make_for_blender'; +function sk4d_runtimeeffect_make_for_color_filter; external LibraryName name 'sk4d_runtimeeffect_make_for_color_filter'; +function sk4d_runtimeeffect_make_for_shader; external LibraryName name 'sk4d_runtimeeffect_make_for_shader'; +function sk4d_runtimeeffect_make_image; external LibraryName name 'sk4d_runtimeeffect_make_image'; +function sk4d_runtimeeffect_make_shader; external LibraryName name 'sk4d_runtimeeffect_make_shader'; +{$ENDIF} + + +{ include/c/sk4d_shader.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_shader_make_blend := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_blend')); + sk4d_shader_make_color := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_color')); + sk4d_shader_make_color2 := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_color2')); + sk4d_shader_make_gradient_linear := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_gradient_linear')); + sk4d_shader_make_gradient_linear2 := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_gradient_linear2')); + sk4d_shader_make_gradient_radial := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_gradient_radial')); + sk4d_shader_make_gradient_radial2 := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_gradient_radial2')); + sk4d_shader_make_gradient_sweep := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_gradient_sweep')); + sk4d_shader_make_gradient_sweep2 := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_gradient_sweep2')); + sk4d_shader_make_gradient_two_point_conical := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_gradient_two_point_conical')); + sk4d_shader_make_gradient_two_point_conical2 := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_gradient_two_point_conical2')); + sk4d_shader_make_perlin_noise_fractal_noise := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_perlin_noise_fractal_noise')); + sk4d_shader_make_perlin_noise_turbulence := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_perlin_noise_turbulence')); + sk4d_shader_make_with_color_filter := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_with_color_filter')); + sk4d_shader_make_with_local_matrix := GetProcAddress(LibraryHandle, PChar('sk4d_shader_make_with_local_matrix')); +{$ELSE} +function sk4d_shader_make_blend; external LibraryName name 'sk4d_shader_make_blend'; +function sk4d_shader_make_color; external LibraryName name 'sk4d_shader_make_color'; +function sk4d_shader_make_color2; external LibraryName name 'sk4d_shader_make_color2'; +function sk4d_shader_make_gradient_linear; external LibraryName name 'sk4d_shader_make_gradient_linear'; +function sk4d_shader_make_gradient_linear2; external LibraryName name 'sk4d_shader_make_gradient_linear2'; +function sk4d_shader_make_gradient_radial; external LibraryName name 'sk4d_shader_make_gradient_radial'; +function sk4d_shader_make_gradient_radial2; external LibraryName name 'sk4d_shader_make_gradient_radial2'; +function sk4d_shader_make_gradient_sweep; external LibraryName name 'sk4d_shader_make_gradient_sweep'; +function sk4d_shader_make_gradient_sweep2; external LibraryName name 'sk4d_shader_make_gradient_sweep2'; +function sk4d_shader_make_gradient_two_point_conical; external LibraryName name 'sk4d_shader_make_gradient_two_point_conical'; +function sk4d_shader_make_gradient_two_point_conical2; external LibraryName name 'sk4d_shader_make_gradient_two_point_conical2'; +function sk4d_shader_make_perlin_noise_fractal_noise; external LibraryName name 'sk4d_shader_make_perlin_noise_fractal_noise'; +function sk4d_shader_make_perlin_noise_turbulence; external LibraryName name 'sk4d_shader_make_perlin_noise_turbulence'; +function sk4d_shader_make_with_color_filter; external LibraryName name 'sk4d_shader_make_with_color_filter'; +function sk4d_shader_make_with_local_matrix; external LibraryName name 'sk4d_shader_make_with_local_matrix'; +{$ENDIF} + + +{ include/c/sk4d_stream.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_streamadapter_create := GetProcAddress(LibraryHandle, PChar('sk4d_streamadapter_create')); + sk4d_streamadapter_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_streamadapter_destroy')); + sk4d_streamadapter_set_procs := GetProcAddress(LibraryHandle, PChar('sk4d_streamadapter_set_procs')); + sk4d_wstreamadapter_create := GetProcAddress(LibraryHandle, PChar('sk4d_wstreamadapter_create')); + sk4d_wstreamadapter_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_wstreamadapter_destroy')); + sk4d_wstreamadapter_set_procs := GetProcAddress(LibraryHandle, PChar('sk4d_wstreamadapter_set_procs')); +{$ELSE} +function sk4d_streamadapter_create; external LibraryName name 'sk4d_streamadapter_create'; +procedure sk4d_streamadapter_destroy; external LibraryName name 'sk4d_streamadapter_destroy'; +procedure sk4d_streamadapter_set_procs; external LibraryName name 'sk4d_streamadapter_set_procs'; +function sk4d_wstreamadapter_create; external LibraryName name 'sk4d_wstreamadapter_create'; +procedure sk4d_wstreamadapter_destroy; external LibraryName name 'sk4d_wstreamadapter_destroy'; +procedure sk4d_wstreamadapter_set_procs; external LibraryName name 'sk4d_wstreamadapter_set_procs'; +{$ENDIF} + + +{ include/c/sk4d_string.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_string_create := GetProcAddress(LibraryHandle, PChar('sk4d_string_create')); + sk4d_string_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_string_destroy')); + sk4d_string_get_text := GetProcAddress(LibraryHandle, PChar('sk4d_string_get_text')); +{$ELSE} +function sk4d_string_create; external LibraryName name 'sk4d_string_create'; +procedure sk4d_string_destroy; external LibraryName name 'sk4d_string_destroy'; +function sk4d_string_get_text; external LibraryName name 'sk4d_string_get_text'; +{$ENDIF} + + +{ include/c/sk4d_surface.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_surface_draw := GetProcAddress(LibraryHandle, PChar('sk4d_surface_draw')); + sk4d_surface_flush := GetProcAddress(LibraryHandle, PChar('sk4d_surface_flush')); + sk4d_surface_flush_and_submit := GetProcAddress(LibraryHandle, PChar('sk4d_surface_flush_and_submit')); + sk4d_surface_get_canvas := GetProcAddress(LibraryHandle, PChar('sk4d_surface_get_canvas')); + sk4d_surface_get_props := GetProcAddress(LibraryHandle, PChar('sk4d_surface_get_props')); + sk4d_surface_make_from_mtk_view := GetProcAddress(LibraryHandle, PChar('sk4d_surface_make_from_mtk_view')); + sk4d_surface_make_from_render_target := GetProcAddress(LibraryHandle, PChar('sk4d_surface_make_from_render_target')); + sk4d_surface_make_from_texture := GetProcAddress(LibraryHandle, PChar('sk4d_surface_make_from_texture')); + sk4d_surface_make_image_snapshot := GetProcAddress(LibraryHandle, PChar('sk4d_surface_make_image_snapshot')); + sk4d_surface_make_image_snapshot2 := GetProcAddress(LibraryHandle, PChar('sk4d_surface_make_image_snapshot2')); + sk4d_surface_make_raster := GetProcAddress(LibraryHandle, PChar('sk4d_surface_make_raster')); + sk4d_surface_make_raster_direct := GetProcAddress(LibraryHandle, PChar('sk4d_surface_make_raster_direct')); + sk4d_surface_make_render_target := GetProcAddress(LibraryHandle, PChar('sk4d_surface_make_render_target')); + sk4d_surface_peek_pixels := GetProcAddress(LibraryHandle, PChar('sk4d_surface_peek_pixels')); + sk4d_surface_read_pixels := GetProcAddress(LibraryHandle, PChar('sk4d_surface_read_pixels')); +{$ELSE} +procedure sk4d_surface_draw; external LibraryName name 'sk4d_surface_draw'; +procedure sk4d_surface_flush; external LibraryName name 'sk4d_surface_flush'; +procedure sk4d_surface_flush_and_submit; external LibraryName name 'sk4d_surface_flush_and_submit'; +function sk4d_surface_get_canvas; external LibraryName name 'sk4d_surface_get_canvas'; +procedure sk4d_surface_get_props; external LibraryName name 'sk4d_surface_get_props'; +function sk4d_surface_make_from_mtk_view; external LibraryName name 'sk4d_surface_make_from_mtk_view'; +function sk4d_surface_make_from_render_target; external LibraryName name 'sk4d_surface_make_from_render_target'; +function sk4d_surface_make_from_texture; external LibraryName name 'sk4d_surface_make_from_texture'; +function sk4d_surface_make_image_snapshot; external LibraryName name 'sk4d_surface_make_image_snapshot'; +function sk4d_surface_make_image_snapshot2; external LibraryName name 'sk4d_surface_make_image_snapshot2'; +function sk4d_surface_make_raster; external LibraryName name 'sk4d_surface_make_raster'; +function sk4d_surface_make_raster_direct; external LibraryName name 'sk4d_surface_make_raster_direct'; +function sk4d_surface_make_render_target; external LibraryName name 'sk4d_surface_make_render_target'; +function sk4d_surface_peek_pixels; external LibraryName name 'sk4d_surface_peek_pixels'; +function sk4d_surface_read_pixels; external LibraryName name 'sk4d_surface_read_pixels'; +{$ENDIF} + + +{ include/c/sk4d_svgcanvas.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_svgcanvas_make := GetProcAddress(LibraryHandle, PChar('sk4d_svgcanvas_make')); +{$ELSE} +function sk4d_svgcanvas_make; external LibraryName name 'sk4d_svgcanvas_make'; +{$ENDIF} + + +{ include/c/sk4d_textblob.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_textblob_get_intercepts := GetProcAddress(LibraryHandle, PChar('sk4d_textblob_get_intercepts')); + sk4d_textblob_make_from_text := GetProcAddress(LibraryHandle, PChar('sk4d_textblob_make_from_text')); + sk4d_textblob_make_from_text_horizontally_positioned := GetProcAddress(LibraryHandle, PChar('sk4d_textblob_make_from_text_horizontally_positioned')); + sk4d_textblob_make_from_text_positioned := GetProcAddress(LibraryHandle, PChar('sk4d_textblob_make_from_text_positioned')); + sk4d_textblob_make_from_text_transform := GetProcAddress(LibraryHandle, PChar('sk4d_textblob_make_from_text_transform')); + sk4d_textblob_ref := GetProcAddress(LibraryHandle, PChar('sk4d_textblob_ref')); + sk4d_textblob_unref := GetProcAddress(LibraryHandle, PChar('sk4d_textblob_unref')); +{$ELSE} +function sk4d_textblob_get_intercepts; external LibraryName name 'sk4d_textblob_get_intercepts'; +function sk4d_textblob_make_from_text; external LibraryName name 'sk4d_textblob_make_from_text'; +function sk4d_textblob_make_from_text_horizontally_positioned; external LibraryName name 'sk4d_textblob_make_from_text_horizontally_positioned'; +function sk4d_textblob_make_from_text_positioned; external LibraryName name 'sk4d_textblob_make_from_text_positioned'; +function sk4d_textblob_make_from_text_transform; external LibraryName name 'sk4d_textblob_make_from_text_transform'; +procedure sk4d_textblob_ref; external LibraryName name 'sk4d_textblob_ref'; +procedure sk4d_textblob_unref; external LibraryName name 'sk4d_textblob_unref'; + +{$ENDIF} + + +{ include/c/sk4d_tracememorydump.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_tracememorydumpbaseclass_create := GetProcAddress(LibraryHandle, PChar('sk4d_tracememorydumpbaseclass_create')); + sk4d_tracememorydumpbaseclass_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_tracememorydumpbaseclass_destroy')); + sk4d_tracememorydumpbaseclass_set_procs := GetProcAddress(LibraryHandle, PChar('sk4d_tracememorydumpbaseclass_set_procs')); +{$ELSE} +function sk4d_tracememorydumpbaseclass_create; external LibraryName name 'sk4d_tracememorydumpbaseclass_create'; +procedure sk4d_tracememorydumpbaseclass_destroy; external LibraryName name 'sk4d_tracememorydumpbaseclass_destroy'; +procedure sk4d_tracememorydumpbaseclass_set_procs; external LibraryName name 'sk4d_tracememorydumpbaseclass_set_procs'; +{$ENDIF} + + +{ include/c/sk4d_typeface.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_typeface_get_family_name := GetProcAddress(LibraryHandle, PChar('sk4d_typeface_get_family_name')); + sk4d_typeface_get_slant := GetProcAddress(LibraryHandle, PChar('sk4d_typeface_get_slant')); + sk4d_typeface_get_style := GetProcAddress(LibraryHandle, PChar('sk4d_typeface_get_style')); + sk4d_typeface_get_weight := GetProcAddress(LibraryHandle, PChar('sk4d_typeface_get_weight')); + sk4d_typeface_get_width := GetProcAddress(LibraryHandle, PChar('sk4d_typeface_get_width')); + sk4d_typeface_make_default := GetProcAddress(LibraryHandle, PChar('sk4d_typeface_make_default')); + sk4d_typeface_make_from_file := GetProcAddress(LibraryHandle, PChar('sk4d_typeface_make_from_file')); + sk4d_typeface_make_from_stream := GetProcAddress(LibraryHandle, PChar('sk4d_typeface_make_from_stream')); + sk4d_typeface_make_from_name := GetProcAddress(LibraryHandle, PChar('sk4d_typeface_make_from_name')); +{$ELSE} +function sk4d_typeface_get_family_name; external LibraryName name 'sk4d_typeface_get_family_name'; +function sk4d_typeface_get_slant; external LibraryName name 'sk4d_typeface_get_slant'; +procedure sk4d_typeface_get_style; external LibraryName name 'sk4d_typeface_get_style'; +function sk4d_typeface_get_weight; external LibraryName name 'sk4d_typeface_get_weight'; +function sk4d_typeface_get_width; external LibraryName name 'sk4d_typeface_get_width'; +function sk4d_typeface_make_default; external LibraryName name 'sk4d_typeface_make_default'; +function sk4d_typeface_make_from_file; external LibraryName name 'sk4d_typeface_make_from_file'; +function sk4d_typeface_make_from_stream; external LibraryName name 'sk4d_typeface_make_from_stream'; +function sk4d_typeface_make_from_name; external LibraryName name 'sk4d_typeface_make_from_name'; +{$ENDIF} + + +{ include/c/sk4d_vertices.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_vertices_make_copy := GetProcAddress(LibraryHandle, PChar('sk4d_vertices_make_copy')); + sk4d_vertices_ref := GetProcAddress(LibraryHandle, PChar('sk4d_vertices_ref')); + sk4d_vertices_unref := GetProcAddress(LibraryHandle, PChar('sk4d_vertices_unref')); +{$ELSE} +function sk4d_vertices_make_copy; external LibraryName name 'sk4d_vertices_make_copy'; +procedure sk4d_vertices_ref; external LibraryName name 'sk4d_vertices_ref'; +procedure sk4d_vertices_unref; external LibraryName name 'sk4d_vertices_unref'; +{$ENDIF} + + +{ modules/particles/include/sk4d_particleeffect.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_particleeffect_get_position := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_get_position')); + sk4d_particleeffect_get_rate := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_get_rate')); + sk4d_particleeffect_get_uniform := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_get_uniform')); + sk4d_particleeffect_get_uniform_count := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_get_uniform_count')); + sk4d_particleeffect_get_uniform_data := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_get_uniform_data')); + sk4d_particleeffect_get_uniform_data_count := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_get_uniform_data_count')); + sk4d_particleeffect_get_uniform_name := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_get_uniform_name')); + sk4d_particleeffect_init := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_init')); + sk4d_particleeffect_make_from_file := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_make_from_file')); + sk4d_particleeffect_make_from_stream := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_make_from_stream')); + sk4d_particleeffect_render := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_render')); + sk4d_particleeffect_set_position := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_set_position')); + sk4d_particleeffect_set_rate := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_set_rate')); + sk4d_particleeffect_set_uniform := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_set_uniform')); + sk4d_particleeffect_start := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_start')); + sk4d_particleeffect_update := GetProcAddress(LibraryHandle, PChar('sk4d_particleeffect_update')); +{$ELSE} +procedure sk4d_particleeffect_get_position; external LibraryName name 'sk4d_particleeffect_get_position'; +function sk4d_particleeffect_get_rate; external LibraryName name 'sk4d_particleeffect_get_rate'; +procedure sk4d_particleeffect_get_uniform; external LibraryName name 'sk4d_particleeffect_get_uniform'; +function sk4d_particleeffect_get_uniform_count; external LibraryName name 'sk4d_particleeffect_get_uniform_count'; +function sk4d_particleeffect_get_uniform_data; external LibraryName name 'sk4d_particleeffect_get_uniform_data'; +function sk4d_particleeffect_get_uniform_data_count; external LibraryName name 'sk4d_particleeffect_get_uniform_data_count'; +function sk4d_particleeffect_get_uniform_name; external LibraryName name 'sk4d_particleeffect_get_uniform_name'; +procedure sk4d_particleeffect_init; external LibraryName name 'sk4d_particleeffect_init'; +function sk4d_particleeffect_make_from_file; external LibraryName name 'sk4d_particleeffect_make_from_file'; +function sk4d_particleeffect_make_from_stream; external LibraryName name 'sk4d_particleeffect_make_from_stream'; +procedure sk4d_particleeffect_render; external LibraryName name 'sk4d_particleeffect_render'; +procedure sk4d_particleeffect_set_position; external LibraryName name 'sk4d_particleeffect_set_position'; +procedure sk4d_particleeffect_set_rate; external LibraryName name 'sk4d_particleeffect_set_rate'; +function sk4d_particleeffect_set_uniform; external LibraryName name 'sk4d_particleeffect_set_uniform'; +procedure sk4d_particleeffect_start; external LibraryName name 'sk4d_particleeffect_start'; +procedure sk4d_particleeffect_update; external LibraryName name 'sk4d_particleeffect_update'; +{$ENDIF} + + +{ modules/skottie/include/sk4d_skottie.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_skottieanimation_get_duration := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_get_duration')); + sk4d_skottieanimation_get_fps := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_get_fps')); + sk4d_skottieanimation_get_in_point := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_get_in_point')); + sk4d_skottieanimation_get_out_point := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_get_out_point')); + sk4d_skottieanimation_get_size := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_get_size')); + sk4d_skottieanimation_get_version := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_get_version')); + sk4d_skottieanimation_make_from_file := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_make_from_file')); + sk4d_skottieanimation_make_from_stream := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_make_from_stream')); + sk4d_skottieanimation_ref := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_ref')); + sk4d_skottieanimation_render := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_render')); + sk4d_skottieanimation_seek_frame := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_seek_frame')); + sk4d_skottieanimation_seek_frame_time := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_seek_frame_time')); + sk4d_skottieanimation_unref := GetProcAddress(LibraryHandle, PChar('sk4d_skottieanimation_unref')); +{$ELSE} +function sk4d_skottieanimation_get_duration; external LibraryName name 'sk4d_skottieanimation_get_duration'; +function sk4d_skottieanimation_get_fps; external LibraryName name 'sk4d_skottieanimation_get_fps'; +function sk4d_skottieanimation_get_in_point; external LibraryName name 'sk4d_skottieanimation_get_in_point'; +function sk4d_skottieanimation_get_out_point; external LibraryName name 'sk4d_skottieanimation_get_out_point'; +procedure sk4d_skottieanimation_get_size; external LibraryName name 'sk4d_skottieanimation_get_size'; +function sk4d_skottieanimation_get_version; external LibraryName name 'sk4d_skottieanimation_get_version'; +function sk4d_skottieanimation_make_from_file; external LibraryName name 'sk4d_skottieanimation_make_from_file'; +function sk4d_skottieanimation_make_from_stream; external LibraryName name 'sk4d_skottieanimation_make_from_stream'; +procedure sk4d_skottieanimation_ref; external LibraryName name 'sk4d_skottieanimation_ref'; +procedure sk4d_skottieanimation_render; external LibraryName name 'sk4d_skottieanimation_render'; +procedure sk4d_skottieanimation_seek_frame; external LibraryName name 'sk4d_skottieanimation_seek_frame'; +procedure sk4d_skottieanimation_seek_frame_time; external LibraryName name 'sk4d_skottieanimation_seek_frame_time'; +procedure sk4d_skottieanimation_unref; external LibraryName name 'sk4d_skottieanimation_unref'; +{$ENDIF} + + +{ modules/skparagraph/include/sk4d_paragraph.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_paragraph_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_destroy')); + sk4d_paragraph_did_exceed_max_lines := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_did_exceed_max_lines')); + sk4d_paragraph_get_alphabetic_baseline := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_alphabetic_baseline')); + sk4d_paragraph_get_glyph_position_at_coordinate := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_glyph_position_at_coordinate')); + sk4d_paragraph_get_height := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_height')); + sk4d_paragraph_get_ideographic_baseline := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_ideographic_baseline')); + sk4d_paragraph_get_line_metrics := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_line_metrics')); + sk4d_paragraph_get_longest_line := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_longest_line')); + sk4d_paragraph_get_max_intrinsic_width := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_max_intrinsic_width')); + sk4d_paragraph_get_max_width := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_max_width')); + sk4d_paragraph_get_min_intrinsic_width := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_min_intrinsic_width')); + sk4d_paragraph_get_rects_for_placeholders := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_rects_for_placeholders')); + sk4d_paragraph_get_rects_for_range := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_rects_for_range')); + sk4d_paragraph_get_word_boundary := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_get_word_boundary')); + sk4d_paragraph_layout := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_layout')); + sk4d_paragraph_paint := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_paint')); + sk4d_paragraph_to_path := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_to_path')); + sk4d_paragraph_visit := GetProcAddress(LibraryHandle, PChar('sk4d_paragraph_visit')); +{$ELSE} +procedure sk4d_paragraph_destroy; external LibraryName name 'sk4d_paragraph_destroy'; +function sk4d_paragraph_did_exceed_max_lines; external LibraryName name 'sk4d_paragraph_did_exceed_max_lines'; +function sk4d_paragraph_get_alphabetic_baseline; external LibraryName name 'sk4d_paragraph_get_alphabetic_baseline'; +procedure sk4d_paragraph_get_glyph_position_at_coordinate; external LibraryName name 'sk4d_paragraph_get_glyph_position_at_coordinate'; +function sk4d_paragraph_get_height; external LibraryName name 'sk4d_paragraph_get_height'; +function sk4d_paragraph_get_ideographic_baseline; external LibraryName name 'sk4d_paragraph_get_ideographic_baseline'; +function sk4d_paragraph_get_line_metrics; external LibraryName name 'sk4d_paragraph_get_line_metrics'; +function sk4d_paragraph_get_longest_line; external LibraryName name 'sk4d_paragraph_get_longest_line'; +function sk4d_paragraph_get_max_intrinsic_width; external LibraryName name 'sk4d_paragraph_get_max_intrinsic_width'; +function sk4d_paragraph_get_max_width; external LibraryName name 'sk4d_paragraph_get_max_width'; +function sk4d_paragraph_get_min_intrinsic_width; external LibraryName name 'sk4d_paragraph_get_min_intrinsic_width'; +function sk4d_paragraph_get_rects_for_placeholders; external LibraryName name 'sk4d_paragraph_get_rects_for_placeholders'; +function sk4d_paragraph_get_rects_for_range; external LibraryName name 'sk4d_paragraph_get_rects_for_range'; +procedure sk4d_paragraph_get_word_boundary; external LibraryName name 'sk4d_paragraph_get_word_boundary'; +procedure sk4d_paragraph_layout; external LibraryName name 'sk4d_paragraph_layout'; +procedure sk4d_paragraph_paint; external LibraryName name 'sk4d_paragraph_paint'; +function sk4d_paragraph_to_path; external LibraryName name 'sk4d_paragraph_to_path'; +procedure sk4d_paragraph_visit; external LibraryName name 'sk4d_paragraph_visit'; +{$ENDIF} + + +{ modules/skparagraph/include/sk4d_paragraphbuilder.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_paragraphbuilder_add_placeholder := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphbuilder_add_placeholder')); + sk4d_paragraphbuilder_add_text := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphbuilder_add_text')); + sk4d_paragraphbuilder_build := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphbuilder_build')); + sk4d_paragraphbuilder_create := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphbuilder_create')); + sk4d_paragraphbuilder_create2 := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphbuilder_create2')); + sk4d_paragraphbuilder_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphbuilder_destroy')); + sk4d_paragraphbuilder_pop := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphbuilder_pop')); + sk4d_paragraphbuilder_push_style := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphbuilder_push_style')); +{$ELSE} +procedure sk4d_paragraphbuilder_add_placeholder; external LibraryName name 'sk4d_paragraphbuilder_add_placeholder'; +procedure sk4d_paragraphbuilder_add_text; external LibraryName name 'sk4d_paragraphbuilder_add_text'; +function sk4d_paragraphbuilder_build; external LibraryName name 'sk4d_paragraphbuilder_build'; +function sk4d_paragraphbuilder_create; external LibraryName name 'sk4d_paragraphbuilder_create'; +function sk4d_paragraphbuilder_create2; external LibraryName name 'sk4d_paragraphbuilder_create2'; +procedure sk4d_paragraphbuilder_destroy; external LibraryName name 'sk4d_paragraphbuilder_destroy'; +procedure sk4d_paragraphbuilder_pop; external LibraryName name 'sk4d_paragraphbuilder_pop'; +procedure sk4d_paragraphbuilder_push_style; external LibraryName name 'sk4d_paragraphbuilder_push_style'; +{$ENDIF} + + +{ modules/skparagraph/include/sk4d_paragraphstyle.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_paragraphstyle_create := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_create')); + sk4d_paragraphstyle_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_destroy')); + sk4d_paragraphstyle_disable_hinting := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_disable_hinting')); + sk4d_paragraphstyle_get_ellipsis := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_get_ellipsis')); + sk4d_paragraphstyle_get_height := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_get_height')); + sk4d_paragraphstyle_get_max_lines := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_get_max_lines')); + sk4d_paragraphstyle_get_strut_style := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_get_strut_style')); + sk4d_paragraphstyle_get_text_align := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_get_text_align')); + sk4d_paragraphstyle_get_text_direction := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_get_text_direction')); + sk4d_paragraphstyle_get_text_height_behaviors := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_get_text_height_behaviors')); + sk4d_paragraphstyle_get_text_style := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_get_text_style')); + sk4d_paragraphstyle_set_ellipsis := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_set_ellipsis')); + sk4d_paragraphstyle_set_height := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_set_height')); + sk4d_paragraphstyle_set_max_lines := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_set_max_lines')); + sk4d_paragraphstyle_set_strut_style := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_set_strut_style')); + sk4d_paragraphstyle_set_text_align := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_set_text_align')); + sk4d_paragraphstyle_set_text_direction := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_set_text_direction')); + sk4d_paragraphstyle_set_text_height_behaviors := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_set_text_height_behaviors')); + sk4d_paragraphstyle_set_text_style := GetProcAddress(LibraryHandle, PChar('sk4d_paragraphstyle_set_text_style')); + sk4d_strutstyle_create := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_create')); + sk4d_strutstyle_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_destroy')); + sk4d_strutstyle_get_enabled := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_get_enabled')); + sk4d_strutstyle_get_font_families := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_get_font_families')); + sk4d_strutstyle_get_font_size := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_get_font_size')); + sk4d_strutstyle_get_font_style := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_get_font_style')); + sk4d_strutstyle_get_force_height := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_get_force_height')); + sk4d_strutstyle_get_half_leading := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_get_half_leading')); + sk4d_strutstyle_get_height_multiplier := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_get_height_multiplier')); + sk4d_strutstyle_get_leading := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_get_leading')); + sk4d_strutstyle_is_equal := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_is_equal')); + sk4d_strutstyle_set_enabled := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_set_enabled')); + sk4d_strutstyle_set_font_families := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_set_font_families')); + sk4d_strutstyle_set_font_size := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_set_font_size')); + sk4d_strutstyle_set_font_style := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_set_font_style')); + sk4d_strutstyle_set_force_height := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_set_force_height')); + sk4d_strutstyle_set_half_leading := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_set_half_leading')); + sk4d_strutstyle_set_height_multiplier := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_set_height_multiplier')); + sk4d_strutstyle_set_leading := GetProcAddress(LibraryHandle, PChar('sk4d_strutstyle_set_leading')); +{$ELSE} +function sk4d_paragraphstyle_create; external LibraryName name 'sk4d_paragraphstyle_create'; +procedure sk4d_paragraphstyle_destroy; external LibraryName name 'sk4d_paragraphstyle_destroy'; +procedure sk4d_paragraphstyle_disable_hinting; external LibraryName name 'sk4d_paragraphstyle_disable_hinting'; +function sk4d_paragraphstyle_get_ellipsis; external LibraryName name 'sk4d_paragraphstyle_get_ellipsis'; +function sk4d_paragraphstyle_get_height; external LibraryName name 'sk4d_paragraphstyle_get_height'; +function sk4d_paragraphstyle_get_max_lines; external LibraryName name 'sk4d_paragraphstyle_get_max_lines'; +function sk4d_paragraphstyle_get_strut_style; external LibraryName name 'sk4d_paragraphstyle_get_strut_style'; +function sk4d_paragraphstyle_get_text_align; external LibraryName name 'sk4d_paragraphstyle_get_text_align'; +function sk4d_paragraphstyle_get_text_direction; external LibraryName name 'sk4d_paragraphstyle_get_text_direction'; +function sk4d_paragraphstyle_get_text_height_behaviors; external LibraryName name 'sk4d_paragraphstyle_get_text_height_behaviors'; +function sk4d_paragraphstyle_get_text_style; external LibraryName name 'sk4d_paragraphstyle_get_text_style'; +procedure sk4d_paragraphstyle_set_ellipsis; external LibraryName name 'sk4d_paragraphstyle_set_ellipsis'; +procedure sk4d_paragraphstyle_set_height; external LibraryName name 'sk4d_paragraphstyle_set_height'; +procedure sk4d_paragraphstyle_set_max_lines; external LibraryName name 'sk4d_paragraphstyle_set_max_lines'; +procedure sk4d_paragraphstyle_set_strut_style; external LibraryName name 'sk4d_paragraphstyle_set_strut_style'; +procedure sk4d_paragraphstyle_set_text_align; external LibraryName name 'sk4d_paragraphstyle_set_text_align'; +procedure sk4d_paragraphstyle_set_text_direction; external LibraryName name 'sk4d_paragraphstyle_set_text_direction'; +procedure sk4d_paragraphstyle_set_text_height_behaviors; external LibraryName name 'sk4d_paragraphstyle_set_text_height_behaviors'; +procedure sk4d_paragraphstyle_set_text_style; external LibraryName name 'sk4d_paragraphstyle_set_text_style'; +function sk4d_strutstyle_create; external LibraryName name 'sk4d_strutstyle_create'; +procedure sk4d_strutstyle_destroy; external LibraryName name 'sk4d_strutstyle_destroy'; +function sk4d_strutstyle_get_enabled; external LibraryName name 'sk4d_strutstyle_get_enabled'; +function sk4d_strutstyle_get_font_families; external LibraryName name 'sk4d_strutstyle_get_font_families'; +function sk4d_strutstyle_get_font_size; external LibraryName name 'sk4d_strutstyle_get_font_size'; +procedure sk4d_strutstyle_get_font_style; external LibraryName name 'sk4d_strutstyle_get_font_style'; +function sk4d_strutstyle_get_force_height; external LibraryName name 'sk4d_strutstyle_get_force_height'; +function sk4d_strutstyle_get_half_leading; external LibraryName name 'sk4d_strutstyle_get_half_leading'; +function sk4d_strutstyle_get_height_multiplier; external LibraryName name 'sk4d_strutstyle_get_height_multiplier'; +function sk4d_strutstyle_get_leading; external LibraryName name 'sk4d_strutstyle_get_leading'; +function sk4d_strutstyle_is_equal; external LibraryName name 'sk4d_strutstyle_is_equal'; +procedure sk4d_strutstyle_set_enabled; external LibraryName name 'sk4d_strutstyle_set_enabled'; +procedure sk4d_strutstyle_set_font_families; external LibraryName name 'sk4d_strutstyle_set_font_families'; +procedure sk4d_strutstyle_set_font_size; external LibraryName name 'sk4d_strutstyle_set_font_size'; +procedure sk4d_strutstyle_set_font_style; external LibraryName name 'sk4d_strutstyle_set_font_style'; +procedure sk4d_strutstyle_set_force_height; external LibraryName name 'sk4d_strutstyle_set_force_height'; +procedure sk4d_strutstyle_set_half_leading; external LibraryName name 'sk4d_strutstyle_set_half_leading'; +procedure sk4d_strutstyle_set_height_multiplier; external LibraryName name 'sk4d_strutstyle_set_height_multiplier'; +procedure sk4d_strutstyle_set_leading; external LibraryName name 'sk4d_strutstyle_set_leading'; +{$ENDIF} + + +{ modules/skparagraph/include/sk4d_textstyle.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_textstyle_add_font_feature := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_add_font_feature')); + sk4d_textstyle_add_shadow := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_add_shadow')); + sk4d_textstyle_clear_background_color := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_clear_background_color')); + sk4d_textstyle_clear_foreground_color := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_clear_foreground_color')); + sk4d_textstyle_create := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_create')); + sk4d_textstyle_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_destroy')); + sk4d_textstyle_get_background := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_background')); + sk4d_textstyle_get_color := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_color')); + sk4d_textstyle_get_decoration_color := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_decoration_color')); + sk4d_textstyle_get_decoration_style := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_decoration_style')); + sk4d_textstyle_get_decoration_thickness := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_decoration_thickness')); + sk4d_textstyle_get_decorations := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_decorations')); + sk4d_textstyle_get_font_families := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_font_families')); + sk4d_textstyle_get_font_metrics := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_font_metrics')); + sk4d_textstyle_get_font_size := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_font_size')); + sk4d_textstyle_get_font_style := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_font_style')); + sk4d_textstyle_get_foreground := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_foreground')); + sk4d_textstyle_get_half_leading := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_half_leading')); + sk4d_textstyle_get_height_multiplier := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_height_multiplier')); + sk4d_textstyle_get_letter_spacing := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_letter_spacing')); + sk4d_textstyle_get_locale := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_locale')); + sk4d_textstyle_get_word_spacing := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_get_word_spacing')); + sk4d_textstyle_is_equal := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_is_equal')); + sk4d_textstyle_reset_font_features := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_reset_font_features')); + sk4d_textstyle_reset_shadows := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_reset_shadows')); + sk4d_textstyle_set_background_color := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_background_color')); + sk4d_textstyle_set_color := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_color')); + sk4d_textstyle_set_decoration_color := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_decoration_color')); + sk4d_textstyle_set_decoration_style := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_decoration_style')); + sk4d_textstyle_set_decoration_thickness := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_decoration_thickness')); + sk4d_textstyle_set_decorations := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_decorations')); + sk4d_textstyle_set_font_families := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_font_families')); + sk4d_textstyle_set_font_size := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_font_size')); + sk4d_textstyle_set_font_style := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_font_style')); + sk4d_textstyle_set_foreground_color := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_foreground_color')); + sk4d_textstyle_set_half_leading := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_half_leading')); + sk4d_textstyle_set_height_multiplier := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_height_multiplier')); + sk4d_textstyle_set_letter_spacing := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_letter_spacing')); + sk4d_textstyle_set_locale := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_locale')); + sk4d_textstyle_set_word_spacing := GetProcAddress(LibraryHandle, PChar('sk4d_textstyle_set_word_spacing')); +{$ELSE} +procedure sk4d_textstyle_add_font_feature; external LibraryName name 'sk4d_textstyle_add_font_feature'; +procedure sk4d_textstyle_add_shadow; external LibraryName name 'sk4d_textstyle_add_shadow'; +procedure sk4d_textstyle_clear_background_color; external LibraryName name 'sk4d_textstyle_clear_background_color'; +procedure sk4d_textstyle_clear_foreground_color; external LibraryName name 'sk4d_textstyle_clear_foreground_color'; +function sk4d_textstyle_create; external LibraryName name 'sk4d_textstyle_create'; +procedure sk4d_textstyle_destroy; external LibraryName name 'sk4d_textstyle_destroy'; +function sk4d_textstyle_get_background; external LibraryName name 'sk4d_textstyle_get_background'; +function sk4d_textstyle_get_color; external LibraryName name 'sk4d_textstyle_get_color'; +function sk4d_textstyle_get_decoration_color; external LibraryName name 'sk4d_textstyle_get_decoration_color'; +function sk4d_textstyle_get_decoration_style; external LibraryName name 'sk4d_textstyle_get_decoration_style'; +function sk4d_textstyle_get_decoration_thickness; external LibraryName name 'sk4d_textstyle_get_decoration_thickness'; +function sk4d_textstyle_get_decorations; external LibraryName name 'sk4d_textstyle_get_decorations'; +function sk4d_textstyle_get_font_families; external LibraryName name 'sk4d_textstyle_get_font_families'; +procedure sk4d_textstyle_get_font_metrics; external LibraryName name 'sk4d_textstyle_get_font_metrics'; +function sk4d_textstyle_get_font_size; external LibraryName name 'sk4d_textstyle_get_font_size'; +procedure sk4d_textstyle_get_font_style; external LibraryName name 'sk4d_textstyle_get_font_style'; +function sk4d_textstyle_get_foreground; external LibraryName name 'sk4d_textstyle_get_foreground'; +function sk4d_textstyle_get_half_leading; external LibraryName name 'sk4d_textstyle_get_half_leading'; +function sk4d_textstyle_get_height_multiplier; external LibraryName name 'sk4d_textstyle_get_height_multiplier'; +function sk4d_textstyle_get_letter_spacing; external LibraryName name 'sk4d_textstyle_get_letter_spacing'; +function sk4d_textstyle_get_locale; external LibraryName name 'sk4d_textstyle_get_locale'; +function sk4d_textstyle_get_word_spacing; external LibraryName name 'sk4d_textstyle_get_word_spacing'; +function sk4d_textstyle_is_equal; external LibraryName name 'sk4d_textstyle_is_equal'; +procedure sk4d_textstyle_reset_font_features; external LibraryName name 'sk4d_textstyle_reset_font_features'; +procedure sk4d_textstyle_reset_shadows; external LibraryName name 'sk4d_textstyle_reset_shadows'; +procedure sk4d_textstyle_set_background_color; external LibraryName name 'sk4d_textstyle_set_background_color'; +procedure sk4d_textstyle_set_color; external LibraryName name 'sk4d_textstyle_set_color'; +procedure sk4d_textstyle_set_decoration_color; external LibraryName name 'sk4d_textstyle_set_decoration_color'; +procedure sk4d_textstyle_set_decoration_style; external LibraryName name 'sk4d_textstyle_set_decoration_style'; +procedure sk4d_textstyle_set_decoration_thickness; external LibraryName name 'sk4d_textstyle_set_decoration_thickness'; +procedure sk4d_textstyle_set_decorations; external LibraryName name 'sk4d_textstyle_set_decorations'; +procedure sk4d_textstyle_set_font_families; external LibraryName name 'sk4d_textstyle_set_font_families'; +procedure sk4d_textstyle_set_font_size; external LibraryName name 'sk4d_textstyle_set_font_size'; +procedure sk4d_textstyle_set_font_style; external LibraryName name 'sk4d_textstyle_set_font_style'; +procedure sk4d_textstyle_set_foreground_color; external LibraryName name 'sk4d_textstyle_set_foreground_color'; +procedure sk4d_textstyle_set_half_leading; external LibraryName name 'sk4d_textstyle_set_half_leading'; +procedure sk4d_textstyle_set_height_multiplier; external LibraryName name 'sk4d_textstyle_set_height_multiplier'; +procedure sk4d_textstyle_set_letter_spacing; external LibraryName name 'sk4d_textstyle_set_letter_spacing'; +procedure sk4d_textstyle_set_locale; external LibraryName name 'sk4d_textstyle_set_locale'; +procedure sk4d_textstyle_set_word_spacing; external LibraryName name 'sk4d_textstyle_set_word_spacing'; +{$ENDIF} + + +{ modules/skparagraph/include/sk4d_typefacefontprovider.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_typefacefontprovider_create := GetProcAddress(LibraryHandle, PChar('sk4d_typefacefontprovider_create')); + sk4d_typefacefontprovider_register_typeface := GetProcAddress(LibraryHandle, PChar('sk4d_typefacefontprovider_register_typeface')); + sk4d_typefacefontprovider_register_typeface2 := GetProcAddress(LibraryHandle, PChar('sk4d_typefacefontprovider_register_typeface2')); +{$ELSE} +function sk4d_typefacefontprovider_create; external LibraryName name 'sk4d_typefacefontprovider_create'; +procedure sk4d_typefacefontprovider_register_typeface; external LibraryName name 'sk4d_typefacefontprovider_register_typeface'; +procedure sk4d_typefacefontprovider_register_typeface2; external LibraryName name 'sk4d_typefacefontprovider_register_typeface2'; +{$ENDIF} + + +{ modules/skresources/include/sk4d_resources.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_resourceproviderbaseclass_create := GetProcAddress(LibraryHandle, PChar('sk4d_resourceproviderbaseclass_create')); + sk4d_resourceproviderbaseclass_set_procs := GetProcAddress(LibraryHandle, PChar('sk4d_resourceproviderbaseclass_set_procs')); +{$ELSE} +function sk4d_resourceproviderbaseclass_create; external LibraryName name 'sk4d_resourceproviderbaseclass_create'; +procedure sk4d_resourceproviderbaseclass_set_procs; external LibraryName name 'sk4d_resourceproviderbaseclass_set_procs'; +{$ENDIF} + + +{ modules/skshaper/include/sk4d_shaper.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_shaper_create := GetProcAddress(LibraryHandle, PChar('sk4d_shaper_create')); + sk4d_shaper_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_shaper_destroy')); + sk4d_shaper_shape := GetProcAddress(LibraryHandle, PChar('sk4d_shaper_shape')); +{$ELSE} +function sk4d_shaper_create; external LibraryName name 'sk4d_shaper_create'; +procedure sk4d_shaper_destroy; external LibraryName name 'sk4d_shaper_destroy'; +function sk4d_shaper_shape; external LibraryName name 'sk4d_shaper_shape'; +{$ENDIF} + + +{ modules/skunicode/include/sk4d_unicode.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_unicode_create := GetProcAddress(LibraryHandle, PChar('sk4d_unicode_create')); + sk4d_unicode_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_unicode_destroy')); + sk4d_unicode_for_each_bidi_region := GetProcAddress(LibraryHandle, PChar('sk4d_unicode_for_each_bidi_region')); + sk4d_unicode_for_each_break := GetProcAddress(LibraryHandle, PChar('sk4d_unicode_for_each_break')); + sk4d_unicode_for_each_codepoint := GetProcAddress(LibraryHandle, PChar('sk4d_unicode_for_each_codepoint')); + sk4d_unicodebreakiterator_create := GetProcAddress(LibraryHandle, PChar('sk4d_unicodebreakiterator_create')); + sk4d_unicodebreakiterator_create2 := GetProcAddress(LibraryHandle, PChar('sk4d_unicodebreakiterator_create2')); + sk4d_unicodebreakiterator_destroy := GetProcAddress(LibraryHandle, PChar('sk4d_unicodebreakiterator_destroy')); + sk4d_unicodebreakiterator_next := GetProcAddress(LibraryHandle, PChar('sk4d_unicodebreakiterator_next')); +{$ELSE} +function sk4d_unicode_create; external LibraryName name 'sk4d_unicode_create'; +procedure sk4d_unicode_destroy; external LibraryName name 'sk4d_unicode_destroy'; +procedure sk4d_unicode_for_each_bidi_region; external LibraryName name 'sk4d_unicode_for_each_bidi_region'; +procedure sk4d_unicode_for_each_break; external LibraryName name 'sk4d_unicode_for_each_break'; +procedure sk4d_unicode_for_each_codepoint; external LibraryName name 'sk4d_unicode_for_each_codepoint'; +function sk4d_unicodebreakiterator_create; external LibraryName name 'sk4d_unicodebreakiterator_create'; +function sk4d_unicodebreakiterator_create2; external LibraryName name 'sk4d_unicodebreakiterator_create2'; +procedure sk4d_unicodebreakiterator_destroy; external LibraryName name 'sk4d_unicodebreakiterator_destroy'; +function sk4d_unicodebreakiterator_next; external LibraryName name 'sk4d_unicodebreakiterator_next'; +{$ENDIF} + + +{ modules/svg/include/sk4d_svgdom.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_svgdom_find_node_by_id := GetProcAddress(LibraryHandle, PChar('sk4d_svgdom_find_node_by_id')); + sk4d_svgdom_get_root := GetProcAddress(LibraryHandle, PChar('sk4d_svgdom_get_root')); + sk4d_svgdom_make_from_file := GetProcAddress(LibraryHandle, PChar('sk4d_svgdom_make_from_file')); + sk4d_svgdom_make_from_stream := GetProcAddress(LibraryHandle, PChar('sk4d_svgdom_make_from_stream')); + sk4d_svgdom_render := GetProcAddress(LibraryHandle, PChar('sk4d_svgdom_render')); + sk4d_svgdom_set_container_size := GetProcAddress(LibraryHandle, PChar('sk4d_svgdom_set_container_size')); +{$ELSE} +function sk4d_svgdom_find_node_by_id; external LibraryName name 'sk4d_svgdom_find_node_by_id'; +function sk4d_svgdom_get_root; external LibraryName name 'sk4d_svgdom_get_root'; +function sk4d_svgdom_make_from_file; external LibraryName name 'sk4d_svgdom_make_from_file'; +function sk4d_svgdom_make_from_stream; external LibraryName name 'sk4d_svgdom_make_from_stream'; +procedure sk4d_svgdom_render; external LibraryName name 'sk4d_svgdom_render'; +procedure sk4d_svgdom_set_container_size; external LibraryName name 'sk4d_svgdom_set_container_size'; +{$ENDIF} + + +{ modules/svg/include/sk4d_svgnode.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_svgnode_set_attribute := GetProcAddress(LibraryHandle, PChar('sk4d_svgnode_set_attribute')); +{$ELSE} +function sk4d_svgnode_set_attribute; external LibraryName name 'sk4d_svgnode_set_attribute'; +{$ENDIF} + + +{ modules/svg/include/sk4d_svgsvg.h } + +{$IFNDEF SK_STATIC_LIBRARY} + sk4d_svgsvg_get_height := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_get_height')); + sk4d_svgsvg_get_intrinsic_size := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_get_intrinsic_size')); + sk4d_svgsvg_get_preserve_aspect_ratio := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_get_preserve_aspect_ratio')); + sk4d_svgsvg_get_view_box := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_get_view_box')); + sk4d_svgsvg_get_width := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_get_width')); + sk4d_svgsvg_get_x := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_get_x')); + sk4d_svgsvg_get_y := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_get_y')); + sk4d_svgsvg_set_height := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_set_height')); + sk4d_svgsvg_set_preserve_aspect_ratio := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_set_preserve_aspect_ratio')); + sk4d_svgsvg_set_view_box := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_set_view_box')); + sk4d_svgsvg_set_width := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_set_width')); + sk4d_svgsvg_set_x := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_set_x')); + sk4d_svgsvg_set_y := GetProcAddress(LibraryHandle, PChar('sk4d_svgsvg_set_y')); +{$ELSE} +procedure sk4d_svgsvg_get_height; external LibraryName name 'sk4d_svgsvg_get_height'; +procedure sk4d_svgsvg_get_intrinsic_size; external LibraryName name 'sk4d_svgsvg_get_intrinsic_size'; +procedure sk4d_svgsvg_get_preserve_aspect_ratio; external LibraryName name 'sk4d_svgsvg_get_preserve_aspect_ratio'; +function sk4d_svgsvg_get_view_box; external LibraryName name 'sk4d_svgsvg_get_view_box'; +procedure sk4d_svgsvg_get_width; external LibraryName name 'sk4d_svgsvg_get_width'; +procedure sk4d_svgsvg_get_x; external LibraryName name 'sk4d_svgsvg_get_x'; +procedure sk4d_svgsvg_get_y; external LibraryName name 'sk4d_svgsvg_get_y'; +procedure sk4d_svgsvg_set_height; external LibraryName name 'sk4d_svgsvg_set_height'; +procedure sk4d_svgsvg_set_preserve_aspect_ratio; external LibraryName name 'sk4d_svgsvg_set_preserve_aspect_ratio'; +procedure sk4d_svgsvg_set_view_box; external LibraryName name 'sk4d_svgsvg_set_view_box'; +procedure sk4d_svgsvg_set_width; external LibraryName name 'sk4d_svgsvg_set_width'; +procedure sk4d_svgsvg_set_x; external LibraryName name 'sk4d_svgsvg_set_x'; +procedure sk4d_svgsvg_set_y; external LibraryName name 'sk4d_svgsvg_set_y'; +{$ENDIF} + + +{$IFNDEF SK_STATIC_LIBRARY} +end; +{$ELSE} +procedure SkInitialize; +begin +end; +{$ENDIF} + +{$IFNDEF SK_STATIC_LIBRARY} +procedure SkFinalize; +begin + if AtomicDecrement(InitCount) <> 0 then + Exit; + FreeLibrary(LibraryHandle); +end; +{$ELSE} +procedure SkFinalize; +begin +end; +{$ENDIF} + +{$IFDEF SK_STATIC_LIBRARY} + {$IF DEFINED(IOS) and NOT DEFINED(IOSSIMULATOR)} + procedure libcpp; external '/usr/lib/libc++.dylib'; + procedure libcompiler_rt; external '/usr/lib/clang/lib/darwin/libclang_rt.ios.a'; + {$ENDIF} +{$ENDIF} + +end. diff --git a/skia4delphi/Source/Skia.Bindings.pas b/skia4delphi/Source/Skia.Bindings.pas deleted file mode 100644 index 48b6c32..0000000 --- a/skia4delphi/Source/Skia.Bindings.pas +++ /dev/null @@ -1,475 +0,0 @@ -{************************************************************************} -{ } -{ Skia4Delphi } -{ } -{ Copyright (c) 2011-2022 Google LLC. } -{ Copyright (c) 2021-2022 Skia4Delphi Project. } -{ } -{ Use of this source code is governed by a BSD-style license that can be } -{ found in the LICENSE file. } -{ } -{************************************************************************} -{$IFNDEF SKIA_EMBEDDED} -unit Skia.Bindings; -{$ENDIF} - -interface - -{$SCOPEDENUMS ON} - -uses - { Delphi } - System.SysUtils; - -type - ESkBindings = class(Exception); - - { ISkObject } - - ISkObject = interface - function GetHandle: THandle; - function GetOwnsHandle: Boolean; - property Handle: THandle read GetHandle; - property OwnsHandle: Boolean read GetOwnsHandle; - end; - - { TSkObject } - - TSkObject = class abstract(TInterfacedObject, ISkObject) - {$IFNDEF AUTOREFCOUNT} - strict private const - objDestroyingFlag = Integer($80000000); - {$ENDIF} - strict private - FHandle: THandle; - FOwnsHandle: Boolean; - {$IFNDEF AUTOREFCOUNT} - [Volatile] FRefCount: Integer; - {$ENDIF} - function GetOwnsHandle: Boolean; - {$IFNDEF AUTOREFCOUNT} - function GetRefCount: Integer; inline; - {$ENDIF} - protected - function GetHandle: THandle; inline; - strict protected - function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; - function _AddRef: Integer; stdcall; - function _Release: Integer; stdcall; - {$IFNDEF AUTOREFCOUNT} - class procedure __MarkDestroying(const Obj); static; inline; - {$ENDIF} - class procedure DestroyHandle(const AHandle: THandle); virtual; - class procedure RefHandle(const AHandle: THandle); virtual; - class procedure UnrefHandle(const AHandle: THandle); virtual; - public - constructor Create(const AHandle: THandle); - constructor Wrap(const AHandle: THandle; const AOwnsHandle: Boolean = True); virtual; - destructor Destroy; override; - class function ReleaseHandle(const AObject: ISkObject): THandle; - {$IFNDEF AUTOREFCOUNT} - procedure AfterConstruction; override; - procedure BeforeDestruction; override; - property RefCount: Integer read GetRefCount; - class function NewInstance: TObject; override; - {$ENDIF} - end; - - { ISkReferenceCountedBase } - - ISkReferenceCountedBase = interface(ISkObject) - procedure Release; - procedure Retain; - end; - - { TSkReferenceCountedBase } - - TSkReferenceCountedBase = class abstract(TSkObject) - strict protected - procedure Release; - procedure Retain; - end; - - { ISkReferenceCounted } - - ISkReferenceCounted = interface(ISkReferenceCountedBase) - ['{80B556E0-204B-4A64-82E9-D45056F4FE06}'] - end; - - { TSkReferenceCounted } - - TSkReferenceCounted = class abstract(TSkReferenceCountedBase, ISkReferenceCounted) - public - class procedure RefHandle(const AHandle: THandle); override; final; - class procedure UnrefHandle(const AHandle: THandle); override; final; - end; - - { ISkNonVirtualReferenceCounted } - - ISkNonVirtualReferenceCounted = interface(ISkReferenceCountedBase) - ['{96733457-7335-4ADC-B82B-E18A2E5808A3}'] - end; - - { TSkNonVirtualReferenceCounted } - - TSkNonVirtualReferenceCounted = class abstract(TSkReferenceCountedBase, ISkNonVirtualReferenceCounted); - - TSkEnumerable = class; - - { TSkEnumerator } - - TSkEnumerator = class - strict private - FEnumerable: TSkEnumerable; - public - constructor Create(const AEnumerable: TSkEnumerable); - function GetCurrent: T; - function MoveNext: Boolean; - property Current: T read GetCurrent; - end; - - { ISkEnumerable } - - ISkEnumerable = interface(ISkObject) - ['{A0D2696B-E080-4F15-8B60-45245B0D0D7B}'] - function GetEnumerator: TSkEnumerator; - end; - - { TSkEnumerable } - - TSkEnumerable = class abstract(TSkObject, ISkEnumerable) - strict private - FRun: Boolean; - protected - function GetCurrent: T; virtual; abstract; - function GetEnumerator: TSkEnumerator; - function MoveNext: Boolean; virtual; abstract; - procedure Reset; virtual; - end; - - TSkDelegateInitializeFunc = reference to function (const AContextProc: Pointer): I; - - TSkDelegateInvokeProc = reference to procedure (const AProc: T); - - { TSkDelegate } - - TSkDelegate = record - strict private type - TProcWrapper = record - Proc: T; - end; - PProcWrapper = ^TProcWrapper; - - public - class function Initialize(const AProc: T; const AInitializeFunc: TSkDelegateInitializeFunc): I; static; inline; - class procedure Finalize(const AContextProc: Pointer); static; inline; - class procedure Invoke(const AContextProc: Pointer; const AInvokeProc: TSkDelegateInvokeProc); static; inline; - end; - - TSkGetStringsFunc = reference to function (const AHandle: THandle; const AStrings: PMarshaledAString): Integer; - - TSkSetStringsProc = reference to procedure (const AHandle: THandle; const AStrings: PMarshaledAString; const ALength: Integer); - - { TSkBindings } - - TSkBindings = record - class function GetStrings(const AHandle: THandle; const AFunc: TSkGetStringsFunc): TArray; static; inline; - class function SafeCreate(const AHandle: THandle; const AOwnsHandle: Boolean = True): T; static; inline; - class function SafeGetHandle(const AObject: ISkObject): THandle; static; inline; - class procedure SetStrings(const AHandle: THandle; const AStrings: TArray; const AProc: TSkSetStringsProc); static; inline; - end; - -implementation - -{$IFNDEF SKIA_EMBEDDED} -uses - { Skia } - Skia.API; -{$ENDIF} - -{ TSkObject } - -{$IFNDEF AUTOREFCOUNT} - -procedure TSkObject.AfterConstruction; -begin - AtomicDecrement(FRefCount); - inherited; -end; - -procedure TSkObject.BeforeDestruction; -begin - inherited; - if RefCount <> 0 then - Error(reInvalidPtr); -end; - -{$ENDIF} - -constructor TSkObject.Create(const AHandle: THandle); -begin - inherited Create; - Assert(AHandle <> 0); - FHandle := AHandle; - FOwnsHandle := True; -end; - -destructor TSkObject.Destroy; -begin - if FOwnsHandle then - DestroyHandle(FHandle); - inherited; -end; - -class procedure TSkObject.DestroyHandle(const AHandle: THandle); -begin - UnrefHandle(AHandle); -end; - -function TSkObject.GetHandle: THandle; -begin - Result := FHandle; -end; - -function TSkObject.GetOwnsHandle: Boolean; -begin - Result := FOwnsHandle; -end; - -{$IFNDEF AUTOREFCOUNT} - -function TSkObject.GetRefCount: Integer; -begin - Result := FRefCount and not objDestroyingFlag; -end; - -class function TSkObject.NewInstance: TObject; -begin - Result := inherited NewInstance; - TSkObject(Result).FRefCount := 1; -end; - -{$ENDIF} - -function TSkObject.QueryInterface(const IID: TGUID; out Obj): HResult; -begin - if GetInterface(IID, Obj) then - Result := 0 - else - Result := E_NOINTERFACE; -end; - -class procedure TSkObject.RefHandle(const AHandle: THandle); -begin -end; - -class function TSkObject.ReleaseHandle(const AObject: ISkObject): THandle; -var - LObject: TSkObject; -begin - if not Assigned(AObject) then - Exit(0); - LObject := AObject as TSkObject; - Result := LObject.GetHandle; - if not LObject.FOwnsHandle then - raise ESkBindings.Create('Current object is not owner of the handle'); - LObject.FOwnsHandle := False; -end; - -class procedure TSkObject.UnrefHandle(const AHandle: THandle); -begin -end; - -constructor TSkObject.Wrap(const AHandle: THandle; const AOwnsHandle: Boolean); -begin - inherited Create; - Assert(AHandle <> 0); - FHandle := AHandle; - FOwnsHandle := AOwnsHandle; -end; - -function TSkObject._AddRef: Integer; -begin - {$IFNDEF AUTOREFCOUNT} - Result := AtomicIncrement(FRefCount); - {$ELSE} - Result := __ObjAddRef; - {$ENDIF} - if Result > 1 then - RefHandle(FHandle); -end; - -function TSkObject._Release: Integer; -begin - {$IFNDEF AUTOREFCOUNT} - Result := AtomicDecrement(FRefCount); - if Result = 0 then - begin - __MarkDestroying(Self); - Destroy; - end; - {$ELSE} - Result := __ObjRelease; - {$ENDIF} - if Result > 0 then - UnrefHandle(FHandle); -end; - -{$IFNDEF AUTOREFCOUNT} - -class procedure TSkObject.__MarkDestroying(const Obj); -var - LRef: Integer; -begin - repeat - LRef := TSkObject(Obj).FRefCount; - until AtomicCmpExchange(TSkObject(Obj).FRefCount, LRef or objDestroyingFlag, LRef) = LRef; -end; - -{$ENDIF} - -{ TSkReferenceCountedBase } - -procedure TSkReferenceCountedBase.Release; -begin - UnrefHandle(GetHandle); -end; - -procedure TSkReferenceCountedBase.Retain; -begin - RefHandle(GetHandle); -end; - -{ TSkReferenceCounted } - -class procedure TSkReferenceCounted.RefHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_refcnt_ref(AHandle); -end; - -class procedure TSkReferenceCounted.UnrefHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_refcnt_unref(AHandle); -end; - -{ TSkEnumerator } - -constructor TSkEnumerator.Create(const AEnumerable: TSkEnumerable); -begin - inherited Create; - FEnumerable := AEnumerable; -end; - -function TSkEnumerator.GetCurrent: T; -begin - Result := FEnumerable.GetCurrent; -end; - -function TSkEnumerator.MoveNext: Boolean; -begin - Result := FEnumerable.MoveNext; -end; - -{ TSkEnumerable } - -function TSkEnumerable.GetEnumerator: TSkEnumerator; -begin - if FRun then - Reset; - Result := TSkEnumerator.Create(Self); - FRun := True; -end; - -procedure TSkEnumerable.Reset; -begin - raise ESkBindings.Create('No reset support for this iterator'); -end; - -{ TSkDelegate } - -class procedure TSkDelegate.Finalize(const AContextProc: Pointer); -begin - Dispose(PProcWrapper(AContextProc)); -end; - -class function TSkDelegate.Initialize(const AProc: T; - const AInitializeFunc: TSkDelegateInitializeFunc): I; -var - LProcWrapper: PProcWrapper; -begin - New(LProcWrapper); - try - LProcWrapper.Proc := AProc; - Result := AInitializeFunc(LProcWrapper); - if not Assigned(Result) then - Dispose(LProcWrapper); - except - Dispose(LProcWrapper); - raise; - end; -end; - -class procedure TSkDelegate.Invoke(const AContextProc: Pointer; - const AInvokeProc: TSkDelegateInvokeProc); -begin - AInvokeProc(PProcWrapper(AContextProc).Proc) -end; - -{ TSkBindings } - -class function TSkBindings.GetStrings(const AHandle: THandle; - const AFunc: TSkGetStringsFunc): TArray; -var - I: Integer; - LMarshaledAStrings: TArray; -begin - SetLength(LMarshaledAStrings, AFunc(AHandle, nil)); - if Length(LMarshaledAStrings) = 0 then - Result := nil - else - begin - AFunc(AHandle, @LMarshaledAStrings[0]); - SetLength(Result, Length(LMarshaledAStrings)); - for I := 0 to Length(LMarshaledAStrings) - 1 do - Result[I] := string(LMarshaledAStrings[I]); - end; -end; - -class function TSkBindings.SafeCreate(const AHandle: THandle; - const AOwnsHandle: Boolean): T; -begin - if AHandle = 0 then - Exit(nil); - Result := T.Wrap(AHandle, AOwnsHandle); -end; - -class function TSkBindings.SafeGetHandle(const AObject: ISkObject): THandle; -begin - if not Assigned(AObject) then - Exit(0); - Result := AObject.Handle; -end; - -class procedure TSkBindings.SetStrings(const AHandle: THandle; - const AStrings: TArray; const AProc: TSkSetStringsProc); -var - I: integer; - LMarshaledAStrings: TArray; - LUTF8Strings: TArray; -begin - if Length(AStrings) = 0 then - AProc(AHandle, nil, 0) - else - begin - SetLength(LUTF8Strings, Length(AStrings)); - SetLength(LMarshaledAStrings, Length(AStrings)); - for I := 0 to Length(AStrings) - 1 do - begin - LUTF8Strings[I] := UTF8String(AStrings[I]); - LMarshaledAStrings[I] := MarshaledAString(LUTF8Strings[I]); - end; - AProc(AHandle, @LMarshaledAStrings[0], Length(AStrings)); - end; -end; - -end. diff --git a/skia4delphi/Source/Skia.pas b/skia4delphi/Source/Skia.pas index 660f8fa..2f55ad4 100644 --- a/skia4delphi/Source/Skia.pas +++ b/skia4delphi/Source/Skia.pas @@ -9,12 +9,12 @@ { found in the LICENSE file. } { } {************************************************************************} -{$IFNDEF SKIA_EMBEDDED} unit Skia; interface {$ALIGN ON} + {$MINENUMSIZE 4} {$SCOPEDENUMS ON} @@ -28,75 +28,187 @@ interface System.UITypes, { Skia } - Skia.API, - Skia.Bindings; -{$ENDIF} + Skia.API; const - SkVersion = '3.4.1'; + SkVersion = '4.0.2'; type - ESkException = class(Exception); + TGrBackendAPI = (OpenGl, Vulkan, Metal); + TGrShaderCacheStrategy = (SkSL, BackendSource, BackendBinary); + TGrSurfaceOrigin = (TopLeft, BottomLeft); + TGrVkAllocFlag = (Noncoherent, Mappable, LazilyAllocated); + TSkAffinity = (Upstream, Downstream); + TSkAlphaType = (Unknown, Opaque, Premul, Unpremul); + TSkBlendMode = (Clear, Src, Dest, SrcOver, DestOver, SrcIn, DestIn, SrcOut, DestOut, SrcATop, DestATop, &Xor, Plus, Modulate, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Multiply, Hue, Saturation, Color, Luminosity); + TSkBlurStyle = (Normal, Solid, Outer, Inner); + TSkBreakType = (Words, Graphemes, Lines); + TSkClipOp = (Difference, Intersect); + TSkColorChannel = (R, G, B, A); + TSkColorType = (Unknown, Alpha8, RGB565, ARGB4444, RGBA8888, RGB888X, BGRA8888, RGBA1010102, BGRA1010102, RGB101010X, BGR101010X, Gray8, RGBAF16, RGBAF16Clamped, RGBAF32, RG88, AlphaF16, RGF16, Alpha16, RG1616, RGBA16161616, SRGBA8888, R8); + TSkContrastInvertStyle = (NoInvert, InvertBrightness, InvertLightness); + TSkDirection = (LeftToRight, RightToLeft); + TSkDrawPointsMode = (Points, Lines, Polygon); + TSkEncodedImageFormat = (BMP, GIF, ICO, JPEG, PNG, WBMP, WEBP, PKM, KTX, ASTC, DNG, HEIF, AVIF); + TSkFilterMode = (Nearest, Linear); + TSkFontEdging = (Alias, AntiAlias, SubpixelAntiAlias); + TSkFontHinting = (None, Slight, Normal, Full); + TSkFontMetricsFlag = (UnderlineThicknessIsValid, UnderlinePositionIsValid, StrikeoutThicknessIsValid, StrikeoutPositionIsValid, BoundsInvalid); + TSkFontSlant = (Upright, Italic, Oblique); + TSkFontWeight = (Invisible, Thin = 100, ExtraLight = 200, Light = 300, Normal = 400, Medium = 500, SemiBold = 600, Bold = 700, ExtraBold = 800, Black = 900, ExtraBlack = 1000); + TSkFontWidth = (UltraCondensed = 1, ExtraCondensed, Condensed, SemiCondensed, Normal, SemiExpanded, Expanded, ExtraExpanded, UltraExpanded); + TSkImageCachingHint = (Allow, Disallow); + TSkLatticeRectType = (Default, Transparent, FixedColor); + TSkMipmapMode = (None, Nearest, Linear); + TSkottieAnimationRenderFlag = (SkipTopLevelIsolation, DisableTopLevelClipping); + TSkPaintStyle = (Fill, Stroke, StrokeAndFill); + TSkParagraphVisitorFlag = (WhiteSpace); + TSkPathArcSize = (Small, Large); + TSkPathDirection = (CW, CCW); + TSkPathEffect1DStyle = (Translate, Rotate, Morph); + TSkPathEffectTrimMode = (Normal, Inverted); + TSkPathFillType = (Winding, EvenOdd, InverseWinding, InverseEvenOdd); + TSkPathMeasureMatrixFlag = (Position, Tangent); + TSkPathOp = (Difference, Intersect, Union, &Xor, ReverseDifference); + TSkPathVerb = (Move, Line, Quad, Conic, Cubic, Close); + TSkPixelGeometry = (Unknown, RGBHorizontal, BGRHorizontal, RGBVertical, BGRVertical); + TSkPlaceholderAlignment = (Baseline, AboveBaseline, BelowBaseline, Top, Bottom, Middle); + TSkRectHeightStyle = (Tight, Max, IncludeLineSpacingMiddle, IncludeLineSpacingTop, IncludeLineSpacingBottom, Strut); + TSkRectWidthStyle = (Tight, Max); + TSkRegionOp = (Difference, Intersect, Union, &Xor, ReverseDifference, Replace); + TSkRoundRectCorner = (UpperLeft, UpperRight, LowerRight, LowerLeft); + TSkRuntimeEffectChildType = (Shader, ColorFilter, Blender); + TSkRuntimeEffectUniformType = (Float, Float2, Float3, Float4, Float2x2, Float3x3, Float4x4, Int, Int2, Int3, Int4); + TSkSegmentMask = (Line, Quad, Conic, Cubic); + TSkSrcRectConstraint = (Close, Fast); + TSkStrokeCap = (Butt, Round, Square); + TSkStrokeJoin = (Miter, Round, Bevel); + TSkSurfacePropertiesFlag = (UseDeviceIndependentFonts, DynamicMSAA); + TSkSVGAspectAlign = (XMinYMin, XMidYMin, XMaxYMin, XMinYMid = 4, XMidYMid, XMaxYMid, XMinYMax = 8, XMidYMax, XMaxYMax, None = 16); + TSkSVGAspectScale = (Meet, Slice); + TSkSVGCanvasFlag = (ConvertTextToPaths, NoPrettyXML, RelativePathEncoding); + TSkSVGLengthUnit = (Unknown, Number, Percentage, EmUnit, ExUnit, Pixel, Centimeter, Millimeter, Inch, Point, Pica); + TSkTextAlign = (Left, Right, Center, Justify, Start, Terminate); + TSkTextBaseline = (Alphabetic, Ideographic); + TSkTextDecoration = (Underline, Overline, LineThrough); + TSkTextDecorationStyle = (Solid, Double, Dotted, Dashed, Wavy); + TSkTextDirection = (RightToLeft, LeftToRight); + TSkTextHeightBehavior = (DisableFirstAscent, DisableLastDescent); + TSkTileMode = (Clamp, &Repeat, Mirror, Decal); + TSkVertexMode = (Triangles, TriangleStrip, TriangleFan); + + TGrVkAllocFlags = set of TGrVkAllocFlag; + TSkFontMetricsFlags = set of TSkFontMetricsFlag; + TSkottieAnimationRenderFlags = set of TSkottieAnimationRenderFlag; + TSkParagraphVisitorFlags = set of TSkParagraphVisitorFlag; + TSkPathMeasureMatrixFlags = set of TSkPathMeasureMatrixFlag; + TSkSegmentMasks = set of TSkSegmentMask; + TSkSurfacePropertiesFlags = set of TSkSurfacePropertiesFlag; + TSkSVGCanvasFlags = set of TSkSVGCanvasFlag; + TSkTextDecorations = set of TSkTextDecoration; + TSkTextHeightBehaviors = set of TSkTextHeightBehavior; + + IGrGlInterface = interface; + IGrPersistentCache = interface; + IGrShaderErrorHandler = interface; + IGrVkExtensions = interface; + ISkColorSpace = interface; + ISkColorSpaceICCProfile = interface; + ISkFont = interface; + ISkImage = interface; + ISkImageFilter = interface; + ISkPaint = interface; + ISkParagraphStyle = interface; + ISkPath = interface; + ISkPathEffect = interface; + ISkPicture = interface; + ISkPixmap = interface; + ISkRegion = interface; + ISkResourceProvider = interface; + ISkRoundRect = interface; + ISkShader = interface; + ISkSurface = interface; + ISkSVGNode = interface; + ISkSVGSVG = interface; + ISkTextBlob = interface; + ISkTextStyle = interface; + ISkTraceMemoryDump = interface; + ISkTypeface = interface; + ISkTypefaceFontProvider = interface; + ISkVertices = interface; + + GrGlenum = Cardinal; + GrGluint = Cardinal; + GrMtlHandle = Pointer; + GrVkBool32 = Cardinal; + GrVkChromaLocation = Integer; + GrVkDevice = Pointer; + GrVkDeviceMemory = UInt64; + GrVkDeviceSize = UInt64; + GrVkFilter = Integer; + GrVkFormat = Integer; + GrVkFormatFeatureFlags = Cardinal; + GrVkImage = UInt64; + GrVkImageLayout = Integer; + GrVkImageUsageFlags = Cardinal; + GrVkInstance = Pointer; + GrVkPhysicalDevice = Pointer; + GrVkPhysicalDeviceFeatures = Pointer; + GrVkPhysicalDeviceFeatures2 = Pointer; + GrVkQueue = Pointer; + GrVkSamplerYcbcrModelConversion = Integer; + GrVkSharingMode = Integer; + GrVkVkImageTiling = Integer; + GrVkVkSamplerYcbcrRange = Integer; + + TSkOverdrawColor = array[0..5] of TAlphaColor; + TSkParticleUniformData = array[0..0] of Single; + TSkPatchColors = array[0..3] of TAlphaColor; + TSkPatchCubics = array[0..11] of TPointF; + TSkPatchTexCoords = array[0..3] of TPointF; + TSkPathPoints = array[0..3] of TPointF; + TSkRoundRectRadii = array[TSkRoundRectCorner] of Single; + TSkTableFilter = array[0..255] of Byte; + + {$POINTERMATH ON} + PCardinalArray = ^Cardinal; + PPointFArray = ^TPointF; + PSingleArray = ^Single; + PWordArray = ^Word; + {$POINTERMATH OFF} + + TGrGlGetProc = reference to function (const AName: string): Pointer; + TSkFontPathProc = reference to procedure (const APathOrNil: ISkPath; const AMatrix: TMatrix); + TSkImageRasterReleaseProc = reference to procedure (const APixels: Pointer); + TSkImageTextureReleaseProc = reference to procedure (); + TSkUnicodeBidiRegionProc = reference to procedure (const AStart, AEnd: Integer; const ALevel: Byte); + TGrVkGetProc = reference to function (const AName: string; const AInstance: GrVkInstance; const ADevice: GrVkDevice): Pointer; + TSkSurfaceRasterReleaseProc = reference to procedure (const APixels: Pointer); + TSkUnicodeBreakProc = reference to procedure (const APosition, AStatus: Integer); + TSkUnicodeCodepointProc = reference to procedure (const AUnichar, AStart, AEnd: Integer); + + ESkArgumentException = class(Exception); + ESkException = class(Exception); - ESkArgumentException = class(ESkException); - - TGrBackendAPI = (OpenGl, Metal = 2); + { TGrContextOptions } - GrGlenum = Cardinal; - GrGluint = Cardinal; + TGrContextOptions = record + BufferMapThreshold: Integer; + DoManualMipmapping: Boolean; + AllowPathMaskCaching: Boolean; + GlyphCacheTextureMaximumBytes: NativeUInt; + AvoidStencilBuffers: Boolean; + RuntimeProgramCacheSize: Integer; + PersistentCache: IGrPersistentCache; + ShaderCacheStrategy: TGrShaderCacheStrategy; + ShaderErrorHandler: IGrShaderErrorHandler; + end; { TGrGlFramebufferInfo } TGrGlFramebufferInfo = record FBOID: GrGluint; Format: GrGlenum; - constructor Create(const AFBOID: GrGluint; const AFormat: GrGlenum); - class operator Equal(const AGlFramebufferInfo1, AGlFramebufferInfo2: TGrGlFramebufferInfo): Boolean; - class operator NotEqual(const AGlFramebufferInfo1, AGlFramebufferInfo2: TGrGlFramebufferInfo): Boolean; - end; - - GrMtlHandle = Pointer; - - { TGrMtlTextureInfo } - - TGrMtlTextureInfo = record - Texture: GrMtlHandle; - constructor Create(const ATexture: GrMtlHandle); - class operator Equal(const AMtlTextureInfo1, AMtlTextureInfo2: TGrMtlTextureInfo): Boolean; - class operator NotEqual(const AMtlTextureInfo1, AMtlTextureInfo2: TGrMtlTextureInfo): Boolean; - end; - - { IGrBackendRenderTarget } - - IGrBackendRenderTarget = interface(ISkObject) - ['{499243CD-E98D-4DFB-9606-92E3E679E6CF}'] - function GetBackendAPI: TGrBackendAPI; - function GetHeight: Integer; - function GetSampleCount: Integer; - function GetStencilBits: Integer; - function GetWidth: Integer; - function IsValid: Boolean; - property BackendAPI: TGrBackendAPI read GetBackendAPI; - property Height: Integer read GetHeight; - property SampleCount: Integer read GetSampleCount; - property StencilBits: Integer read GetStencilBits; - property Width: Integer read GetWidth; - end; - - { TGrBackendRenderTarget } - - TGrBackendRenderTarget = class(TSkObject, IGrBackendRenderTarget) - strict protected - function GetBackendAPI: TGrBackendAPI; - function GetHeight: Integer; - function GetSampleCount: Integer; - function GetStencilBits: Integer; - function GetWidth: Integer; - function IsValid: Boolean; - public - constructor CreateGl(const AWidth, AHeight, ASampleCount, AStencilBits: Integer; const AFramebufferInfo: TGrGlFramebufferInfo); - constructor CreateMetal(const AWidth, AHeight: Integer; const ATextureInfo: TGrMtlTextureInfo); - class procedure DestroyHandle(const AHandle: THandle); override; end; { TGrGlTextureInfo } @@ -105,53 +217,6 @@ TGrGlTextureInfo = record Target: GrGlenum; ID: GrGluint; Format: GrGlenum; - constructor Create(const ATarget: GrGlenum; const AID: GrGluint; const AFormat: GrGlenum); - class operator Equal(const AGlTextureInfo1, AGlTextureInfo2: TGrGlTextureInfo): Boolean; - class operator NotEqual(const AGlTextureInfo1, AGlTextureInfo2: TGrGlTextureInfo): Boolean; - end; - - { IGrBackendTexture } - - IGrBackendTexture = interface(ISkObject) - ['{9E4E938C-0513-4690-851E-7F4BC1323B84}'] - function GetBackendAPI: TGrBackendAPI; - function GetGlTextureInfo(out ATextureInfo: TGrGlTextureInfo): Boolean; - function GetHeight: Integer; - function GetWidth: Integer; - function HasMipmaps: Boolean; - function IsValid: Boolean; - property BackendAPI: TGrBackendAPI read GetBackendAPI; - property Height: Integer read GetHeight; - property Width: Integer read GetWidth; - end; - - { TGrBackendTexture } - - TGrBackendTexture = class(TSkObject, IGrBackendTexture) - strict protected - function GetBackendAPI: TGrBackendAPI; - function GetGlTextureInfo(out ATextureInfo: TGrGlTextureInfo): Boolean; - function GetHeight: Integer; - function GetWidth: Integer; - function HasMipmaps: Boolean; - function IsValid: Boolean; - public - constructor CreateGl(const AWidth, AHeight: Integer; const AIsMipmapped: Boolean; const ATextureInfo: TGrGlTextureInfo); - constructor CreateMetal(const AWidth, AHeight: Integer; const AIsMipmapped: Boolean; const ATextureInfo: TGrMtlTextureInfo); - class procedure DestroyHandle(const AHandle: THandle); override; - end; - - { TGrContextOptions } - - TGrContextOptions = record - BufferMapThreshold: Integer; - DoManualMipmapping: Boolean; - AllowPathMaskCaching: Boolean; - GlyphCacheTextureMaximumBytes: NativeUInt; - AvoidStencilBuffers: Boolean; - RuntimeProgramCacheSize: Integer; - class operator Equal(const AContextOptions1, AContextOptions2: TGrContextOptions): Boolean; - class operator NotEqual(const AContextOptions1, AContextOptions2: TGrContextOptions): Boolean; end; { TGrMtlBackendContext } @@ -160,201 +225,152 @@ TGrMtlBackendContext = record Device: GrMtlHandle; Queue: GrMtlHandle; BinaryArchive: GrMtlHandle; - constructor Create(const ADevice, AQueue, ABinaryArchive: GrMtlHandle); - class operator Equal(const AMtlBackendContext1, AMtlBackendContext2: TGrMtlBackendContext): Boolean; - class operator NotEqual(const AMtlBackendContext1, AMtlBackendContext2: TGrMtlBackendContext): Boolean; - end; - - ISkTraceMemoryDump = interface; - - TSkColorType = ( - Unknown, - Alpha8, - RGB565, - ARGB4444, - RGBA8888, - RGB888X, - BGRA8888, - RGBA1010102, - BGRA1010102, - RGB101010X, - BGR101010X, - Gray8, - RGBAF16, - RGBAF16Clamped, - RGBAF32, - RG88, - AlphaF16, - RGF16, - Alpha16, - RG1616, - RGBA16161616, - SRGBA8888 - ); + end; - IGrGlInterface = interface; + { TGrMtlTextureInfo } + TGrMtlTextureInfo = record + Texture: GrMtlHandle; + end; - { IGrDirectContext } + { TGrVkAlloc } - IGrDirectContext = interface(ISkReferenceCounted) - ['{BDB6E966-B0BE-4B32-96EA-6BAE5127D90F}'] - procedure AbandonContext; - procedure DumpMemoryStatistics(const ATraceMemoryDump: ISkTraceMemoryDump); - procedure Flush; - procedure FlushAndSubmit(const ASyncCPU: Boolean = False); - procedure FreeGPUResources; - function GetBackendAPI: TGrBackendAPI; - function GetMaxSurfaceSampleCountForColorType(const AColorType: TSkColorType): Integer; - function GetResourceCacheLimit: NativeUInt; - procedure GetResourceCacheUsage(out AResources: Integer; out AResourcesBytes: NativeUInt); - function IsAbandoned: Boolean; - procedure PerformDeferredCleanup(const AMilliseconds: Int64); - procedure PurgeUnlockedResources(const AScratchResourcesOnly: Boolean); overload; - procedure PurgeUnlockedResources(const ABytesToPurge: NativeUInt; const APreferScratchResources: Boolean); overload; - procedure ReleaseResourcesAndAbandonContext; - procedure ResetContext; - procedure SetResourceCacheLimit(const AValue: NativeUInt); - function Submit(const ASyncCPU: Boolean = False): Boolean; - property BackendAPI: TGrBackendAPI read GetBackendAPI; - property ResourceCacheLimit: NativeUInt read GetResourceCacheLimit write SetResourceCacheLimit; + TGrVkAlloc = record + DeviceMemory: GrVkDeviceMemory; + Offset: GrVkDeviceSize; + Size: GrVkDeviceSize; + Flags: TGrVkAllocFlags; + Memory: THandle; end; - { TGrDirectContext } + { TGrVkBackendContext } - TGrDirectContext = class(TSkReferenceCounted, IGrDirectContext) - strict protected - procedure AbandonContext; - procedure DumpMemoryStatistics(const ATraceMemoryDump: ISkTraceMemoryDump); - procedure Flush; - procedure FlushAndSubmit(const ASyncCPU: Boolean = False); - procedure FreeGPUResources; - function GetBackendAPI: TGrBackendAPI; - function GetMaxSurfaceSampleCountForColorType(const AColorType: TSkColorType): Integer; - function GetResourceCacheLimit: NativeUInt; - procedure GetResourceCacheUsage(out AResources: Integer; out AResourcesBytes: NativeUInt); - function IsAbandoned: Boolean; - procedure PerformDeferredCleanup(const AMilliseconds: Int64); - procedure PurgeUnlockedResources(const AScratchResourcesOnly: Boolean); overload; - procedure PurgeUnlockedResources(const ABytesToPurge: NativeUInt; const APreferScratchResources: Boolean); overload; - procedure ReleaseResourcesAndAbandonContext; - procedure ResetContext; - procedure SetResourceCacheLimit(const AValue: NativeUInt); - function Submit(const ASyncCPU: Boolean = False): Boolean; - public - class function MakeGl(AInterface: IGrGlInterface = nil): IGrDirectContext; overload; static; - class function MakeGl(const AOptions: TGrContextOptions; const AInterface: IGrGlInterface = nil): IGrDirectContext; overload; static; - class function MakeMetal(const ABackendContext: TGrMtlBackendContext): IGrDirectContext; overload; static; - class function MakeMetal(const ABackendContext: TGrMtlBackendContext; const AOptions: TGrContextOptions): IGrDirectContext; overload; static; + TGrVkBackendContext = record + Instance: GrVkInstance; + PhysicalDevice: GrVkPhysicalDevice; + Device: GrVkDevice; + Queue: GrVkQueue; + GraphicsQueueIndex: Cardinal; + MaxVersion: Cardinal; + Extensions: IGrVkExtensions; + PhysicalDeviceFeatures: GrVkPhysicalDeviceFeatures; + PhysicalDeviceFeatures2: GrVkPhysicalDeviceFeatures2; + GetProc: TGrVkGetProc; + ProtectedContext: Boolean; end; - TGrGlGetProc = reference to function (const AName: string): Pointer; + { TGrVkYcbcrConversionInfo } - { IGrGlInterface } - - IGrGlInterface = interface(ISkReferenceCounted) - ['{24AAE766-2B36-43DC-911A-98842BB81277}'] - function HasExtension(const AName: string): Boolean; - function Validate: Boolean; + TGrVkYcbcrConversionInfo = record + Format: GrVkFormat; + FExternalFormat: UInt64; + YcbcrModel: GrVkSamplerYcbcrModelConversion; + YcbcrRange: GrVkVkSamplerYcbcrRange; + XChromaOffset: GrVkChromaLocation; + YChromaOffset: GrVkChromaLocation; + ChromaFilter: GrVkFilter; + ForceExplicitReconstruction: GrVkBool32; + FormatFeatures: GrVkFormatFeatureFlags; end; - { TGrGlInterface } + { TGrVkImageInfo } - TGrGlInterface = class(TSkReferenceCounted, IGrGlInterface) - strict private - class function get_proc(context: Pointer; const name: MarshaledAString): Pointer; cdecl; static; - strict protected - function HasExtension(const AName: string): Boolean; - function Validate: Boolean; - public - class function MakeAssembled(const AProc: TGrGlGetProc): IGrGlInterface; static; - class function MakeAssembledGl(const AProc: TGrGlGetProc): IGrGlInterface; static; - class function MakeAssembledGles(const AProc: TGrGlGetProc): IGrGlInterface; static; - class function MakeAssembledWebGl(const AProc: TGrGlGetProc): IGrGlInterface; static; - class function MakeNative: IGrGlInterface; static; + TGrVkImageInfo = record + Image: GrVkImage; + Alloc: TGrVkAlloc; + ImageTiling: GrVkVkImageTiling; + ImageLayout: GrVkImageLayout; + Format: GrVkFormat; + ImageUsageFlags: GrVkImageUsageFlags; + SampleCount: Cardinal; + LevelCount: Cardinal; + CurrentQueueFamily: Cardinal; + ProtectedImage: Boolean; + YcbcrConversionInfo: TGrVkYcbcrConversionInfo; + SharingMode: GrVkSharingMode; end; - TSkBlendMode = ( - Clear, - Src, - Dest, - SrcOver, - DestOver, - SrcIn, - DestIn, - SrcOut, - DestOut, - SrcATop, - DestATop, - &Xor, - Plus, - Modulate, - Screen, - Overlay, - Darken, - Lighten, - ColorDodge, - ColorBurn, - HardLight, - SoftLight, - Difference, - Exclusion, - Multiply, - Hue, - Saturation, - Color, - Luminosity - ); - - { ISkBlender } + { TSkColorMatrix } - ISkBlender = interface(ISkReferenceCounted) - ['{C8C7B026-3768-4EA5-A3F0-718CBE7F092E}'] + TSkColorMatrix = record + constructor Create(const AM11, AM12, AM13, AM14, AM15, AM21, AM22, AM23, AM24, AM25, AM31, AM32, AM33, AM34, AM35, AM41, AM42, AM43, AM44, AM45: Single); + class function CreateSaturation(const ASaturation: Single): TSkColorMatrix; static; + class function CreateScale(const AScaleR, AScaleG, AScaleB: Single; const AScaleA: Single = 1): TSkColorMatrix; static; + class function Identity: TSkColorMatrix; static; inline; + class operator Equal(const AColorMatrix1, AColorMatrix2: TSkColorMatrix): Boolean; + class operator NotEqual(const AColorMatrix1, AColorMatrix2: TSkColorMatrix): Boolean; + class operator Multiply(const AColorMatrix1, AColorMatrix2: TSkColorMatrix): TSkColorMatrix; + case Integer of + 0: (M11, M12, M13, M14, M15, + M21, M22, M23, M24, M25, + M31, M32, M33, M34, M35, + M41, M42, M43, M44, M45: Single); + 1: (Vector: array[0..3] of array[0..4] of Single); end; - { TSkBlender } + { TSkColorSpaceXyz } - TSkBlender = class(TSkReferenceCounted, ISkBlender) + TSkColorSpaceXyz = record + public const + FixedToFloat = 1.52587890625e-5; public - class function MakeArithmetic(const AK1, AK2, AK3, AK4: Single; const AEnforcePremultipliedColor: Boolean): ISkBlender; static; - class function MakeMode(const AMode: TSkBlendMode): ISkBlender; static; + constructor Create(const AM11, AM12, AM13, AM21, AM22, AM23, AM31, AM32, AM33: Single); + function Adjoint: TSkColorSpaceXyz; + function Determinant: Single; + function Inverse: TSkColorSpaceXyz; + class function AdobeRGB: TSkColorSpaceXyz; static; inline; + class function DisplayP3: TSkColorSpaceXyz; static; inline; + class function Identity: TSkColorSpaceXyz; static; inline; + class function Rec2020: TSkColorSpaceXyz; static; inline; + class function SRGB: TSkColorSpaceXyz; static; inline; + class operator Equal(const AColorSpaceXyz1, AColorSpaceXyz2: TSkColorSpaceXyz): Boolean; + class operator NotEqual(const AColorSpaceXyz1, AColorSpaceXyz2: TSkColorSpaceXyz): Boolean; + class operator Multiply(const AColorSpaceXyz1, AColorSpaceXyz2: TSkColorSpaceXyz): TSkColorSpaceXyz; + case Integer of + 0: (M11, M12, M13, + M21, M22, M23, + M31, M32, M33: Single); + 1: (Vector: array[0..2] of array[0..2] of Single); end; - ISkPath = interface; - - TSkClipOp = (Difference, Intersect); - - ISkRegion = interface; - - ISkRoundRect = interface; - - ISkShader = interface; - - ISkPaint = interface; - - ISkImage = interface; - - { TSkRotationScaleMatrix } + { TSkColorSpacePrimaries } - TSkRotationScaleMatrix = record - SCosinus: Single; - SSinus: Single; - TranslateX: Single; - TranslateY: Single; - constructor Create(const ASCosinus, ASSinus, ATranslateX, ATranslateY: Single); - class function CreateDegrees(const AScale, ADegrees, ATranslateX, ATranslateY, AAnchorX, AAnchorY: Single): TSkRotationScaleMatrix; static; - class function CreateRadians(const AScale, ARadians, ATranslateX, ATranslateY, AAnchorX, AAnchorY: Single): TSkRotationScaleMatrix; static; - class operator Equal(const ARotationScaleMatrix1, ARotationScaleMatrix2: TSkRotationScaleMatrix): Boolean; - class operator NotEqual(const ARotationScaleMatrix1, ARotationScaleMatrix2: TSkRotationScaleMatrix): Boolean; - class operator Implicit(const ARotationScaleMatrix: TSkRotationScaleMatrix): TMatrix; + TSkColorSpacePrimaries = record + RX: Single; + RY: Single; + GX: Single; + GY: Single; + BX: Single; + BY: Single; + WX: Single; + WY: Single; + constructor Create(const ARX, ARY, AGX, AGY, ABX, ABY, AWX, AWY: Single); + class operator Equal(const AColorSpacePrimaries1, AColorSpacePrimaries2: TSkColorSpacePrimaries): Boolean; + class operator NotEqual(const AColorSpacePrimaries1, AColorSpacePrimaries2: TSkColorSpacePrimaries): Boolean; + class operator Implicit(const AColorSpacePrimaries: TSkColorSpacePrimaries): TSkColorSpaceXyz; end; - { TSkRotationScaleMatrixConstants } + { TSkColorSpaceTransferFunction } - TSkRotationScaleMatrixConstants = record helper for TSkRotationScaleMatrix - const - Identity: TSkRotationScaleMatrix = (SCosinus : 1; SSinus : 0; - TranslateX : 0; TranslateY : 0); + TSkColorSpaceTransferFunction = record + G: Single; + A: Single; + B: Single; + C: Single; + D: Single; + E: Single; + F: Single; + constructor Create(const AG, AA, AB, AC, AD, AE, AF: Single); + function Invert(out ATransferFunction: TSkColorSpaceTransferFunction): Boolean; + function Transform(const AX: Single): Single; + class function HLG: TSkColorSpaceTransferFunction; static; inline; + class function Linear: TSkColorSpaceTransferFunction; static; inline; + class function PQ: TSkColorSpaceTransferFunction; static; inline; + class function Rec2020: TSkColorSpaceTransferFunction; static; inline; + class function SRGB: TSkColorSpaceTransferFunction; static; inline; + class function TwoDotTwo: TSkColorSpaceTransferFunction; static; inline; + class operator Equal(const AColorSpaceTransferFunction1, AColorSpaceTransferFunction2: TSkColorSpaceTransferFunction): Boolean; + class operator NotEqual(const AColorSpaceTransferFunction1, AColorSpaceTransferFunction2: TSkColorSpaceTransferFunction): Boolean; end; { TSkCubicResampler } @@ -363,53 +379,130 @@ TSkCubicResampler = record B: Single; C: Single; constructor Create(const AB, AC: Single); + class function CatmullRom: TSkCubicResampler; static; inline; + class function Mitchell: TSkCubicResampler; static; inline; class operator Equal(const ACubicResampler1, ACubicResampler2: TSkCubicResampler): Boolean; class operator NotEqual(const ACubicResampler1, ACubicResampler2: TSkCubicResampler): Boolean; end; - { TSkCubicResamplerConstants } - - TSkCubicResamplerConstants = record helper for TSkCubicResampler - const - CatmullRom : TSkCubicResampler = (B: 0; C: 1 / 2); - Mitchell : TSkCubicResampler = (B: 1 / 3; C: 1 / 3); - end; - - TSkFilterMode = (Nearest, Linear); - - TSkMipmapMode = (None, Nearest, Linear); - - { TSkSamplingOptions } + { TSkFontMetrics } - TSkSamplingOptions = record - strict private - FUseCubic: Boolean; - FCubic: TSkCubicResampler; - FFilter: TSkFilterMode; - FMipmap: TSkMipmapMode; - public - constructor Create(const ACubic: TSkCubicResampler); overload; - constructor Create(const AFilter: TSkFilterMode; const AMipmap: TSkMipmapMode); overload; - property UseCubic: Boolean read FUseCubic; - property Cubic: TSkCubicResampler read FCubic; - property Filter: TSkFilterMode read FFilter; - property Mipmap: TSkMipmapMode read FMipmap; - class operator Equal(const ASamplingOptions1, ASamplingOptions2: TSkSamplingOptions): Boolean; - class operator NotEqual(const ASamplingOptions1, ASamplingOptions2: TSkSamplingOptions): Boolean; + TSkFontMetrics = record + Flags: TSkFontMetricsFlags; + Top: Single; + Ascent: Single; + Descent: Single; + Bottom: Single; + Leading: Single; + AvgCharWidth: Single; + MaxCharWidth: Single; + XMin: Single; + XMax: Single; + XHeight: Single; + CapHeight: Single; + UnderlineThickness: Single; + UnderlinePosition: Single; + StrikeoutThickness: Single; + StrikeoutPosition: Single; + class operator Equal(const AFontMetrics1, AFontMetrics2: TSkFontMetrics): Boolean; + class operator NotEqual(const AFontMetrics1, AFontMetrics2: TSkFontMetrics): Boolean; + end; + + { TSkFontStyle } + + TSkFontStyle = record + Weight: Integer; + Width: Integer; + Slant: TSkFontSlant; + constructor Create(const AWeight, AWidth: Integer; const ASlant: TSkFontSlant); overload; + constructor Create(const AWeight: TSkFontWeight; const AWidth: TSkFontWidth; const ASlant: TSkFontSlant); overload; + class function Bold: TSkFontStyle; static; inline; + class function BoldItalic: TSkFontStyle; static; inline; + class function Italic: TSkFontStyle; static; inline; + class function Normal: TSkFontStyle; static; inline; + class operator Equal(const AFontStyle1, AFontStyle2: TSkFontStyle): Boolean; + class operator NotEqual(const AFontStyle1, AFontStyle2: TSkFontStyle): Boolean; + end; + + { TSkGraphics } + + TSkGraphics = record + class procedure AllowJIT; static; + class procedure DumpMemoryStatistics(const ATraceMemoryDump: ISkTraceMemoryDump); static; + class function GetFontCacheCountLimit: Integer; static; + class function GetFontCacheCountUsed: Integer; static; + class function GetFontCacheLimit: NativeUInt; static; + class function GetFontCacheUsed: NativeUInt; static; + class function GetResourceCacheSingleAllocationByteLimit: NativeUInt; static; + class function GetResourceCacheTotalByteLimit: NativeUInt; static; + class function GetResourceCacheTotalBytesUsed: NativeUInt; static; + class procedure Init; static; + class procedure PurgeAllCaches; static; + class procedure PurgeFontCache; static; + class procedure PurgeResourceCache; static; + class procedure SetFontCacheCountLimit(const AValue: Integer); static; + class procedure SetFontCacheLimit(const AValue: NativeUInt); static; + class procedure SetResourceCacheSingleAllocationByteLimit(const AValue: NativeUInt); static; + class procedure SetResourceCacheTotalByteLimit(const AValue: NativeUInt); static; + class property FontCacheCountLimit: Integer read GetFontCacheCountLimit write SetFontCacheCountLimit; + class property FontCacheCountUsed: Integer read GetFontCacheCountUsed; + class property FontCacheLimit: NativeUInt read GetFontCacheLimit write SetFontCacheLimit; + class property FontCacheUsed: NativeUInt read GetFontCacheUsed; + class property ResourceCacheSingleAllocationByteLimit: NativeUInt read GetResourceCacheSingleAllocationByteLimit write SetResourceCacheSingleAllocationByteLimit; + class property ResourceCacheTotalByteLimit: NativeUInt read GetResourceCacheTotalByteLimit write SetResourceCacheTotalByteLimit; + class property ResourceCacheTotalBytesUsed: NativeUInt read GetResourceCacheTotalBytesUsed; + end; + + { TSkHighContrastConfig } + + TSkHighContrastConfig = record + Grayscale: Boolean; + InvertStyle: TSkContrastInvertStyle; + Contrast: Single; + constructor Create(const AGrayscale: Boolean; const AInvertStyle: TSkContrastInvertStyle; const AContrast: Single); + class operator Equal(const AHighContrastConfig1, AHighContrastConfig2: TSkHighContrastConfig): Boolean; + class operator NotEqual(const AHighContrastConfig1, AHighContrastConfig2: TSkHighContrastConfig): Boolean; end; - { TSkSamplingOptionsConstants } + { TSkImageInfo } - TSkSamplingOptionsConstants = record helper for TSkSamplingOptions - const - Low : TSkSamplingOptions = (FUseCubic: False; FCubic: (B: 0; C: 0); FFilter: TSkFilterMode.Nearest; FMipmap: TSkMipmapMode.Nearest); - Medium : TSkSamplingOptions = (FUseCubic: False; FCubic: (B: 0; C: 0); FFilter: TSkFilterMode.Linear; FMipmap: TSkMipmapMode.Nearest); - High : TSkSamplingOptions = (FUseCubic: True; FCubic: (B: 1 / 3; C: 1 / 3); FFilter: TSkFilterMode.Nearest; FMipmap: TSkMipmapMode.None); + TSkImageInfo = record + Width: Integer; + Height: Integer; + ColorType: TSkColorType; + AlphaType: TSkAlphaType; + ColorSpace: ISkColorSpace; + constructor Create(const AWidth, AHeight: Integer); overload; + constructor Create(const AWidth, AHeight: Integer; const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil); overload; + function ByteSize(const ARowBytes: NativeUInt): NativeUInt; + function BytesPerPixel: Integer; inline; + function IsEmpty: Boolean; + function IsOpaque: Boolean; + function IsValid: Boolean; + function IsValidRowBytes(const ARowBytes: NativeUInt): Boolean; + function MakeAlphaType(const AAlphaType: TSkAlphaType): TSkImageInfo; + function MakeColorSpace(AColorSpace: ISkColorSpace): TSkImageInfo; + function MakeColorType(const AColorType: TSkColorType): TSkImageInfo; + function MakeDimensions(const AWidth, AHeight: Integer): TSkImageInfo; + function MinByteSize: NativeUInt; + function MinRowBytes: NativeUInt; + function ShiftPerPixel: Integer; inline; + class operator Equal(const AImageInfo1, AImageInfo2: TSkImageInfo): Boolean; + class operator NotEqual(const AImageInfo1, AImageInfo2: TSkImageInfo): Boolean; end; - ISkFont = interface; + { TSkImageEncoder } - TSkLatticeRectType = (Default, Transparent, FixedColor); + TSkImageEncoder = record + class function Encode(const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): TBytes; overload; static; + class function Encode(const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): TBytes; overload; static; inline; + class function EncodeToFile(const AFileName: string; const ASrc: ISkPixmap; const AQuality: Integer = 80): Boolean; overload; static; + class function EncodeToFile(const AFileName: string; const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat; const AQuality: Integer = 80): Boolean; overload; static; + class function EncodeToFile(const AFileName: string; const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; const AQuality: Integer = 80): Boolean; overload; static; + class function EncodeToFile(const AFileName: string; const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; const AEncodedImageFormat: TSkEncodedImageFormat; const AQuality: Integer = 80): Boolean; overload; static; inline; + class function EncodeToStream(const AStream: TStream; const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): Boolean; overload; static; + class function EncodeToStream(const AStream: TStream; const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): Boolean; overload; static; inline; + end; { TSkLattice } @@ -421,3590 +514,4875 @@ TSkLattice = record FColors: TArray; FUseBounds: Boolean; FBounds: TRect; - function GetXDivs: TArray; - function GetYDivs: TArray; - function GetRectTypes: TArray; - function GetColors: TArray; public constructor Create(const AXDivs, AYDivs: TArray; const ARectTypes: TArray = nil; const AColors: TArray = nil); overload; constructor Create(const AXDivs, AYDivs: TArray; ABounds: TRect; const ARectTypes: TArray = nil; const AColors: TArray = nil); overload; - property XDivs: TArray read GetXDivs; - property YDivs: TArray read GetYDivs; - property RectTypes: TArray read GetRectTypes; - property Colors: TArray read GetColors; + property XDivs: TArray read FXDivs; + property YDivs: TArray read FYDivs; + property RectTypes: TArray read FRectTypes; + property Colors: TArray read FColors; property UseBounds: Boolean read FUseBounds; property Bounds: TRect read FBounds; - class operator Equal(const ALattice1, ALattice2: TSkLattice): Boolean; - class operator NotEqual(const ALattice1, ALattice2: TSkLattice): Boolean; end; - TSkSrcRectConstraint = (Close, Fast); + { TSkMetrics } - TSkPatchCubics = array[0..11] of TPointF; + TSkMetrics = record + StartIndex: NativeUInt; + EndIndex: NativeUInt; + EndExcludingWhitespaces: NativeUInt; + EndIncludingNewline: NativeUInt; + IsHardBreak: Boolean; + Ascent: Double; + Descent: Double; + Height: Double; + Width: Double; + Left: Double; + Baseline: Double; + LineNumber: NativeUInt; + class operator Equal(const AMetrics1, AMetrics2: TSkMetrics): Boolean; + class operator NotEqual(const AMetrics1, AMetrics2: TSkMetrics): Boolean; + end; - TSkPatchColors = array[0..3] of TAlphaColor; + { TSkParagraphVisitorInfo } - TSkPatchTexCoords = array[0..3] of TPointF; + TSkParagraphVisitorInfo = record + Font: ISkFont; + Origin: TPointF; + AdvanceX: Single; + Count: Integer; + Glyphs: PWordArray; + Positions: PPointFArray; + Utf8Starts: PCardinalArray; + Flags: TSkParagraphVisitorFlags; + end; - ISkPicture = interface; + { TSkParticleUniform } - TSkDrawPointsMode = (Points, Lines, Polygon); + TSkParticleUniform = record + Columns: Integer; + Rows: Integer; + Slot: Integer; + end; - ISkTextBlob = interface; + { TSkPathIteratorElem } - ISkVertices = interface; + TSkPathIteratorElem = record + Verb: TSkPathVerb; + Points: TSkPathPoints; + ConicWeight: Single; + end; - { ISkCanvas } + { TSkPDFMetadata } - ISkCanvas = interface(ISkObject) - ['{E960928D-B73D-40EE-A4B6-049D7D9474C9}'] - procedure Clear(const AColor: TAlphaColor); overload; - procedure Clear(const AColor: TAlphaColorF); overload; - procedure Discard; - procedure ClipPath(const APath: ISkPath; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); - procedure ClipRect(const ARect: TRectF; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); - procedure ClipRegion(const ARegion: ISkRegion; const AOp: TSkClipOp = TSkClipOp.Intersect); - procedure ClipRoundRect(const ARoundRect: ISkRoundRect; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); - procedure ClipShader(const AShader: ISkShader; const AOp: TSkClipOp = TSkClipOp.Intersect); - procedure Concat(const AMatrix: TMatrix); overload; - procedure Concat(const AMatrix: TMatrix3D); overload; - procedure DrawAnnotation(const ARect: TRectF; const AKey: string); overload; - procedure DrawAnnotation(const ARect: TRectF; const AKey: string; const AValue; const ASize: NativeUInt); overload; - procedure DrawArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single; const AUseCenter: Boolean; const APaint: ISkPaint); - procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; - procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ASampling: TSkSamplingOptions; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; - procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ACullRect: TRectF; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; - procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ASampling: TSkSamplingOptions; const ACullRect: TRectF; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; - procedure DrawCircle(const ACenter: TPointF; ARadius: Single; const APaint: ISkPaint); overload; - procedure DrawCircle(const ACenterX, ACenterY, ARadius: Single; const APaint: ISkPaint); overload; - procedure DrawColor(const AColor: TAlphaColor; const ABlendMode: TSkBlendMode = TSkBlendMode.SrcOver); overload; - procedure DrawColor(const AColor: TAlphaColorF; const ABlendMode: TSkBlendMode = TSkBlendMode.SrcOver); overload; - procedure DrawGlyphs(const AGlyphs: TArray; const APositions: TArray; const AOrigin: TPointF; const AFont: ISkFont; const APaint: ISkPaint); overload; - procedure DrawGlyphs(const AGlyphs: TArray; const AMatrices: TArray; const AOrigin: TPointF; const AFont: ISkFont; const APaint: ISkPaint); overload; - procedure DrawImage(const AImage: ISkImage; const AX, AY: Single; const APaint: ISkPaint = nil); overload; - procedure DrawImage(const AImage: ISkImage; const AX, AY: Single; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil); overload; - procedure DrawImageLattice(const AImage: ISkImage; const ALattice: TSkLattice; const ADest: TRectF; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear; const APaint: ISkPaint = nil); - procedure DrawImageNine(const AImage: ISkImage; const ACenter: TRect; const ADest: TRectF; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear; const APaint: ISkPaint = nil); - procedure DrawImageRect(const AImage: ISkImage; const ADest: TRectF; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; - procedure DrawImageRect(const AImage: ISkImage; const ADest: TRectF; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; - procedure DrawImageRect(const AImage: ISkImage; const ASrc, ADest: TRectF; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; - procedure DrawImageRect(const AImage: ISkImage; const ASrc, ADest: TRectF; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; - procedure DrawLine(const APoint1, APoint2: TPointF; const APaint: ISkPaint); overload; - procedure DrawLine(const AX1, AY1, AX2, AY2: Single; const APaint: ISkPaint); overload; - procedure DrawOval(const AOval: TRectF; const APaint: ISkPaint); - procedure DrawPaint(const APaint: ISkPaint); - procedure DrawPatch(const ACubics: TSkPatchCubics; const AColors: TSkPatchColors; const ATexCoords: TSkPatchTexCoords; const ABlendMode: TSkBlendMode; const APaint: ISkPaint); - procedure DrawPath(const APath: ISkPath; const APaint: ISkPaint); - procedure DrawPicture(const APicture: ISkPicture; const APaint: ISkPaint = nil); overload; - procedure DrawPicture(const APicture: ISkPicture; const AMatrix: TMatrix; const APaint: ISkPaint = nil); overload; - procedure DrawPoint(const APoint: TPointF; const APaint: ISkPaint); overload; - procedure DrawPoint(const AX, AY: Single; const APaint: ISkPaint); overload; - procedure DrawPoints(const AMode: TSkDrawPointsMode; const APoints: TArray; const APaint: ISkPaint); - procedure DrawRect(const ARect: TRectF; const APaint: ISkPaint); - procedure DrawRegion(const ARegion: ISkRegion; const APaint: ISkPaint); - procedure DrawRoundRect(const ARoundRect: ISkRoundRect; const APaint: ISkPaint); overload; - procedure DrawRoundRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single; const APaint: ISkPaint); overload; - procedure DrawRoundRectDifference(const AOuter, AInner: ISkRoundRect; const APaint: ISkPaint); overload; - procedure DrawSimpleText(const AText: string; const AX, AY: Single; const AFont: ISkFont; const APaint: ISkPaint); - procedure DrawSimpleTextGlyphs(const AGlyphs: TArray; const AX, AY: Single; const AFont: ISkFont; const APaint: ISkPaint); - procedure DrawTextBlob(const ATextBlob: ISkTextBlob; const AX, AY: Single; const APaint: ISkPaint); overload; - procedure DrawVertices(const AVertices: ISkVertices; const ABlendMode: TSkBlendMode; const APaint: ISkPaint); - function GetDeviceClipBounds: TRect; - function GetLocalClipBounds: TRectF; - function GetLocalToDevice: TMatrix3D; - function GetLocalToDeviceAs3x3: TMatrix; - function GetSaveCount: Integer; - function QuickReject(const ARect: TRectF): Boolean; overload; - function QuickReject(const APath: ISkPath): Boolean; overload; - procedure ResetMatrix; - procedure Restore; - procedure RestoreToCount(const ASaveCount: Integer); - procedure Rotate(const ADegrees: Single); overload; - procedure Rotate(const ADegrees, APX, APY: Single); overload; - procedure RotateRadians(const ARadians: Single); - function Save: Integer; - procedure SaveLayer(const APaint: ISkPaint = nil); overload; - procedure SaveLayer(const ABounds: TRectF; const APaint: ISkPaint = nil); overload; - procedure SaveLayerAlpha(const AAlpha: Byte); overload; - procedure SaveLayerAlpha(const ABounds: TRectF; const AAlpha: Byte); overload; - procedure Scale(const AScaleX, AScaleY: Single); - procedure SetMatrix(const AMatrix: TMatrix); overload; - procedure SetMatrix(const AMatrix: TMatrix3D); overload; - procedure Skew(const ASkewX, ASkewY: Single); - procedure Translate(const ADeltaX, ADeltaY: Single); + TSkPDFMetadata = record + Title: string; + Author: string; + Subject: string; + Keywords: string; + Creator: string; + Producer: string; + Creation: TDateTime; + Modified: TDateTime; + RasterDPI: Single; + PDFA: Boolean; + EncodingQuality: Integer; + constructor Create(const ATitle, AAuthor, ASubject, AKeywords, ACreator: string; const AProducer: string = 'Skia/PDF'; const ARasterDPI: Single = 72; const APDFA: Boolean = False; const AEncodingQuality: Integer = 101); overload; + constructor Create(const ATitle, AAuthor, ASubject, AKeywords, ACreator: string; const ACreation, AModified: TDateTime; const AProducer: string = 'Skia/PDF'; const ARasterDPI: Single = 72; const APDFA: Boolean = False; const AEncodingQuality: Integer = 101); overload; + class operator Equal(const APDFMetadata1, APDFMetadata2: TSkPDFMetadata): Boolean; + class operator NotEqual(const APDFMetadata1, APDFMetadata2: TSkPDFMetadata): Boolean; end; - { TSkCanvas } + { TSkPlaceholderStyle } - TSkCanvas = class(TSkObject, ISkCanvas) - strict protected - procedure Clear(const AColor: TAlphaColor); overload; - procedure Clear(const AColor: TAlphaColorF); overload; - procedure Discard; - procedure ClipPath(const APath: ISkPath; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); - procedure ClipRect(const ARect: TRectF; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); - procedure ClipRegion(const ARegion: ISkRegion; const AOp: TSkClipOp = TSkClipOp.Intersect); - procedure ClipRoundRect(const ARoundRect: ISkRoundRect; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); - procedure ClipShader(const AShader: ISkShader; const AOp: TSkClipOp = TSkClipOp.Intersect); - procedure Concat(const AMatrix: TMatrix); overload; - procedure Concat(const AMatrix: TMatrix3D); overload; - procedure DrawAnnotation(const ARect: TRectF; const AKey: string); overload; - procedure DrawAnnotation(const ARect: TRectF; const AKey: string; const AValue; const ASize: NativeUInt); overload; - procedure DrawArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single; const AUseCenter: Boolean; const APaint: ISkPaint); - procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; - procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ASampling: TSkSamplingOptions; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; - procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ACullRect: TRectF; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; - procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ASampling: TSkSamplingOptions; const ACullRect: TRectF; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; - procedure DrawCircle(const ACenter: TPointF; ARadius: Single; const APaint: ISkPaint); overload; - procedure DrawCircle(const ACenterX, ACenterY, ARadius: Single; const APaint: ISkPaint); overload; - procedure DrawColor(const AColor: TAlphaColor; const ABlendMode: TSkBlendMode = TSkBlendMode.SrcOver); overload; - procedure DrawColor(const AColor: TAlphaColorF; const ABlendMode: TSkBlendMode = TSkBlendMode.SrcOver); overload; - procedure DrawGlyphs(const AGlyphs: TArray; const APositions: TArray; const AOrigin: TPointF; const AFont: ISkFont; const APaint: ISkPaint); overload; - procedure DrawGlyphs(const AGlyphs: TArray; const AMatrices: TArray; const AOrigin: TPointF; const AFont: ISkFont; const APaint: ISkPaint); overload; - procedure DrawImage(const AImage: ISkImage; const AX, AY: Single; const APaint: ISkPaint = nil); overload; - procedure DrawImage(const AImage: ISkImage; const AX, AY: Single; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil); overload; - procedure DrawImageLattice(const AImage: ISkImage; const ALattice: TSkLattice; const ADest: TRectF; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear; const APaint: ISkPaint = nil); - procedure DrawImageNine(const AImage: ISkImage; const ACenter: TRect; const ADest: TRectF; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear; const APaint: ISkPaint = nil); - procedure DrawImageRect(const AImage: ISkImage; const ADest: TRectF; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; - procedure DrawImageRect(const AImage: ISkImage; const ADest: TRectF; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; - procedure DrawImageRect(const AImage: ISkImage; const ASrc, ADest: TRectF; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; - procedure DrawImageRect(const AImage: ISkImage; const ASrc, ADest: TRectF; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; - procedure DrawLine(const APoint1, APoint2: TPointF; const APaint: ISkPaint); overload; - procedure DrawLine(const AX1, AY1, AX2, AY2: Single; const APaint: ISkPaint); overload; - procedure DrawOval(const AOval: TRectF; const APaint: ISkPaint); - procedure DrawPaint(const APaint: ISkPaint); - procedure DrawPatch(const ACubics: TSkPatchCubics; const AColors: TSkPatchColors; const ATexCoords: TSkPatchTexCoords; const ABlendMode: TSkBlendMode; const APaint: ISkPaint); - procedure DrawPath(const APath: ISkPath; const APaint: ISkPaint); - procedure DrawPicture(const APicture: ISkPicture; const APaint: ISkPaint = nil); overload; - procedure DrawPicture(const APicture: ISkPicture; const AMatrix: TMatrix; const APaint: ISkPaint = nil); overload; - procedure DrawPoint(const APoint: TPointF; const APaint: ISkPaint); overload; - procedure DrawPoint(const AX, AY: Single; const APaint: ISkPaint); overload; - procedure DrawPoints(const AMode: TSkDrawPointsMode; const APoints: TArray; const APaint: ISkPaint); - procedure DrawRect(const ARect: TRectF; const APaint: ISkPaint); - procedure DrawRegion(const ARegion: ISkRegion; const APaint: ISkPaint); - procedure DrawRoundRect(const ARoundRect: ISkRoundRect; const APaint: ISkPaint); overload; - procedure DrawRoundRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single; const APaint: ISkPaint); overload; - procedure DrawRoundRectDifference(const AOuter, AInner: ISkRoundRect; const APaint: ISkPaint); overload; - procedure DrawSimpleText(const AText: string; const AX, AY: Single; const AFont: ISkFont; const APaint: ISkPaint); - procedure DrawSimpleTextGlyphs(const AGlyphs: TArray; const AX, AY: Single; const AFont: ISkFont; const APaint: ISkPaint); - procedure DrawTextBlob(const ATextBlob: ISkTextBlob; const AX, AY: Single; const APaint: ISkPaint); overload; - procedure DrawVertices(const AVertices: ISkVertices; const ABlendMode: TSkBlendMode; const APaint: ISkPaint); - function GetDeviceClipBounds: TRect; - function GetLocalClipBounds: TRectF; - function GetLocalToDevice: TMatrix3D; - function GetLocalToDeviceAs3x3: TMatrix; - function GetSaveCount: Integer; - function QuickReject(const ARect: TRectF): Boolean; overload; - function QuickReject(const APath: ISkPath): Boolean; overload; - procedure ResetMatrix; - procedure Restore; - procedure RestoreToCount(const ASaveCount: Integer); - procedure Rotate(const ADegrees: Single); overload; - procedure Rotate(const ADegrees, APX, APY: Single); overload; - procedure RotateRadians(const ARadians: Single); - function Save: Integer; - procedure SaveLayer(const APaint: ISkPaint = nil); overload; - procedure SaveLayer(const ABounds: TRectF; const APaint: ISkPaint = nil); overload; - procedure SaveLayerAlpha(const AAlpha: Byte); overload; - procedure SaveLayerAlpha(const ABounds: TRectF; const AAlpha: Byte); overload; - procedure Scale(const AScaleX, AScaleY: Single); - procedure SetMatrix(const AMatrix: TMatrix); overload; - procedure SetMatrix(const AMatrix: TMatrix3D); overload; - procedure Skew(const ASkewX, ASkewY: Single); - procedure Translate(const ADeltaX, ADeltaY: Single); - public - class procedure DestroyHandle(const AHandle: THandle); override; + TSkPlaceholderStyle = record + Width: Single; + Height: Single; + Alignment: TSkPlaceholderAlignment; + Baseline: TSkTextBaseline; + BaselineOffset: Single; + constructor Create(const AWidth, AHeight: Single; const AAlignment: TSkPlaceholderAlignment; const ABaseline: TSkTextBaseline; const ABaselineOffset: Single); + class operator Equal(const APlaceholderStyle1, APlaceholderStyle2: TSkPlaceholderStyle): Boolean; + class operator NotEqual(const APlaceholderStyle1, APlaceholderStyle2: TSkPlaceholderStyle): Boolean; end; - TSkAlphaType = (Unknown, Opaque, Premul, Unpremul); - - ISkColorSpace = interface; - - TSkEncodedImageFormat = (BMP, GIF, ICO, JPEG, PNG, WBMP, WEBP, PKM, KTX, ASTC, DNG, HEIF, AVIF); - - TSkImage = class; - - { ISkCodec } + { TSkPositionAffinity } - ISkCodec = interface(ISkObject) - ['{EAFB4293-A036-4B9B-9157-049819923F13}'] - function GetDimensions: TSize; - function GetEncodedImageFormat: TSkEncodedImageFormat; - function GetHeight: Integer; - function GetImage(const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; const AColorSpace: ISkColorSpace = nil): ISkImage; - function GetPixels(const APixels: Pointer; const ARowBytes: NativeUInt; const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; const AColorSpace: ISkColorSpace = nil): Boolean; - function GetWidth: Integer; - property Dimensions: TSize read GetDimensions; - property EncodedImageFormat: TSkEncodedImageFormat read GetEncodedImageFormat; - property Height: Integer read GetHeight; - property Width: Integer read GetWidth; + TSkPositionAffinity = record + Position: Integer; + Affinity: TSkAffinity; + class operator Equal(const APositionAffinity1, APositionAffinity2: TSkPositionAffinity): Boolean; + class operator NotEqual(const APositionAffinity1, APositionAffinity2: TSkPositionAffinity): Boolean; end; - { TSkCodec } + { TSkRotationScaleMatrix } - TSkCodec = class(TSkObject, ISkCodec) - strict protected - function GetDimensions: TSize; - function GetEncodedImageFormat: TSkEncodedImageFormat; - function GetHeight: Integer; - function GetImage(const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; const AColorSpace: ISkColorSpace = nil): ISkImage; - function GetPixels(const APixels: Pointer; const ARowBytes: NativeUInt; const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; const AColorSpace: ISkColorSpace = nil): Boolean; - function GetWidth: Integer; - public - class procedure DestroyHandle(const AHandle: THandle); override; - class function MakeFromFile(const AFileName: string): ISkCodec; static; - class function MakeFromStream(const AStream: TStream): ISkCodec; static; - class function MakeWithCopy(const AData: Pointer; const ASize: NativeUInt): ISkCodec; static; - class function MakeWithoutCopy(const AData: Pointer; const ASize: NativeUInt): ISkCodec; static; + TSkRotationScaleMatrix = record + SCosinus: Single; + SSinus: Single; + TranslateX: Single; + TranslateY: Single; + constructor Create(const ASCosinus, ASSinus, ATranslateX, ATranslateY: Single); + class function CreateDegrees(const AScale, ADegrees, ATranslateX, ATranslateY, AAnchorX, AAnchorY: Single): TSkRotationScaleMatrix; static; + class function CreateRadians(const AScale, ARadians, ATranslateX, ATranslateY, AAnchorX, AAnchorY: Single): TSkRotationScaleMatrix; static; + class function Identity: TSkRotationScaleMatrix; static; inline; + class operator Equal(const ARotationScaleMatrix1, ARotationScaleMatrix2: TSkRotationScaleMatrix): Boolean; + class operator NotEqual(const ARotationScaleMatrix1, ARotationScaleMatrix2: TSkRotationScaleMatrix): Boolean; + class operator Implicit(const ARotationScaleMatrix: TSkRotationScaleMatrix): TMatrix; end; - { ISkAnimationCodecPlayer } - - ISkAnimationCodecPlayer = interface(ISkObject) - ['{56A3230F-1499-4DBE-A416-6304A6A60E7F}'] - function GetDimensions: TSize; - function GetDuration: Cardinal; - function GetFrame: ISkImage; - function GetHeight: Integer; - function GetWidth: Integer; - function Seek(const AMilliseconds: Cardinal): Boolean; - property Dimensions: TSize read GetDimensions; - property Duration: Cardinal read GetDuration; - property Frame: ISkImage read GetFrame; - property Height: Integer read GetHeight; - property Width: Integer read GetWidth; - end; + {$ALIGN 4} - { TSkAnimationCodecPlayer } + { TSkRuntimeEffectFloat2 } - TSkAnimationCodecPlayer = class(TSkObject, ISkAnimationCodecPlayer) - strict protected - function GetDimensions: TSize; - function GetDuration: Cardinal; - function GetFrame: ISkImage; - function GetHeight: Integer; - function GetWidth: Integer; - function Seek(const AMilliseconds: Cardinal): Boolean; - public - class procedure DestroyHandle(const AHandle: THandle); override; - class function MakeFromFile(const AFileName: string): ISkAnimationCodecPlayer; static; - class function MakeFromStream(const AStream: TStream): ISkAnimationCodecPlayer; static; + TSkRuntimeEffectFloat2 = packed record + constructor Create(const AV1, AV2: Single); + case Integer of + 0: (V1, V2: Single); + 1: (Values: array[0..1] of Single); end; - TSkContrastInvertStyle = (NoInvert, InvertBrightness, InvertLightness); - - { TSkHighContrastConfig } + { TSkRuntimeEffectFloat3 } - TSkHighContrastConfig = record - Grayscale: Boolean; - InvertStyle: TSkContrastInvertStyle; - Contrast: Single; - constructor Create(const AGrayscale: Boolean; const AInvertStyle: TSkContrastInvertStyle; const AContrast: Single); - class operator Equal(const AHighContrastConfig1, AHighContrastConfig2: TSkHighContrastConfig): Boolean; - class operator NotEqual(const AHighContrastConfig1, AHighContrastConfig2: TSkHighContrastConfig): Boolean; + TSkRuntimeEffectFloat3 = packed record + constructor Create(const AV1, AV2, AV3: Single); + case Integer of + 0: (V1, V2, V3: Single); + 1: (Values: array[0..2] of Single); end; - { TSkColorMatrix } + { TSkRuntimeEffectFloat4 } - TSkColorMatrix = record - constructor Create(const AM11, AM12, AM13, AM14, AM15, AM21, AM22, AM23, AM24, AM25, AM31, AM32, AM33, AM34, AM35, AM41, AM42, AM43, AM44, AM45: Single); - class function CreateSaturation(const ASaturation: Single): TSkColorMatrix; static; - class function CreateScale(const AScaleR, AScaleG, AScaleB: Single; const AScaleA: Single = 1): TSkColorMatrix; static; - class operator Equal(const AColorMatrix1, AColorMatrix2: TSkColorMatrix): Boolean; - class operator NotEqual(const AColorMatrix1, AColorMatrix2: TSkColorMatrix): Boolean; - class operator Multiply(const AColorMatrix1, AColorMatrix2: TSkColorMatrix): TSkColorMatrix; + TSkRuntimeEffectFloat4 = packed record + constructor Create(const AV1, AV2, AV3, AV4: Single); case Integer of - 0: (M11, M12, M13, M14, M15, - M21, M22, M23, M24, M25, - M31, M32, M33, M34, M35, - M41, M42, M43, M44, M45: Single); - 1: (Vector: array[0..3] of array[0..4] of Single); + 0: (V1, V2, V3, V4: Single); + 1: (Values: array[0..3] of Single); end; - { TSkColorMatrixConstants } + { TSkRuntimeEffectFloat2x2 } - TSkColorMatrixConstants = record helper for TSkColorMatrix - const - Identity: TSkColorMatrix = (M11: 1; M12: 0; M13: 0; M14: 0; M15: 0; - M21: 0; M22: 1; M23: 0; M24: 0; M25: 0; - M31: 0; M32: 0; M33: 1; M34: 0; M35: 0; - M41: 0; M42: 0; M43: 0; M44: 1; M45: 0); + TSkRuntimeEffectFloat2x2 = packed record + constructor Create(const AV11, AV12, AV21, AV22: Single); + case Integer of + 0: (V11, V12, + V21, V22: Single); + 1: (Values: array[0..3] of Single); end; - TSkOverdrawColor = array[0..5] of TAlphaColor; + { TSkRuntimeEffectFloat3x3 } - TSkTableFilter = array[0..255] of Byte; + TSkRuntimeEffectFloat3x3 = packed record + constructor Create(const AV11, AV12, AV13, AV21, AV22, AV23, AV31, AV32, AV33: Single); + case Integer of + 0: (V11, V12, V13, + V21, V22, V23, + V31, V32, V33: Single); + 1: (Values: array[0..8] of Single); + end; - { ISkColorFilter } + { TSkRuntimeEffectFloat4x4 } - ISkColorFilter = interface(ISkReferenceCounted) - ['{5CA5AB17-1B1E-4190-8496-6D2D951C0EDE}'] + TSkRuntimeEffectFloat4x4 = packed record + constructor Create(const AV11, AV12, AV13, AV14, AV21, AV22, AV23, AV24, AV31, AV32, AV33, AV34, AV41, AV42, AV43, AV44: Single); + case Integer of + 0: (V11, V12, V13, V14, + V21, V22, V23, V24, + V31, V32, V33, V34, + V41, V42, V43, V44: Single); + 1: (Values: array[0..15] of Single); end; - { TSkColorFilter } + { TSkRuntimeEffectInt2 } - TSkColorFilter = class(TSkReferenceCounted, ISkColorFilter) - public - class function MakeBlend(const AColor: TAlphaColor; const AMode: TSkBlendMode): ISkColorFilter; static; - class function MakeCompose(const AOuter, AInner: ISkColorFilter): ISkColorFilter; static; - class function MakeHighContrast(const AConfig: TSkHighContrastConfig): ISkColorFilter; static; - class function MakeHSLAMatrix(const AMatrix: TSkColorMatrix): ISkColorFilter; static; - class function MakeLighting(const AMultiply, AAdd: TAlphaColor): ISkColorFilter; static; - class function MakeLinearToSRGBGamma: ISkColorFilter; - class function MakeLumaColor: ISkColorFilter; static; - class function MakeMatrix(const AMatrix: TSkColorMatrix): ISkColorFilter; static; - class function MakeOverdraw(const AColors: TSkOverdrawColor): ISkColorFilter; static; - class function MakeTable(const ATable: TSkTableFilter): ISkColorFilter; overload; static; - class function MakeTable(const ATableA, ATableR, ATableG, ATableB: TSkTableFilter): ISkColorFilter; overload; static; + TSkRuntimeEffectInt2 = packed record + constructor Create(const AV1, AV2: Integer); + case Integer of + 0: (V1, V2: Integer); + 1: (Values: array[0..1] of Integer); end; - { TSkColorSpaceXyz } + { TSkRuntimeEffectInt3 } - TSkColorSpaceXyz = record - public const - FixedToFloat = 1.52587890625e-5; - public - constructor Create(const AM11, AM12, AM13, AM21, AM22, AM23, AM31, AM32, AM33: Single); - function Adjoint: TSkColorSpaceXyz; - function Determinant: Single; - function Inverse: TSkColorSpaceXyz; - class operator Equal(const AColorSpaceXyz1, AColorSpaceXyz2: TSkColorSpaceXyz): Boolean; - class operator NotEqual(const AColorSpaceXyz1, AColorSpaceXyz2: TSkColorSpaceXyz): Boolean; - class operator Multiply(const AColorSpaceXyz1, AColorSpaceXyz2: TSkColorSpaceXyz): TSkColorSpaceXyz; + TSkRuntimeEffectInt3 = packed record + constructor Create(const AV1, AV2, AV3: Integer); case Integer of - 0: (M11, M12, M13, - M21, M22, M23, - M31, M32, M33: Single); - 1: (Vector: array[0..2] of array[0..2] of Single); + 0: (V1, V2, V3: Integer); + 1: (Values: array[0..2] of Integer); end; - { TSkColorSpaceXyzConstants } + { TSkRuntimeEffectInt4 } - TSkColorSpaceXyzConstants = record helper for TSkColorSpaceXyz - const - Identity : TSkColorSpaceXyz = (M11: 1; M12: 0; M13: 0; - M21: 0; M22: 1; M23: 0; - M31: 0; M32: 0; M33: 1); + TSkRuntimeEffectInt4 = packed record + constructor Create(const AV1, AV2, AV3, AV4: Integer); + case Integer of + 0: (V1, V2, V3, V4: Integer); + 1: (Values: array[0..3] of Integer); + end; - SRGB : TSkColorSpaceXyz = (M11: $6FA2 * TSkColorSpaceXyz.FixedToFloat; M12: $6299 * TSkColorSpaceXyz.FixedToFloat; M13: $24A0 * TSkColorSpaceXyz.FixedToFloat; - M21: $38F5 * TSkColorSpaceXyz.FixedToFloat; M22: $B785 * TSkColorSpaceXyz.FixedToFloat; M23: $0F84 * TSkColorSpaceXyz.FixedToFloat; - M31: $0390 * TSkColorSpaceXyz.FixedToFloat; M32: $18DA * TSkColorSpaceXyz.FixedToFloat; M33: $B6CF * TSkColorSpaceXyz.FixedToFloat); + {$ALIGN ON} - AdobeRGB : TSkColorSpaceXyz = (M11: $9C18 * TSkColorSpaceXyz.FixedToFloat; M12: $348D * TSkColorSpaceXyz.FixedToFloat; M13: $2631 * TSkColorSpaceXyz.FixedToFloat; - M21: $4FA5 * TSkColorSpaceXyz.FixedToFloat; M22: $A02C * TSkColorSpaceXyz.FixedToFloat; M23: $102F * TSkColorSpaceXyz.FixedToFloat; - M31: $04FC * TSkColorSpaceXyz.FixedToFloat; M32: $0F95 * TSkColorSpaceXyz.FixedToFloat; M33: $BE9C * TSkColorSpaceXyz.FixedToFloat); + { TSkSamplingOptions } - DisplayP3 : TSkColorSpaceXyz = (M11: 0.515102; M12: 0.291965; M13: 0.157153; - M21: 0.241182; M22: 0.692236; M23: 0.0665819; - M31: -0.00104941; M32: 0.0418818; M33: 0.784378); + TSkSamplingOptions = record + strict private + FMaxAnisotropic: Integer; + FUseCubic: Boolean; + FCubic: TSkCubicResampler; + FFilter: TSkFilterMode; + FMipmap: TSkMipmapMode; + public + constructor Create(const ACubic: TSkCubicResampler); overload; + constructor Create(const AFilter: TSkFilterMode; const AMipmap: TSkMipmapMode); overload; + constructor Create(const AMaxAnisotropic: Integer); overload; + property MaxAnisotropic: Integer read FMaxAnisotropic; + property UseCubic: Boolean read FUseCubic; + property Cubic: TSkCubicResampler read FCubic; + property Filter: TSkFilterMode read FFilter; + property Mipmap: TSkMipmapMode read FMipmap; + class function High: TSkSamplingOptions; static; inline; + class function Low: TSkSamplingOptions; static; inline; + class function Medium: TSkSamplingOptions; static; inline; + class operator Equal(const ASamplingOptions1, ASamplingOptions2: TSkSamplingOptions): Boolean; + class operator NotEqual(const ASamplingOptions1, ASamplingOptions2: TSkSamplingOptions): Boolean; + end; - Rec2020 : TSkColorSpaceXyz = (M11: 0.673459; M12: 0.165661; M13: 0.125100; - M21: 0.279033; M22: 0.675338; M23: 0.0456288; - M31: -0.00193139; M32: 0.0299794; M33: 0.797162); + { TSkSurfaceProperties } + + TSkSurfaceProperties = record + Flags: TSkSurfacePropertiesFlags; + PixelGeometry: TSkPixelGeometry; + constructor Create(const AFlags: TSkSurfacePropertiesFlags; const APixelGeometry: TSkPixelGeometry); + class operator Equal(const ASurfaceProperties1, ASurfaceProperties2: TSkSurfaceProperties): Boolean; + class operator NotEqual(const ASurfaceProperties1, ASurfaceProperties2: TSkSurfaceProperties): Boolean; end; - { TSkColorSpaceTransferFunction } + { TSkSVGLength } - TSkColorSpaceTransferFunction = record - G: Single; - A: Single; - B: Single; - C: Single; - D: Single; - E: Single; - F: Single; - constructor Create(const AG, AA, AB, AC, AD, AE, AF: Single); - function Invert(out ATransferFunction: TSkColorSpaceTransferFunction): Boolean; - function Transform(const AX: Single): Single; - class operator Equal(const AColorSpaceTransferFunction1, AColorSpaceTransferFunction2: TSkColorSpaceTransferFunction): Boolean; - class operator NotEqual(const AColorSpaceTransferFunction1, AColorSpaceTransferFunction2: TSkColorSpaceTransferFunction): Boolean; + TSkSVGLength = record + Value: Single; + &Unit: TSkSVGLengthUnit; + constructor Create(const AValue: Single; const AUnit: TSkSVGLengthUnit = TSkSVGLengthUnit.Number); + class operator Equal(const ASVGLength1, ASVGLength2: TSkSVGLength): Boolean; + class operator NotEqual(const ASVGLength1, ASVGLength2: TSkSVGLength): Boolean; end; - { TSkColorSpaceTransferFunctionConstants } + { TSkSVGPreserveAspectRatio } - TSkColorSpaceTransferFunctionConstants = record helper for TSkColorSpaceTransferFunction - const - SRGB : TSkColorSpaceTransferFunction = (G: 2.4; A: 1 / 1.055; B: 0.055 / 1.055; C: 1 / 12.92; D: 0.04045; E: 0; F: 0); - TwoDotTwo : TSkColorSpaceTransferFunction = (G: 2.2; A: 1; B: 0; C: 0; D: 0; E: 0; F: 0); - Linear : TSkColorSpaceTransferFunction = (G: 1; A: 1; B: 0; C: 0; D: 0; E: 0; F: 0); - Rec2020 : TSkColorSpaceTransferFunction = (G: 2.22222; A: 0.909672; B: 0.0903276; C: 0.222222; D: 0.0812429; E: 0; F: 0); - PQ : TSkColorSpaceTransferFunction = (G: -2; A: -107 / 128; B: 1; C: 32 / 2523; D: 2413 / 128; E: -2392 / 128; F: 8192 / 1305); - HLG : TSkColorSpaceTransferFunction = (G: -3; A: 2; B: 2; C: 1 / 0.17883277; D: 0.28466892; E: 0.55991073; F: 0); + TSkSVGPreserveAspectRatio = record + Align: TSkSVGAspectAlign; + Scale: TSkSVGAspectScale; + constructor Create(const AAlign: TSkSVGAspectAlign; const AScale: TSkSVGAspectScale); + class operator Equal(const ASVGPreserveAspectRatio1, ASVGPreserveAspectRatio2: TSkSVGPreserveAspectRatio): Boolean; + class operator NotEqual(const ASVGPreserveAspectRatio1, ASVGPreserveAspectRatio2: TSkSVGPreserveAspectRatio): Boolean; end; - ISkColorSpaceICCProfile = interface; + { TSkTextBox } - { ISkColorSpace } + TSkTextBox = record + Rect: TRectF; + Direction: TSkTextDirection; + class operator Equal(const ATextBox1, ATextBox2: TSkTextBox): Boolean; + class operator NotEqual(const ATextBox1, ATextBox2: TSkTextBox): Boolean; + end; - ISkColorSpace = interface(ISkNonVirtualReferenceCounted) - ['{3A1330D4-E2B2-4A62-A87A-C26FDB104310}'] - function GammaCloseToSRGB: Boolean; - function GammaIsLinear: Boolean; - function IsEqual(const AColorSpace: ISkColorSpace): Boolean; - function IsNumericalTransferFunction(out ATransferFunction: TSkColorSpaceTransferFunction): Boolean; - function IsSRGB: Boolean; - function MakeLinearGamma: ISkColorSpace; - function MakeSRGBGamma: ISkColorSpace; - function ToProfile: ISkColorSpaceICCProfile; - function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; + { TSkTextShadow } + + TSkTextShadow = record + Color: TAlphaColor; + Offset: TPointF; + BlurRadius: Double; + constructor Create(const AColor: TAlphaColor; const AOffset: TPointF; const ABlurRadius: Double); + class operator Equal(const ATextShadow1, ATextShadow2: TSkTextShadow): Boolean; + class operator NotEqual(const ATextShadow1, ATextShadow2: TSkTextShadow): Boolean; end; - { TSkColorSpace } + { TSkUnicodeBreakIteratorElem } - TSkColorSpace = class(TSkNonVirtualReferenceCounted, ISkColorSpace) + TSkUnicodeBreakIteratorElem = record + Position: Integer; + Status: Integer; + end; + + TSkParagraphVisitProc = reference to procedure (const ALineNumber: Integer; const AInfo: TSkParagraphVisitorInfo); + + (*$HPPEMIT END '#define __SkCreate(AClass, AIntf, ...) \' *) + (*$HPPEMIT END ' ({ \' *) + (*$HPPEMIT END ' using namespace ::Skia; \' *) + (*$HPPEMIT END ' _di_##AIntf __Result; \' *) + (*$HPPEMIT END ' (new AClass(__VA_ARGS__))->GetInterface(__Result); \' *) + (*$HPPEMIT END ' __Result; \' *) + (*$HPPEMIT END ' })' *) + + { ISkObject } + + ISkObject = interface + function GetHandle: THandle; + property Handle: THandle read GetHandle; + end; + + { TSkObject } + + TSkObject = class abstract(TInterfacedObject, ISkObject) + {$IFNDEF AUTOREFCOUNT} + strict private const + objDestroyingFlag = Integer($80000000); + {$ENDIF} + strict private + FHandle: THandle; + FOwnsHandle: Boolean; + {$IFNDEF AUTOREFCOUNT} + [Volatile] FRefCount: Integer; + {$ENDIF} + function GetHandle: THandle; + {$IFNDEF AUTOREFCOUNT} + function GetRefCount: Integer; inline; + {$ENDIF} + class constructor Create; + class destructor Destroy; strict protected - function GammaCloseToSRGB: Boolean; - function GammaIsLinear: Boolean; - function IsEqual(const AColorSpace: ISkColorSpace): Boolean; - function IsNumericalTransferFunction(out ATransferFunction: TSkColorSpaceTransferFunction): Boolean; - function IsSRGB: Boolean; - function MakeLinearGamma: ISkColorSpace; - function MakeSRGBGamma: ISkColorSpace; - function ToProfile: ISkColorSpaceICCProfile; - function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + class procedure __DestroyHandle(const AHandle: THandle); virtual; + {$IFNDEF AUTOREFCOUNT} + class procedure __MarkDestroying(const Obj); static; inline; + {$ENDIF} + class procedure __RefHandle(const AHandle: THandle); virtual; + class procedure __UnrefHandle(const AHandle: THandle); virtual; public - class function Make(const AProfile: ISkColorSpaceICCProfile): ISkColorSpace; static; - class function MakeRGB(const ATransferFunction: TSkColorSpaceTransferFunction; const AToXyzD50: TSkColorSpaceXyz): ISkColorSpace; static; - class function MakeSRGB: ISkColorSpace; static; - class function MakeSRGBLinear: ISkColorSpace; static; - class procedure RefHandle(const AHandle: THandle); override; - class procedure UnrefHandle(const AHandle: THandle); override; + constructor Create(const AHandle: THandle); + constructor Wrap(const AHandle: THandle; const AOwnsHandle: Boolean = True); + destructor Destroy; override; + {$IFNDEF AUTOREFCOUNT} + procedure AfterConstruction; override; + procedure BeforeDestruction; override; + {$ENDIF} + property Handle: THandle read FHandle; + {$IFNDEF AUTOREFCOUNT} + property RefCount: Integer read GetRefCount; + class function NewInstance: TObject; override; + {$ENDIF} + class function __ReleaseHandle(const AObject: ISkObject): THandle; end; - { ISkColorSpaceICCProfile } + { ISkReferenceCounted } - ISkColorSpaceICCProfile = interface(ISkObject) - ['{81FAF49C-4699-4E16-AF20-4AA5F3E56408}'] - function ToBytes: TBytes; - function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; + ISkReferenceCounted = interface(ISkObject) end; - { TSkColorSpaceICCProfile } + { TSkReferenceCounted } - TSkColorSpaceICCProfile = class(TSkObject, ISkColorSpaceICCProfile) - strict protected - function ToBytes: TBytes; - function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; + TSkReferenceCounted = class abstract(TSkObject, ISkReferenceCounted) public - class procedure DestroyHandle(const AHandle: THandle); override; - class function MakeFromBytes(const ABytes: TBytes): ISkColorSpaceICCProfile; static; + class procedure __RefHandle(const AHandle: THandle); override; final; + class procedure __UnrefHandle(const AHandle: THandle); override; final; end; - { TSkColorSpacePrimaries } + { ISkNonVirtualReferenceCounted } - TSkColorSpacePrimaries = record - RX: Single; - RY: Single; - GX: Single; - GY: Single; - BX: Single; - BY: Single; - WX: Single; - WY: Single; - constructor Create(const ARX, ARY, AGX, AGY, ABX, ABY, AWX, AWY: Single); - class operator Equal(const AColorSpacePrimaries1, AColorSpacePrimaries2: TSkColorSpacePrimaries): Boolean; - class operator NotEqual(const AColorSpacePrimaries1, AColorSpacePrimaries2: TSkColorSpacePrimaries): Boolean; - class operator Implicit(const AColorSpacePrimaries: TSkColorSpacePrimaries): TSkColorSpaceXyz; + ISkNonVirtualReferenceCounted = interface(ISkObject) end; - { TSkPDFMetadata } + { TSkNonVirtualReferenceCounted } - TSkPDFMetadata = record - Title: string; - Author: string; - Subject: string; - Keywords: string; - Creator: string; - Producer: string; - Creation: TDateTime; - Modified: TDateTime; - RasterDPI: Single; - PDFA: Boolean; - EncodingQuality: Integer; - constructor Create(const ATitle, AAuthor, ASubject, AKeywords, ACreator: string; const AProducer: string = 'Skia/PDF'; const ARasterDPI: Single = 72; const APDFA: Boolean = False; const AEncodingQuality: Integer = 101); overload; - constructor Create(const ATitle, AAuthor, ASubject, AKeywords, ACreator: string; const ACreation, AModified: TDateTime; const AProducer: string = 'Skia/PDF'; const ARasterDPI: Single = 72; const APDFA: Boolean = False; const AEncodingQuality: Integer = 101); overload; - class operator Equal(const APDFMetadata1, APDFMetadata2: TSkPDFMetadata): Boolean; - class operator NotEqual(const APDFMetadata1, APDFMetadata2: TSkPDFMetadata): Boolean; + TSkNonVirtualReferenceCounted = class abstract(TSkObject, ISkNonVirtualReferenceCounted); + + TSkEnumerable = class; + + { TSkEnumerator } + + TSkEnumerator = class + strict private + FEnumerable: TSkEnumerable; + public + constructor Create(const AEnumerable: TSkEnumerable); + function GetCurrent: T; + function MoveNext: Boolean; + property Current: T read GetCurrent; end; - { ISkDocument } + { ISkEnumerable } - ISkDocument = interface(ISkReferenceCounted) - ['{98B62FC5-FA4D-42A2-8D28-AF3AF08BE35F}'] - function BeginPage(const AWidth, AHeight: Single): ISkCanvas; overload; - function BeginPage(const AWidth, AHeight: Single; const AContent: TRectF): ISkCanvas; overload; - procedure Close; - procedure EndPage; - procedure Terminate; + ISkEnumerable = interface(ISkObject) + function MoveNext: Boolean; end; - { TSkDocument } + { TSkEnumerable } - TSkDocument = class(TSkReferenceCounted, ISkDocument) - strict protected - function BeginPage(const AWidth, AHeight: Single): ISkCanvas; overload; - function BeginPage(const AWidth, AHeight: Single; const AContent: TRectF): ISkCanvas; overload; - procedure Close; - procedure EndPage; - procedure Terminate; + TSkEnumerable = class abstract(TSkObject, ISkEnumerable) public - class function MakePDF(const AStream: TStream): ISkDocument; overload; - class function MakePDF(const AStream: TStream; const AMetadata: TSkPDFMetadata): ISkDocument; overload; - class function MakeXPS(const AStream: TStream; const ADPI: Single = 72): ISkDocument; + function GetCurrent: T; virtual; abstract; + function GetEnumerator: TSkEnumerator; + function MoveNext: Boolean; virtual; abstract; end; - TSkFontEdging = (Alias, AntiAlias, SubpixelAntiAlias); + { IGrBackendRenderTarget } - TSkFontHinting = (None, Slight, Normal, Full); + IGrBackendRenderTarget = interface(ISkObject) + ['{2E56D489-6BCB-472F-8A69-93B2B18624DB}'] + function GetBackendAPI: TGrBackendAPI; + function GetHeight: Integer; + function GetSampleCount: Integer; + function GetStencilBits: Integer; + function GetWidth: Integer; + function IsValid: Boolean; + property BackendAPI: TGrBackendAPI read GetBackendAPI; + property Height: Integer read GetHeight; + property SampleCount: Integer read GetSampleCount; + property StencilBits: Integer read GetStencilBits; + property Width: Integer read GetWidth; + end; - TSkFontMetricsFlag = (UnderlineThicknessIsValid, UnderlinePositionIsValid, StrikeoutThicknessIsValid, StrikeoutPositionIsValid, BoundsInvalid); - TSkFontMetricsFlags = set of TSkFontMetricsFlag; + { TGrBackendRenderTarget } - { TSkFontMetrics } + TGrBackendRenderTarget = class(TSkObject, IGrBackendRenderTarget) + strict private + function GetBackendAPI: TGrBackendAPI; + function GetHeight: Integer; + function GetSampleCount: Integer; + function GetStencilBits: Integer; + function GetWidth: Integer; + function IsValid: Boolean; + public + constructor CreateGl(const AWidth, AHeight, ASampleCount, AStencilBits: Integer; const AFramebufferInfo: TGrGlFramebufferInfo); + constructor CreateMetal(const AWidth, AHeight: Integer; const ATextureInfo: TGrMtlTextureInfo); + constructor CreateVulkan(const AWidth, AHeight: Integer; const AImageInfo: TGrVkImageInfo); + class procedure __DestroyHandle(const AHandle: THandle); override; + end; - TSkFontMetrics = record - Flags: TSkFontMetricsFlags; - Top: Single; - Ascent: Single; - Descent: Single; - Bottom: Single; - Leading: Single; - AvgCharWidth: Single; - MaxCharWidth: Single; - XMin: Single; - XMax: Single; - XHeight: Single; - CapHeight: Single; - UnderlineThickness: Single; - UnderlinePosition: Single; - StrikeoutThickness: Single; - StrikeoutPosition: Single; - class operator Equal(const AFontMetrics1, AFontMetrics2: TSkFontMetrics): Boolean; - class operator NotEqual(const AFontMetrics1, AFontMetrics2: TSkFontMetrics): Boolean; + {$HPPEMIT END '#define GrBackendRenderTarget(...) __SkCreate(TGrBackendRenderTarget, IGrBackendRenderTarget, __VA_ARGS__)'} + + { IGrBackendTexture } + + IGrBackendTexture = interface(ISkObject) + ['{2725242E-7CA7-41A5-A79B-3802E99557C4}'] + function GetBackendAPI: TGrBackendAPI; + function GetGlTextureInfo(out ATextureInfo: TGrGlTextureInfo): Boolean; + function GetHeight: Integer; + function GetWidth: Integer; + function HasMipmaps: Boolean; + function IsValid: Boolean; + property BackendAPI: TGrBackendAPI read GetBackendAPI; + property Height: Integer read GetHeight; + property Width: Integer read GetWidth; end; - TSkFontPathProc = reference to procedure (const APathOrNil: ISkPath; const AMatrix: TMatrix); + { TGrBackendTexture } - ISkTypeface = interface; + TGrBackendTexture = class(TSkObject, IGrBackendTexture) + strict private + function GetBackendAPI: TGrBackendAPI; + function GetGlTextureInfo(out ATextureInfo: TGrGlTextureInfo): Boolean; + function GetHeight: Integer; + function GetWidth: Integer; + function HasMipmaps: Boolean; + function IsValid: Boolean; + public + constructor CreateGl(const AWidth, AHeight: Integer; const AIsMipmapped: Boolean; const ATextureInfo: TGrGlTextureInfo); + constructor CreateMetal(const AWidth, AHeight: Integer; const AIsMipmapped: Boolean; const ATextureInfo: TGrMtlTextureInfo); + constructor CreateVulkan(const AWidth, AHeight: Integer; const AImageInfo: TGrVkImageInfo); + class procedure __DestroyHandle(const AHandle: THandle); override; + end; - { ISkFont } + {$HPPEMIT END '#define GrBackendTexture(...) __SkCreate(TGrBackendTexture, IGrBackendTexture, __VA_ARGS__)'} - ISkFont = interface(ISkObject) - ['{A8FE9892-368D-4BF7-BD71-FB81FF651098}'] - function GetBaselineSnap: Boolean; - function GetBounds(const AGlyphs: TArray; const APaint: ISkPaint = nil): TArray; - function GetEdging: TSkFontEdging; - function GetEmbeddedBitmaps: Boolean; - function GetEmbolden: Boolean; - function GetForceAutoHinting: Boolean; - function GetGlyphs(const AText: string): TArray; - function GetHinting: TSkFontHinting; - function GetHorizontalPositions(const AGlyphs: TArray; const AOrigin: Single = 0): TArray; - function GetIntercepts(const AGlyphs: TArray; const APositions: TArray; const AUpperBounds, ALowerBounds: Single; const APaint: ISkPaint = nil): TArray; - function GetLinearMetrics: Boolean; - function GetMetrics(out AMetrics: TSkFontMetrics): Single; - function GetPath(const AGlyph: Word): ISkPath; - procedure GetPaths(const AGlyphs: TArray; const AProc: TSkFontPathProc); - function GetPositions(const AGlyphs: TArray): TArray; overload; - function GetPositions(const AGlyphs: TArray; const AOrigin: TPointF): TArray; overload; - function GetScaleX: Single; - function GetSize: Single; - function GetSkewX: Single; - function GetSpacing: Single; - function GetSubpixel: Boolean; - function GetTypeface: ISkTypeface; - function GetTypefaceOrDefault: ISkTypeface; - function GetWidths(const AGlyphs: TArray; const APaint: ISkPaint = nil): TArray; - procedure GetWidthsAndBounds(const AGlyphs: TArray; out AWidths: TArray; out ABounds: TArray; const APaint: ISkPaint = nil); - function IsEqual(const AFont: ISkFont): Boolean; - function MakeWithSize(const ASize: Single): ISkFont; - function MeasureText(const AText: string; const APaint: ISkPaint = nil): Single; overload; - function MeasureText(const AText: string; out ABounds: TRectF; const APaint: ISkPaint = nil): Single; overload; - function MeasureTextGlyphs(const AGlyphs: TArray; const APaint: ISkPaint = nil): Single; overload; - function MeasureTextGlyphs(const AGlyphs: TArray; out ABounds: TRectF; const APaint: ISkPaint = nil): Single; overload; - procedure SetBaselineSnap(const AValue: Boolean); - procedure SetEdging(const AValue: TSkFontEdging); - procedure SetEmbeddedBitmaps(const AValue: Boolean); - procedure SetEmbolden(const AValue: Boolean); - procedure SetForceAutoHinting(const AValue: Boolean); - procedure SetHinting(const AValue: TSkFontHinting); - procedure SetLinearMetrics(const AValue: Boolean); - procedure SetScaleX(const AValue: Single); - procedure SetSize(const AValue: Single); - procedure SetSkewX(const AValue: Single); - procedure SetSubpixel(const AValue: Boolean); - procedure SetTypeface(AValue: ISkTypeface); - function UnicharToGlyph(const AUnichar: Integer): Word; - function UnicharsToGlyphs(const AUnichars: TArray): TArray; - property BaselineSnap: Boolean read GetBaselineSnap write SetBaselineSnap; - property Edging: TSkFontEdging read GetEdging write SetEdging; - property EmbeddedBitmaps: Boolean read GetEmbeddedBitmaps write SetEmbeddedBitmaps; - property Embolden: Boolean read GetEmbolden write SetEmbolden; - property ForceAutoHinting: Boolean read GetForceAutoHinting write SetForceAutoHinting; - property Hinting: TSkFontHinting read GetHinting write SetHinting; - property LinearMetrics: Boolean read GetLinearMetrics write SetLinearMetrics; - property ScaleX: Single read GetScaleX write SetScaleX; - property Size: Single read GetSize write SetSize; - property SkewX: Single read GetSkewX write SetSkewX; - property Spacing: Single read GetSpacing; - property Subpixel: Boolean read GetSubpixel write SetSubpixel; - property Typeface: ISkTypeface read GetTypeface write SetTypeface; + { IGrDirectContext } + + IGrDirectContext = interface(ISkReferenceCounted) + ['{8B4304D7-385A-4165-ADE2-F052DAAA70D3}'] + procedure AbandonContext; + procedure DumpMemoryStatistics(const ATraceMemoryDump: ISkTraceMemoryDump); + procedure Flush; + procedure FlushAndSubmit(const ASyncCpu: Boolean = False); + procedure FreeGpuResources; + function GetBackendAPI: TGrBackendAPI; + function GetMaxSurfaceSampleCountForColorType(const AColorType: TSkColorType): Integer; + function GetResourceCacheLimit: NativeUInt; + procedure GetResourceCacheUsage(out AResources: Integer; out AResourcesBytes: NativeUInt); + function IsAbandoned: Boolean; + procedure PerformDeferredCleanup(const AMilliseconds: Int64); + procedure PurgeUnlockedResources(const AScratchResourcesOnly: Boolean); overload; + procedure PurgeUnlockedResources(const ABytesToPurge: NativeUInt; const APreferScratchResources: Boolean); overload; + procedure ReleaseResourcesAndAbandonContext; + procedure ResetContext; + procedure SetResourceCacheLimit(const AValue: NativeUInt); + function Submit(const ASyncCpu: Boolean = False): Boolean; + property BackendAPI: TGrBackendAPI read GetBackendAPI; + property ResourceCacheLimit: NativeUInt read GetResourceCacheLimit write SetResourceCacheLimit; end; - { TSkFont } + { TGrDirectContext } - TSkFont = class(TSkObject, ISkFont) + TGrDirectContext = class(TSkReferenceCounted, IGrDirectContext) strict private - class procedure path_proc(const path: sk_path_t; const matrix: psk_matrix_t; context: Pointer); cdecl; static; + procedure AbandonContext; + procedure DumpMemoryStatistics(const ATraceMemoryDump: ISkTraceMemoryDump); + procedure Flush; + procedure FlushAndSubmit(const ASyncCpu: Boolean = False); + procedure FreeGpuResources; + function GetBackendAPI: TGrBackendAPI; + function GetMaxSurfaceSampleCountForColorType(const AColorType: TSkColorType): Integer; + function GetResourceCacheLimit: NativeUInt; + procedure GetResourceCacheUsage(out AResources: Integer; out AResourcesBytes: NativeUInt); + function IsAbandoned: Boolean; + procedure PerformDeferredCleanup(const AMilliseconds: Int64); + procedure PurgeUnlockedResources(const AScratchResourcesOnly: Boolean); overload; + procedure PurgeUnlockedResources(const ABytesToPurge: NativeUInt; const APreferScratchResources: Boolean); overload; + procedure ReleaseResourcesAndAbandonContext; + procedure ResetContext; + procedure SetResourceCacheLimit(const AValue: NativeUInt); + function Submit(const ASyncCpu: Boolean = False): Boolean; + public + class function MakeGl(AInterface: IGrGlInterface = nil): IGrDirectContext; overload; static; + class function MakeGl(const AOptions: TGrContextOptions; const AInterface: IGrGlInterface = nil): IGrDirectContext; overload; static; + class function MakeMetal(const ABackendContext: TGrMtlBackendContext): IGrDirectContext; overload; static; + class function MakeMetal(const ABackendContext: TGrMtlBackendContext; const AOptions: TGrContextOptions): IGrDirectContext; overload; static; + class function MakeVulkan(const ABackendContext: TGrVkBackendContext): IGrDirectContext; overload; static; + class function MakeVulkan(const ABackendContext: TGrVkBackendContext; const AOptions: TGrContextOptions): IGrDirectContext; overload; static; + end; + + { IGrGlInterface } + + IGrGlInterface = interface(ISkReferenceCounted) + ['{77860D76-5A77-45FB-9F62-03C1DD694489}'] + function HasExtension(const AName: string): Boolean; + function Validate: Boolean; + end; + + { TGrGlInterface } + + TGrGlInterface = class(TSkReferenceCounted, IGrGlInterface) + strict private + function HasExtension(const AName: string): Boolean; + function Validate: Boolean; + public + class function MakeAssembled(const AProc: TGrGlGetProc): IGrGlInterface; static; + class function MakeAssembledGl(const AProc: TGrGlGetProc): IGrGlInterface; static; + class function MakeAssembledGles(const AProc: TGrGlGetProc): IGrGlInterface; static; + class function MakeAssembledWebGl(const AProc: TGrGlGetProc): IGrGlInterface; static; + class function MakeNative: IGrGlInterface; static; + end; + + { IGrPersistentCache } + + IGrPersistentCache = interface(ISkObject) + ['{AF624E98-7525-44E4-90EB-D6D21826011A}'] + end; + + { TGrPersistentCacheBaseClass } + + TGrPersistentCacheBaseClass = class abstract(TSkObject, IGrPersistentCache) + strict private + class constructor Create; + class function load_proc(context: Pointer; const key_data: Pointer; key_size: size_t): sk_data_t; cdecl; static; + class procedure store_proc(context: Pointer; const key_data: Pointer; key_size: size_t; const data: Pointer; size: size_t); cdecl; static; strict protected - function GetBaselineSnap: Boolean; - function GetBounds(const AGlyphs: TArray; const APaint: ISkPaint = nil): TArray; - function GetEdging: TSkFontEdging; - function GetEmbeddedBitmaps: Boolean; - function GetEmbolden: Boolean; - function GetForceAutoHinting: Boolean; - function GetGlyphs(const AText: string): TArray; - function GetHinting: TSkFontHinting; - function GetHorizontalPositions(const AGlyphs: TArray; const AOrigin: Single = 0): TArray; - function GetIntercepts(const AGlyphs: TArray; const APositions: TArray; const AUpperBounds, ALowerBounds: Single; const APaint: ISkPaint = nil): TArray; - function GetLinearMetrics: Boolean; - function GetMetrics(out AMetrics: TSkFontMetrics): Single; - function GetPath(const AGlyph: Word): ISkPath; - procedure GetPaths(const AGlyphs: TArray; const AProc: TSkFontPathProc); - function GetPositions(const AGlyphs: TArray): TArray; overload; - function GetPositions(const AGlyphs: TArray; const AOrigin: TPointF): TArray; overload; - function GetScaleX: Single; - function GetSize: Single; - function GetSkewX: Single; - function GetSpacing: Single; - function GetSubpixel: Boolean; - function GetTypeface: ISkTypeface; - function GetTypefaceOrDefault: ISkTypeface; - function GetWidths(const AGlyphs: TArray; const APaint: ISkPaint = nil): TArray; - procedure GetWidthsAndBounds(const AGlyphs: TArray; out AWidths: TArray; out ABounds: TArray; const APaint: ISkPaint = nil); - function IsEqual(const AFont: ISkFont): Boolean; - function MakeWithSize(const ASize: Single): ISkFont; - function MeasureText(const AText: string; const APaint: ISkPaint = nil): Single; overload; - function MeasureText(const AText: string; out ABounds: TRectF; const APaint: ISkPaint = nil): Single; overload; - function MeasureTextGlyphs(const AGlyphs: TArray; const APaint: ISkPaint = nil): Single; overload; - function MeasureTextGlyphs(const AGlyphs: TArray; out ABounds: TRectF; const APaint: ISkPaint = nil): Single; overload; - procedure SetBaselineSnap(const AValue: Boolean); - procedure SetEdging(const AValue: TSkFontEdging); - procedure SetEmbeddedBitmaps(const AValue: Boolean); - procedure SetEmbolden(const AValue: Boolean); - procedure SetForceAutoHinting(const AValue: Boolean); - procedure SetHinting(const AValue: TSkFontHinting); - procedure SetLinearMetrics(const AValue: Boolean); - procedure SetScaleX(const AValue: Single); - procedure SetSize(const AValue: Single); - procedure SetSkewX(const AValue: Single); - procedure SetSubpixel(const AValue: Boolean); - procedure SetTypeface(AValue: ISkTypeface); - function UnicharToGlyph(const AUnichar: Integer): Word; - function UnicharsToGlyphs(const AUnichars: TArray): TArray; + function Load(const AKey: TBytes): TBytes; virtual; abstract; + procedure Store(const AKey, AData: TBytes); virtual; abstract; public - constructor Create(ATypeface: ISkTypeface = nil; const ASize: Single = 12; const AScaleX: Single = 1; const ASkewX: Single = 0); overload; - constructor Create(const AFont: ISkFont); overload; - class procedure DestroyHandle(const AHandle: THandle); override; + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; end; - { TSkGraphics } + { IGrShaderErrorHandler } - TSkGraphics = record - class procedure AllowJIT; static; - class procedure DumpMemoryStatistics(const ATraceMemoryDump: ISkTraceMemoryDump); static; - class function GetFontCacheCountLimit: Integer; static; - class function GetFontCacheCountUsed: Integer; static; - class function GetFontCacheLimit: NativeUInt; static; - class function GetFontCacheUsed: NativeUInt; static; - class function GetResourceCacheSingleAllocationByteLimit: NativeUInt; static; - class function GetResourceCacheTotalByteLimit: NativeUInt; static; - class function GetResourceCacheTotalBytesUsed: NativeUInt; static; - class procedure Init; static; - class procedure PurgeAllCaches; static; - class procedure PurgeFontCache; static; - class procedure PurgeResourceCache; static; - class procedure SetFontCacheCountLimit(const AValue: Integer); static; - class procedure SetFontCacheLimit(const AValue: NativeUInt); static; - class procedure SetResourceCacheSingleAllocationByteLimit(const AValue: NativeUInt); static; - class procedure SetResourceCacheTotalByteLimit(const AValue: NativeUInt); static; - class property FontCacheCountLimit: Integer read GetFontCacheCountLimit write SetFontCacheCountLimit; - class property FontCacheCountUsed: Integer read GetFontCacheCountUsed; - class property FontCacheLimit: NativeUInt read GetFontCacheLimit write SetFontCacheLimit; - class property FontCacheUsed: NativeUInt read GetFontCacheUsed; - class property ResourceCacheSingleAllocationByteLimit: NativeUInt read GetResourceCacheSingleAllocationByteLimit write SetResourceCacheSingleAllocationByteLimit; - class property ResourceCacheTotalByteLimit: NativeUInt read GetResourceCacheTotalByteLimit write SetResourceCacheTotalByteLimit; - class property ResourceCacheTotalBytesUsed: NativeUInt read GetResourceCacheTotalBytesUsed; + IGrShaderErrorHandler = interface(ISkObject) + ['{7CCA8C48-CB40-4FBD-B70D-986BC2FC1D58}'] end; - { TSkEncodedImageFormatHelper } + { TGrShaderErrorHandlerBaseClass } - TSkEncodedImageFormatHelper = record helper for TSkEncodedImageFormat - class function FromExtension(const AExtension: string): TSkEncodedImageFormat; static; + TGrShaderErrorHandlerBaseClass = class abstract(TSkObject, IGrShaderErrorHandler) + strict private + class constructor Create; + class procedure compile_error_proc(context: Pointer; const shader, errors: MarshaledAString); cdecl; static; + strict protected + procedure CompileError(const AShader, AErrors: string); virtual; abstract; + public + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; end; - { TSkImageInfo } + { IGrVkExtensions } - TSkImageInfo = record - Width: Integer; - Height: Integer; - ColorType: TSkColorType; - AlphaType: TSkAlphaType; - ColorSpace: ISkColorSpace; - constructor Create(const AWidth, AHeight: Integer); overload; - constructor Create(const AWidth, AHeight: Integer; const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil); overload; - function ByteSize(const ARowBytes: NativeUInt): NativeUInt; - function BytesPerPixel: Integer; inline; - function IsEmpty: Boolean; - function IsOpaque: Boolean; - function IsValid: Boolean; - function IsValidRowBytes(const ARowBytes: NativeUInt): Boolean; - function MakeAlphaType(const AAlphaType: TSkAlphaType): TSkImageInfo; - function MakeColorSpace(AColorSpace: ISkColorSpace): TSkImageInfo; - function MakeColorType(const AColorType: TSkColorType): TSkImageInfo; - function MakeDimensions(const AWidth, AHeight: Integer): TSkImageInfo; - function MinByteSize: NativeUInt; - function MinRowBytes: NativeUInt; - function ShiftPerPixel: Integer; inline; - class operator Equal(const AImageInfo1, AImageInfo2: TSkImageInfo): Boolean; - class operator NotEqual(const AImageInfo1, AImageInfo2: TSkImageInfo): Boolean; + IGrVkExtensions = interface(ISkObject) + ['{A3F62993-F17A-4D8D-BA85-725AFE2ACDF4}'] + function HasExtension(const AName: string; const AMinVersion: Cardinal): Boolean; + procedure Init(const AProc: TGrVkGetProc; const AInstance: GrVkInstance; const APhysicalDevice: GrVkPhysicalDevice; const AInstanceExtensions, ADeviceExtensions: TArray); end; - TSkTileMode = (Clamp, &Repeat, Mirror, Decal); + { TGrVkExtensions } - ISkImageFilter = interface; + TGrVkExtensions = class(TSkObject, IGrVkExtensions) + strict private + function HasExtension(const AName: string; const AMinVersion: Cardinal): Boolean; + procedure Init(const AProc: TGrVkGetProc; const AInstance: GrVkInstance; const APhysicalDevice: GrVkPhysicalDevice; const AInstanceExtensions, ADeviceExtensions: TArray); + public + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; - ISkPixmap = interface; + {$HPPEMIT END '#define GrVkExtensions(...) __SkCreate(TGrVkExtensions, IGrVkExtensions, __VA_ARGS__)'} - TSkImageCachingHint = (Allow, Disallow); + { ISkBlender } - TGrSurfaceOrigin = (TopLeft, BottomLeft); + ISkBlender = interface(ISkReferenceCounted) + ['{78342141-22D6-4D38-A87D-38D70DE65A8C}'] + end; - TSkImageRasterReleaseProc = reference to procedure (const APixels: Pointer); + { TSkBlender } - TSkImageTextureReleaseProc = reference to procedure (); + TSkBlender = class(TSkReferenceCounted, ISkBlender) + public + class function MakeArithmetic(const AK1, AK2, AK3, AK4: Single; const AEnforcePremultipliedColor: Boolean): ISkBlender; static; + class function MakeMode(const AMode: TSkBlendMode): ISkBlender; static; + end; - { ISkImage } + { ISkCanvas } - ISkImage = interface(ISkReferenceCounted) - ['{5BA7E4F4-9A74-4025-8691-D4E6F1FE15D0}'] - function Encode(const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): TBytes; - function EncodeToFile(const AFileName: string; const AQuality: Integer = 80): Boolean; overload; - function EncodeToFile(const AFileName: string; const AEncodedImageFormat: TSkEncodedImageFormat; const AQuality: Integer = 80): Boolean; overload; - function EncodeToStream(const AStream: TStream; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): Boolean; - function GetAlphaType: TSkAlphaType; - function GetColorSpace: ISkColorSpace; - function GetColorType: TSkColorType; - function GetHeight: Integer; - function GetImageInfo: TSkImageInfo; - function GetUniqueId: NativeUInt; - function GetWidth: Integer; - function IsAlphaOnly: Boolean; - function IsLazyGenerated: Boolean; - function IsOpaque: Boolean; - function IsTextureBacked: Boolean; - function IsValid(AContext: IGrDirectContext = nil): Boolean; - function MakeBackendTexture(const AContext: IGrDirectContext): IGrBackendTexture; - function MakeNonTextureImage: ISkImage; - function MakeRasterImage: ISkImage; - function MakeRawShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeRawShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeRawShader(const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeRawShader(const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeShader(const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeShader(const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeSubset(const ASubset: TRect; AContext: IGrDirectContext = nil): ISkImage; - function MakeTextureImage(const AContext: IGrDirectContext; const AIsMipmapped: Boolean = False): ISkImage; - function MakeWithFilter(const AFilter: ISkImageFilter; const ASubset, AClipBounds: TRect; out AOutSubset: TRect; out AOffset: TPoint; AContext: IGrDirectContext = nil): ISkImage; - function PeekPixels: ISkPixmap; - function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow; AContext: IGrDirectContext = nil): Boolean; overload; - function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow; AContext: IGrDirectContext = nil): Boolean; overload; - function ScalePixels(const ADest: ISkPixmap; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; - function ScalePixels(const ADest: ISkPixmap; const ASampling: TSkSamplingOptions; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; - function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; - function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; - property AlphaType: TSkAlphaType read GetAlphaType; - property ColorSpace: ISkColorSpace read GetColorSpace; - property ColorType: TSkColorType read GetColorType; + ISkCanvas = interface(ISkObject) + ['{FC12079A-38A3-4078-88D7-30F550F1B49E}'] + procedure Clear(const AColor: TAlphaColor); overload; + procedure Clear(const AColor: TAlphaColorF); overload; + procedure Discard; + procedure ClipPath(const APath: ISkPath; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); + procedure ClipRect(const ARect: TRectF; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); + procedure ClipRegion(const ARegion: ISkRegion; const AOp: TSkClipOp = TSkClipOp.Intersect); + procedure ClipRoundRect(const ARoundRect: ISkRoundRect; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); + procedure ClipShader(const AShader: ISkShader; const AOp: TSkClipOp = TSkClipOp.Intersect); + procedure Concat(const AMatrix: TMatrix); overload; + procedure Concat(const AMatrix: TMatrix3D); overload; + procedure DrawAnnotation(const ARect: TRectF; const AKey: string); overload; + procedure DrawAnnotation(const ARect: TRectF; const AKey: string; const AValue; const ASize: NativeUInt); overload; + procedure DrawArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single; const AUseCenter: Boolean; const APaint: ISkPaint); + procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; + procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ASampling: TSkSamplingOptions; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; + procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ACullRect: TRectF; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; + procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ASampling: TSkSamplingOptions; const ACullRect: TRectF; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; + procedure DrawCircle(const ACenter: TPointF; ARadius: Single; const APaint: ISkPaint); overload; + procedure DrawCircle(const ACenterX, ACenterY, ARadius: Single; const APaint: ISkPaint); overload; + procedure DrawColor(const AColor: TAlphaColor; const ABlendMode: TSkBlendMode = TSkBlendMode.SrcOver); overload; + procedure DrawColor(const AColor: TAlphaColorF; const ABlendMode: TSkBlendMode = TSkBlendMode.SrcOver); overload; + procedure DrawGlyphs(const AGlyphs: TArray; const APositions: TArray; const AOrigin: TPointF; const AFont: ISkFont; const APaint: ISkPaint); overload; + procedure DrawGlyphs(const AGlyphs: TArray; const AMatrices: TArray; const AOrigin: TPointF; const AFont: ISkFont; const APaint: ISkPaint); overload; + procedure DrawImage(const AImage: ISkImage; const AX, AY: Single; const APaint: ISkPaint = nil); overload; + procedure DrawImage(const AImage: ISkImage; const AX, AY: Single; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil); overload; + procedure DrawImageLattice(const AImage: ISkImage; const ALattice: TSkLattice; const ADest: TRectF; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear; const APaint: ISkPaint = nil); + procedure DrawImageNine(const AImage: ISkImage; const ACenter: TRect; const ADest: TRectF; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear; const APaint: ISkPaint = nil); + procedure DrawImageRect(const AImage: ISkImage; const ADest: TRectF; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; + procedure DrawImageRect(const AImage: ISkImage; const ADest: TRectF; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; + procedure DrawImageRect(const AImage: ISkImage; const ASrc, ADest: TRectF; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; + procedure DrawImageRect(const AImage: ISkImage; const ASrc, ADest: TRectF; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; + procedure DrawLine(const APoint1, APoint2: TPointF; const APaint: ISkPaint); overload; + procedure DrawLine(const AX1, AY1, AX2, AY2: Single; const APaint: ISkPaint); overload; + procedure DrawOval(const AOval: TRectF; const APaint: ISkPaint); + procedure DrawPaint(const APaint: ISkPaint); + procedure DrawPatch(const ACubics: TSkPatchCubics; const AColors: TSkPatchColors; const ATexCoords: TSkPatchTexCoords; const ABlendMode: TSkBlendMode; const APaint: ISkPaint); + procedure DrawPath(const APath: ISkPath; const APaint: ISkPaint); + procedure DrawPicture(const APicture: ISkPicture; const APaint: ISkPaint = nil); overload; + procedure DrawPicture(const APicture: ISkPicture; const AMatrix: TMatrix; const APaint: ISkPaint = nil); overload; + procedure DrawPoint(const APoint: TPointF; const APaint: ISkPaint); overload; + procedure DrawPoint(const AX, AY: Single; const APaint: ISkPaint); overload; + procedure DrawPoints(const AMode: TSkDrawPointsMode; const APoints: TArray; const APaint: ISkPaint); + procedure DrawRect(const ARect: TRectF; const APaint: ISkPaint); + procedure DrawRegion(const ARegion: ISkRegion; const APaint: ISkPaint); + procedure DrawRoundRect(const ARoundRect: ISkRoundRect; const APaint: ISkPaint); overload; + procedure DrawRoundRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single; const APaint: ISkPaint); overload; + procedure DrawRoundRectDifference(const AOuter, AInner: ISkRoundRect; const APaint: ISkPaint); overload; + procedure DrawSimpleText(const AText: string; const AX, AY: Single; const AFont: ISkFont; const APaint: ISkPaint); + procedure DrawSimpleTextGlyphs(const AGlyphs: TArray; const AX, AY: Single; const AFont: ISkFont; const APaint: ISkPaint); + procedure DrawTextBlob(const ATextBlob: ISkTextBlob; const AX, AY: Single; const APaint: ISkPaint); overload; + procedure DrawVertices(const AVertices: ISkVertices; const ABlendMode: TSkBlendMode; const APaint: ISkPaint); + function GetBaseProperties: TSkSurfaceProperties; + function GetDeviceClipBounds: TRect; + function GetLocalClipBounds: TRectF; + function GetLocalToDevice: TMatrix3D; + function GetLocalToDeviceAs3x3: TMatrix; + function GetSaveCount: Integer; + function GetTopProperties: TSkSurfaceProperties; + function MakeSurface(const AImageInfo: TSkImageInfo): ISkSurface; overload; + function MakeSurface(const AImageInfo: TSkImageInfo; const AProperties: TSkSurfaceProperties): ISkSurface; overload; + function QuickReject(const ARect: TRectF): Boolean; overload; + function QuickReject(const APath: ISkPath): Boolean; overload; + procedure ResetMatrix; + procedure Restore; + procedure RestoreToCount(const ASaveCount: Integer); + procedure Rotate(const ADegrees: Single); overload; + procedure Rotate(const ADegrees, APX, APY: Single); overload; + procedure RotateRadians(const ARadians: Single); + function Save: Integer; + procedure SaveLayer(const APaint: ISkPaint = nil); overload; + procedure SaveLayer(const ABounds: TRectF; const APaint: ISkPaint = nil); overload; + procedure SaveLayerAlpha(const AAlpha: Byte); overload; + procedure SaveLayerAlpha(const ABounds: TRectF; const AAlpha: Byte); overload; + procedure Scale(const AScaleX, AScaleY: Single); + procedure SetMatrix(const AMatrix: TMatrix); overload; + procedure SetMatrix(const AMatrix: TMatrix3D); overload; + procedure Skew(const ASkewX, ASkewY: Single); + procedure Translate(const ADeltaX, ADeltaY: Single); + property BaseProperties: TSkSurfaceProperties read GetBaseProperties; + property TopProperties: TSkSurfaceProperties read GetTopProperties; + end; + + { TSkCanvas } + + TSkCanvas = class(TSkObject, ISkCanvas) + strict private + procedure Clear(const AColor: TAlphaColor); overload; + procedure Clear(const AColor: TAlphaColorF); overload; + procedure Discard; + procedure ClipPath(const APath: ISkPath; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); + procedure ClipRect(const ARect: TRectF; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); + procedure ClipRegion(const ARegion: ISkRegion; const AOp: TSkClipOp = TSkClipOp.Intersect); + procedure ClipRoundRect(const ARoundRect: ISkRoundRect; const AOp: TSkClipOp = TSkClipOp.Intersect; const AAntiAlias: Boolean = False); + procedure ClipShader(const AShader: ISkShader; const AOp: TSkClipOp = TSkClipOp.Intersect); + procedure Concat(const AMatrix: TMatrix); overload; + procedure Concat(const AMatrix: TMatrix3D); overload; + procedure DrawAnnotation(const ARect: TRectF; const AKey: string); overload; + procedure DrawAnnotation(const ARect: TRectF; const AKey: string; const AValue; const ASize: NativeUInt); overload; + procedure DrawArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single; const AUseCenter: Boolean; const APaint: ISkPaint); + procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; + procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ASampling: TSkSamplingOptions; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; + procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ACullRect: TRectF; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; + procedure DrawAtlas(const AAtlas: ISkImage; const ATansforms: TArray; const ASprites: TArray; const ABlendMode: TSkBlendMode; const ASampling: TSkSamplingOptions; const ACullRect: TRectF; const AColors: TArray = nil; const APaint: ISkPaint = nil); overload; + procedure DrawCircle(const ACenter: TPointF; ARadius: Single; const APaint: ISkPaint); overload; + procedure DrawCircle(const ACenterX, ACenterY, ARadius: Single; const APaint: ISkPaint); overload; + procedure DrawColor(const AColor: TAlphaColor; const ABlendMode: TSkBlendMode = TSkBlendMode.SrcOver); overload; + procedure DrawColor(const AColor: TAlphaColorF; const ABlendMode: TSkBlendMode = TSkBlendMode.SrcOver); overload; + procedure DrawGlyphs(const AGlyphs: TArray; const APositions: TArray; const AOrigin: TPointF; const AFont: ISkFont; const APaint: ISkPaint); overload; + procedure DrawGlyphs(const AGlyphs: TArray; const AMatrices: TArray; const AOrigin: TPointF; const AFont: ISkFont; const APaint: ISkPaint); overload; + procedure DrawImage(const AImage: ISkImage; const AX, AY: Single; const APaint: ISkPaint = nil); overload; + procedure DrawImage(const AImage: ISkImage; const AX, AY: Single; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil); overload; + procedure DrawImageLattice(const AImage: ISkImage; const ALattice: TSkLattice; const ADest: TRectF; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear; const APaint: ISkPaint = nil); + procedure DrawImageNine(const AImage: ISkImage; const ACenter: TRect; const ADest: TRectF; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear; const APaint: ISkPaint = nil); + procedure DrawImageRect(const AImage: ISkImage; const ADest: TRectF; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; + procedure DrawImageRect(const AImage: ISkImage; const ADest: TRectF; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; + procedure DrawImageRect(const AImage: ISkImage; const ASrc, ADest: TRectF; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; + procedure DrawImageRect(const AImage: ISkImage; const ASrc, ADest: TRectF; const ASampling: TSkSamplingOptions; const APaint: ISkPaint = nil; const AConstraint: TSkSrcRectConstraint = TSkSrcRectConstraint.Fast); overload; + procedure DrawLine(const APoint1, APoint2: TPointF; const APaint: ISkPaint); overload; + procedure DrawLine(const AX1, AY1, AX2, AY2: Single; const APaint: ISkPaint); overload; + procedure DrawOval(const AOval: TRectF; const APaint: ISkPaint); + procedure DrawPaint(const APaint: ISkPaint); + procedure DrawPatch(const ACubics: TSkPatchCubics; const AColors: TSkPatchColors; const ATexCoords: TSkPatchTexCoords; const ABlendMode: TSkBlendMode; const APaint: ISkPaint); + procedure DrawPath(const APath: ISkPath; const APaint: ISkPaint); + procedure DrawPicture(const APicture: ISkPicture; const APaint: ISkPaint = nil); overload; + procedure DrawPicture(const APicture: ISkPicture; const AMatrix: TMatrix; const APaint: ISkPaint = nil); overload; + procedure DrawPoint(const APoint: TPointF; const APaint: ISkPaint); overload; + procedure DrawPoint(const AX, AY: Single; const APaint: ISkPaint); overload; + procedure DrawPoints(const AMode: TSkDrawPointsMode; const APoints: TArray; const APaint: ISkPaint); + procedure DrawRect(const ARect: TRectF; const APaint: ISkPaint); + procedure DrawRegion(const ARegion: ISkRegion; const APaint: ISkPaint); + procedure DrawRoundRect(const ARoundRect: ISkRoundRect; const APaint: ISkPaint); overload; + procedure DrawRoundRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single; const APaint: ISkPaint); overload; + procedure DrawRoundRectDifference(const AOuter, AInner: ISkRoundRect; const APaint: ISkPaint); overload; + procedure DrawSimpleText(const AText: string; const AX, AY: Single; const AFont: ISkFont; const APaint: ISkPaint); + procedure DrawSimpleTextGlyphs(const AGlyphs: TArray; const AX, AY: Single; const AFont: ISkFont; const APaint: ISkPaint); + procedure DrawTextBlob(const ATextBlob: ISkTextBlob; const AX, AY: Single; const APaint: ISkPaint); overload; + procedure DrawVertices(const AVertices: ISkVertices; const ABlendMode: TSkBlendMode; const APaint: ISkPaint); + function GetBaseProperties: TSkSurfaceProperties; + function GetDeviceClipBounds: TRect; + function GetLocalClipBounds: TRectF; + function GetLocalToDevice: TMatrix3D; + function GetLocalToDeviceAs3x3: TMatrix; + function GetSaveCount: Integer; + function GetTopProperties: TSkSurfaceProperties; + function MakeSurface(const AImageInfo: TSkImageInfo): ISkSurface; overload; + function MakeSurface(const AImageInfo: TSkImageInfo; const AProperties: TSkSurfaceProperties): ISkSurface; overload; + function QuickReject(const ARect: TRectF): Boolean; overload; + function QuickReject(const APath: ISkPath): Boolean; overload; + procedure ResetMatrix; + procedure Restore; + procedure RestoreToCount(const ASaveCount: Integer); + procedure Rotate(const ADegrees: Single); overload; + procedure Rotate(const ADegrees, APX, APY: Single); overload; + procedure RotateRadians(const ARadians: Single); + function Save: Integer; + procedure SaveLayer(const APaint: ISkPaint = nil); overload; + procedure SaveLayer(const ABounds: TRectF; const APaint: ISkPaint = nil); overload; + procedure SaveLayerAlpha(const AAlpha: Byte); overload; + procedure SaveLayerAlpha(const ABounds: TRectF; const AAlpha: Byte); overload; + procedure Scale(const AScaleX, AScaleY: Single); + procedure SetMatrix(const AMatrix: TMatrix); overload; + procedure SetMatrix(const AMatrix: TMatrix3D); overload; + procedure Skew(const ASkewX, ASkewY: Single); + procedure Translate(const ADeltaX, ADeltaY: Single); + public + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + { ISkCodec } + + ISkCodec = interface(ISkObject) + ['{7FE13F05-959F-462B-8001-0DE5A0878CD8}'] + function GetDimensions: TSize; + function GetEncodedImageFormat: TSkEncodedImageFormat; + function GetHeight: Integer; + function GetImage(const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil): ISkImage; + function GetPixels(const APixels: Pointer; const ARowBytes: NativeUInt; const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil): Boolean; + function GetWidth: Integer; + property Dimensions: TSize read GetDimensions; + property EncodedImageFormat: TSkEncodedImageFormat read GetEncodedImageFormat; property Height: Integer read GetHeight; - property ImageInfo: TSkImageInfo read GetImageInfo; - property UniqueId: NativeUInt read GetUniqueId; property Width: Integer read GetWidth; end; - { TSkImage } + { TSkCodec } - TSkImage = class(TSkReferenceCounted, ISkImage) + TSkCodec = class(TSkObject, ISkCodec) strict private - class procedure raster_release_proc(const pixels: Pointer; context: Pointer); cdecl; static; - class procedure texture_release_proc(context: Pointer); cdecl; static; - strict protected - function Encode(const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): TBytes; - function EncodeToFile(const AFileName: string; const AQuality: Integer = 80): Boolean; overload; - function EncodeToFile(const AFileName: string; const AEncodedImageFormat: TSkEncodedImageFormat; const AQuality: Integer = 80): Boolean; overload; - function EncodeToStream(const AStream: TStream; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): Boolean; - function GetAlphaType: TSkAlphaType; - function GetColorSpace: ISkColorSpace; - function GetColorType: TSkColorType; + function GetDimensions: TSize; + function GetEncodedImageFormat: TSkEncodedImageFormat; function GetHeight: Integer; - function GetImageInfo: TSkImageInfo; - function GetUniqueId: NativeUInt; + function GetImage(const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil): ISkImage; + function GetPixels(const APixels: Pointer; const ARowBytes: NativeUInt; const AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil): Boolean; function GetWidth: Integer; - function IsAlphaOnly: Boolean; - function IsLazyGenerated: Boolean; - function IsOpaque: Boolean; - function IsTextureBacked: Boolean; - function IsValid(AContext: IGrDirectContext = nil): Boolean; - function MakeBackendTexture(const AContext: IGrDirectContext): IGrBackendTexture; - function MakeNonTextureImage: ISkImage; - function MakeRasterImage: ISkImage; - function MakeRawShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeRawShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeRawShader(const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeRawShader(const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeShader(const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeShader(const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - function MakeSubset(const ASubset: TRect; AContext: IGrDirectContext = nil): ISkImage; - function MakeTextureImage(const AContext: IGrDirectContext; const AIsMipmapped: Boolean = False): ISkImage; - function MakeWithFilter(const AFilter: ISkImageFilter; const ASubset, AClipBounds: TRect; out AOutSubset: TRect; out AOffset: TPoint; AContext: IGrDirectContext = nil): ISkImage; - function PeekPixels: ISkPixmap; - function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow; AContext: IGrDirectContext = nil): Boolean; overload; - function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow; AContext: IGrDirectContext = nil): Boolean; overload; - function ScalePixels(const ADest: ISkPixmap; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; - function ScalePixels(const ADest: ISkPixmap; const ASampling: TSkSamplingOptions; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; - function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; - function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; public - class function MakeFromAdoptedTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; const AColorSpace: ISkColorSpace = nil): ISkImage; static; - class function MakeFromEncoded(const ABytes: TBytes): ISkImage; overload; static; - class function MakeFromEncodedFile(const AFileName: string): ISkImage; overload; static; - class function MakeFromEncodedStream(const AStream: TStream): ISkImage; overload; static; - class function MakeFromRaster(const APixmap: ISkPixmap; const ARasterReleaseProc: TSkImageRasterReleaseProc = nil): ISkImage; overload; static; - class function MakeFromRaster(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt; const ARasterReleaseProc: TSkImageRasterReleaseProc = nil): ISkImage; overload; static; inline; - class function MakeFromTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; const AColorSpace: ISkColorSpace = nil; const ATextureReleaseProc: TSkImageTextureReleaseProc = nil): ISkImage; static; - class function MakeRasterCopy(const APixmap: ISkPixmap): ISkImage; overload; static; - class function MakeRasterCopy(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt): ISkImage; overload; static; inline; + class function MakeFromFile(const AFileName: string): ISkCodec; static; + class function MakeFromStream(const AStream: TStream): ISkCodec; static; + class function MakeWithCopy(const AData: Pointer; const ASize: NativeUInt): ISkCodec; static; + class function MakeWithoutCopy(const AData: Pointer; const ASize: NativeUInt): ISkCodec; static; + class procedure __DestroyHandle(const AHandle: THandle); override; end; - { TSkImageEncoder } + { ISkAnimationCodecPlayer } - TSkImageEncoder = record - class function Encode(const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): TBytes; overload; static; - class function Encode(const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): TBytes; overload; static; inline; - class function EncodeToFile(const AFileName: string; const ASrc: ISkPixmap; const AQuality: Integer = 80): Boolean; overload; static; - class function EncodeToFile(const AFileName: string; const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat; const AQuality: Integer = 80): Boolean; overload; static; - class function EncodeToFile(const AFileName: string; const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; const AQuality: Integer = 80): Boolean; overload; static; - class function EncodeToFile(const AFileName: string; const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; const AEncodedImageFormat: TSkEncodedImageFormat; const AQuality: Integer = 80): Boolean; overload; static; inline; - class function EncodeToStream(const AStream: TStream; const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): Boolean; overload; static; - class function EncodeToStream(const AStream: TStream; const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): Boolean; overload; static; inline; + ISkAnimationCodecPlayer = interface(ISkObject) + ['{F900E95B-3B21-4CA1-B2BC-B6D060A2773D}'] + function GetDimensions: TSize; + function GetDuration: Cardinal; + function GetFrame: ISkImage; + function GetHeight: Integer; + function GetWidth: Integer; + function Seek(const AMilliseconds: Cardinal): Boolean; + property Dimensions: TSize read GetDimensions; + property Duration: Cardinal read GetDuration; + property Frame: ISkImage read GetFrame; + property Height: Integer read GetHeight; + property Width: Integer read GetWidth; + end; + + { TSkAnimationCodecPlayer } + + TSkAnimationCodecPlayer = class(TSkObject, ISkAnimationCodecPlayer) + strict private + function GetDimensions: TSize; + function GetDuration: Cardinal; + function GetFrame: ISkImage; + function GetHeight: Integer; + function GetWidth: Integer; + function Seek(const AMilliseconds: Cardinal): Boolean; + public + class function MakeFromFile(const AFileName: string): ISkAnimationCodecPlayer; static; + class function MakeFromStream(const AStream: TStream): ISkAnimationCodecPlayer; static; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + { ISkColorFilter } + + ISkColorFilter = interface(ISkReferenceCounted) + ['{A7F1A527-A796-4387-8957-5D5C2DAB0924}'] + end; + + { TSkColorFilter } + + TSkColorFilter = class(TSkReferenceCounted, ISkColorFilter) + public + class function MakeBlend(const AColor: TAlphaColor; const AMode: TSkBlendMode): ISkColorFilter; overload; static; + class function MakeBlend(const AColor: TAlphaColorF; AColorSpace: ISkColorSpace; const AMode: TSkBlendMode): ISkColorFilter; overload; static; + class function MakeCompose(const AOuter, AInner: ISkColorFilter): ISkColorFilter; static; + class function MakeHighContrast(const AConfig: TSkHighContrastConfig): ISkColorFilter; static; + class function MakeHSLAMatrix(const AMatrix: TSkColorMatrix): ISkColorFilter; static; + class function MakeLighting(const AMultiply, AAdd: TAlphaColor): ISkColorFilter; static; + class function MakeLinearToSRGBGamma: ISkColorFilter; + class function MakeLumaColor: ISkColorFilter; static; + class function MakeMatrix(const AMatrix: TSkColorMatrix): ISkColorFilter; static; + class function MakeOverdraw(const AColors: TSkOverdrawColor): ISkColorFilter; static; + class function MakeTable(const ATable: TSkTableFilter): ISkColorFilter; overload; static; + class function MakeTable(const ATableA, ATableR, ATableG, ATableB: TSkTableFilter): ISkColorFilter; overload; static; + end; + + { ISkColorSpace } + + ISkColorSpace = interface(ISkNonVirtualReferenceCounted) + ['{0581D967-BDFC-4F6D-A821-D0BFA2DCCBAC}'] + function GammaCloseToSRGB: Boolean; + function GammaIsLinear: Boolean; + function IsEqual(const AColorSpace: ISkColorSpace): Boolean; + function IsNumericalTransferFunction(out ATransferFunction: TSkColorSpaceTransferFunction): Boolean; + function IsSRGB: Boolean; + function MakeLinearGamma: ISkColorSpace; + function MakeSRGBGamma: ISkColorSpace; + function ToProfile: ISkColorSpaceICCProfile; + function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; + end; + + { TSkColorSpace } + + TSkColorSpace = class(TSkNonVirtualReferenceCounted, ISkColorSpace) + strict private + function GammaCloseToSRGB: Boolean; + function GammaIsLinear: Boolean; + function IsEqual(const AColorSpace: ISkColorSpace): Boolean; + function IsNumericalTransferFunction(out ATransferFunction: TSkColorSpaceTransferFunction): Boolean; + function IsSRGB: Boolean; + function MakeLinearGamma: ISkColorSpace; + function MakeSRGBGamma: ISkColorSpace; + function ToProfile: ISkColorSpaceICCProfile; + function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; + public + class function Make(const AProfile: ISkColorSpaceICCProfile): ISkColorSpace; static; + class function MakeRGB(const ATransferFunction: TSkColorSpaceTransferFunction; const AToXyzD50: TSkColorSpaceXyz): ISkColorSpace; static; + class function MakeSRGB: ISkColorSpace; static; + class function MakeSRGBLinear: ISkColorSpace; static; + class procedure __RefHandle(const AHandle: THandle); override; + class procedure __UnrefHandle(const AHandle: THandle); override; + end; + + { ISkColorSpaceICCProfile } + + ISkColorSpaceICCProfile = interface(ISkObject) + ['{F5645A9F-F9AE-4B59-BA03-931E56B32422}'] + function ToBytes: TBytes; + function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; + end; + + { TSkColorSpaceICCProfile } + + TSkColorSpaceICCProfile = class(TSkObject, ISkColorSpaceICCProfile) + strict private + function ToBytes: TBytes; + function ToXyz(out ADest: TSkColorSpaceXyz): Boolean; + public + class function MakeFromBytes(const ABytes: TBytes): ISkColorSpaceICCProfile; static; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + { ISkDocument } + + ISkDocument = interface(ISkReferenceCounted) + ['{E41A23F2-F67A-487A-9830-21908617EC48}'] + function BeginPage(const AWidth, AHeight: Single): ISkCanvas; overload; + function BeginPage(const AWidth, AHeight: Single; const AContent: TRectF): ISkCanvas; overload; + procedure Close; + procedure EndPage; + procedure Terminate; + end; + + { TSkDocument } + + TSkDocument = class(TSkReferenceCounted, ISkDocument) + strict private + FHolder: ISkObject; + function BeginPage(const AWidth, AHeight: Single): ISkCanvas; overload; + function BeginPage(const AWidth, AHeight: Single; const AContent: TRectF): ISkCanvas; overload; + procedure Close; + procedure EndPage; + procedure Terminate; + public + class function MakePDF(const AStream: TStream): ISkDocument; overload; + class function MakePDF(const AStream: TStream; const AMetadata: TSkPDFMetadata): ISkDocument; overload; + class function MakeXPS(const AStream: TStream; const ADPI: Single = 72): ISkDocument; + end; + + { ISkFont } + + ISkFont = interface(ISkObject) + ['{034205CA-029A-428B-9037-45CBF160C3F1}'] + function GetBaselineSnap: Boolean; + function GetBounds(const AGlyphs: TArray; const APaint: ISkPaint = nil): TArray; + function GetEdging: TSkFontEdging; + function GetEmbeddedBitmaps: Boolean; + function GetEmbolden: Boolean; + function GetForceAutoHinting: Boolean; + function GetGlyphs(const AText: string): TArray; + function GetHinting: TSkFontHinting; + function GetHorizontalPositions(const AGlyphs: TArray; const AOrigin: Single = 0): TArray; + function GetIntercepts(const AGlyphs: TArray; const APositions: TArray; const AUpperBounds, ALowerBounds: Single; const APaint: ISkPaint = nil): TArray; + function GetLinearMetrics: Boolean; + function GetMetrics(out AMetrics: TSkFontMetrics): Single; + function GetPath(const AGlyph: Word): ISkPath; + procedure GetPaths(const AGlyphs: TArray; const AProc: TSkFontPathProc); + function GetPositions(const AGlyphs: TArray): TArray; overload; + function GetPositions(const AGlyphs: TArray; const AOrigin: TPointF): TArray; overload; + function GetScaleX: Single; + function GetSize: Single; + function GetSkewX: Single; + function GetSpacing: Single; + function GetSubpixel: Boolean; + function GetTypeface: ISkTypeface; + function GetTypefaceOrDefault: ISkTypeface; + function GetWidths(const AGlyphs: TArray; const APaint: ISkPaint = nil): TArray; + procedure GetWidthsAndBounds(const AGlyphs: TArray; out AWidths: TArray; out ABounds: TArray; const APaint: ISkPaint = nil); + function IsEqual(const AFont: ISkFont): Boolean; + function MakeWithSize(const ASize: Single): ISkFont; + function MeasureText(const AText: string; const APaint: ISkPaint = nil): Single; overload; + function MeasureText(const AText: string; out ABounds: TRectF; const APaint: ISkPaint = nil): Single; overload; + function MeasureTextGlyphs(const AGlyphs: TArray; const APaint: ISkPaint = nil): Single; overload; + function MeasureTextGlyphs(const AGlyphs: TArray; out ABounds: TRectF; const APaint: ISkPaint = nil): Single; overload; + procedure SetBaselineSnap(const AValue: Boolean); + procedure SetEdging(const AValue: TSkFontEdging); + procedure SetEmbeddedBitmaps(const AValue: Boolean); + procedure SetEmbolden(const AValue: Boolean); + procedure SetForceAutoHinting(const AValue: Boolean); + procedure SetHinting(const AValue: TSkFontHinting); + procedure SetLinearMetrics(const AValue: Boolean); + procedure SetScaleX(const AValue: Single); + procedure SetSize(const AValue: Single); + procedure SetSkewX(const AValue: Single); + procedure SetSubpixel(const AValue: Boolean); + procedure SetTypeface(AValue: ISkTypeface); + function UnicharToGlyph(const AUnichar: Integer): Word; + function UnicharsToGlyphs(const AUnichars: TArray): TArray; + property BaselineSnap: Boolean read GetBaselineSnap write SetBaselineSnap; + property Edging: TSkFontEdging read GetEdging write SetEdging; + property EmbeddedBitmaps: Boolean read GetEmbeddedBitmaps write SetEmbeddedBitmaps; + property Embolden: Boolean read GetEmbolden write SetEmbolden; + property ForceAutoHinting: Boolean read GetForceAutoHinting write SetForceAutoHinting; + property Hinting: TSkFontHinting read GetHinting write SetHinting; + property LinearMetrics: Boolean read GetLinearMetrics write SetLinearMetrics; + property ScaleX: Single read GetScaleX write SetScaleX; + property Size: Single read GetSize write SetSize; + property SkewX: Single read GetSkewX write SetSkewX; + property Spacing: Single read GetSpacing; + property Subpixel: Boolean read GetSubpixel write SetSubpixel; + property Typeface: ISkTypeface read GetTypeface write SetTypeface; + end; + + { TSkFont } + + TSkFont = class(TSkObject, ISkFont) + strict private + function GetBaselineSnap: Boolean; + function GetBounds(const AGlyphs: TArray; const APaint: ISkPaint = nil): TArray; + function GetEdging: TSkFontEdging; + function GetEmbeddedBitmaps: Boolean; + function GetEmbolden: Boolean; + function GetForceAutoHinting: Boolean; + function GetGlyphs(const AText: string): TArray; + function GetHinting: TSkFontHinting; + function GetHorizontalPositions(const AGlyphs: TArray; const AOrigin: Single = 0): TArray; + function GetIntercepts(const AGlyphs: TArray; const APositions: TArray; const AUpperBounds, ALowerBounds: Single; const APaint: ISkPaint = nil): TArray; + function GetLinearMetrics: Boolean; + function GetMetrics(out AMetrics: TSkFontMetrics): Single; + function GetPath(const AGlyph: Word): ISkPath; + procedure GetPaths(const AGlyphs: TArray; const AProc: TSkFontPathProc); + function GetPositions(const AGlyphs: TArray): TArray; overload; + function GetPositions(const AGlyphs: TArray; const AOrigin: TPointF): TArray; overload; + function GetScaleX: Single; + function GetSize: Single; + function GetSkewX: Single; + function GetSpacing: Single; + function GetSubpixel: Boolean; + function GetTypeface: ISkTypeface; + function GetTypefaceOrDefault: ISkTypeface; + function GetWidths(const AGlyphs: TArray; const APaint: ISkPaint = nil): TArray; + procedure GetWidthsAndBounds(const AGlyphs: TArray; out AWidths: TArray; out ABounds: TArray; const APaint: ISkPaint = nil); + function IsEqual(const AFont: ISkFont): Boolean; + function MakeWithSize(const ASize: Single): ISkFont; + function MeasureText(const AText: string; const APaint: ISkPaint = nil): Single; overload; + function MeasureText(const AText: string; out ABounds: TRectF; const APaint: ISkPaint = nil): Single; overload; + function MeasureTextGlyphs(const AGlyphs: TArray; const APaint: ISkPaint = nil): Single; overload; + function MeasureTextGlyphs(const AGlyphs: TArray; out ABounds: TRectF; const APaint: ISkPaint = nil): Single; overload; + procedure SetBaselineSnap(const AValue: Boolean); + procedure SetEdging(const AValue: TSkFontEdging); + procedure SetEmbeddedBitmaps(const AValue: Boolean); + procedure SetEmbolden(const AValue: Boolean); + procedure SetForceAutoHinting(const AValue: Boolean); + procedure SetHinting(const AValue: TSkFontHinting); + procedure SetLinearMetrics(const AValue: Boolean); + procedure SetScaleX(const AValue: Single); + procedure SetSize(const AValue: Single); + procedure SetSkewX(const AValue: Single); + procedure SetSubpixel(const AValue: Boolean); + procedure SetTypeface(AValue: ISkTypeface); + function UnicharToGlyph(const AUnichar: Integer): Word; + function UnicharsToGlyphs(const AUnichars: TArray): TArray; + class procedure path_proc(const path: sk_path_t; const matrix: psk_matrix_t; context: Pointer); cdecl; static; + public + constructor Create(ATypeface: ISkTypeface = nil; const ASize: Single = 12; const AScaleX: Single = 1; const ASkewX: Single = 0); overload; + constructor Create(const AFont: ISkFont); overload; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkFont(...) __SkCreate(TSkFont, ISkFont, __VA_ARGS__)'} + + { ISkImage } + + ISkImage = interface(ISkReferenceCounted) + ['{E10DF07F-583F-4700-B14F-4DA7433FFB0F}'] + function Encode(const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): TBytes; + function EncodeToFile(const AFileName: string; const AQuality: Integer = 80): Boolean; overload; + function EncodeToFile(const AFileName: string; const AEncodedImageFormat: TSkEncodedImageFormat; const AQuality: Integer = 80): Boolean; overload; + function EncodeToStream(const AStream: TStream; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): Boolean; + function GetAlphaType: TSkAlphaType; + function GetColorSpace: ISkColorSpace; + function GetColorType: TSkColorType; + function GetHeight: Integer; + function GetImageInfo: TSkImageInfo; + function GetUniqueId: NativeUInt; + function GetWidth: Integer; + function IsAlphaOnly: Boolean; + function IsLazyGenerated: Boolean; + function IsOpaque: Boolean; + function IsTextureBacked: Boolean; + function IsValid(AContext: IGrDirectContext = nil): Boolean; + function MakeNonTextureImage: ISkImage; + function MakeRasterImage: ISkImage; + function MakeRawShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeRawShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeRawShader(const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeRawShader(const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeShader(const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeShader(const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeSubset(const ASubset: TRect; AContext: IGrDirectContext = nil): ISkImage; + function MakeTextureImage(const AContext: IGrDirectContext; const AIsMipmapped: Boolean = False): ISkImage; + function MakeWithFilter(const AFilter: ISkImageFilter; const ASubset, AClipBounds: TRect; out AOutSubset: TRect; out AOffset: TPoint; AContext: IGrDirectContext = nil): ISkImage; + function PeekPixels: ISkPixmap; + function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow; AContext: IGrDirectContext = nil): Boolean; overload; + function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow; AContext: IGrDirectContext = nil): Boolean; overload; + function ScalePixels(const ADest: ISkPixmap; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; + function ScalePixels(const ADest: ISkPixmap; const ASampling: TSkSamplingOptions; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; + function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; + function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; + property AlphaType: TSkAlphaType read GetAlphaType; + property ColorSpace: ISkColorSpace read GetColorSpace; + property ColorType: TSkColorType read GetColorType; + property Height: Integer read GetHeight; + property ImageInfo: TSkImageInfo read GetImageInfo; + property UniqueId: NativeUInt read GetUniqueId; + property Width: Integer read GetWidth; + end; + + { TSkImage } + + TSkImage = class(TSkReferenceCounted, ISkImage) + strict private + function Encode(const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): TBytes; + function EncodeToFile(const AFileName: string; const AQuality: Integer = 80): Boolean; overload; + function EncodeToFile(const AFileName: string; const AEncodedImageFormat: TSkEncodedImageFormat; const AQuality: Integer = 80): Boolean; overload; + function EncodeToStream(const AStream: TStream; const AEncodedImageFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG; const AQuality: Integer = 80): Boolean; + function GetAlphaType: TSkAlphaType; + function GetColorSpace: ISkColorSpace; + function GetColorType: TSkColorType; + function GetHeight: Integer; + function GetImageInfo: TSkImageInfo; + function GetUniqueId: NativeUInt; + function GetWidth: Integer; + function IsAlphaOnly: Boolean; + function IsLazyGenerated: Boolean; + function IsOpaque: Boolean; + function IsTextureBacked: Boolean; + function IsValid(AContext: IGrDirectContext = nil): Boolean; + function MakeNonTextureImage: ISkImage; + function MakeRasterImage: ISkImage; + function MakeRawShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeRawShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeRawShader(const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeRawShader(const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeShader(const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeShader(const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + function MakeSubset(const ASubset: TRect; AContext: IGrDirectContext = nil): ISkImage; + function MakeTextureImage(const AContext: IGrDirectContext; const AIsMipmapped: Boolean = False): ISkImage; + function MakeWithFilter(const AFilter: ISkImageFilter; const ASubset, AClipBounds: TRect; out AOutSubset: TRect; out AOffset: TPoint; AContext: IGrDirectContext = nil): ISkImage; + function PeekPixels: ISkPixmap; + function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow; AContext: IGrDirectContext = nil): Boolean; overload; + function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow; AContext: IGrDirectContext = nil): Boolean; overload; + function ScalePixels(const ADest: ISkPixmap; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; + function ScalePixels(const ADest: ISkPixmap; const ASampling: TSkSamplingOptions; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; + function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; + function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions; const ACachingHint: TSkImageCachingHint = TSkImageCachingHint.Allow): Boolean; overload; + class procedure raster_release_proc(const pixels: Pointer; context: Pointer); cdecl; static; + class procedure texture_release_proc(context: Pointer); cdecl; static; + public + class function MakeCrossContext(const AContext: IGrDirectContext; const APixmap: ISkPixmap; const ABuildMips: Boolean; const ALimitToMaxTextureSize: Boolean = False): ISkImage; overload; static; + class function MakeCrossContext(const AContext: IGrDirectContext; const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt; const ABuildMips: Boolean; const ALimitToMaxTextureSize: Boolean = False): ISkImage; overload; static; inline; + class function MakeFromAdoptedTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil): ISkImage; static; + class function MakeFromEncoded(const ABytes: TBytes): ISkImage; overload; static; + class function MakeFromEncodedFile(const AFileName: string): ISkImage; overload; static; + class function MakeFromEncodedStream(const AStream: TStream): ISkImage; overload; static; + class function MakeFromPicture(const APicture: ISkPicture; const ADimensions: TSize; const APaint: ISkPaint = nil; AColorSpace: ISkColorSpace = nil): ISkImage; overload; static; + class function MakeFromPicture(const APicture: ISkPicture; const ADimensions: TSize; const AMatrix: TMatrix; const APaint: ISkPaint = nil; AColorSpace: ISkColorSpace = nil): ISkImage; overload; static; + class function MakeFromPicture(const APicture: ISkPicture; const ADimensions: TSize; const AProperties: TSkSurfaceProperties; const APaint: ISkPaint = nil; AColorSpace: ISkColorSpace = nil): ISkImage; overload; static; + class function MakeFromPicture(const APicture: ISkPicture; const ADimensions: TSize; const AMatrix: TMatrix; const AProperties: TSkSurfaceProperties; const APaint: ISkPaint = nil; AColorSpace: ISkColorSpace = nil): ISkImage; overload; static; + class function MakeFromRaster(const APixmap: ISkPixmap; const ARasterReleaseProc: TSkImageRasterReleaseProc = nil): ISkImage; overload; static; + class function MakeFromRaster(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt; const ARasterReleaseProc: TSkImageRasterReleaseProc = nil): ISkImage; overload; static; inline; + class function MakeFromTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; AColorType: TSkColorType; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil; const ATextureReleaseProc: TSkImageTextureReleaseProc = nil): ISkImage; static; + class function MakeRasterCopy(const APixmap: ISkPixmap): ISkImage; overload; static; + class function MakeRasterCopy(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt): ISkImage; overload; static; inline; + end; + + { ISkImageFilter } + + ISkImageFilter = interface(ISkReferenceCounted) + ['{C3156B37-98A5-489F-BFB7-C0EB5DDDEDB6}'] + function MakeWithLocalMatrix(const AMatrix: TMatrix): ISkImageFilter; + end; + + { TSkImageFilter } + + TSkImageFilter = class(TSkReferenceCounted, ISkImageFilter) + strict private + function MakeWithLocalMatrix(const AMatrix: TMatrix): ISkImageFilter; + public + class function MakeAlphaThreshold(const ARegion: TRect; const AInnerMin, AOuterMax: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; inline; + class function MakeAlphaThreshold(const ARegion: ISkRegion; const AInnerMin, AOuterMax: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeArithmetic(const AK1, AK2, AK3, AK4: Single; const AEnforcePremultipliedColor: Boolean; const ABackground: ISkImageFilter; AForeground: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeArithmetic(const AK1, AK2, AK3, AK4: Single; const AEnforcePremultipliedColor: Boolean; const ABackground: ISkImageFilter; const ACropRect: TRectF; AForeground: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeBlend(const AMode: TSkBlendMode; const ABackground: ISkImageFilter; AForeground: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeBlend(const AMode: TSkBlendMode; const ABackground: ISkImageFilter; const ACropRect: TRectF; AForeground: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeBlur(const ASigmaX, ASigmaY: Single; AInput: ISkImageFilter = nil; const ATileMode: TSkTileMode = TSkTileMode.Decal): ISkImageFilter; overload; static; + class function MakeBlur(const ASigmaX, ASigmaY: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil; const ATileMode: TSkTileMode = TSkTileMode.Decal): ISkImageFilter; overload; static; + class function MakeColorFilter(const AColorFilter: ISkColorFilter; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeColorFilter(const AColorFilter: ISkColorFilter; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeCompose(const AOuter, AInner: ISkImageFilter): ISkImageFilter; static; + class function MakeDilate(const ARadiusX, ARadiusY: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDilate(const ARadiusX, ARadiusY: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDisplacementMap(const AXChannelSelector, AYChannelSelector: TSkColorChannel; const AScale: Single; const ADisplacement: ISkImageFilter; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDisplacementMap(const AXChannelSelector, AYChannelSelector: TSkColorChannel; const AScale: Single; const ADisplacement: ISkImageFilter; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDistantLitDiffuse(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDistantLitDiffuse(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDistantLitSpecular(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDistantLitSpecular(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDropShadow(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDropShadow(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDropShadowOnly(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeDropShadowOnly(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeErode(const ARadiusX, ARadiusY: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeErode(const ARadiusX, ARadiusY: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeImage(const AImage: ISkImage): ISkImageFilter; overload; static; inline; + class function MakeImage(const AImage: ISkImage; const ASampling: TSkSamplingOptions): ISkImageFilter; overload; static; inline; + class function MakeImage(const AImage: ISkImage; const ASrc, ADest: TRectF): ISkImageFilter; overload; static; inline; + class function MakeImage(const AImage: ISkImage; const ASrc, ADest: TRectF; const ASampling: TSkSamplingOptions): ISkImageFilter; overload; static; + class function MakeMagnifier(const ASrc: TRectF; const AInset: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeMagnifier(const ASrc: TRectF; const AInset: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeMatrixConvolution(const AKernelSize: TSize; const AKernel: TArray; const AGain, ABias: Single; const AKernelOffset: TPoint; const ATileMode: TSkTileMode; const AConvolveAlpha: Boolean; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeMatrixConvolution(const AKernelSize: TSize; const AKernel: TArray; const AGain, ABias: Single; const AKernelOffset: TPoint; const ATileMode: TSkTileMode; const AConvolveAlpha: Boolean; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeMatrixTransform(const AMatrix: TMatrix; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; inline; + class function MakeMatrixTransform(const AMatrix: TMatrix; const ASampling: TSkSamplingOptions; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeMerge(const AFilter1, AFilter2: ISkImageFilter): ISkImageFilter; overload; static; inline; + class function MakeMerge(const AFilter1, AFilter2: ISkImageFilter; const ACropRect: TRectF): ISkImageFilter; overload; static; inline; + class function MakeMerge(const AFilters: TArray): ISkImageFilter; overload; static; + class function MakeMerge(const AFilters: TArray; const ACropRect: TRectF): ISkImageFilter; overload; static; + class function MakeOffset(const ADeltaX, ADeltaY: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeOffset(const ADeltaX, ADeltaY: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakePicture(const APicture: ISkPicture): ISkImageFilter; overload; static; + class function MakePicture(const APicture: ISkPicture; const ACropRect: TRectF): ISkImageFilter; overload; static; + class function MakePointLitDiffuse(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakePointLitDiffuse(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakePointLitSpecular(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakePointLitSpecular(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeShader(const AShader: ISkShader; const ADither: Boolean): ISkImageFilter; overload; static; + class function MakeShader(const AShader: ISkShader; const ADither: Boolean; const ACropRect: TRectF): ISkImageFilter; overload; static; + class function MakeSpotLitDiffuse(const ALocation, ATarget: TPoint3D; const AFalloffExponent, ACutoffAngle: Single; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeSpotLitDiffuse(const ALocation, ATarget: TPoint3D; const AFalloffExponent, ACutoffAngle: Single; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeSpotLitSpecular(const ALocation, ATarget: TPoint3D; const AFalloffExponent, ACutoffAngle: Single; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeSpotLitSpecular(const ALocation, ATarget: TPoint3D; const AFalloffExponent, ACutoffAngle: Single; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; + class function MakeTile(const ASrc, ADest: TRect; AInput: ISkImageFilter = nil): ISkImageFilter; static; + end; + + { ISkMaskFilter } + + ISkMaskFilter = interface(ISkReferenceCounted) + ['{BBA0BC39-23F1-43B2-A924-526E7D089CAF}'] + end; + + { TSkMaskFilter } + + TSkMaskFilter = class(TSkReferenceCounted, ISkMaskFilter) + public + class function MakeBlur(const AStyle: TSkBlurStyle; const ASigma: Single; const ARespectCTM: Boolean = True): ISkMaskFilter; static; + class function MakeShader(const AShader: ISkShader): ISkMaskFilter; static; + class function MakeTable(const ATable: TSkTableFilter): ISkMaskFilter; static; + class function MakeTableClip(const AMin, AMax: Byte): ISkMaskFilter; static; + class function MakeTableGamma(const AGamma: Single): ISkMaskFilter; static; + end; + + { ISkPaint } + + ISkPaint = interface(ISkObject) + ['{C95825F8-0D51-4BCE-8945-84AFE6264213}'] + function GetAlpha: Byte; + function GetAlphaF: Single; + function GetAntiAlias: Boolean; + function GetBlender: ISkBlender; + function GetColor: TAlphaColor; + function GetColorF: TAlphaColorF; + function GetColorFilter: ISkColorFilter; + function GetDither: Boolean; + function GetFillPath(const APath: ISkPath): ISkPath; overload; + function GetFillPath(const APath: ISkPath; const ACullRect: TRectF; const AResScale: Single = 1): ISkPath; overload; + function GetImageFilter: ISkImageFilter; + function GetMaskFilter: ISkMaskFilter; + function GetPathEffect: ISkPathEffect; + function GetShader: ISkShader; + function GetStrokeCap: TSkStrokeCap; + function GetStrokeJoin: TSkStrokeJoin; + function GetStrokeMiter: Single; + function GetStrokeWidth: Single; + function GetStyle: TSkPaintStyle; + procedure Reset; + procedure SetAlpha(const AValue: Byte); + procedure SetAlphaF(const AValue: Single); + procedure SetAntiAlias(const AValue: Boolean); + procedure SetARGB(const A, R, G, B: Byte); + procedure SetBlender(AValue: ISkBlender); + procedure SetColor(const AValue: TAlphaColor); + procedure SetColorF(const AValue: TAlphaColorF; AColorSpace: ISkColorSpace = nil); + procedure SetColorFilter(AValue: ISkColorFilter); + procedure SetDither(const AValue: Boolean); + procedure SetImageFilter(AValue: ISkImageFilter); + procedure SetMaskFilter(AValue: ISkMaskFilter); + procedure SetPathEffect(AValue: ISkPathEffect); + procedure SetShader(AValue: ISkShader); + procedure SetStrokeCap(const AValue: TSkStrokeCap); + procedure SetStrokeJoin(const AValue: TSkStrokeJoin); + procedure SetStrokeMiter(const AValue: Single); + procedure SetStrokeWidth(const AValue: Single); + procedure SetStyle(const AValue: TSkPaintStyle); + property Alpha: Byte read GetAlpha write SetAlpha; + property AlphaF: Single read GetAlphaF write SetAlphaF; + property AntiAlias: Boolean read GetAntiAlias write SetAntiAlias; + property Blender: ISkBlender read GetBlender write SetBlender; + property Color: TAlphaColor read GetColor write SetColor; + property ColorFilter: ISkColorFilter read GetColorFilter write SetColorFilter; + property Dither: Boolean read GetDither write SetDither; + property ImageFilter: ISkImageFilter read GetImageFilter write SetImageFilter; + property MaskFilter: ISkMaskFilter read GetMaskFilter write SetMaskFilter; + property PathEffect: ISkPathEffect read GetPathEffect write SetPathEffect; + property Shader: ISkShader read GetShader write SetShader; + property StrokeCap: TSkStrokeCap read GetStrokeCap write SetStrokeCap; + property StrokeJoin: TSkStrokeJoin read GetStrokeJoin write SetStrokeJoin; + property StrokeMiter: Single read GetStrokeMiter write SetStrokeMiter; + property StrokeWidth: Single read GetStrokeWidth write SetStrokeWidth; + property Style: TSkPaintStyle read GetStyle write SetStyle; + end; + + { TSkPaint } + + TSkPaint = class(TSkObject, ISkPaint) + strict private + function GetAlpha: Byte; + function GetAlphaF: Single; + function GetAntiAlias: Boolean; + function GetBlender: ISkBlender; + function GetColor: TAlphaColor; + function GetColorF: TAlphaColorF; + function GetColorFilter: ISkColorFilter; + function GetDither: Boolean; + function GetFillPath(const APath: ISkPath): ISkPath; overload; + function GetFillPath(const APath: ISkPath; const ACullRect: TRectF; const AResScale: Single = 1): ISkPath; overload; + function GetImageFilter: ISkImageFilter; + function GetMaskFilter: ISkMaskFilter; + function GetPathEffect: ISkPathEffect; + function GetShader: ISkShader; + function GetStrokeCap: TSkStrokeCap; + function GetStrokeJoin: TSkStrokeJoin; + function GetStrokeMiter: Single; + function GetStrokeWidth: Single; + function GetStyle: TSkPaintStyle; + procedure Reset; + procedure SetAlpha(const AValue: Byte); + procedure SetAlphaF(const AValue: Single); + procedure SetAntiAlias(const AValue: Boolean); + procedure SetARGB(const A, R, G, B: Byte); + procedure SetBlender(AValue: ISkBlender); + procedure SetColor(const AValue: TAlphaColor); + procedure SetColorF(const AValue: TAlphaColorF; AColorSpace: ISkColorSpace = nil); + procedure SetColorFilter(AValue: ISkColorFilter); + procedure SetDither(const AValue: Boolean); + procedure SetImageFilter(AValue: ISkImageFilter); + procedure SetMaskFilter(AValue: ISkMaskFilter); + procedure SetPathEffect(AValue: ISkPathEffect); + procedure SetShader(AValue: ISkShader); + procedure SetStrokeCap(const AValue: TSkStrokeCap); + procedure SetStrokeJoin(const AValue: TSkStrokeJoin); + procedure SetStrokeMiter(const AValue: Single); + procedure SetStrokeWidth(const AValue: Single); + procedure SetStyle(const AValue: TSkPaintStyle); + public + constructor Create; overload; + constructor Create(const APaint: ISkPaint); overload; + constructor Create(const AStyle: TSkPaintStyle); overload; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkPaint(...) __SkCreate(TSkPaint, ISkPaint, __VA_ARGS__)'} + + { ISkOpBuilder } + + ISkOpBuilder = interface(ISkObject) + ['{A0F0AB29-477D-4AA2-A4AD-4AEBC3C6D630}'] + procedure Add(const APath: ISkPath; const AOp: TSkPathOp); + function Detach: ISkPath; + end; + + { TSkOpBuilder } + + TSkOpBuilder = class(TSkObject, ISkOpBuilder) + strict private + procedure Add(const APath: ISkPath; const AOp: TSkPathOp); + function Detach: ISkPath; + public + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkOpBuilder(...) __SkCreate(TSkOpBuilder, ISkOpBuilder, __VA_ARGS__)'} + + { ISkPathIterator } + + ISkPathIterator = interface(ISkEnumerable) + ['{AD3EC8F2-01C0-4685-B098-6850AEA6D8A6}'] + function GetCurrent: TSkPathIteratorElem; + function GetEnumerator: TSkEnumerator; + end; + + { ISkPath } + + ISkPath = interface(ISkObject) + ['{0801E1D4-5426-4B7E-A3CD-9B40B21C26F0}'] + function Contains(const AX, AY: Single): Boolean; + function GetBounds: TRectF; + function GetFillType: TSkPathFillType; + function GetIterator(const AForceClose: Boolean): ISkPathIterator; + function GetLastPoint: TPointF; + function GetSegmentMasks: TSkSegmentMasks; + function GetTightBounds: TRectF; + function Interpolate(const AEnding: ISkPath; const AWeight: Single): ISkPath; + function IsConvex: Boolean; + function IsEmpty: Boolean; + function IsFinite: Boolean; + function IsInterpolatable(const APath: ISkPath): Boolean; + function IsLastContourClosed: Boolean; + function IsLine: Boolean; overload; + function IsLine(out APoint1, APoint2: TPointF): Boolean; overload; + function IsOval: Boolean; overload; + function IsOval(out ARect: TRectF): Boolean; overload; + function IsRect: Boolean; overload; + function IsRect(out ARect: TRectF): Boolean; overload; + function IsRoundRect: Boolean; overload; + function IsRoundRect(out ARoundRect: ISkRoundRect): Boolean; overload; + function Op(const APath: ISkPath; const AOp: TSkPathOp): ISkPath; + function Serialize: TBytes; + procedure SerializeToStream(const AStream: TStream); + function ToSVG: string; + function Transform(const AMatrix: TMatrix): ISkPath; + property Bounds: TRectF read GetBounds; + property FillType: TSkPathFillType read GetFillType; + property LastPoint: TPointF read GetLastPoint; + property SegmentMasks: TSkSegmentMasks read GetSegmentMasks; + property TightBounds: TRectF read GetTightBounds; + end; + + { TSkPath } + + TSkPath = class(TSkObject, ISkPath) + strict private type + TPathIterator = class(TSkEnumerable, ISkPathIterator) + strict private + FCurrent: TSkPathIteratorElem; + public + constructor Create(const APath: ISkPath; const AForceClose: Boolean); + function GetCurrent: TSkPathIteratorElem; override; + function MoveNext: Boolean; override; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + strict private + function Contains(const AX, AY: Single): Boolean; + function GetBounds: TRectF; + function GetFillType: TSkPathFillType; + function GetIterator(const AForceClose: Boolean): ISkPathIterator; + function GetLastPoint: TPointF; + function GetSegmentMasks: TSkSegmentMasks; + function GetTightBounds: TRectF; + function Interpolate(const AEnding: ISkPath; const AWeight: Single): ISkPath; + function IsConvex: Boolean; + function IsEmpty: Boolean; + function IsFinite: Boolean; + function IsInterpolatable(const APath: ISkPath): Boolean; + function IsLastContourClosed: Boolean; + function IsLine: Boolean; overload; + function IsLine(out APoint1, APoint2: TPointF): Boolean; overload; + function IsOval: Boolean; overload; + function IsOval(out ARect: TRectF): Boolean; overload; + function IsRect: Boolean; overload; + function IsRect(out ARect: TRectF): Boolean; overload; + function IsRoundRect: Boolean; overload; + function IsRoundRect(out ARoundRect: ISkRoundRect): Boolean; overload; + function Op(const APath: ISkPath; const AOp: TSkPathOp): ISkPath; + function Serialize: TBytes; + procedure SerializeToStream(const AStream: TStream); + function ToSVG: string; + function Transform(const AMatrix: TMatrix): ISkPath; + public + constructor Create(const ASVG: string); overload; + constructor Create(const ABytes: TBytes); overload; + constructor Create(const AStream: TStream); overload; + class function ConvertConicToQuads(const APoint1, APoint2, APoint3: TPointF; const AWeight: Single; const APower2: Integer): TArray; static; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkPath(...) __SkCreate(TSkPath, ISkPath, __VA_ARGS__)'} + + { ISkPathBuilder } + + ISkPathBuilder = interface(ISkObject) + ['{F0976C6D-4474-4290-B9CD-22DB130F8EB5}'] + procedure AddArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single); + procedure AddCircle(const ACenter: TPointF; ARadius: Single; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddCircle(const ACenterX, ACenterY, ARadius: Single; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddOval(const ARect: TRectF; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddOval(const ARect: TRectF; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; + procedure AddPath(const APath: ISkPath); + procedure AddPolygon(const APolygon: TPolygon; const IsClosed: Boolean); + procedure AddRect(const ARect: TRectF; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddRect(const ARect: TRectF; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; + procedure AddRoundRect(const ARoundRect: ISkRoundRect; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddRoundRect(const ARoundRect: ISkRoundRect; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; + procedure ArcTo(const APoint1, APoint2: TPointF; const ARadius: Single); overload; + procedure ArcTo(const AOval: TRectF; const AStartAngle, ASweepAngle: Single; const AForceMoveTo: Boolean); overload; + procedure ArcTo(const ARadius: TPointF; const XAxisRotate: Single; const ALargeArc: TSkPathArcSize; const ASweep: TSkPathDirection; const AXY: TPointF); overload; + procedure Close; + procedure ConicTo(const APoint1, APoint2: TPointF; const AWeight: Single); overload; + procedure ConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); overload; + procedure CubicTo(const APoint1, APoint2, APoint3: TPointF); overload; + procedure CubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); overload; + function Detach: ISkPath; + function GetBounds: TRectF; + function GetFillType: TSkPathFillType; + procedure IncReserve(const AExtraPointCount: Integer); overload; + procedure IncReserve(const AExtraPointCount, AExtraVerbCount: Integer); overload; + procedure LineTo(const APoint: TPointF); overload; + procedure LineTo(const AX, AY: Single); overload; + procedure MoveTo(const APoint: TPointF); overload; + procedure MoveTo(const AX, AY: Single); overload; + procedure Offset(const ADeltaX, ADeltaY: Single); + procedure PolylineTo(const APoints: TArray); + procedure QuadTo(const APoint1, APoint2: TPointF); overload; + procedure QuadTo(const AX1, AY1, AX2, AY2: Single); overload; + procedure RConicTo(const APoint1, APoint2: TPointF; const AWeight: Single); overload; + procedure RConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); overload; + procedure RCubicTo(const APoint1, APoint2, APoint3: TPointF); overload; + procedure RCubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); overload; + procedure Reset; + procedure RLineTo(const APoint: TPointF); overload; + procedure RLineTo(const AX, AY: Single); overload; + procedure RQuadTo(const APoint1, APoint2: TPointF); overload; + procedure RQuadTo(const AX1, AY1, AX2, AY2: Single); overload; + procedure SetFillType(const AValue: TSkPathFillType); + function Snapshot: ISkPath; + procedure ToggleInverseFillType; + property Bounds: TRectF read GetBounds; + property FillType: TSkPathFillType read GetFillType write SetFillType; + end; + + { TSkPathBuilder } + + TSkPathBuilder = class(TSkObject, ISkPathBuilder) + strict private + procedure AddArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single); + procedure AddCircle(const ACenter: TPointF; ARadius: Single; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddCircle(const ACenterX, ACenterY, ARadius: Single; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddOval(const ARect: TRectF; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddOval(const ARect: TRectF; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; + procedure AddPath(const APath: ISkPath); + procedure AddPolygon(const APolygon: TPolygon; const IsClosed: Boolean); + procedure AddRect(const ARect: TRectF; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddRect(const ARect: TRectF; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; + procedure AddRoundRect(const ARoundRect: ISkRoundRect; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; + procedure AddRoundRect(const ARoundRect: ISkRoundRect; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; + procedure ArcTo(const APoint1, APoint2: TPointF; const ARadius: Single); overload; + procedure ArcTo(const AOval: TRectF; const AStartAngle, ASweepAngle: Single; const AForceMoveTo: Boolean); overload; + procedure ArcTo(const ARadius: TPointF; const XAxisRotate: Single; const ALargeArc: TSkPathArcSize; const ASweep: TSkPathDirection; const AXY: TPointF); overload; + procedure Close; + procedure ConicTo(const APoint1, APoint2: TPointF; const AWeight: Single); overload; + procedure ConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); overload; + procedure CubicTo(const APoint1, APoint2, APoint3: TPointF); overload; + procedure CubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); overload; + function Detach: ISkPath; + function GetBounds: TRectF; + function GetFillType: TSkPathFillType; + procedure IncReserve(const AExtraPointCount: Integer); overload; + procedure IncReserve(const AExtraPointCount, AExtraVerbCount: Integer); overload; + procedure LineTo(const APoint: TPointF); overload; + procedure LineTo(const AX, AY: Single); overload; + procedure MoveTo(const APoint: TPointF); overload; + procedure MoveTo(const AX, AY: Single); overload; + procedure Offset(const ADeltaX, ADeltaY: Single); + procedure PolylineTo(const APoints: TArray); + procedure QuadTo(const APoint1, APoint2: TPointF); overload; + procedure QuadTo(const AX1, AY1, AX2, AY2: Single); overload; + procedure RConicTo(const APoint1, APoint2: TPointF; const AWeight: Single); overload; + procedure RConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); overload; + procedure RCubicTo(const APoint1, APoint2, APoint3: TPointF); overload; + procedure RCubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); overload; + procedure Reset; + procedure RLineTo(const APoint: TPointF); overload; + procedure RLineTo(const AX, AY: Single); overload; + procedure RQuadTo(const APoint1, APoint2: TPointF); overload; + procedure RQuadTo(const AX1, AY1, AX2, AY2: Single); overload; + procedure SetFillType(const AValue: TSkPathFillType); + function Snapshot: ISkPath; + procedure ToggleInverseFillType; + public + constructor Create; overload; + constructor Create(const APathBuilder: ISkPathBuilder); overload; + constructor Create(const AFillType: TSkPathFillType); overload; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkPathBuilder(...) __SkCreate(TSkPathBuilder, ISkPathBuilder, __VA_ARGS__)'} + + { ISkPathEffect } + + ISkPathEffect = interface(ISkReferenceCounted) + ['{6229C1C7-5DBB-4525-B9B8-9E50F644AB3F}'] + end; + + { TSkPathEffect } + + TSkPathEffect = class(TSkReferenceCounted, ISkPathEffect) + public + class function Make1DPath(const APath: ISkPath; const AAdvance, APhase: Single; const AStyle: TSkPathEffect1DStyle): ISkPathEffect; static; + class function Make2DLine(const AWidth: Single; const AMatrix: TMatrix): ISkPathEffect; static; + class function Make2DPath(const AMatrix: TMatrix; const APath: ISkPath): ISkPathEffect; static; + class function MakeCompose(const AOuter, AInner: ISkPathEffect): ISkPathEffect; static; + class function MakeCorner(const ARadius: Single): ISkPathEffect; static; + class function MakeDash(const AIntervals: TArray; const APhase: Single): ISkPathEffect; static; + class function MakeDiscrete(const ASegLength, ADeviation: Single; const ASeedAssist: Cardinal = 0): ISkPathEffect; static; + class function MakeMatrix(const AMatrix: TMatrix): ISkPathEffect; static; + class function MakeMerge(const AEffect1, AEffect2: ISkPathEffect; const AOp: TSkPathOp): ISkPathEffect; static; + class function MakeStroke(const AWidth: Single; const AJoin: TSkStrokeJoin; const ACap: TSkStrokeCap; const AMiter: Single = 4): ISkPathEffect; static; + class function MakeStrokeAndFill: ISkPathEffect; static; + class function MakeSum(const AEffect1, AEffect2: ISkPathEffect): ISkPathEffect; static; + class function MakeTranslate(const ADeltaX, ADeltaY: Single): ISkPathEffect; static; + class function MakeTrim(const AStart, AStop: Single; const AMode: TSkPathEffectTrimMode): ISkPathEffect; static; + end; + + { ISkPathMeasure } + + ISkPathMeasure = interface(ISkObject) + ['{33A4DFAF-069C-44BE-8AEF-333B88187B78}'] + function GetLength: Single; + function GetMatrix(const ADistance: Single; out AMatrix: TMatrix; const AMatrixFlags: TSkPathMeasureMatrixFlags = [TSkPathMeasureMatrixFlag.Position, TSkPathMeasureMatrixFlag.Tangent]): Boolean; + function GetPositionAndTangent(const ADistance: Single; out APosition, ATangent: TPointF): Boolean; + function GetSegment(const AStart, AStop: Single; const AStartWithMoveTo: Boolean): ISkPath; + function IsClosed: Boolean; + function NextContour: Boolean; + property Length: Single read GetLength; + end; + + { TSkPathMeasure } + + TSkPathMeasure = class(TSkObject, ISkPathMeasure) + strict private + function GetLength: Single; + function GetMatrix(const ADistance: Single; out AMatrix: TMatrix; const AMatrixFlags: TSkPathMeasureMatrixFlags = [TSkPathMeasureMatrixFlag.Position, TSkPathMeasureMatrixFlag.Tangent]): Boolean; + function GetPositionAndTangent(const ADistance: Single; out APosition, ATangent: TPointF): Boolean; + function GetSegment(const AStart, AStop: Single; const AStartWithMoveTo: Boolean): ISkPath; + function IsClosed: Boolean; + function NextContour: Boolean; + public + constructor Create(const APath: ISkPath; const AForceClosed: Boolean = False; const AResScale: Single = 1); + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkPathMeasure(...) __SkCreate(TSkPathMeasure, ISkPathMeasure, __VA_ARGS__)'} + + { ISkPicture } + + ISkPicture = interface(ISkReferenceCounted) + ['{5FBF6D75-3A44-4012-AAC9-AD22E1C955D2}'] + function GetCullRect: TRectF; + function MakeShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + function MakeShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + function MakeShader(const ATileRect: TRectF; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + function MakeShader(const ATileRect: TRectF; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + procedure Playback(const ACanvas: ISkCanvas); + function Serialize: TBytes; + procedure SerializeToStream(const AStream: TStream); + property CullRect: TRectF read GetCullRect; + end; + + { TSkPicture } + + TSkPicture = class(TSkReferenceCounted, ISkPicture) + strict private + function GetCullRect: TRectF; + function MakeShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + function MakeShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + function MakeShader(const ATileRect: TRectF; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + function MakeShader(const ATileRect: TRectF; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + procedure Playback(const ACanvas: ISkCanvas); + function Serialize: TBytes; + procedure SerializeToStream(const AStream: TStream); + public + class function MakeFromBytes(const ABytes: TBytes): ISkPicture; static; + class function MakeFromStream(const AStream: TStream): ISkPicture; static; + end; + + { ISkPictureRecorder } + + ISkPictureRecorder = interface(ISkObject) + ['{46663FA5-57B9-4289-9381-0433E3A70EB9}'] + function BeginRecording(const AWidth, AHeight: Single): ISkCanvas; overload; + function BeginRecording(const ABounds: TRectF): ISkCanvas; overload; + function FinishRecording: ISkPicture; overload; + function FinishRecording(const ACullRect: TRectF): ISkPicture; overload; + end; + + { TSkPictureRecorder } + + TSkPictureRecorder = class(TSkObject, ISkPictureRecorder) + strict private + function BeginRecording(const AWidth, AHeight: Single): ISkCanvas; overload; + function BeginRecording(const ABounds: TRectF): ISkCanvas; overload; + function FinishRecording: ISkPicture; overload; + function FinishRecording(const ACullRect: TRectF): ISkPicture; overload; + public + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkPictureRecorder(...) __SkCreate(TSkPictureRecorder, ISkPictureRecorder, __VA_ARGS__)'} + + { ISkPixmap } + + ISkPixmap = interface(ISkObject) + ['{EFEDBF69-4C8D-4124-83A6-68A9B1DF239E}'] + function Erase(const AColor: TAlphaColor): Boolean; overload; + function Erase(const AColor: TAlphaColor; const ASubset: TRectF): Boolean; overload; + function Erase(const AColor: TAlphaColorF; AColorSpace: ISkColorSpace = nil): Boolean; overload; + function Erase(const AColor: TAlphaColorF; const ASubset: TRectF; AColorSpace: ISkColorSpace = nil): Boolean; overload; + function ExtractSubset(const ADest: ISkPixmap; const AArea: TRect): Boolean; + function GetAlpha(const AX, AY: Integer): Single; + function GetAlphaType: TSkAlphaType; + function GetColor(const AX, AY: Integer): TAlphaColor; + function GetColorF(const AX, AY: Integer): TAlphaColorF; + function GetColorSpace: ISkColorSpace; + function GetColorType: TSkColorType; + function GetHeight: Integer; + function GetImageInfo: TSkImageInfo; + function GetPixelAddr(const AX, AY: Integer): Pointer; + function GetPixels: Pointer; + function GetRowBytes: NativeUInt; + function GetWidth: Integer; + function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; + function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; + function ScalePixels(const ADest: ISkPixmap): Boolean; overload; + function ScalePixels(const ADest: ISkPixmap; const ASampling: TSkSamplingOptions): Boolean; overload; + function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt): Boolean; overload; + function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions): Boolean; overload; + procedure SetColorSpace(AValue: ISkColorSpace); + property Alphas[const AX, AY: Integer]: Single read GetAlpha; + property AlphaType: TSkAlphaType read GetAlphaType; + property Colors[const AX, AY: Integer]: TAlphaColor read GetColor; + property ColorsF[const AX, AY: Integer]: TAlphaColorF read GetColorF; + property ColorSpace: ISkColorSpace read GetColorSpace write SetColorSpace; + property ColorType: TSkColorType read GetColorType; + property Height: Integer read GetHeight; + property ImageInfo: TSkImageInfo read GetImageInfo; + property PixelAddr[const AX, AY: Integer]: Pointer read GetPixelAddr; + property Pixels: Pointer read GetPixels; + property RowBytes: NativeUInt read GetRowBytes; + property Width: Integer read GetWidth; + end; + + { TSkPixmap } + + TSkPixmap = class(TSkObject, ISkPixmap) + strict private + function Erase(const AColor: TAlphaColor): Boolean; overload; + function Erase(const AColor: TAlphaColor; const ASubset: TRectF): Boolean; overload; + function Erase(const AColor: TAlphaColorF; AColorSpace: ISkColorSpace = nil): Boolean; overload; + function Erase(const AColor: TAlphaColorF; const ASubset: TRectF; AColorSpace: ISkColorSpace = nil): Boolean; overload; + function ExtractSubset(const ADest: ISkPixmap; const AArea: TRect): Boolean; + function GetAlpha(const AX, AY: Integer): Single; + function GetAlphaType: TSkAlphaType; + function GetColor(const AX, AY: Integer): TAlphaColor; + function GetColorF(const AX, AY: Integer): TAlphaColorF; + function GetColorSpace: ISkColorSpace; + function GetColorType: TSkColorType; + function GetHeight: Integer; + function GetImageInfo: TSkImageInfo; + function GetPixelAddr(const AX, AY: Integer): Pointer; + function GetPixels: Pointer; + function GetRowBytes: NativeUInt; + function GetWidth: Integer; + function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; + function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; + function ScalePixels(const ADest: ISkPixmap): Boolean; overload; + function ScalePixels(const ADest: ISkPixmap; const ASampling: TSkSamplingOptions): Boolean; overload; + function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt): Boolean; overload; + function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions): Boolean; overload; + procedure SetColorSpace(AValue: ISkColorSpace); + public + constructor Create(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt); + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkPixmap(...) __SkCreate(TSkPixmap, ISkPixmap, __VA_ARGS__)'} + + { ISkRegionCliperator } + + ISkRegionCliperator = interface(ISkEnumerable) + ['{2A8DA4E7-1B52-4311-9398-E3A93BACDB02}'] + function GetCurrent: TRect; + function GetEnumerator: TSkEnumerator; + end; + + { ISkRegionIterator } + + ISkRegionIterator = interface(ISkEnumerable) + ['{2A0AC6C3-6101-4A9C-83BE-8F56B67F4239}'] + function GetCurrent: TRect; + function GetEnumerator: TSkEnumerator; + end; + + { ISkRegionSpanerator } + + ISkRegionSpanerator = interface(ISkEnumerable) + ['{E6980A05-9F49-4B3E-BD03-7A305C69B9AE}'] + function GetCurrent: TPoint; + function GetEnumerator: TSkEnumerator; + end; + + { ISkRegion } + + ISkRegion = interface(ISkObject) + ['{9ED1C7B2-BF4E-4E4E-9A69-DDDB615C0319}'] + function Contains(const AX, AY: Integer): Boolean; overload; + function Contains(const ARect: TRect): Boolean; overload; + function Contains(const ARegion: ISkRegion): Boolean; overload; + function GetBoundaryPath: ISkPath; + function GetBounds: TRect; + function GetCliperator(const AClip: TRect): ISkRegionCliperator; + function GetIterator: ISkRegionIterator; + function GetSpanerator(const AY, ALeft, ARight: Integer): ISkRegionSpanerator; + function Intersects(const ARect: TRect): Boolean; overload; + function Intersects(const ARegion: ISkRegion): Boolean; overload; + function IsComplex: Boolean; + function IsEmpty: Boolean; + function IsEqual(const ARegion: ISkRegion): Boolean; + function IsRect: Boolean; + function Op(const ARect: TRect; const AOp: TSkRegionOp): Boolean; overload; + function Op(const ARegion: ISkRegion; const AOp: TSkRegionOp): Boolean; overload; + function QuickContains(const ARect: TRect): Boolean; + function QuickReject(const ARect: TRect): Boolean; overload; + function QuickReject(const ARegion: ISkRegion): Boolean; overload; + procedure SetEmpty; + function SetPath(const APath: ISkPath; const AClip: ISkRegion): Boolean; + function SetRect(const ARect: TRect): Boolean; + function SetRects(const ARects: TArray): Boolean; + procedure Translate(const ADeltaX, ADeltaY: Integer); + property Bounds: TRect read GetBounds; + end; + + { TSkRegion } + + TSkRegion = class(TSkObject, ISkRegion) + strict private type + TRegionCliperator = class(TSkEnumerable, ISkRegionCliperator) + public + constructor Create(const ARegion: ISkRegion; const AClip: TRect); + function GetCurrent: TRect; override; + function MoveNext: Boolean; override; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + TRegionIterator = class(TSkEnumerable, ISkRegionIterator) + public + constructor Create(const ARegion: ISkRegion); + function GetCurrent: TRect; override; + function MoveNext: Boolean; override; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + TRegionSpanerator = class(TSkEnumerable, ISkRegionSpanerator) + strict private + FCurrent: TPoint; + public + constructor Create(const ARegion: ISkRegion; const AY, ALeft, ARight: Integer); + function GetCurrent: TPoint; override; + function MoveNext: Boolean; override; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + strict private + function Contains(const AX, AY: Integer): Boolean; overload; + function Contains(const ARect: TRect): Boolean; overload; + function Contains(const ARegion: ISkRegion): Boolean; overload; + function GetBoundaryPath: ISkPath; + function GetBounds: TRect; + function GetCliperator(const AClip: TRect): ISkRegionCliperator; + function GetIterator: ISkRegionIterator; + function GetSpanerator(const AY, ALeft, ARight: Integer): ISkRegionSpanerator; + function Intersects(const ARect: TRect): Boolean; overload; + function Intersects(const ARegion: ISkRegion): Boolean; overload; + function IsComplex: Boolean; + function IsEmpty: Boolean; + function IsEqual(const ARegion: ISkRegion): Boolean; + function IsRect: Boolean; + function Op(const ARect: TRect; const AOp: TSkRegionOp): Boolean; overload; + function Op(const ARegion: ISkRegion; const AOp: TSkRegionOp): Boolean; overload; + function QuickContains(const ARect: TRect): Boolean; + function QuickReject(const ARect: TRect): Boolean; overload; + function QuickReject(const ARegion: ISkRegion): Boolean; overload; + procedure SetEmpty; + function SetPath(const APath: ISkPath; const AClip: ISkRegion): Boolean; + function SetRect(const ARect: TRect): Boolean; + function SetRects(const ARects: TArray): Boolean; + procedure Translate(const ADeltaX, ADeltaY: Integer); + public + constructor Create; overload; + constructor Create(const ARegion: ISkRegion); overload; + constructor Create(const ARect: TRect); overload; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkRegion(...) __SkCreate(TSkRegion, ISkRegion, __VA_ARGS__)'} + + { ISkRoundRect } + + ISkRoundRect = interface(ISkObject) + ['{A828D0E5-98C6-42EC-A44B-494DF41183DA}'] + function Contains(const ARect: TRect): Boolean; + procedure Deflate(const ADeltaX, ADeltaY: Single); + function GetHeight: Single; + function GetRadii(const ACorner: TSkRoundRectCorner): TPointF; + function GetRect: TRectF; + function GetSimpleRadii: TPointF; + function GetWidth: Single; + procedure Inflate(const ADeltaX, ADeltaY: Single); + function IsComplex: Boolean; + function IsEmpty: Boolean; + function IsEqual(const ARoundRect: ISkRoundRect): Boolean; + function IsNinePatch: Boolean; + function IsOval: Boolean; + function IsRect: Boolean; + function IsSimple: Boolean; + function IsValid: Boolean; + procedure Offset(const ADeltaX, ADeltaY: Single); + procedure SetEmpty; + procedure SetNinePatch(const ARect: TRectF; const ARadiusLeft, ARadiusTop, ARadiusRight, ARadiusBottom: Single); + procedure SetOval(const ARect: TRectF); + procedure SetRect(const ARect: TRectF); overload; + procedure SetRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single); overload; + procedure SetRect(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; + function Transform(const AMatrix: TMatrix): ISkRoundRect; + property Height: Single read GetHeight; + property Radii[const ACorner: TSkRoundRectCorner]: TPointF read GetRadii; + property Rect: TRectF read GetRect; + property SimpleRadii: TPointF read GetSimpleRadii; + property Width: Single read GetWidth; + end; + + { TSkRoundRect } + + TSkRoundRect = class(TSkObject, ISkRoundRect) + strict private + function Contains(const ARect: TRect): Boolean; + procedure Deflate(const ADeltaX, ADeltaY: Single); + function GetHeight: Single; + function GetRadii(const ACorner: TSkRoundRectCorner): TPointF; + function GetRect: TRectF; + function GetSimpleRadii: TPointF; + function GetWidth: Single; + procedure Inflate(const ADeltaX, ADeltaY: Single); + function IsComplex: Boolean; + function IsEmpty: Boolean; + function IsEqual(const ARoundRect: ISkRoundRect): Boolean; + function IsNinePatch: Boolean; + function IsOval: Boolean; + function IsRect: Boolean; + function IsSimple: Boolean; + function IsValid: Boolean; + procedure Offset(const ADeltaX, ADeltaY: Single); + procedure SetEmpty; + procedure SetNinePatch(const ARect: TRectF; const ARadiusLeft, ARadiusTop, ARadiusRight, ARadiusBottom: Single); + procedure SetOval(const ARect: TRectF); + procedure SetRect(const ARect: TRectF); overload; + procedure SetRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single); overload; + procedure SetRect(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; + function Transform(const AMatrix: TMatrix): ISkRoundRect; + public + constructor Create; overload; + constructor Create(const ARoundRect: ISkRoundRect); overload; + constructor Create(const ARect: TRectF; const ARadiusX, ARadiusY: Single); overload; + constructor Create(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + {$HPPEMIT END '#define SkRoundRect(...) __SkCreate(TSkRoundRect, ISkRoundRect, __VA_ARGS__)'} + + { ISkRuntimeEffect } + + ISkRuntimeEffect = interface(ISkReferenceCounted) + ['{BC1BDAAE-9331-47E5-A869-E7EC2D15ED52}'] + function ChildExists(const AName: string): Boolean; + function GetChildColorFilter(const AIndex: Integer): ISkColorFilter; + function GetChildColorFilterByName(const AName: string): ISkColorFilter; + function GetChildCount: Integer; + function GetChildName(const AIndex: Integer): string; + function GetChildBlender(const AIndex: Integer): ISkBlender; + function GetChildBlenderByName(const AName: string): ISkBlender; + function GetChildShader(const AIndex: Integer): ISkShader; + function GetChildShaderByName(const AName: string): ISkShader; + function GetChildType(const AIndex: Integer): TSkRuntimeEffectChildType; + function GetChildTypeByName(const AName: string): TSkRuntimeEffectChildType; + function GetUniform(const AIndex: Integer): Pointer; + function GetUniformByName(const AName: string): Pointer; + function GetUniformCount: Integer; + function GetUniformData: Pointer; + function GetUniformDataSize: NativeUInt; + function GetUniformName(const AIndex: Integer): string; + function GetUniformOffset(const AIndex: Integer): NativeUInt; + function GetUniformOffsetByName(const AName: string): NativeUInt; + function GetUniformType(const AIndex: Integer): TSkRuntimeEffectUniformType; + function GetUniformTypeByName(const AName: string): TSkRuntimeEffectUniformType; + function GetUniformTypeCount(const AIndex: Integer): Integer; + function GetUniformTypeCountByName(const AName: string): Integer; + function IndexOfChild(const AName: string): Integer; + function IndexOfUniform(const AName: string): Integer; + function IsUniformTypeOrdinal(const AIndex: Integer): Boolean; + function IsUniformTypeOrdinalByName(const AName: string): Boolean; + function MakeBlender: ISkBlender; + function MakeColorFilter: ISkColorFilter; + function MakeImage(const AImageInfo: TSkImageInfo; const AMipmapped: Boolean = False; const AContext: IGrDirectContext = nil): ISkImage; overload; + function MakeImage(const AImageInfo: TSkImageInfo; const ALocalMatrix: TMatrix; const AMipmapped: Boolean = False; const AContext: IGrDirectContext = nil): ISkImage; overload; + function MakeShader: ISkShader; overload; + function MakeShader(const ALocalMatrix: TMatrix): ISkShader; overload; + procedure SetChildBlender(const AIndex: Integer; const AValue: ISkBlender); + procedure SetChildBlenderByName(const AName: string; const AValue: ISkBlender); + procedure SetChildColorFilter(const AIndex: Integer; const AValue: ISkColorFilter); + procedure SetChildColorFilterByName(const AName: string; const AValue: ISkColorFilter); + procedure SetChildShader(const AIndex: Integer; const AValue: ISkShader); + procedure SetChildShaderByName(const AName: string; const AValue: ISkShader); + procedure SetUniform(const AIndex: Integer; const AData; const ASize: NativeUInt); overload; + procedure SetUniform(const AIndex: Integer; const AValue: Integer); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TArray); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TPoint); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt2); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt3); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt4); overload; + procedure SetUniform(const AIndex: Integer; const AValue: Single); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TArray); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TPointF); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TAlphaColorF); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat2); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat3); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat4); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat2x2); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat3x3); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat4x4); overload; + procedure SetUniform(const AName: string; const AData; const ASize: NativeUInt); overload; + procedure SetUniform(const AName: string; const AValue: Integer); overload; + procedure SetUniform(const AName: string; const AValue: TArray); overload; + procedure SetUniform(const AName: string; const AValue: TPoint); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt2); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt3); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt4); overload; + procedure SetUniform(const AName: string; const AValue: Single); overload; + procedure SetUniform(const AName: string; const AValue: TArray); overload; + procedure SetUniform(const AName: string; const AValue: TPointF); overload; + procedure SetUniform(const AName: string; const AValue: TAlphaColorF); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat2); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat3); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat4); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat2x2); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat3x3); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat4x4); overload; + function UniformExists(const AName: string): Boolean; + procedure WriteUniform(const AOffset: NativeUInt; const AData; const ASize: NativeUInt); + property ChildCount: Integer read GetChildCount; + property ChildrenBlenders[const AIndex: Integer]: ISkBlender read GetChildBlender write SetChildBlender; + property ChildrenBlendersByName[const AName: string]: ISkBlender read GetChildBlenderByName write SetChildBlenderByName; + property ChildrenColorFilters[const AIndex: Integer]: ISkColorFilter read GetChildColorFilter write SetChildColorFilter; + property ChildrenColorFiltersByName[const AName: string]: ISkColorFilter read GetChildColorFilterByName write SetChildColorFilterByName; + property ChildrenNames[const AIndex: Integer]: string read GetChildName; + property ChildrenShaders[const AIndex: Integer]: ISkShader read GetChildShader write SetChildShader; + property ChildrenShadersByName[const AName: string]: ISkShader read GetChildShaderByName write SetChildShaderByName; + property ChildType[const AIndex: Integer]: TSkRuntimeEffectChildType read GetChildType; + property ChildTypeByName[const AName: string]: TSkRuntimeEffectChildType read GetChildTypeByName; + property UniformCount: Integer read GetUniformCount; + property UniformData: Pointer read GetUniformData; + property UniformDataSize: NativeUInt read GetUniformDataSize; + property UniformNames[const AIndex: Integer]: string read GetUniformName; + property UniformOffset[const AIndex: Integer]: NativeUInt read GetUniformOffset; + property UniformOffsetByName[const AName: string]: NativeUInt read GetUniformOffsetByName; + property Uniforms[const AIndex: Integer]: Pointer read GetUniform; + property UniformsByName[const AName: string]: Pointer read GetUniformByName; + property UniformType[const AIndex: Integer]: TSkRuntimeEffectUniformType read GetUniformType; + property UniformTypeByName[const AName: string]: TSkRuntimeEffectUniformType read GetUniformTypeByName; + property UniformTypeCount[const AIndex: Integer]: Integer read GetUniformTypeCount; + property UniformTypeCountByName[const AName: string]: Integer read GetUniformTypeCountByName; + end; + + { TSkRuntimeEffect } + + TSkRuntimeEffect = class(TSkReferenceCounted, ISkRuntimeEffect) + strict private + FChildren: TArray; + FUniformData: Pointer; + function ChildExists(const AName: string): Boolean; + function GetChildColorFilter(const AIndex: Integer): ISkColorFilter; + function GetChildColorFilterByName(const AName: string): ISkColorFilter; + function GetChildCount: Integer; + function GetChildName(const AIndex: Integer): string; + function GetChildBlender(const AIndex: Integer): ISkBlender; + function GetChildBlenderByName(const AName: string): ISkBlender; + function GetChildShader(const AIndex: Integer): ISkShader; + function GetChildShaderByName(const AName: string): ISkShader; + function GetChildType(const AIndex: Integer): TSkRuntimeEffectChildType; + function GetChildTypeByName(const AName: string): TSkRuntimeEffectChildType; + function GetUniform(const AIndex: Integer): Pointer; + function GetUniformByName(const AName: string): Pointer; + function GetUniformCount: Integer; + function GetUniformData: Pointer; + function GetUniformDataSize: NativeUInt; + function GetUniformName(const AIndex: Integer): string; + function GetUniformOffset(const AIndex: Integer): NativeUInt; + function GetUniformOffsetByName(const AName: string): NativeUInt; + function GetUniformType(const AIndex: Integer): TSkRuntimeEffectUniformType; + function GetUniformTypeByName(const AName: string): TSkRuntimeEffectUniformType; + function GetUniformTypeCount(const AIndex: Integer): Integer; + function GetUniformTypeCountByName(const AName: string): Integer; + function IndexOfChild(const AName: string): Integer; + function IndexOfUniform(const AName: string): Integer; + function IsUniformTypeOrdinal(const AIndex: Integer): Boolean; + function IsUniformTypeOrdinalByName(const AName: string): Boolean; + function MakeBlender: ISkBlender; + function MakeColorFilter: ISkColorFilter; + function MakeImage(const AImageInfo: TSkImageInfo; const AMipmapped: Boolean = False; const AContext: IGrDirectContext = nil): ISkImage; overload; + function MakeImage(const AImageInfo: TSkImageInfo; const ALocalMatrix: TMatrix; const AMipmapped: Boolean = False; const AContext: IGrDirectContext = nil): ISkImage; overload; + function MakeShader: ISkShader; overload; + function MakeShader(const ALocalMatrix: TMatrix): ISkShader; overload; + procedure SetChildBlender(const AIndex: Integer; const AValue: ISkBlender); + procedure SetChildBlenderByName(const AName: string; const AValue: ISkBlender); + procedure SetChildColorFilter(const AIndex: Integer; const AValue: ISkColorFilter); + procedure SetChildColorFilterByName(const AName: string; const AValue: ISkColorFilter); + procedure SetChildShader(const AIndex: Integer; const AValue: ISkShader); + procedure SetChildShaderByName(const AName: string; const AValue: ISkShader); + procedure SetUniform(const AIndex: Integer; const AData; const ASize: NativeUInt); overload; + procedure SetUniform(const AIndex: Integer; const AValue: Integer); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TArray); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TPoint); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt2); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt3); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt4); overload; + procedure SetUniform(const AIndex: Integer; const AValue: Single); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TArray); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TPointF); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TAlphaColorF); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat2); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat3); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat4); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat2x2); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat3x3); overload; + procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat4x4); overload; + procedure SetUniform(const AName: string; const AData; const ASize: NativeUInt); overload; + procedure SetUniform(const AName: string; const AValue: Integer); overload; + procedure SetUniform(const AName: string; const AValue: TArray); overload; + procedure SetUniform(const AName: string; const AValue: TPoint); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt2); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt3); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt4); overload; + procedure SetUniform(const AName: string; const AValue: Single); overload; + procedure SetUniform(const AName: string; const AValue: TArray); overload; + procedure SetUniform(const AName: string; const AValue: TPointF); overload; + procedure SetUniform(const AName: string; const AValue: TAlphaColorF); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat2); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat3); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat4); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat2x2); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat3x3); overload; + procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat4x4); overload; + function UniformExists(const AName: string): Boolean; + procedure WriteUniform(const AOffset: NativeUInt; const AData; const ASize: NativeUInt); + public + procedure AfterConstruction; override; + procedure BeforeDestruction; override; + class function MakeForBlender(const ASkSL: string): ISkRuntimeEffect; overload; static; + class function MakeForBlender(const ASkSL: string; out AErrorText: string): ISkRuntimeEffect; overload; static; + class function MakeForColorFilter(const ASkSL: string): ISkRuntimeEffect; overload; static; + class function MakeForColorFilter(const ASkSL: string; out AErrorText: string): ISkRuntimeEffect; overload; static; + class function MakeForShader(const ASkSL: string): ISkRuntimeEffect; overload; static; + class function MakeForShader(const ASkSL: string; out AErrorText: string): ISkRuntimeEffect; overload; static; end; - TSkColorChannel = (R, G, B, A); - - { ISkImageFilter } + { ISkShader } - ISkImageFilter = interface(ISkReferenceCounted) - ['{4EF1950D-0AAA-4D99-9E58-CD78809C55DB}'] - function MakeWithLocalMatrix(const AMatrix: TMatrix): ISkImageFilter; + ISkShader = interface(ISkReferenceCounted) + ['{7CB71D93-131A-4C89-96C5-B966D39F43AF}'] + function MakeWithColorFilter(const AColorFilter: ISkColorFilter): ISkShader; + function MakeWithLocalMatrix(const AMatrix: TMatrix): ISkShader; end; - { TSkImageFilter } + { TSkShader } - TSkImageFilter = class(TSkReferenceCounted, ISkImageFilter) - strict protected - function MakeWithLocalMatrix(const AMatrix: TMatrix): ISkImageFilter; + TSkShader = class(TSkReferenceCounted, ISkShader) + strict private + function MakeWithColorFilter(const AColorFilter: ISkColorFilter): ISkShader; + function MakeWithLocalMatrix(const AMatrix: TMatrix): ISkShader; public - class function MakeAlphaThreshold(const ARegion: TRect; const AInnerMin, AOuterMax: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; inline; - class function MakeAlphaThreshold(const ARegion: ISkRegion; const AInnerMin, AOuterMax: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeArithmetic(const AK1, AK2, AK3, AK4: Single; const AEnforcePremultipliedColor: Boolean; const ABackground: ISkImageFilter; AForeground: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeArithmetic(const AK1, AK2, AK3, AK4: Single; const AEnforcePremultipliedColor: Boolean; const ABackground: ISkImageFilter; const ACropRect: TRectF; AForeground: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeBlend(const AMode: TSkBlendMode; const ABackground: ISkImageFilter; AForeground: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeBlend(const AMode: TSkBlendMode; const ABackground: ISkImageFilter; const ACropRect: TRectF; AForeground: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeBlur(const ASigmaX, ASigmaY: Single; AInput: ISkImageFilter = nil; const ATileMode: TSkTileMode = TSkTileMode.Decal): ISkImageFilter; overload; static; - class function MakeBlur(const ASigmaX, ASigmaY: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil; const ATileMode: TSkTileMode = TSkTileMode.Decal): ISkImageFilter; overload; static; - class function MakeColorFilter(const AColorFilter: ISkColorFilter; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeColorFilter(const AColorFilter: ISkColorFilter; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeCompose(const AOuter, AInner: ISkImageFilter): ISkImageFilter; static; - class function MakeDilate(const ARadiusX, ARadiusY: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDilate(const ARadiusX, ARadiusY: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDisplacementMap(const AXChannelSelector, AYChannelSelector: TSkColorChannel; const AScale: Single; const ADisplacement: ISkImageFilter; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDisplacementMap(const AXChannelSelector, AYChannelSelector: TSkColorChannel; const AScale: Single; const ADisplacement: ISkImageFilter; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDistantLitDiffuse(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDistantLitDiffuse(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDistantLitSpecular(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDistantLitSpecular(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDropShadow(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDropShadow(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDropShadowOnly(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeDropShadowOnly(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeErode(const ARadiusX, ARadiusY: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeErode(const ARadiusX, ARadiusY: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeImage(const AImage: ISkImage): ISkImageFilter; overload; static; inline; - class function MakeImage(const AImage: ISkImage; const ASampling: TSkSamplingOptions): ISkImageFilter; overload; static; inline; - class function MakeImage(const AImage: ISkImage; const ASrc, ADest: TRectF): ISkImageFilter; overload; static; inline; - class function MakeImage(const AImage: ISkImage; const ASrc, ADest: TRectF; const ASampling: TSkSamplingOptions): ISkImageFilter; overload; static; - class function MakeMagnifier(const ASrc: TRectF; const AInset: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeMagnifier(const ASrc: TRectF; const AInset: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeMatrixConvolution(const AKernelSize: TSize; const AKernel: TArray; const AGain, ABias: Single; const AKernelOffset: TPoint; const ATileMode: TSkTileMode; const AConvolveAlpha: Boolean; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeMatrixConvolution(const AKernelSize: TSize; const AKernel: TArray; const AGain, ABias: Single; const AKernelOffset: TPoint; const ATileMode: TSkTileMode; const AConvolveAlpha: Boolean; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeMatrixTransform(const AMatrix: TMatrix; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; inline; - class function MakeMatrixTransform(const AMatrix: TMatrix; const ASampling: TSkSamplingOptions; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeMerge(const AFilter1, AFilter2: ISkImageFilter): ISkImageFilter; overload; static; inline; - class function MakeMerge(const AFilter1, AFilter2: ISkImageFilter; const ACropRect: TRectF): ISkImageFilter; overload; static; inline; - class function MakeMerge(const AFilters: TArray): ISkImageFilter; overload; static; - class function MakeMerge(const AFilters: TArray; const ACropRect: TRectF): ISkImageFilter; overload; static; - class function MakeOffset(const ADeltaX, ADeltaY: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeOffset(const ADeltaX, ADeltaY: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakePicture(const APicture: ISkPicture): ISkImageFilter; overload; static; - class function MakePicture(const APicture: ISkPicture; const ACropRect: TRectF): ISkImageFilter; overload; static; - class function MakePointLitDiffuse(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakePointLitDiffuse(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakePointLitSpecular(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakePointLitSpecular(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeShader(const AShader: ISkShader; const ADither: Boolean): ISkImageFilter; overload; static; - class function MakeShader(const AShader: ISkShader; const ADither: Boolean; const ACropRect: TRectF): ISkImageFilter; overload; static; - class function MakeSpotLitDiffuse(const ALocation, ATarget: TPoint3D; const AFalloffExponent, ACutoffAngle: Single; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeSpotLitDiffuse(const ALocation, ATarget: TPoint3D; const AFalloffExponent, ACutoffAngle: Single; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeSpotLitSpecular(const ALocation, ATarget: TPoint3D; const AFalloffExponent, ACutoffAngle: Single; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeSpotLitSpecular(const ALocation, ATarget: TPoint3D; const AFalloffExponent, ACutoffAngle: Single; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; const ACropRect: TRectF; AInput: ISkImageFilter = nil): ISkImageFilter; overload; static; - class function MakeTile(const ASrc, ADest: TRect; AInput: ISkImageFilter = nil): ISkImageFilter; static; + class function MakeBlend(const AMode: TSkBlendMode; const ADest, ASrc: ISkShader): ISkShader; static; + class function MakeColor(const AColor: TAlphaColor): ISkShader; overload; static; + class function MakeColor(const AColor: TAlphaColorF; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; + class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColor1, AColor2: TAlphaColor; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; + class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColor1, AColor2: TAlphaColor; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; + class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColor1, AColor2: TAlphaColorF; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; + class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColor1, AColor2: TAlphaColorF; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; + class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; + class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; + class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; + class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; + class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const ACenterColor, AEdgeColor: TAlphaColor; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; + class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const ACenterColor, AEdgeColor: TAlphaColor; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; + class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const ACenterColor, AEdgeColor: TAlphaColorF; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; + class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const ACenterColor, AEdgeColor: TAlphaColorF; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; + class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; + class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; + class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; + class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; + class function MakeGradientSweep(const ACenter: TPointF; const AColor1, AColor2: TAlphaColor; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360): ISkShader; overload; static; inline; + class function MakeGradientSweep(const ACenter: TPointF; const AColor1, AColor2: TAlphaColor; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360): ISkShader; overload; static; inline; + class function MakeGradientSweep(const ACenter: TPointF; const AColor1, AColor2: TAlphaColorF; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; + class function MakeGradientSweep(const ACenter: TPointF; const AColor1, AColor2: TAlphaColorF; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; + class function MakeGradientSweep(const ACenter: TPointF; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360): ISkShader; overload; static; + class function MakeGradientSweep(const ACenter: TPointF; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360): ISkShader; overload; static; + class function MakeGradientSweep(const ACenter: TPointF; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; + class function MakeGradientSweep(const ACenter: TPointF; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; + class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColor1, AColor2: TAlphaColor; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; + class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColor1, AColor2: TAlphaColor; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; + class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColor1, AColor2: TAlphaColorF; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; + class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColor1, AColor2: TAlphaColorF; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; + class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; + class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; + class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; + class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; + class function MakeImage(const AImage: ISkImage; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + class function MakeImage(const AImage: ISkImage; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + class function MakeImage(const AImage: ISkImage; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + class function MakeImage(const AImage: ISkImage; const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; + class function MakePerlinNoiseFractalNoise(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single): ISkShader; overload; static; + class function MakePerlinNoiseFractalNoise(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single; const ATileSize: TSize): ISkShader; overload; static; + class function MakePerlinNoiseTurbulence(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single): ISkShader; overload; static; + class function MakePerlinNoiseTurbulence(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single; const ATileSize: TSize): ISkShader; overload; static; + class function MakePicture(const APicture: ISkPicture; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + class function MakePicture(const APicture: ISkPicture; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + class function MakePicture(const APicture: ISkPicture; const ATileRect: TRectF; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; + class function MakePicture(const APicture: ISkPicture; const ATileRect: TRectF; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; end; - TSkBlurStyle = (Normal, Solid, Outer, Inner); - - { ISkMaskFilter } + { ISkSurface } - ISkMaskFilter = interface(ISkReferenceCounted) - ['{95610E43-0B23-411D-BA4B-D522FC724365}'] + ISkSurface = interface(ISkReferenceCounted) + ['{69826677-0632-4D9E-ABAB-B210BE9309C3}'] + function GetCanvas: ISkCanvas; + function GetProperties: TSkSurfaceProperties; + function MakeImageSnapshot: ISkImage; overload; + function MakeImageSnapshot(const ABounds: TRect): ISkImage; overload; + function PeekPixels: ISkPixmap; + function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; + function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; + procedure Draw(const ACanvas: ISkCanvas; const AX, AY: Single; const APaint: ISkPaint = nil); + procedure Flush; + procedure FlushAndSubmit(const ASyncCpu: Boolean = False); + property Canvas: ISkCanvas read GetCanvas; + property Properties: TSkSurfaceProperties read GetProperties; end; - { TSkMaskFilter } + { TSkSurface } - TSkMaskFilter = class(TSkReferenceCounted, ISkMaskFilter) + TSkSurface = class(TSkReferenceCounted, ISkSurface) + strict private + FCanvas: ISkCanvas; + function GetCanvas: ISkCanvas; + function GetProperties: TSkSurfaceProperties; + function MakeImageSnapshot: ISkImage; overload; + function MakeImageSnapshot(const ABounds: TRect): ISkImage; overload; + function PeekPixels: ISkPixmap; + function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; + function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; + procedure Draw(const ACanvas: ISkCanvas; const AX, AY: Single; const APaint: ISkPaint = nil); + procedure Flush; + procedure FlushAndSubmit(const ASyncCpu: Boolean = False); + class procedure raster_release_proc(pixels: Pointer; context: Pointer); cdecl; static; public - class function MakeBlur(const AStyle: TSkBlurStyle; const ASigma: Single; const ARespectCTM: Boolean = True): ISkMaskFilter; static; - class function MakeShader(const AShader: ISkShader): ISkMaskFilter; static; - class function MakeTable(const ATable: TSkTableFilter): ISkMaskFilter; static; - class function MakeTableClip(const AMin, AMax: Byte): ISkMaskFilter; static; - class function MakeTableGamma(const AGamma: Single): ISkMaskFilter; static; + class function MakeFromMTKView(const AContext: IGrDirectContext; const AView: GrMtlHandle; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; + class function MakeFromMTKView(const AContext: IGrDirectContext; const AView: GrMtlHandle; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; const AProperties: TSkSurfaceProperties; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; + class function MakeFromRenderTarget(const AContext: IGrDirectContext; const ARenderTarget: IGrBackendRenderTarget; const AOrigin: TGrSurfaceOrigin; const AColorType: TSkColorType; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; + class function MakeFromRenderTarget(const AContext: IGrDirectContext; const ARenderTarget: IGrBackendRenderTarget; const AOrigin: TGrSurfaceOrigin; const AColorType: TSkColorType; const AProperties: TSkSurfaceProperties; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; + class function MakeFromTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; + class function MakeFromTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; const AProperties: TSkSurfaceProperties; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; + class function MakeRaster(const AWidth, AHeight: Integer; const AColorType: TSkColorType = {$IFDEF BIGENDIAN}TSkColorType.RGBA8888{$ELSE}TSkColorType.BGRA8888{$ENDIF}; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; inline; + class function MakeRaster(const AWidth, AHeight: Integer; const AProperties: TSkSurfaceProperties; const AColorType: TSkColorType = {$IFDEF BIGENDIAN}TSkColorType.RGBA8888{$ELSE}TSkColorType.BGRA8888{$ENDIF}; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; inline; + class function MakeRaster(const AImageInfo: TSkImageInfo): ISkSurface; overload; static; inline; + class function MakeRaster(const AImageInfo: TSkImageInfo; const AProperties: TSkSurfaceProperties): ISkSurface; overload; static; inline; + class function MakeRaster(const AImageInfo: TSkImageInfo; const ARowBytes: NativeUInt): ISkSurface; overload; static; + class function MakeRaster(const AImageInfo: TSkImageInfo; const ARowBytes: NativeUInt; const AProperties: TSkSurfaceProperties): ISkSurface; overload; static; + class function MakeRasterDirect(const APixmap: ISkPixmap; const ARasterReleaseProc: TSkSurfaceRasterReleaseProc = nil): ISkSurface; overload; static; + class function MakeRasterDirect(const APixmap: ISkPixmap; const AProperties: TSkSurfaceProperties; const ARasterReleaseProc: TSkSurfaceRasterReleaseProc = nil): ISkSurface; overload; static; + class function MakeRasterDirect(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt; const ARasterReleaseProc: TSkSurfaceRasterReleaseProc = nil): ISkSurface; overload; static; + class function MakeRasterDirect(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt; const AProperties: TSkSurfaceProperties; const ARasterReleaseProc: TSkSurfaceRasterReleaseProc = nil): ISkSurface; overload; static; + class function MakeRenderTarget(const AContext: IGrDirectContext; const AIsBudgeted: Boolean; const AImageInfo: TSkImageInfo; const ASampleCount: Integer = 0; const AOrigin: TGrSurfaceOrigin = TGrSurfaceOrigin.BottomLeft; const AShouldCreateWithMips: Boolean = False): ISkSurface; overload; static; + class function MakeRenderTarget(const AContext: IGrDirectContext; const AIsBudgeted: Boolean; const AImageInfo: TSkImageInfo; const AProperties: TSkSurfaceProperties; const ASampleCount: Integer = 0; const AOrigin: TGrSurfaceOrigin = TGrSurfaceOrigin.BottomLeft; const AShouldCreateWithMips: Boolean = False): ISkSurface; overload; static; end; - ISkPathEffect = interface; - - TSkStrokeCap = (Butt, Round, Square); + { ISkTextBlob } - TSkStrokeJoin = (Miter, Round, Bevel); + ISkTextBlob = interface(ISkNonVirtualReferenceCounted) + ['{EC17FBCB-9578-402C-86B9-55ECA69E78E0}'] + function GetIntercepts(const AUpperBounds, ALowerBounds: Single; const APaint: ISkPaint = nil): TArray; + end; - TSkPaintStyle = (Fill, Stroke, StrokeAndFill); + { TSkTextBlob } - { ISkPaint } + TSkTextBlob = class(TSkNonVirtualReferenceCounted, ISkTextBlob) + strict private + function GetIntercepts(const AUpperBounds, ALowerBounds: Single; const APaint: ISkPaint = nil): TArray; + public + class function MakeFromText(const AText: string; const AFont: ISkFont): ISkTextBlob; static; + class function MakeFromTextHorizontallyPositioned(const AText: string; const AXPositions: TArray; const AY: Single; const AFont: ISkFont): ISkTextBlob; static; + class function MakeFromTextPositioned(const AText: string; const APositions: TArray; const AFont: ISkFont): ISkTextBlob; static; + class function MakeFromTextTransform(const AText: string; const AMatrices: TArray; const AFont: ISkFont): ISkTextBlob; static; + class procedure __RefHandle(const AHandle: THandle); override; + class procedure __UnrefHandle(const AHandle: THandle); override; + end; - ISkPaint = interface(ISkObject) - ['{CE841D6E-DD17-488C-8A07-05F65E8DB03E}'] - function GetAlpha: Byte; - function GetAlphaF: Single; - function GetAntiAlias: Boolean; - function GetBlender: ISkBlender; - function GetColor: TAlphaColor; - function GetColorF: TAlphaColorF; - function GetColorFilter: ISkColorFilter; - function GetDither: Boolean; - function GetFillPath(const APath: ISkPath): ISkPath; overload; - function GetFillPath(const APath: ISkPath; const ACullRect: TRectF; const AResScale: Single = 1): ISkPath; overload; - function GetImageFilter: ISkImageFilter; - function GetMaskFilter: ISkMaskFilter; - function GetPathEffect: ISkPathEffect; - function GetShader: ISkShader; - function GetStrokeCap: TSkStrokeCap; - function GetStrokeJoin: TSkStrokeJoin; - function GetStrokeMiter: Single; - function GetStrokeWidth: Single; - function GetStyle: TSkPaintStyle; - procedure Reset; - procedure SetAlpha(const AValue: Byte); - procedure SetAlphaF(const AValue: Single); - procedure SetAntiAlias(const AValue: Boolean); - procedure SetARGB(const A, R, G, B: Byte); - procedure SetBlender(AValue: ISkBlender); - procedure SetColor(const AValue: TAlphaColor); - procedure SetColorF(const AValue: TAlphaColorF; AColorSpace: ISkColorSpace = nil); - procedure SetColorFilter(AValue: ISkColorFilter); - procedure SetDither(const AValue: Boolean); - procedure SetImageFilter(AValue: ISkImageFilter); - procedure SetMaskFilter(AValue: ISkMaskFilter); - procedure SetPathEffect(AValue: ISkPathEffect); - procedure SetShader(AValue: ISkShader); - procedure SetStrokeCap(const AValue: TSkStrokeCap); - procedure SetStrokeJoin(const AValue: TSkStrokeJoin); - procedure SetStrokeMiter(const AValue: Single); - procedure SetStrokeWidth(const AValue: Single); - procedure SetStyle(const AValue: TSkPaintStyle); - property Alpha: Byte read GetAlpha write SetAlpha; - property AlphaF: Single read GetAlphaF write SetAlphaF; - property AntiAlias: Boolean read GetAntiAlias write SetAntiAlias; - property Blender: ISkBlender read GetBlender write SetBlender; - property Color: TAlphaColor read GetColor write SetColor; - property ColorFilter: ISkColorFilter read GetColorFilter write SetColorFilter; - property Dither: Boolean read GetDither write SetDither; - property ImageFilter: ISkImageFilter read GetImageFilter write SetImageFilter; - property MaskFilter: ISkMaskFilter read GetMaskFilter write SetMaskFilter; - property PathEffect: ISkPathEffect read GetPathEffect write SetPathEffect; - property Shader: ISkShader read GetShader write SetShader; - property StrokeCap: TSkStrokeCap read GetStrokeCap write SetStrokeCap; - property StrokeJoin: TSkStrokeJoin read GetStrokeJoin write SetStrokeJoin; - property StrokeMiter: Single read GetStrokeMiter write SetStrokeMiter; - property StrokeWidth: Single read GetStrokeWidth write SetStrokeWidth; - property Style: TSkPaintStyle read GetStyle write SetStyle; + { ISkTraceMemoryDump } + + ISkTraceMemoryDump = interface(ISkObject) + ['{7736D6EF-9FCA-46C5-AD45-AFBB92086D33}'] end; - { TSkPaint } + { TSkTraceMemoryDumpBaseClass } - TSkPaint = class(TSkObject, ISkPaint) + TSkTraceMemoryDumpBaseClass = class abstract(TSkObject, ISkTraceMemoryDump) + strict private + class constructor Create; + class procedure dump_numeric_value_proc(context: Pointer; const dump_name, value_name, units: MarshaledAString; value: uint64_t); cdecl; static; + class procedure dump_string_value_proc(context: Pointer; const dump_name, value_name, value: MarshaledAString); cdecl; static; strict protected - function GetAlpha: Byte; - function GetAlphaF: Single; - function GetAntiAlias: Boolean; - function GetBlender: ISkBlender; - function GetColor: TAlphaColor; - function GetColorF: TAlphaColorF; - function GetColorFilter: ISkColorFilter; - function GetDither: Boolean; - function GetFillPath(const APath: ISkPath): ISkPath; overload; - function GetFillPath(const APath: ISkPath; const ACullRect: TRectF; const AResScale: Single = 1): ISkPath; overload; - function GetImageFilter: ISkImageFilter; - function GetMaskFilter: ISkMaskFilter; - function GetPathEffect: ISkPathEffect; - function GetShader: ISkShader; - function GetStrokeCap: TSkStrokeCap; - function GetStrokeJoin: TSkStrokeJoin; - function GetStrokeMiter: Single; - function GetStrokeWidth: Single; - function GetStyle: TSkPaintStyle; - procedure Reset; - procedure SetAlpha(const AValue: Byte); - procedure SetAlphaF(const AValue: Single); - procedure SetAntiAlias(const AValue: Boolean); - procedure SetARGB(const A, R, G, B: Byte); - procedure SetBlender(AValue: ISkBlender); - procedure SetColor(const AValue: TAlphaColor); - procedure SetColorF(const AValue: TAlphaColorF; AColorSpace: ISkColorSpace = nil); - procedure SetColorFilter(AValue: ISkColorFilter); - procedure SetDither(const AValue: Boolean); - procedure SetImageFilter(AValue: ISkImageFilter); - procedure SetMaskFilter(AValue: ISkMaskFilter); - procedure SetPathEffect(AValue: ISkPathEffect); - procedure SetShader(AValue: ISkShader); - procedure SetStrokeCap(const AValue: TSkStrokeCap); - procedure SetStrokeJoin(const AValue: TSkStrokeJoin); - procedure SetStrokeMiter(const AValue: Single); - procedure SetStrokeWidth(const AValue: Single); - procedure SetStyle(const AValue: TSkPaintStyle); + procedure DumpNumericValue(const ADumpName, AValueName, AUnits: string; const AValue: UInt64); virtual; abstract; + procedure DumpStringValue(const ADumpName, AValueName, AValue: string); virtual; abstract; public - constructor Create; overload; - constructor Create(const APaint: ISkPaint); overload; - constructor Create(const AStyle: TSkPaintStyle); overload; - class procedure DestroyHandle(const AHandle: THandle); override; + constructor Create(const ADetailedDump, ADumpWrappedObjects: Boolean); + class procedure __DestroyHandle(const AHandle: THandle); override; end; - TSkPathOp = (Difference, Intersect, Union, &Xor, ReverseDifference); - - { ISkOpBuilder } + { ISkTypeface } - ISkOpBuilder = interface(ISkObject) - ['{A100B404-CA30-4A30-807E-6D641326816A}'] - procedure Add(const APath: ISkPath; const AOp: TSkPathOp); - function Detach: ISkPath; + ISkTypeface = interface(ISkReferenceCounted) + ['{A6ECEB69-E0EB-4CFF-941F-75B8D1702FE5}'] + function GetFamilyName: string; + function GetSlant: TSkFontSlant; + function GetStyle: TSkFontStyle; + function GetWeight: Integer; + function GetWidth: Integer; + function IsBold: Boolean; + function IsItalic: Boolean; + property FamilyName: string read GetFamilyName; + property Slant: TSkFontSlant read GetSlant; + property Style: TSkFontStyle read GetStyle; + property Weight: Integer read GetWeight; + property Width: Integer read GetWidth; end; - { TSkOpBuilder } + { TSkTypeface } - TSkOpBuilder = class(TSkObject, ISkOpBuilder) - strict protected - procedure Add(const APath: ISkPath; const AOp: TSkPathOp); - function Detach: ISkPath; + TSkTypeface = class(TSkReferenceCounted, ISkTypeface) + strict private + function GetFamilyName: string; + function GetSlant: TSkFontSlant; + function GetStyle: TSkFontStyle; + function GetWeight: Integer; + function GetWidth: Integer; + function IsBold: Boolean; + function IsItalic: Boolean; public - constructor Create; - class procedure DestroyHandle(const AHandle: THandle); override; + class function MakeDefault: ISkTypeface; static; + class function MakeFromFile(const AFileName: string; const ATTCIndex: Integer = 0): ISkTypeface; static; + class function MakeFromName(const AFamilyName: string; const AStyle: TSkFontStyle): ISkTypeface; static; + class function MakeFromStream(const AStream: TStream; const ATTCIndex: Integer = 0): ISkTypeface; static; end; - TSkPathVerb = (Move, Line, Quad, Conic, Cubic, Close); + { ISkVertices } - TSkPathPoints = array[0..3] of TPointF; + ISkVertices = interface(ISkNonVirtualReferenceCounted) + ['{C4D307F3-E77A-4270-8559-E27ED245E86A}'] + end; - { TSkPathIteratorElem } + { TSkVertices } - TSkPathIteratorElem = record - Verb: TSkPathVerb; - Points: TSkPathPoints; - ConicWeight: Single; + TSkVertices = class(TSkNonVirtualReferenceCounted, ISkVertices) + public + class function MakeCopy(const AVertexMode: TSkVertexMode; const APositions, ATextures: TArray; const AColors: TArray; const AIndices: TArray = nil): ISkVertices; static; + class procedure __RefHandle(const AHandle: THandle); override; + class procedure __UnrefHandle(const AHandle: THandle); override; end; - TSkPathFillType = (Winding, EvenOdd, InverseWinding, InverseEvenOdd); + { ISkParticleEffect } - { ISkPathIterator } + ISkParticleEffect = interface(ISkReferenceCounted) + ['{A8AAC230-E76B-4BBE-84F2-82D09D38E0D4}'] + function GetPosition: TPointF; + function GetRate: Single; + function GetUniform(const AIndex: NativeUInt): TSkParticleUniform; + function GetUniformCount: NativeUInt; + function GetUniformData: PSingleArray; + function GetUniformDataCount: Integer; + function GetUniformName(const AIndex: NativeUInt): string; + procedure Render(const ACanvas: ISkCanvas); + procedure SetPosition(const AValue: TPointF); + procedure SetRate(const AValue: Single); + function SetUniform(const AName: string; const AData: TArray): Boolean; + procedure Start(const ANow: Double; const ALooping: Boolean); + procedure Update(const ANow: Double); + property Position: TPointF read GetPosition write SetPosition; + property Rate: Single read GetRate write SetRate; + property Uniforms[const AIndex: NativeUInt]: TSkParticleUniform read GetUniform; + property UniformCount: NativeUInt read GetUniformCount; + property UniformData: PSingleArray read GetUniformData; + property UniformDataCount: Integer read GetUniformDataCount; + property UniformName[const AIndex: NativeUInt]: string read GetUniformName; + end; - ISkPathIterator = interface(ISkEnumerable) - ['{5FE88F86-9913-4594-B41D-4A4DA84CB54B}'] + { TSkParticleEffect } + + TSkParticleEffect = class(TSkReferenceCounted, ISkParticleEffect) + strict private + function GetPosition: TPointF; + function GetRate: Single; + function GetUniform(const AIndex: NativeUInt): TSkParticleUniform; + function GetUniformCount: NativeUInt; + function GetUniformData: PSingleArray; + function GetUniformDataCount: Integer; + function GetUniformName(const AIndex: NativeUInt): string; + procedure Render(const ACanvas: ISkCanvas); + procedure SetPosition(const AValue: TPointF); + procedure SetRate(const AValue: Single); + function SetUniform(const AName: string; const AData: TArray): Boolean; + procedure Start(const ANow: Double; const ALooping: Boolean); + procedure Update(const ANow: Double); + class constructor Create; + public + class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil): ISkParticleEffect; static; + class function MakeFromFile(const AFileName: string): ISkParticleEffect; static; + class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil): ISkParticleEffect; static; end; - TSkSegmentMask = (Line, Quad, Conic, Cubic); - TSkSegmentMasks = set of TSkSegmentMask; + { ISkottieAnimation } - { ISkPath } + ISkottieAnimation = interface(ISkNonVirtualReferenceCounted) + ['{3B87EFFF-8184-4576-A4AC-B73342834211}'] + function GetDuration: Double; + function GetFPS: Double; + function GetInPoint: Double; + function GetOutPoint: Double; + function GetSize: TSizeF; + function GetVersion: string; + procedure Render(const ACanvas: ISkCanvas; const ARenderFlags: TSkottieAnimationRenderFlags = []); overload; + procedure Render(const ACanvas: ISkCanvas; const ADest: TRectF; const ARenderFlags: TSkottieAnimationRenderFlags = []); overload; + procedure SeekFrame(const ATick: Double); + procedure SeekFrameTime(const ATick: Double); + property Duration: Double read GetDuration; + property FPS: Double read GetFPS; + property InPoint: Double read GetInPoint; + property OutPoint: Double read GetOutPoint; + property Size: TSizeF read GetSize; + property Version: string read GetVersion; + end; - ISkPath = interface(ISkObject) - ['{0C027CE6-EDF6-4E6D-950C-FABA79C2251A}'] - function Contains(const AX, AY: Single): Boolean; - function GetBounds: TRectF; - function GetFillType: TSkPathFillType; - function GetIterator(const AForceClose: Boolean): ISkPathIterator; - function GetLastPoint: TPointF; - function GetSegmentMasks: TSkSegmentMasks; - function GetTightBounds: TRectF; - function Interpolate(const AEnding: ISkPath; const AWeight: Single): ISkPath; - function IsConvex: Boolean; - function IsEmpty: Boolean; - function IsFinite: Boolean; - function IsInterpolatable(const AOther: ISkPath): Boolean; - function IsLastContourClosed: Boolean; - function IsLine: Boolean; overload; - function IsLine(out APoint1, APoint2: TPointF): Boolean; overload; - function IsOval: Boolean; overload; - function IsOval(out ARect: TRectF): Boolean; overload; - function IsRect: Boolean; overload; - function IsRect(out ARect: TRectF): Boolean; overload; - function IsRoundRect: Boolean; overload; - function IsRoundRect(out ARoundRect: ISkRoundRect): Boolean; overload; - function Serialize: TBytes; - procedure SerializeToStream(const AStream: TStream); - function ToSVG: string; - function Transform(const AMatrix: TMatrix): ISkPath; - property Bounds: TRectF read GetBounds; - property FillType: TSkPathFillType read GetFillType; - property LastPoint: TPointF read GetLastPoint; - property SegmentMasks: TSkSegmentMasks read GetSegmentMasks; - property TightBounds: TRectF read GetTightBounds; + { TSkottieAnimation } + + TSkottieAnimation = class(TSkNonVirtualReferenceCounted, ISkottieAnimation) + strict private + function GetDuration: Double; + function GetFPS: Double; + function GetInPoint: Double; + function GetOutPoint: Double; + function GetSize: TSizeF; + function GetVersion: string; + procedure Render(const ACanvas: ISkCanvas; const ARenderFlags: TSkottieAnimationRenderFlags = []); overload; + procedure Render(const ACanvas: ISkCanvas; const ADest: TRectF; const ARenderFlags: TSkottieAnimationRenderFlags = []); overload; + procedure SeekFrame(const ATick: Double); + procedure SeekFrameTime(const ATick: Double); + public + class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil): ISkottieAnimation; static; + class function MakeFromFile(const AFileName: string): ISkottieAnimation; static; + class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil): ISkottieAnimation; static; + class procedure __RefHandle(const AHandle: THandle); override; + class procedure __UnrefHandle(const AHandle: THandle); override; end; - { TSkPath } + { ISkParagraph } - TSkPath = class(TSkObject, ISkPath) - strict private type - TPathIterator = class(TSkEnumerable, ISkPathIterator) - strict private - FCurrent: TSkPathIteratorElem; - strict protected - function GetCurrent: TSkPathIteratorElem; override; - function MoveNext: Boolean; override; - public - constructor Create(const APath: ISkPath; const AForceClose: Boolean); - class procedure DestroyHandle(const AHandle: THandle); override; - end; + ISkParagraph = interface(ISkObject) + ['{CB618EF9-C99E-4079-8637-9E282FAA64DD}'] + function DidExceedMaxLines: Boolean; + function GetAlphabeticBaseline: Single; + function GetGlyphPositionAtCoordinate(const ADeltaX, ADeltaY: Single): TSkPositionAffinity; + function GetHeight: Single; + function GetIdeographicBaseline: Single; + function GetLineMetrics: TArray; + function GetLongestLine: Single; + function GetMaxIntrinsicWidth: Single; + function GetMaxWidth: Single; + function GetMinIntrinsicWidth: Single; + function GetRectsForPlaceholders: TArray; + function GetRectsForRange(const AStart, AEnd: Cardinal; const ARectHeightStyle: TSkRectHeightStyle; const ARectWidthStyle: TSkRectWidthStyle): TArray; + procedure GetWordBoundary(const AOffset: Cardinal; out AStart, AEnd: Cardinal); + procedure Layout(const AWidth: Single); + procedure Paint(const ACanvas: ISkCanvas; const AX, AY: Single); + function ToPath: ISkPath; + procedure Visit(const AProc: TSkParagraphVisitProc); + property AlphabeticBaseline: Single read GetAlphabeticBaseline; + property Height: Single read GetHeight; + property IdeographicBaseline: Single read GetIdeographicBaseline; + property LineMetrics: TArray read GetLineMetrics; + property LongestLine: Single read GetLongestLine; + property MaxIntrinsicWidth: Single read GetMaxIntrinsicWidth; + property MaxWidth: Single read GetMaxWidth; + property MinIntrinsicWidth: Single read GetMinIntrinsicWidth; + end; + + { TSkParagraph } - strict protected - function Contains(const AX, AY: Single): Boolean; - function GetBounds: TRectF; - function GetFillType: TSkPathFillType; - function GetIterator(const AForceClose: Boolean): ISkPathIterator; - function GetLastPoint: TPointF; - function GetSegmentMasks: TSkSegmentMasks; - function GetTightBounds: TRectF; - function Interpolate(const AEnding: ISkPath; const AWeight: Single): ISkPath; - function IsConvex: Boolean; - function IsEmpty: Boolean; - function IsFinite: Boolean; - function IsInterpolatable(const APath: ISkPath): Boolean; - function IsLastContourClosed: Boolean; - function IsLine: Boolean; overload; - function IsLine(out APoint1, APoint2: TPointF): Boolean; overload; - function IsOval: Boolean; overload; - function IsOval(out ARect: TRectF): Boolean; overload; - function IsRect: Boolean; overload; - function IsRect(out ARect: TRectF): Boolean; overload; - function IsRoundRect: Boolean; overload; - function IsRoundRect(out ARoundRect: ISkRoundRect): Boolean; overload; - function Serialize: TBytes; - procedure SerializeToStream(const AStream: TStream); - function ToSVG: string; - function Transform(const AMatrix: TMatrix): ISkPath; + TSkParagraph = class(TSkObject, ISkParagraph) + strict private + function DidExceedMaxLines: Boolean; + function GetAlphabeticBaseline: Single; + function GetGlyphPositionAtCoordinate(const ADeltaX, ADeltaY: Single): TSkPositionAffinity; + function GetHeight: Single; + function GetIdeographicBaseline: Single; + function GetLineMetrics: TArray; + function GetLongestLine: Single; + function GetMaxIntrinsicWidth: Single; + function GetMaxWidth: Single; + function GetMinIntrinsicWidth: Single; + function GetRectsForPlaceholders: TArray; + function GetRectsForRange(const AStart, AEnd: Cardinal; const ARectHeightStyle: TSkRectHeightStyle; const ARectWidthStyle: TSkRectWidthStyle): TArray; + procedure GetWordBoundary(const AOffset: Cardinal; out AStart, AEnd: Cardinal); + procedure Layout(const AWidth: Single); + procedure Paint(const ACanvas: ISkCanvas; const AX, AY: Single); + function ToPath: ISkPath; + procedure Visit(const AProc: TSkParagraphVisitProc); + class procedure visit_proc(line_number: int32_t; const info: psk_paragraphvisitorinfo_t; context: Pointer); cdecl; static; public - constructor Create(const ASVG: string); overload; - constructor Create(const ABytes: TBytes); overload; - constructor Create(const AStream: TStream); overload; - class function ConvertConicToQuads(const APoint1, APoint2, APoint3: TPointF; const AWeight: Single; const APower2: Integer): TArray; static; - class procedure DestroyHandle(const AHandle: THandle); override; - end; - TSkPathDirection = (CW, CCW); + class procedure __DestroyHandle(const AHandle: THandle); override; + end; - TSkPathArcSize = (Small, Large); + {$HPPEMIT END '#define SkParagraph(...) __SkCreate(TSkParagraph, ISkParagraph, __VA_ARGS__)'} - { ISkPathBuilder } + { ISkParagraphBuilder } - ISkPathBuilder = interface(ISkObject) - ['{9C587A80-9302-4FAB-86A9-4F068607F74E}'] - procedure AddArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single); - procedure AddCircle(const ACenter: TPointF; ARadius: Single; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddCircle(const ACenterX, ACenterY, ARadius: Single; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddOval(const ARect: TRectF; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddOval(const ARect: TRectF; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; - procedure AddPath(const APath: ISkPath); - procedure AddPolygon(const APolygon: TPolygon; const IsClosed: Boolean); - procedure AddRect(const ARect: TRectF; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddRect(const ARect: TRectF; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; - procedure AddRoundRect(const ARoundRect: ISkRoundRect; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddRoundRect(const ARoundRect: ISkRoundRect; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; - procedure ArcTo(const APoint1, APoint2: TPointF; const ARadius: Single); overload; - procedure ArcTo(const AOval: TRectF; const AStartAngle, ASweepAngle: Single; const AForceMoveTo: Boolean); overload; - procedure ArcTo(const ARadius: TPointF; const XAxisRotate: Single; const ALargeArc: TSkPathArcSize; const ASweep: TSkPathDirection; const AXY: TPointF); overload; - procedure Close; - procedure ConicTo(const APoint1, APoint2: TPointF; const AWeight: Single); overload; - procedure ConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); overload; - procedure CubicTo(const APoint1, APoint2, APoint3: TPointF); overload; - procedure CubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); overload; - function Detach: ISkPath; - function GetBounds: TRectF; - function GetFillType: TSkPathFillType; - procedure IncReserve(const AExtraPointCount: Integer); overload; - procedure IncReserve(const AExtraPointCount, AExtraVerbCount: Integer); overload; - procedure LineTo(const APoint: TPointF); overload; - procedure LineTo(const AX, AY: Single); overload; - procedure MoveTo(const APoint: TPointF); overload; - procedure MoveTo(const AX, AY: Single); overload; - procedure Offset(const ADeltaX, ADeltaY: Single); - procedure PolylineTo(const APoints: TArray); - procedure QuadTo(const APoint1, APoint2: TPointF); overload; - procedure QuadTo(const AX1, AY1, AX2, AY2: Single); overload; - procedure RConicTo(const APoint1, APoint2: TPointF; const AWeight: Single); overload; - procedure RConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); overload; - procedure RCubicTo(const APoint1, APoint2, APoint3: TPointF); overload; - procedure RCubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); overload; - procedure Reset; - procedure RLineTo(const APoint: TPointF); overload; - procedure RLineTo(const AX, AY: Single); overload; - procedure RQuadTo(const APoint1, APoint2: TPointF); overload; - procedure RQuadTo(const AX1, AY1, AX2, AY2: Single); overload; - procedure SetFillType(const AValue: TSkPathFillType); - function Snapshot: ISkPath; - procedure ToggleInverseFillType; - property Bounds: TRectF read GetBounds; - property FillType: TSkPathFillType read GetFillType write SetFillType; + ISkParagraphBuilder = interface(ISkObject) + ['{1D484C30-D4E1-49BC-AF2E-7D7E7FF568BE}'] + procedure AddPlaceholder(const APlaceholder: TSkPlaceholderStyle); + procedure AddText(const AText: string); + function Build: ISkParagraph; + procedure Pop; + procedure PushStyle(const ATextStyle: ISkTextStyle); end; - { TSkPathBuilder } + { TSkParagraphBuilder } - TSkPathBuilder = class(TSkObject, ISkPathBuilder) - strict protected - procedure AddArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single); - procedure AddCircle(const ACenter: TPointF; ARadius: Single; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddCircle(const ACenterX, ACenterY, ARadius: Single; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddOval(const ARect: TRectF; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddOval(const ARect: TRectF; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; - procedure AddPath(const APath: ISkPath); - procedure AddPolygon(const APolygon: TPolygon; const IsClosed: Boolean); - procedure AddRect(const ARect: TRectF; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddRect(const ARect: TRectF; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; - procedure AddRoundRect(const ARoundRect: ISkRoundRect; ADirection: TSkPathDirection = TSkPathDirection.CW); overload; - procedure AddRoundRect(const ARoundRect: ISkRoundRect; ADirection: TSkPathDirection; AStartIndex: Cardinal); overload; - procedure ArcTo(const APoint1, APoint2: TPointF; const ARadius: Single); overload; - procedure ArcTo(const AOval: TRectF; const AStartAngle, ASweepAngle: Single; const AForceMoveTo: Boolean); overload; - procedure ArcTo(const ARadius: TPointF; const XAxisRotate: Single; const ALargeArc: TSkPathArcSize; const ASweep: TSkPathDirection; const AXY: TPointF); overload; - procedure Close; - procedure ConicTo(const APoint1, APoint2: TPointF; const AWeight: Single); overload; - procedure ConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); overload; - procedure CubicTo(const APoint1, APoint2, APoint3: TPointF); overload; - procedure CubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); overload; - function Detach: ISkPath; - function GetBounds: TRectF; - function GetFillType: TSkPathFillType; - procedure IncReserve(const AExtraPointCount: Integer); overload; - procedure IncReserve(const AExtraPointCount, AExtraVerbCount: Integer); overload; - procedure LineTo(const APoint: TPointF); overload; - procedure LineTo(const AX, AY: Single); overload; - procedure MoveTo(const APoint: TPointF); overload; - procedure MoveTo(const AX, AY: Single); overload; - procedure Offset(const ADeltaX, ADeltaY: Single); - procedure PolylineTo(const APoints: TArray); - procedure QuadTo(const APoint1, APoint2: TPointF); overload; - procedure QuadTo(const AX1, AY1, AX2, AY2: Single); overload; - procedure RConicTo(const APoint1, APoint2: TPointF; const AWeight: Single); overload; - procedure RConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); overload; - procedure RCubicTo(const APoint1, APoint2, APoint3: TPointF); overload; - procedure RCubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); overload; - procedure Reset; - procedure RLineTo(const APoint: TPointF); overload; - procedure RLineTo(const AX, AY: Single); overload; - procedure RQuadTo(const APoint1, APoint2: TPointF); overload; - procedure RQuadTo(const AX1, AY1, AX2, AY2: Single); overload; - procedure SetFillType(const AValue: TSkPathFillType); - function Snapshot: ISkPath; - procedure ToggleInverseFillType; + TSkParagraphBuilder = class(TSkObject, ISkParagraphBuilder) + strict private + procedure AddPlaceholder(const APlaceholder: TSkPlaceholderStyle); + procedure AddText(const AText: string); + function Build: ISkParagraph; + procedure Pop; + procedure PushStyle(const ATextStyle: ISkTextStyle); public - constructor Create; overload; - constructor Create(const APathBuilder: ISkPathBuilder); overload; - constructor Create(const AFillType: TSkPathFillType); overload; - class procedure DestroyHandle(const AHandle: THandle); override; + constructor Create(const AParagraphStyle: ISkParagraphStyle); overload; + constructor Create(const AParagraphStyle: ISkParagraphStyle; const AFontProvider: ISkTypefaceFontProvider; const AEnableFontFallback: Boolean = True); overload; + class procedure __DestroyHandle(const AHandle: THandle); override; end; - TSkPathEffect1DStyle = (Translate, Rotate, Morph); + {$HPPEMIT END '#define SkParagraphBuilder(...) __SkCreate(TSkParagraphBuilder, ISkParagraphBuilder, __VA_ARGS__)'} - TSkPathEffectTrimMode = (Normal, Inverted); - - { ISkPathEffect } + { ISkStrutStyle } - ISkPathEffect = interface(ISkReferenceCounted) - ['{FBC6D035-F485-4E05-8891-AED313592692}'] + ISkStrutStyle = interface(ISkObject) + ['{B5275BA1-4FEE-4300-9BCE-6B6C4C6681A8}'] + function GetEnabled: Boolean; + function GetFontFamilies: TArray; + function GetFontSize: Single; + function GetFontStyle: TSkFontStyle; + function GetForceHeight: Boolean; + function GetHalfLeading: Boolean; + function GetHeightMultiplier: Single; + function GetLeading: Single; + function IsEqual(const AStrutStyle: ISkStrutStyle): Boolean; + procedure SetEnabled(const AValue: Boolean); + procedure SetFontFamilies(const AValue: TArray); + procedure SetFontSize(const AValue: Single); + procedure SetFontStyle(const AValue: TSkFontStyle); + procedure SetForceHeight(const AValue: Boolean); + procedure SetHalfLeading(const AValue: Boolean); + procedure SetHeightMultiplier(const AValue: Single); + procedure SetLeading(const AValue: Single); + property Enabled: Boolean read GetEnabled write SetEnabled; + property FontFamilies: TArray read GetFontFamilies write SetFontFamilies; + property FontSize: Single read GetFontSize write SetFontSize; + property FontStyle: TSkFontStyle read GetFontStyle write SetFontStyle; + property ForceHeight: Boolean read GetForceHeight write SetForceHeight; + property HalfLeading: Boolean read GetHalfLeading write SetHalfLeading; + property HeightMultiplier: Single read GetHeightMultiplier write SetHeightMultiplier; + property Leading: Single read GetLeading write SetLeading; end; - { TSkPathEffect } + { TSkStrutStyle } - TSkPathEffect = class(TSkReferenceCounted, ISkPathEffect) + TSkStrutStyle = class(TSkObject, ISkStrutStyle) + strict private + function GetEnabled: Boolean; + function GetFontFamilies: TArray; + function GetFontSize: Single; + function GetFontStyle: TSkFontStyle; + function GetForceHeight: Boolean; + function GetHalfLeading: Boolean; + function GetHeightMultiplier: Single; + function GetLeading: Single; + function IsEqual(const AStrutStyle: ISkStrutStyle): Boolean; + procedure SetEnabled(const AValue: Boolean); + procedure SetFontFamilies(const AValue: TArray); + procedure SetFontSize(const AValue: Single); + procedure SetFontStyle(const AValue: TSkFontStyle); + procedure SetForceHeight(const AValue: Boolean); + procedure SetHalfLeading(const AValue: Boolean); + procedure SetHeightMultiplier(const AValue: Single); + procedure SetLeading(const AValue: Single); public - class function Make1DPath(const APath: ISkPath; const AAdvance, APhase: Single; const AStyle: TSkPathEffect1DStyle): ISkPathEffect; static; - class function Make2DLine(const AWidth: Single; const AMatrix: TMatrix): ISkPathEffect; static; - class function Make2DPath(const AMatrix: TMatrix; const APath: ISkPath): ISkPathEffect; static; - class function MakeCompose(const AOuter, AInner: ISkPathEffect): ISkPathEffect; static; - class function MakeCorner(const ARadius: Single): ISkPathEffect; static; - class function MakeDash(const AIntervals: TArray; const APhase: Single): ISkPathEffect; static; - class function MakeDiscrete(const ASegLength, ADeviation: Single; const ASeedAssist: Cardinal = 0): ISkPathEffect; static; - class function MakeMatrix(const AMatrix: TMatrix): ISkPathEffect; static; - class function MakeMerge(const AEffect1, AEffect2: ISkPathEffect; const AOp: TSkPathOp): ISkPathEffect; static; - class function MakeStroke(const AWidth: Single; const AJoin: TSkStrokeJoin; const ACap: TSkStrokeCap; const AMiter: Single = 4): ISkPathEffect; static; - class function MakeStrokeAndFill: ISkPathEffect; static; - class function MakeSum(const AEffect1, AEffect2: ISkPathEffect): ISkPathEffect; static; - class function MakeTranslate(const ADeltaX, ADeltaY: Single): ISkPathEffect; static; - class function MakeTrim(const AStart, AStop: Single; const AMode: TSkPathEffectTrimMode): ISkPathEffect; static; + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; end; - TSkPathMeasureMatrixFlag = (Position, Tangent); - TSkPathMeasureMatrixFlags = set of TSkPathMeasureMatrixFlag; + {$HPPEMIT END '#define SkStrutStyle(...) __SkCreate(TSkStrutStyle, ISkStrutStyle, __VA_ARGS__)'} - { ISkPathMeasure } + { ISkParagraphStyle } - ISkPathMeasure = interface(ISkObject) - ['{6D963FCB-E879-499F-AF27-9A92904B66B6}'] - function GetLength: Single; - function GetMatrix(const ADistance: Single; out AMatrix: TMatrix; const AMatrixFlags: TSkPathMeasureMatrixFlags = [TSkPathMeasureMatrixFlag.Position, TSkPathMeasureMatrixFlag.Tangent]): Boolean; - function GetPositionAndTangent(const ADistance: Single; out APosition, ATangent: TPointF): Boolean; - function GetSegment(const AStart, AStop: Single; const AStartWithMoveTo: Boolean): ISkPath; - function IsClosed: Boolean; - function NextContour: Boolean; - property Length: Single read GetLength; + ISkParagraphStyle = interface(ISkObject) + ['{A0D8108C-233E-4DF0-B728-6961730E57B9}'] + procedure DisableHinting; + function GetEllipsis: string; + function GetHeight: Single; + function GetMaxLines: NativeUInt; + function GetStrutStyle: ISkStrutStyle; + function GetTextAlign: TSkTextAlign; + function GetTextDirection: TSkTextDirection; + function GetTextHeightBehaviors: TSkTextHeightBehaviors; + function GetTextStyle: ISkTextStyle; + procedure SetEllipsis(const AValue: string); + procedure SetHeight(const AValue: Single); + procedure SetMaxLines(const AValue: NativeUInt); + procedure SetStrutStyle(AValue: ISkStrutStyle); + procedure SetTextAlign(const AValue: TSkTextAlign); + procedure SetTextDirection(const AValue: TSkTextDirection); + procedure SetTextHeightBehaviors(const AValue: TSkTextHeightBehaviors); + procedure SetTextStyle(AValue: ISkTextStyle); + property Ellipsis: string read GetEllipsis write SetEllipsis; + property Height: Single read GetHeight write SetHeight; + property MaxLines: NativeUInt read GetMaxLines write SetMaxLines; + property StrutStyle: ISkStrutStyle read GetStrutStyle write SetStrutStyle; + property TextAlign: TSkTextAlign read GetTextAlign write SetTextAlign; + property TextDirection: TSkTextDirection read GetTextDirection write SetTextDirection; + property TextHeightBehaviors: TSkTextHeightBehaviors read GetTextHeightBehaviors write SetTextHeightBehaviors; + property TextStyle: ISkTextStyle read GetTextStyle write SetTextStyle; end; - { TSkPathMeasure } + { TSkParagraphStyle } - TSkPathMeasure = class(TSkObject, ISkPathMeasure) - strict protected - function GetLength: Single; - function GetMatrix(const ADistance: Single; out AMatrix: TMatrix; const AMatrixFlags: TSkPathMeasureMatrixFlags = [TSkPathMeasureMatrixFlag.Position, TSkPathMeasureMatrixFlag.Tangent]): Boolean; - function GetPositionAndTangent(const ADistance: Single; out APosition, ATangent: TPointF): Boolean; - function GetSegment(const AStart, AStop: Single; const AStartWithMoveTo: Boolean): ISkPath; - function IsClosed: Boolean; - function NextContour: Boolean; + TSkParagraphStyle = class(TSkObject, ISkParagraphStyle) + strict private + procedure DisableHinting; + function GetEllipsis: string; + function GetHeight: Single; + function GetMaxLines: NativeUInt; + function GetStrutStyle: ISkStrutStyle; + function GetTextAlign: TSkTextAlign; + function GetTextDirection: TSkTextDirection; + function GetTextHeightBehaviors: TSkTextHeightBehaviors; + function GetTextStyle: ISkTextStyle; + procedure SetEllipsis(const AValue: string); + procedure SetHeight(const AValue: Single); + procedure SetMaxLines(const AValue: NativeUInt); + procedure SetStrutStyle(AValue: ISkStrutStyle); + procedure SetTextAlign(const AValue: TSkTextAlign); + procedure SetTextDirection(const AValue: TSkTextDirection); + procedure SetTextHeightBehaviors(const AValue: TSkTextHeightBehaviors); + procedure SetTextStyle(AValue: ISkTextStyle); public - constructor Create(const APath: ISkPath; const AForceClosed: Boolean = False; const AResScale: Single = 1); - class procedure DestroyHandle(const AHandle: THandle); override; + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; end; - { ISkPicture } + {$HPPEMIT END '#define SkParagraphStyle(...) __SkCreate(TSkParagraphStyle, ISkParagraphStyle, __VA_ARGS__)'} - ISkPicture = interface(ISkReferenceCounted) - ['{12564CCD-119B-473F-8585-56D2A1F9DB43}'] - function GetCullRect: TRectF; - function MakeShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - function MakeShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - function MakeShader(const ATileRect: TRectF; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - function MakeShader(const ATileRect: TRectF; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - procedure Playback(const ACanvas: ISkCanvas); - function Serialize: TBytes; - procedure SerializeToStream(const AStream: TStream); - property CullRect: TRectF read GetCullRect; + { ISkTextStyle } + + ISkTextStyle = interface(ISkObject) + ['{36B7F057-D721-4FDF-84C0-AF0864732F29}'] + procedure AddFontFeature(const AFeature: string; const AValue: Integer); + procedure AddShadow(const AShadow: TSkTextShadow); + procedure ClearBackgroundColor; + procedure ClearForegroundColor; + function GetBackground: ISkPaint; + function GetColor: TAlphaColor; + function GetDecorationColor: TAlphaColor; + function GetDecorations: TSkTextDecorations; + function GetDecorationStyle: TSkTextDecorationStyle; + function GetDecorationThickness: Single; + function GetFontFamilies: TArray; + function GetFontMetrics: TSkFontMetrics; + function GetFontSize: Single; + function GetFontStyle: TSkFontStyle; + function GetForeground: ISkPaint; + function GetHalfLeading: Boolean; + function GetHeightMultiplier: Single; + function GetLetterSpacing: Single; + function GetLocale: string; + function GetWordSpacing: Single; + function IsEqual(const ATextStyle: ISkTextStyle): Boolean; + procedure ResetFontFeatures; + procedure ResetShadows; + procedure SetBackgroundColor(const APaint: ISkPaint); + procedure SetColor(const AValue: TAlphaColor); + procedure SetDecorationColor(const AValue: TAlphaColor); + procedure SetDecorations(const AValue: TSkTextDecorations); + procedure SetDecorationStyle(const AValue: TSkTextDecorationStyle); + procedure SetDecorationThickness(const AValue: Single); + procedure SetFontFamilies(const AValue: TArray); + procedure SetFontSize(const AValue: Single); + procedure SetFontStyle(const AValue: TSkFontStyle); + procedure SetForegroundColor(const APaint: ISkPaint); + procedure SetHalfLeading(const AValue: Boolean); + procedure SetHeightMultiplier(const AValue: Single); + procedure SetLetterSpacing(const AValue: Single); + procedure SetLocale(const AValue: string); + procedure SetWordSpacing(const AValue: Single); + property Color: TAlphaColor read GetColor write SetColor; + property DecorationColor: TAlphaColor read GetDecorationColor write SetDecorationColor; + property Decorations: TSkTextDecorations read GetDecorations write SetDecorations; + property DecorationStyle: TSkTextDecorationStyle read GetDecorationStyle write SetDecorationStyle; + property DecorationThickness: Single read GetDecorationThickness write SetDecorationThickness; + property FontFamilies: TArray read GetFontFamilies write SetFontFamilies; + property FontMetrics: TSkFontMetrics read GetFontMetrics; + property FontSize: Single read GetFontSize write SetFontSize; + property FontStyle: TSkFontStyle read GetFontStyle write SetFontStyle; + property HalfLeading: Boolean read GetHalfLeading write SetHalfLeading; + property HeightMultiplier: Single read GetHeightMultiplier write SetHeightMultiplier; + property LetterSpacing: Single read GetLetterSpacing write SetLetterSpacing; + property Locale: string read GetLocale write SetLocale; + property WordSpacing: Single read GetWordSpacing write SetWordSpacing; end; - { TSkPicture } + { TSkTextStyle } - TSkPicture = class(TSkReferenceCounted, ISkPicture) - strict protected - function GetCullRect: TRectF; - function MakeShader(const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - function MakeShader(const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - function MakeShader(const ATileRect: TRectF; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - function MakeShader(const ATileRect: TRectF; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - procedure Playback(const ACanvas: ISkCanvas); - function Serialize: TBytes; - procedure SerializeToStream(const AStream: TStream); + TSkTextStyle = class(TSkObject, ISkTextStyle) + strict private + procedure AddFontFeature(const AFeature: string; const AValue: Integer); + procedure AddShadow(const AShadow: TSkTextShadow); + procedure ClearBackgroundColor; + procedure ClearForegroundColor; + function GetBackground: ISkPaint; + function GetColor: TAlphaColor; + function GetDecorationColor: TAlphaColor; + function GetDecorations: TSkTextDecorations; + function GetDecorationStyle: TSkTextDecorationStyle; + function GetDecorationThickness: Single; + function GetFontFamilies: TArray; + function GetFontMetrics: TSkFontMetrics; + function GetFontSize: Single; + function GetFontStyle: TSkFontStyle; + function GetForeground: ISkPaint; + function GetHalfLeading: Boolean; + function GetHeightMultiplier: Single; + function GetLetterSpacing: Single; + function GetLocale: string; + function GetWordSpacing: Single; + function IsEqual(const ATextStyle: ISkTextStyle): Boolean; + procedure ResetFontFeatures; + procedure ResetShadows; + procedure SetBackgroundColor(const APaint: ISkPaint); + procedure SetColor(const AValue: TAlphaColor); + procedure SetDecorationColor(const AValue: TAlphaColor); + procedure SetDecorations(const AValue: TSkTextDecorations); + procedure SetDecorationStyle(const AValue: TSkTextDecorationStyle); + procedure SetDecorationThickness(const AValue: Single); + procedure SetFontFamilies(const AValue: TArray); + procedure SetFontSize(const AValue: Single); + procedure SetFontStyle(const AValue: TSkFontStyle); + procedure SetForegroundColor(const APaint: ISkPaint); + procedure SetHalfLeading(const AValue: Boolean); + procedure SetHeightMultiplier(const AValue: Single); + procedure SetLetterSpacing(const AValue: Single); + procedure SetLocale(const AValue: string); + procedure SetWordSpacing(const AValue: Single); public - class function MakeFromBytes(const ABytes: TBytes): ISkPicture; static; - class function MakeFromStream(const AStream: TStream): ISkPicture; static; + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; end; - { ISkPictureRecorder } + {$HPPEMIT END '#define SkTextStyle(...) __SkCreate(TSkTextStyle, ISkTextStyle, __VA_ARGS__)'} - ISkPictureRecorder = interface(ISkObject) - ['{A6EB80CE-B348-4B65-9C5D-770FBA557F1E}'] - function BeginRecording(const AWidth, AHeight: Single): ISkCanvas; overload; - function BeginRecording(const ABounds: TRectF): ISkCanvas; overload; - function FinishRecording: ISkPicture; overload; - function FinishRecording(const ACullRect: TRectF): ISkPicture; overload; + { ISkTypefaceFontProvider } + + ISkTypefaceFontProvider = interface(ISkReferenceCounted) + ['{04D29164-65B8-4733-A742-9FBE0B2178A2}'] + procedure RegisterTypeface(const ATypeface: ISkTypeface); overload; + procedure RegisterTypeface(const ATypeface: ISkTypeface; const AFamilyName: string); overload; end; - { TSkPictureRecorder } + { TSkTypefaceFontProvider } - TSkPictureRecorder = class(TSkObject, ISkPictureRecorder) - strict protected - function BeginRecording(const AWidth, AHeight: Single): ISkCanvas; overload; - function BeginRecording(const ABounds: TRectF): ISkCanvas; overload; - function FinishRecording: ISkPicture; overload; - function FinishRecording(const ACullRect: TRectF): ISkPicture; overload; + TSkTypefaceFontProvider = class(TSkReferenceCounted, ISkTypefaceFontProvider) + strict private + procedure RegisterTypeface(const ATypeface: ISkTypeface); overload; + procedure RegisterTypeface(const ATypeface: ISkTypeface; const AFamilyName: string); overload; public constructor Create; - class procedure DestroyHandle(const AHandle: THandle); override; end; - { ISkPixmap } + {$HPPEMIT END '#define SkTypefaceFontProvider(...) __SkCreate(TSkTypefaceFontProvider, ISkTypefaceFontProvider, __VA_ARGS__)'} - ISkPixmap = interface(ISkObject) - ['{296CE950-B7CC-4510-A877-1C86CD0AD0B1}'] - function Erase(const AColor: TAlphaColor): Boolean; overload; - function Erase(const AColor: TAlphaColor; const ASubset: TRectF): Boolean; overload; - function Erase(const AColor: TAlphaColorF; AColorSpace: ISkColorSpace = nil): Boolean; overload; - function Erase(const AColor: TAlphaColorF; const ASubset: TRectF; AColorSpace: ISkColorSpace = nil): Boolean; overload; - function ExtractSubset(const ADest: ISkPixmap; const AArea: TRect): Boolean; - function GetAlpha(const AX, AY: Integer): Single; - function GetAlphaType: TSkAlphaType; - function GetColor(const AX, AY: Integer): TAlphaColor; - function GetColorSpace: ISkColorSpace; - function GetColorType: TSkColorType; - function GetHeight: Integer; - function GetImageInfo: TSkImageInfo; - function GetPixelAddr(const AX, AY: Integer): Pointer; - function GetPixels: Pointer; - function GetRowBytes: NativeUInt; - function GetWidth: Integer; - function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; - function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; - function ScalePixels(const ADest: ISkPixmap): Boolean; overload; - function ScalePixels(const ADest: ISkPixmap; const ASampling: TSkSamplingOptions): Boolean; overload; - function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt): Boolean; overload; - function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions): Boolean; overload; - procedure SetColorSpace(AValue: ISkColorSpace); - property Alphas[const AX, AY: Integer]: Single read GetAlpha; - property AlphaType: TSkAlphaType read GetAlphaType; - property Colors[const AX, AY: Integer]: TAlphaColor read GetColor; - property ColorSpace: ISkColorSpace read GetColorSpace write SetColorSpace; - property ColorType: TSkColorType read GetColorType; - property Height: Integer read GetHeight; - property ImageInfo: TSkImageInfo read GetImageInfo; - property PixelAddr[const AX, AY: Integer]: Pointer read GetPixelAddr; - property Pixels: Pointer read GetPixels; - property RowBytes: NativeUInt read GetRowBytes; - property Width: Integer read GetWidth; + { ISkResourceProvider } + + ISkResourceProvider = interface(ISkReferenceCounted) + ['{0CC1E668-7D3A-4E7E-9F08-F967499E8381}'] end; - { TSkPixmap } + { TSkResourceProviderBaseClass } - TSkPixmap = class(TSkObject, ISkPixmap) + TSkResourceProviderBaseClass = class abstract(TSkReferenceCounted, ISkResourceProvider) + strict private + class constructor Create; + class function load_proc(context: Pointer; const path, name: MarshaledAString): sk_data_t; cdecl; static; strict protected - function Erase(const AColor: TAlphaColor): Boolean; overload; - function Erase(const AColor: TAlphaColor; const ASubset: TRectF): Boolean; overload; - function Erase(const AColor: TAlphaColorF; AColorSpace: ISkColorSpace = nil): Boolean; overload; - function Erase(const AColor: TAlphaColorF; const ASubset: TRectF; AColorSpace: ISkColorSpace = nil): Boolean; overload; - function ExtractSubset(const ADest: ISkPixmap; const AArea: TRect): Boolean; - function GetAlpha(const AX, AY: Integer): Single; - function GetAlphaType: TSkAlphaType; - function GetColor(const AX, AY: Integer): TAlphaColor; - function GetColorSpace: ISkColorSpace; - function GetColorType: TSkColorType; - function GetHeight: Integer; - function GetImageInfo: TSkImageInfo; - function GetPixelAddr(const AX, AY: Integer): Pointer; - function GetPixels: Pointer; - function GetRowBytes: NativeUInt; - function GetWidth: Integer; - function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; - function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; - function ScalePixels(const ADest: ISkPixmap): Boolean; overload; - function ScalePixels(const ADest: ISkPixmap; const ASampling: TSkSamplingOptions): Boolean; overload; - function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt): Boolean; overload; - function ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions): Boolean; overload; - procedure SetColorSpace(AValue: ISkColorSpace); + function Load(const APath, AName: string): TBytes; virtual; abstract; public - constructor Create(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt); - class procedure DestroyHandle(const AHandle: THandle); override; - end; - - { ISkRegionCliperator } - - ISkRegionCliperator = interface(ISkEnumerable) - ['{344C7AA5-6D8C-4EC3-AA0E-AAB9C05C2D17}'] + constructor Create(const APredecode: Boolean = False); end; - { ISkRegionIterator } + { ISkFileResourceProvider } - ISkRegionIterator = interface(ISkEnumerable) - ['{39EC8853-79A8-4428-B924-9945C3777150}'] + ISkFileResourceProvider = interface(ISkResourceProvider) + ['{2B7EFDD2-9E20-4E50-ACFF-FFBCB5E532A1}'] end; - { ISkRegionSpanerator } + { TSkFileResourceProvider } - ISkRegionSpanerator = interface(ISkEnumerable) - ['{87F952A9-C5AE-4013-A312-046C8F3B19D7}'] + TSkFileResourceProvider = class(TSkResourceProviderBaseClass, ISkFileResourceProvider) + strict private + FBaseDir: string; + strict protected + function Load(const APath, AName: string): TBytes; override; + public + constructor Create(const APredecode: Boolean = False); overload; + constructor Create(const ABaseDir: string; const APredecode: Boolean = False); overload; end; - TSkRegionOp = (Difference, Intersect, Union, &Xor, ReverseDifference, Replace); + {$HPPEMIT END '#define SkFileResourceProvider(...) __SkCreate(TSkFileResourceProvider, ISkResourceProvider, __VA_ARGS__)'} - { ISkRegion } + { ISkShaper } - ISkRegion = interface(ISkObject) - ['{B26070A8-22D1-4FED-9F04-9D84F1133E56}'] - function Contains(const AX, AY: Integer): Boolean; overload; - function Contains(const ARect: TRect): Boolean; overload; - function Contains(const ARegion: ISkRegion): Boolean; overload; - function GetBoundaryPath: ISkPath; - function GetBounds: TRect; - function GetCliperator(const AClip: TRect): ISkRegionCliperator; - function GetIterator: ISkRegionIterator; - function GetSpanerator(const AY, ALeft, ARight: Integer): ISkRegionSpanerator; - function Intersects(const ARect: TRect): Boolean; overload; - function Intersects(const ARegion: ISkRegion): Boolean; overload; - function IsComplex: Boolean; - function IsEmpty: Boolean; - function IsEqual(const ARegion: ISkRegion): Boolean; - function IsRect: Boolean; - function Op(const ARect: TRect; const AOp: TSkRegionOp): Boolean; overload; - function Op(const ARegion: ISkRegion; const AOp: TSkRegionOp): Boolean; overload; - function QuickContains(const ARect: TRect): Boolean; - function QuickReject(const ARect: TRect): Boolean; overload; - function QuickReject(const ARegion: ISkRegion): Boolean; overload; - procedure SetEmpty; - function SetPath(const APath: ISkPath; const AClip: ISkRegion): Boolean; - function SetRect(const ARect: TRect): Boolean; - function SetRects(const ARects: TArray): Boolean; - procedure Translate(const ADeltaX, ADeltaY: Integer); - property Bounds: TRect read GetBounds; + ISkShaper = interface(ISkObject) + ['{2FDC50D7-2024-45A3-B281-6DD6904FC301}'] + function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single): ISkTextBlob; overload; + function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single; const AOffset: TPointF; out AEndPoint: TPointF): ISkTextBlob; overload; end; - { TSkRegion } + { TSkShaper } - TSkRegion = class(TSkObject, ISkRegion) - strict private type - TRegionCliperator = class(TSkEnumerable, ISkRegionCliperator) - strict protected - function GetCurrent: TRect; override; - function MoveNext: Boolean; override; - public - constructor Create(const ARegion: ISkRegion; const AClip: TRect); - class procedure DestroyHandle(const AHandle: THandle); override; - end; + TSkShaper = class(TSkObject, ISkShaper) + strict private + function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single): ISkTextBlob; overload; + function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single; const AOffset: TPointF; out AEndPoint: TPointF): ISkTextBlob; overload; + public + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; - TRegionIterator = class(TSkEnumerable, ISkRegionIterator) - strict protected - function GetCurrent: TRect; override; - function MoveNext: Boolean; override; - procedure Reset; override; - public - constructor Create(const ARegion: ISkRegion); - class procedure DestroyHandle(const AHandle: THandle); override; - end; + {$HPPEMIT END '#define SkShaper(...) __SkCreate(TSkShaper, ISkShaper, __VA_ARGS__)'} - TRegionSpanerator = class(TSkEnumerable, ISkRegionSpanerator) - strict private - FCurrent: TPoint; - strict protected - function GetCurrent: TPoint; override; - function MoveNext: Boolean; override; - public - constructor Create(const ARegion: ISkRegion; const AY, ALeft, ARight: Integer); - class procedure DestroyHandle(const AHandle: THandle); override; - end; + { TSkSVGCanvas } - strict protected - function Contains(const AX, AY: Integer): Boolean; overload; - function Contains(const ARect: TRect): Boolean; overload; - function Contains(const ARegion: ISkRegion): Boolean; overload; - function GetBoundaryPath: ISkPath; - function GetBounds: TRect; - function GetCliperator(const AClip: TRect): ISkRegionCliperator; - function GetIterator: ISkRegionIterator; - function GetSpanerator(const AY, ALeft, ARight: Integer): ISkRegionSpanerator; - function Intersects(const ARect: TRect): Boolean; overload; - function Intersects(const ARegion: ISkRegion): Boolean; overload; - function IsComplex: Boolean; - function IsEmpty: Boolean; - function IsEqual(const ARegion: ISkRegion): Boolean; - function IsRect: Boolean; - function Op(const ARect: TRect; const AOp: TSkRegionOp): Boolean; overload; - function Op(const ARegion: ISkRegion; const AOp: TSkRegionOp): Boolean; overload; - function QuickContains(const ARect: TRect): Boolean; - function QuickReject(const ARect: TRect): Boolean; overload; - function QuickReject(const ARegion: ISkRegion): Boolean; overload; - procedure SetEmpty; - function SetPath(const APath: ISkPath; const AClip: ISkRegion): Boolean; - function SetRect(const ARect: TRect): Boolean; - function SetRects(const ARects: TArray): Boolean; - procedure Translate(const ADeltaX, ADeltaY: Integer); + TSkSVGCanvas = class(TSkCanvas) + strict private + FHolder: ISkObject; public - constructor Create; overload; - constructor Create(const ARegion: ISkRegion); overload; - constructor Create(const ARect: TRect); overload; - class procedure DestroyHandle(const AHandle: THandle); override; + class function Make(const ABounds: TRectF; const AStream: TStream; const AFlags: TSkSVGCanvasFlags = []): ISkCanvas; static; end; - TSkRoundRectCorner = (UpperLeft, UpperRight, LowerRight, LowerLeft); - - TSkRoundRectRadii = array[TSkRoundRectCorner] of Single; - - { ISkRoundRect } + { ISkSVGDOM } - ISkRoundRect = interface(ISkObject) - ['{574DC656-4D76-4576-B7E2-E7A27D73B01F}'] - function Contains(const ARect: TRect): Boolean; - procedure Deflate(const ADeltaX, ADeltaY: Single); - function GetHeight: Single; - function GetRadii(const ACorner: TSkRoundRectCorner): TPointF; - function GetRect: TRectF; - function GetSimpleRadii: TPointF; - function GetWidth: Single; - procedure Inflate(const ADeltaX, ADeltaY: Single); - function IsComplex: Boolean; - function IsEmpty: Boolean; - function IsEqual(const ARoundRect: ISkRoundRect): Boolean; - function IsNinePatch: Boolean; - function IsOval: Boolean; - function IsRect: Boolean; - function IsSimple: Boolean; - function IsValid: Boolean; - procedure Offset(const ADeltaX, ADeltaY: Single); - procedure SetEmpty; - procedure SetNinePatch(const ARect: TRectF; const ARadiusLeft, ARadiusTop, ARadiusRight, ARadiusBottom: Single); - procedure SetOval(const ARect: TRectF); - procedure SetRect(const ARect: TRectF); overload; - procedure SetRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single); overload; - procedure SetRect(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; - function Transform(const AMatrix: TMatrix): ISkRoundRect; - property Height: Single read GetHeight; - property Radii[const ACorner: TSkRoundRectCorner]: TPointF read GetRadii; - property Rect: TRectF read GetRect; - property SimpleRadii: TPointF read GetSimpleRadii; - property Width: Single read GetWidth; + ISkSVGDOM = interface(ISkReferenceCounted) + ['{5CF1CAA2-825B-4538-A64C-522134DB0415}'] + function FindNodeById(const AId: string): ISkSVGNode; + function GetRoot: ISkSVGSVG; + procedure Render(const ACanvas: ISkCanvas); + procedure SetContainerSize(const ASize: TSizeF); + property Root: ISkSVGSVG read GetRoot; end; - { TSkRoundRect } + { TSkSVGDOM } - TSkRoundRect = class(TSkObject, ISkRoundRect) - strict protected - function Contains(const ARect: TRect): Boolean; - procedure Deflate(const ADeltaX, ADeltaY: Single); - function GetHeight: Single; - function GetRadii(const ACorner: TSkRoundRectCorner): TPointF; - function GetRect: TRectF; - function GetSimpleRadii: TPointF; - function GetWidth: Single; - procedure Inflate(const ADeltaX, ADeltaY: Single); - function IsComplex: Boolean; - function IsEmpty: Boolean; - function IsEqual(const ARoundRect: ISkRoundRect): Boolean; - function IsNinePatch: Boolean; - function IsOval: Boolean; - function IsRect: Boolean; - function IsSimple: Boolean; - function IsValid: Boolean; - procedure Offset(const ADeltaX, ADeltaY: Single); - procedure SetEmpty; - procedure SetNinePatch(const ARect: TRectF; const ARadiusLeft, ARadiusTop, ARadiusRight, ARadiusBottom: Single); - procedure SetOval(const ARect: TRectF); - procedure SetRect(const ARect: TRectF); overload; - procedure SetRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single); overload; - procedure SetRect(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; - function Transform(const AMatrix: TMatrix): ISkRoundRect; + TSkSVGDOM = class(TSkReferenceCounted, ISkSVGDOM) + strict private + FRoot: ISkSVGSVG; + function FindNodeById(const AId: string): ISkSVGNode; + function GetRoot: ISkSVGSVG; + procedure Render(const ACanvas: ISkCanvas); + procedure SetContainerSize(const ASize: TSizeF); public - constructor Create; overload; - constructor Create(const ARoundRect: ISkRoundRect); overload; - constructor Create(const ARect: TRectF; const ARadiusX, ARadiusY: Single); overload; - constructor Create(const ARect: TRectF; const ARadii: TSkRoundRectRadii); overload; - class procedure DestroyHandle(const AHandle: THandle); override; + class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil): ISkSVGDOM; static; + class function MakeFromFile(const AFileName: string): ISkSVGDOM; static; + class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil): ISkSVGDOM; static; end; - {$ALIGN 4} + { ISkSVGNode } - { TSkRuntimeEffectFloat2 } + ISkSVGNode = interface(ISkReferenceCounted) + ['{44A79F6C-4A16-49BA-937D-D892BA5FB453}'] + function TrySetAttribute(const AName, AValue: string): Boolean; + end; - TSkRuntimeEffectFloat2 = packed record - constructor Create(const AV1, AV2: Single); - class operator Implicit(const APoint: TPointF): TSkRuntimeEffectFloat2; - case Integer of - 0: (V1, V2: Single); - 1: (Values: array[0..1] of Single); + { TSkSVGNode } + + TSkSVGNode = class(TSkReferenceCounted, ISkSVGNode) + strict private + function TrySetAttribute(const AName, AValue: string): Boolean; end; - { TSkRuntimeEffectFloat3 } + { ISkSVGSVG } - TSkRuntimeEffectFloat3 = packed record - constructor Create(const AV1, AV2, AV3: Single); - case Integer of - 0: (V1, V2, V3: Single); - 1: (Values: array[0..2] of Single); + ISkSVGSVG = interface(ISkSVGNode) + ['{4DC9309C-664F-4997-B826-B65347C63944}'] + function GetHeight: TSkSVGLength; + function GetIntrinsicSize(const AViewPort: TSizeF; const ADPI: Single = 90): TSizeF; + function GetPreserveAspectRatio: TSkSVGPreserveAspectRatio; + function GetWidth: TSkSVGLength; + function GetX: TSkSVGLength; + function GetY: TSkSVGLength; + procedure SetHeight(const AValue: TSkSVGLength); + procedure SetPreserveAspectRatio(const AValue: TSkSVGPreserveAspectRatio); + procedure SetViewBox(const AViewBox: TRectF); + procedure SetWidth(const AValue: TSkSVGLength); + procedure SetX(const AValue: TSkSVGLength); + procedure SetY(const AValue: TSkSVGLength); + function TryGetViewBox(out AViewBox: TRectF): Boolean; + property Height: TSkSVGLength read GetHeight write SetHeight; + property PreserveAspectRatio: TSkSVGPreserveAspectRatio read GetPreserveAspectRatio write SetPreserveAspectRatio; + property Width: TSkSVGLength read GetWidth write SetWidth; + property X: TSkSVGLength read GetX write SetX; + property Y: TSkSVGLength read GetY write SetY; end; - { TSkRuntimeEffectFloat4 } + { TSkSVGSVG } - TSkRuntimeEffectFloat4 = packed record - constructor Create(const AV1, AV2, AV3, AV4: Single); - class operator Implicit(const AColor: TAlphaColorF): TSkRuntimeEffectFloat4; - case Integer of - 0: (V1, V2, V3, V4: Single); - 1: (Values: array[0..3] of Single); + TSkSVGSVG = class(TSkSVGNode, ISkSVGSVG) + strict private + function GetHeight: TSkSVGLength; + function GetIntrinsicSize(const AViewPort: TSizeF; const ADPI: Single = 90): TSizeF; + function GetPreserveAspectRatio: TSkSVGPreserveAspectRatio; + function GetWidth: TSkSVGLength; + function GetX: TSkSVGLength; + function GetY: TSkSVGLength; + procedure SetHeight(const AValue: TSkSVGLength); + procedure SetPreserveAspectRatio(const AValue: TSkSVGPreserveAspectRatio); + procedure SetViewBox(const AViewBox: TRectF); + procedure SetWidth(const AValue: TSkSVGLength); + procedure SetX(const AValue: TSkSVGLength); + procedure SetY(const AValue: TSkSVGLength); + function TryGetViewBox(out AViewBox: TRectF): Boolean; end; - { TSkRuntimeEffectFloat2x2 } + { ISkUnicodeBreakIterator } - TSkRuntimeEffectFloat2x2 = packed record - constructor Create(const AV11, AV12, AV21, AV22: Single); - case Integer of - 0: (V11, V12, - V21, V22: Single); - 1: (Values: array[0..3] of Single); + ISkUnicodeBreakIterator = interface(ISkEnumerable) + ['{A21F8622-2A3B-413D-BF03-18D393DEF49A}'] + function GetCurrent: TSkUnicodeBreakIteratorElem; + function GetEnumerator: TSkEnumerator; end; - { TSkRuntimeEffectFloat3x3 } + { ISkUnicode } - TSkRuntimeEffectFloat3x3 = packed record - constructor Create(const AV11, AV12, AV13, AV21, AV22, AV23, AV31, AV32, AV33: Single); - case Integer of - 0: (V11, V12, V13, - V21, V22, V23, - V31, V32, V33: Single); - 1: (Values: array[0..8] of Single); + ISkUnicode = interface(ISkObject) + ['{DFD6FE56-0C2E-45C9-BA18-95C750981554}'] + procedure ForEachBidiRegion(const AText: string; const ADirection: TSkDirection; const AProc: TSkUnicodeBidiRegionProc); + procedure ForEachBreak(const AText: string; const AType: TSkBreakType; const AProc: TSkUnicodeBreakProc); + procedure ForEachCodepoint(const AText: string; const AProc: TSkUnicodeCodepointProc); + function GetBreakIterator(const AType: TSkBreakType; const AText: string): ISkUnicodeBreakIterator; + function GetBreakIteratorUTF8(const AType: TSkBreakType; const AText: UTF8String): ISkUnicodeBreakIterator; + function GetBreaks(const AText: string; const AType: TSkBreakType): TArray; end; - { TSkRuntimeEffectFloat4x4 } + { TSkUnicode } - TSkRuntimeEffectFloat4x4 = packed record - constructor Create(const AV11, AV12, AV13, AV14, AV21, AV22, AV23, AV24, AV31, AV32, AV33, AV34, AV41, AV42, AV43, AV44: Single); - case Integer of - 0: (V11, V12, V13, V14, - V21, V22, V23, V24, - V31, V32, V33, V34, - V41, V42, V43, V44: Single); - 1: (Values: array[0..15] of Single); + TSkUnicode = class(TSkObject, ISkUnicode) + strict private type + TUnicodeBreakIterator = class(TSkEnumerable, ISkUnicodeBreakIterator) + strict private + FCurrent: TSkUnicodeBreakIteratorElem; + public + constructor Create(const AUnicode: ISkUnicode; const AType: TSkBreakType; const AText: string); overload; + constructor Create(const AUnicode: ISkUnicode; const AType: TSkBreakType; const AText: UTF8String); overload; + function GetCurrent: TSkUnicodeBreakIteratorElem; override; + function MoveNext: Boolean; override; + class procedure __DestroyHandle(const AHandle: THandle); override; + end; + + strict private + procedure ForEachBidiRegion(const AText: string; const ADirection: TSkDirection; const AProc: TSkUnicodeBidiRegionProc); + procedure ForEachBreak(const AText: string; const AType: TSkBreakType; const AProc: TSkUnicodeBreakProc); + procedure ForEachCodepoint(const AText: string; const AProc: TSkUnicodeCodepointProc); + function GetBreakIterator(const AType: TSkBreakType; const AText: string): ISkUnicodeBreakIterator; + function GetBreakIteratorUTF8(const AType: TSkBreakType; const AText: UTF8String): ISkUnicodeBreakIterator; + function GetBreaks(const AText: string; const AType: TSkBreakType): TArray; + class procedure bidi_region_proc(start, &end: int32_t; level: uint8_t; context: Pointer); cdecl; static; + class procedure break_proc(position, status: int32_t; context: Pointer); cdecl; static; + class procedure codepoint_proc(unichar: sk_unichar_t; start, &end: int32_t; context: Pointer); cdecl; static; + public + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; end; - { TSkRuntimeEffectInt2 } + {$HPPEMIT END '#define SkUnicode(...) __SkCreate(TSkUnicode, ISkUnicode, __VA_ARGS__)'} - TSkRuntimeEffectInt2 = packed record - constructor Create(const AV1, AV2: Integer); - class operator Implicit(const APoint: TPoint): TSkRuntimeEffectInt2; - case Integer of - 0: (V1, V2: Integer); - 1: (Values: array[0..1] of Integer); - end; +function ExtensionToEncodedImageFormat(const AExtension: string): TSkEncodedImageFormat; inline; - { TSkRuntimeEffectInt3 } +const + GrGlTexture2D = $0DE1; + GrGlTextureRectangle = $84F5; + GrGlTextureExternal = $8D65; - TSkRuntimeEffectInt3 = packed record - constructor Create(const AV1, AV2, AV3: Integer); - case Integer of - 0: (V1, V2, V3: Integer); - 1: (Values: array[0..2] of Integer); - end; + GrGlSizedFormat: array[TSkColorType] of GrGlenum = ( + { Unknown } 0, + { Alpha8 - GR_GL_ALPHA8 } $803C, + { RGB565 - GR_GL_RGB565 } $8D62, + { ARGB4444 - GR_GL_RGBA4 } $8056, + { RGBA8888 - GR_GL_RGBA8 } $8058, + { RGB888X - GR_GL_RGBX8 } $96BA, + { BGRA8888 - GR_GL_BGRA8 } $93A1, + { RGBA1010102 - GR_GL_RGB10_A2 } $8059, + { BGRA1010102 } 0, + { RGB101010X } 0, + { BGR101010X } 0, + { Gray8 - GR_GL_LUMINANCE8 } $8040, + { RGBAF16 - GR_GL_RGBA16F } $881A, + { RGBAF16Clamped - GR_GL_RGBA16F } $881A, + { RGBAF32 - GR_GL_RGBA32F } $8814, + { RG88 - GR_GL_RG8 } $822B, + { AlphaF16 - GR_GL_R16F } $822D, + { RGF16 - GR_GL_RG16F } $822F, + { Alpha16 - GR_GL_R16 } $822A, + { RG1616 - GR_GL_RG16 } $822C, + { RGBA16161616 - GR_GL_RGBA16 } $805B, + { SRGBA8888 - GR_GL_SRGB8_ALPHA8 } $8C43, + { R8 - GR_GL_R8 } $8229 + ); - { TSkRuntimeEffectInt4 } + SkBytesPerPixel: array[TSkColorType] of Integer = ( + { Unknown } 0, + { Alpha8 } 1, + { RGB565 } 2, + { ARGB4444 } 2, + { RGBA8888 } 4, + { RGB888X } 4, + { BGRA8888 } 4, + { RGBA1010102 } 4, + { BGRA1010102 } 4, + { RGB101010X } 4, + { BGR101010X } 4, + { Gray8 } 1, + { RGBAF16 } 8, + { RGBAF16Clamped } 8, + { RGBAF32 } 16, + { RG88 } 2, + { AlphaF16 } 2, + { RGF16 } 4, + { Alpha16 } 2, + { RG1616 } 4, + { RGBA16161616 } 8, + { SRGBA8888 } 4, + { R8 } 1 + ); - TSkRuntimeEffectInt4 = packed record - constructor Create(const AV1, AV2, AV3, AV4: Integer); - case Integer of - 0: (V1, V2, V3, V4: Integer); - 1: (Values: array[0..3] of Integer); - end; + SkColorMatrixIdentity: TSkColorMatrix = (M11: 1; M12: 0; M13: 0; M14: 0; M15: 0; + M21: 0; M22: 1; M23: 0; M24: 0; M25: 0; + M31: 0; M32: 0; M33: 1; M34: 0; M35: 0; + M41: 0; M42: 0; M43: 0; M44: 1; M45: 0); - {$ALIGN ON} + SkColorSpaceTransferFunctionHLG : TSkColorSpaceTransferFunction = (G: -3; A: 2; B: 2; C: 1 / 0.17883277; D: 0.28466892; E: 0.55991073; F: 0); + SkColorSpaceTransferFunctionLinear : TSkColorSpaceTransferFunction = (G: 1; A: 1; B: 0; C: 0; D: 0; E: 0; F: 0); + SkColorSpaceTransferFunctionPQ : TSkColorSpaceTransferFunction = (G: -2; A: -107 / 128; B: 1; C: 32 / 2523; D: 2413 / 128; E: -2392 / 128; F: 8192 / 1305); + SkColorSpaceTransferFunctionRec2020 : TSkColorSpaceTransferFunction = (G: 2.22222; A: 0.909672; B: 0.0903276; C: 0.222222; D: 0.0812429; E: 0; F: 0); + SkColorSpaceTransferFunctionSRGB : TSkColorSpaceTransferFunction = (G: 2.4; A: 1 / 1.055; B: 0.055 / 1.055; C: 1 / 12.92; D: 0.04045; E: 0; F: 0); + SkColorSpaceTransferFunctionTwoDotTwo: TSkColorSpaceTransferFunction = (G: 2.2; A: 1; B: 0; C: 0; D: 0; E: 0; F: 0); - TSkRuntimeEffectChildType = (Shader, ColorFilter, Blender); + SkColorSpaceXyzAdobeRGB : TSkColorSpaceXyz = (M11: $9C18 * TSkColorSpaceXyz.FixedToFloat; M12: $348D * TSkColorSpaceXyz.FixedToFloat; M13: $2631 * TSkColorSpaceXyz.FixedToFloat; + M21: $4FA5 * TSkColorSpaceXyz.FixedToFloat; M22: $A02C * TSkColorSpaceXyz.FixedToFloat; M23: $102F * TSkColorSpaceXyz.FixedToFloat; + M31: $04FC * TSkColorSpaceXyz.FixedToFloat; M32: $0F95 * TSkColorSpaceXyz.FixedToFloat; M33: $BE9C * TSkColorSpaceXyz.FixedToFloat); - TSkRuntimeEffectUniformType = (Float, Float2, Float3, Float4, Float2x2, Float3x3, Float4x4, Int, Int2, Int3, Int4); + SkColorSpaceXyzDisplayP3: TSkColorSpaceXyz = (M11: 0.515102; M12: 0.291965; M13: 0.157153; + M21: 0.241182; M22: 0.692236; M23: 0.0665819; + M31: -0.00104941; M32: 0.0418818; M33: 0.784378); - { ISkRuntimeEffect } + SkColorSpaceXyzIdentity : TSkColorSpaceXyz = (M11: 1; M12: 0; M13: 0; + M21: 0; M22: 1; M23: 0; + M31: 0; M32: 0; M33: 1); - ISkRuntimeEffect = interface(ISkReferenceCounted) - ['{E9EEAD6A-2B77-4797-AEC9-85C01965F0B6}'] - function ChildExists(const AName: string): Boolean; - function GetChildColorFilter(const AIndex: Integer): ISkColorFilter; overload; - function GetChildColorFilter(const AName: string): ISkColorFilter; overload; - function GetChildCount: Integer; - function GetChildName(const AIndex: Integer): string; - function GetChildBlender(const AIndex: Integer): ISkBlender; overload; - function GetChildBlender(const AName: string): ISkBlender; overload; - function GetChildShader(const AIndex: Integer): ISkShader; overload; - function GetChildShader(const AName: string): ISkShader; overload; - function GetChildType(const AIndex: Integer): TSkRuntimeEffectChildType; overload; - function GetChildType(const AName: string): TSkRuntimeEffectChildType; overload; - function GetUniform(const AIndex: Integer): Pointer; overload; - function GetUniform(const AName: string): Pointer; overload; - function GetUniformCount: Integer; - function GetUniformData: Pointer; - function GetUniformDataSize: NativeUInt; - function GetUniformName(const AIndex: Integer): string; - function GetUniformOffset(const AIndex: Integer): NativeUInt; overload; - function GetUniformOffset(const AName: string): NativeUInt; overload; - function GetUniformType(const AIndex: Integer): TSkRuntimeEffectUniformType; overload; - function GetUniformType(const AName: string): TSkRuntimeEffectUniformType; overload; - function GetUniformTypeCount(const AIndex: Integer): Integer; overload; - function GetUniformTypeCount(const AName: string): Integer; overload; - function IndexOfChild(const AName: string): Integer; - function IndexOfUniform(const AName: string): Integer; - function IsUniformTypeOrdinal(const AIndex: Integer): Boolean; overload; - function IsUniformTypeOrdinal(const AName: string): Boolean; overload; - function MakeBlender: ISkBlender; - function MakeColorFilter: ISkColorFilter; - function MakeImage(const AImageInfo: TSkImageInfo; const AIsMipmapped: Boolean = False; const AContext: IGrDirectContext = nil): ISkImage; overload; - function MakeImage(const AImageInfo: TSkImageInfo; const ALocalMatrix: TMatrix; const AIsMipmapped: Boolean = False; const AContext: IGrDirectContext = nil): ISkImage; overload; - function MakeShader(const AOpaque: Boolean = False): ISkShader; overload; - function MakeShader(const ALocalMatrix: TMatrix; const AOpaque: Boolean = False): ISkShader; overload; - procedure SetChildBlender(const AIndex: Integer; const AValue: ISkBlender); overload; - procedure SetChildBlender(const AName: string; const AValue: ISkBlender); overload; - procedure SetChildColorFilter(const AIndex: Integer; const AValue: ISkColorFilter); overload; - procedure SetChildColorFilter(const AName: string; const AValue: ISkColorFilter); overload; - procedure SetChildShader(const AIndex: Integer; const AValue: ISkShader); overload; - procedure SetChildShader(const AName: string; const AValue: ISkShader); overload; - procedure SetUniform(const AIndex: Integer; const AData; const ASize: NativeUInt); overload; - procedure SetUniform(const AIndex: Integer; const AValue: Integer); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TArray); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt2); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt3); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt4); overload; - procedure SetUniform(const AIndex: Integer; const AValue: Single); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TArray); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat2); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat3); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat4); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat2x2); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat3x3); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat4x4); overload; - procedure SetUniform(const AName: string; const AData; const ASize: NativeUInt); overload; - procedure SetUniform(const AName: string; const AValue: Integer); overload; - procedure SetUniform(const AName: string; const AValue: TArray); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt2); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt3); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt4); overload; - procedure SetUniform(const AName: string; const AValue: Single); overload; - procedure SetUniform(const AName: string; const AValue: TArray); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat2); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat3); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat4); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat2x2); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat3x3); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat4x4); overload; - function UniformExists(const AName: string): Boolean; - procedure WriteUniform(const AOffset: NativeUInt; const AData; const ASize: NativeUInt); - property ChildCount: Integer read GetChildCount; - property ChildrenBlenders[const AIndex: Integer]: ISkBlender read GetChildBlender write SetChildBlender; - property ChildrenBlenders[const AName: string]: ISkBlender read GetChildBlender write SetChildBlender; - property ChildrenColorFilters[const AIndex: Integer]: ISkColorFilter read GetChildColorFilter write SetChildColorFilter; - property ChildrenColorFilters[const AName: string]: ISkColorFilter read GetChildColorFilter write SetChildColorFilter; - property ChildrenNames[const AIndex: Integer]: string read GetChildName; - property ChildrenShaders[const AIndex: Integer]: ISkShader read GetChildShader write SetChildShader; - property ChildrenShaders[const AName: string]: ISkShader read GetChildShader write SetChildShader; - property ChildType[const AIndex: Integer]: TSkRuntimeEffectChildType read GetChildType; - property ChildType[const AName: string]: TSkRuntimeEffectChildType read GetChildType; - property UniformCount: Integer read GetUniformCount; - property UniformData: Pointer read GetUniformData; - property UniformDataSize: NativeUInt read GetUniformDataSize; - property UniformNames[const AIndex: Integer]: string read GetUniformName; - property UniformOffset[const AIndex: Integer]: NativeUInt read GetUniformOffset; - property UniformOffset[const AName: string]: NativeUInt read GetUniformOffset; - property Uniforms[const AIndex: Integer]: Pointer read GetUniform; - property Uniforms[const AName: string]: Pointer read GetUniform; - property UniformType[const AIndex: Integer]: TSkRuntimeEffectUniformType read GetUniformType; - property UniformType[const AName: string]: TSkRuntimeEffectUniformType read GetUniformType; - property UniformTypeCount[const AIndex: Integer]: Integer read GetUniformTypeCount; - property UniformTypeCount[const AName: string]: Integer read GetUniformTypeCount; - end; + SkColorSpaceXyzRec2020 : TSkColorSpaceXyz = (M11: 0.673459; M12: 0.165661; M13: 0.125100; + M21: 0.279033; M22: 0.675338; M23: 0.0456288; + M31: -0.00193139; M32: 0.0299794; M33: 0.797162); - { TSkRuntimeEffect } + SkColorSpaceXyzSRGB : TSkColorSpaceXyz = (M11: $6FA2 * TSkColorSpaceXyz.FixedToFloat; M12: $6299 * TSkColorSpaceXyz.FixedToFloat; M13: $24A0 * TSkColorSpaceXyz.FixedToFloat; + M21: $38F5 * TSkColorSpaceXyz.FixedToFloat; M22: $B785 * TSkColorSpaceXyz.FixedToFloat; M23: $0F84 * TSkColorSpaceXyz.FixedToFloat; + M31: $0390 * TSkColorSpaceXyz.FixedToFloat; M32: $18DA * TSkColorSpaceXyz.FixedToFloat; M33: $B6CF * TSkColorSpaceXyz.FixedToFloat); - TSkRuntimeEffect = class(TSkReferenceCounted, ISkRuntimeEffect) - strict private - FChildren: TArray; - FUniformData: Pointer; - strict protected - function ChildExists(const AName: string): Boolean; - function GetChildColorFilter(const AIndex: Integer): ISkColorFilter; overload; - function GetChildColorFilter(const AName: string): ISkColorFilter; overload; - function GetChildCount: Integer; inline; - function GetChildName(const AIndex: Integer): string; - function GetChildBlender(const AIndex: Integer): ISkBlender; overload; - function GetChildBlender(const AName: string): ISkBlender; overload; - function GetChildShader(const AIndex: Integer): ISkShader; overload; - function GetChildShader(const AName: string): ISkShader; overload; - function GetChildType(const AIndex: Integer): TSkRuntimeEffectChildType; overload; - function GetChildType(const AName: string): TSkRuntimeEffectChildType; overload; - function GetUniform(const AIndex: Integer): Pointer; overload; - function GetUniform(const AName: string): Pointer; overload; - function GetUniformCount: Integer; inline; - function GetUniformData: Pointer; inline; - function GetUniformDataSize: NativeUInt; inline; - function GetUniformName(const AIndex: Integer): string; - function GetUniformOffset(const AIndex: Integer): NativeUInt; overload; - function GetUniformOffset(const AName: string): NativeUInt; overload; - function GetUniformType(const AIndex: Integer): TSkRuntimeEffectUniformType; overload; - function GetUniformType(const AName: string): TSkRuntimeEffectUniformType; overload; - function GetUniformTypeCount(const AIndex: Integer): Integer; overload; - function GetUniformTypeCount(const AName: string): Integer; overload; - function IndexOfChild(const AName: string): Integer; inline; - function IndexOfUniform(const AName: string): Integer; inline; - function IsUniformTypeOrdinal(const AIndex: Integer): Boolean; overload; inline; - function IsUniformTypeOrdinal(const AName: string): Boolean; overload; - function MakeBlender: ISkBlender; - function MakeColorFilter: ISkColorFilter; - function MakeImage(const AImageInfo: TSkImageInfo; const AIsMipmapped: Boolean = False; const AContext: IGrDirectContext = nil): ISkImage; overload; - function MakeImage(const AImageInfo: TSkImageInfo; const ALocalMatrix: TMatrix; const AIsMipmapped: Boolean = False; const AContext: IGrDirectContext = nil): ISkImage; overload; - function MakeShader(const AOpaque: Boolean = False): ISkShader; overload; - function MakeShader(const ALocalMatrix: TMatrix; const AOpaque: Boolean = False): ISkShader; overload; - procedure SetChildBlender(const AIndex: Integer; const AValue: ISkBlender); overload; - procedure SetChildBlender(const AName: string; const AValue: ISkBlender); overload; - procedure SetChildColorFilter(const AIndex: Integer; const AValue: ISkColorFilter); overload; - procedure SetChildColorFilter(const AName: string; const AValue: ISkColorFilter); overload; - procedure SetChildShader(const AIndex: Integer; const AValue: ISkShader); overload; - procedure SetChildShader(const AName: string; const AValue: ISkShader); overload; - procedure SetUniform(const AIndex: Integer; const AData; const ASize: NativeUInt); overload; - procedure SetUniform(const AIndex: Integer; const AValue: Integer); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TArray); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt2); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt3); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectInt4); overload; - procedure SetUniform(const AIndex: Integer; const AValue: Single); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TArray); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat2); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat3); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat4); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat2x2); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat3x3); overload; - procedure SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat4x4); overload; - procedure SetUniform(const AName: string; const AData; const ASize: NativeUInt); overload; - procedure SetUniform(const AName: string; const AValue: Integer); overload; - procedure SetUniform(const AName: string; const AValue: TArray); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt2); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt3); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectInt4); overload; - procedure SetUniform(const AName: string; const AValue: Single); overload; - procedure SetUniform(const AName: string; const AValue: TArray); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat2); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat3); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat4); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat2x2); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat3x3); overload; - procedure SetUniform(const AName: string; const AValue: TSkRuntimeEffectFloat4x4); overload; - function UniformExists(const AName: string): Boolean; - procedure WriteUniform(const AOffset: NativeUInt; const AData; const ASize: NativeUInt); - public - procedure AfterConstruction; override; - procedure BeforeDestruction; override; - class function MakeForBlender(const ASkSL: string): ISkRuntimeEffect; overload; static; - class function MakeForBlender(const ASkSL: string; out AErrorText: string): ISkRuntimeEffect; overload; static; - class function MakeForColorFilter(const ASkSL: string): ISkRuntimeEffect; overload; static; - class function MakeForColorFilter(const ASkSL: string; out AErrorText: string): ISkRuntimeEffect; overload; static; - class function MakeForShader(const ASkSL: string): ISkRuntimeEffect; overload; static; - class function MakeForShader(const ASkSL: string; out AErrorText: string): ISkRuntimeEffect; overload; static; - end; + SkCubicResamplerCatmullRom: TSkCubicResampler = (B: 0; C: 1 / 2); + SkCubicResamplerMitchell : TSkCubicResampler = (B: 1 / 3; C: 1 / 3); - { ISkShader } + SkFontSlantRegular = TSkFontSlant.Upright; + + SkFontStyleBold : TSkFontStyle = (Weight: Ord(TSkFontWeight.Bold); Width: Ord(TSkFontWidth.Normal); Slant: TSkFontSlant.Upright); + SkFontStyleBoldItalic: TSkFontStyle = (Weight: Ord(TSkFontWeight.Bold); Width: Ord(TSkFontWidth.Normal); Slant: TSkFontSlant.Italic); + SkFontStyleItalic : TSkFontStyle = (Weight: Ord(TSkFontWeight.Normal); Width: Ord(TSkFontWidth.Normal); Slant: TSkFontSlant.Italic); + SkFontStyleNormal : TSkFontStyle = (Weight: Ord(TSkFontWeight.Normal); Width: Ord(TSkFontWidth.Normal); Slant: TSkFontSlant.Upright); + + SkFontWeightDemiBold = TSkFontWeight.SemiBold; + SkFontWeightHairline = TSkFontWeight.Thin; + SkFontWeightHeavy = TSkFontWeight.Black; + SkFontWeightRegular = TSkFontWeight.Normal; + SkFontWeightUltraBlack = TSkFontWeight.ExtraBlack; + SkFontWeightUltraBold = TSkFontWeight.ExtraBold; + SkFontWeightUltraLight = TSkFontWeight.ExtraLight; + + SkFontWidthRegular = TSkFontWidth.Normal; + + SkNative32ColorType: TSkColorType = {$IFDEF BIGENDIAN}TSkColorType.RGBA8888{$ELSE}TSkColorType.BGRA8888{$ENDIF}; + + SkRotationScaleMatrixIdentity: TSkRotationScaleMatrix = (SCosinus : 1; SSinus : 0; + TranslateX : 0; TranslateY : 0); + + SkSamplingOptionsHigh : TSkSamplingOptions = (FUseCubic: True; FCubic: (B: 1 / 3; C: 1 / 3); FFilter: TSkFilterMode.Nearest; FMipmap: TSkMipmapMode.None); + SkSamplingOptionsLow : TSkSamplingOptions = (FUseCubic: False; FCubic: (B: 0; C: 0); FFilter: TSkFilterMode.Nearest; FMipmap: TSkMipmapMode.Nearest); + SkSamplingOptionsMedium: TSkSamplingOptions = (FUseCubic: False; FCubic: (B: 0; C: 0); FFilter: TSkFilterMode.Linear; FMipmap: TSkMipmapMode.Nearest); + + SkShiftPerPixel: array[TSkColorType] of Integer = ( + { Unknown } 0, + { Alpha8 } 0, + { RGB565 } 1, + { ARGB4444 } 1, + { RGBA8888 } 2, + { RGB888X } 2, + { BGRA8888 } 2, + { RGBA1010102 } 2, + { BGRA1010102 } 2, + { RGB101010X } 2, + { BGR101010X } 2, + { Gray8 } 0, + { RGBAF16 } 3, + { RGBAF16Clamped } 3, + { RGBAF32 } 4, + { RG88 } 1, + { AlphaF16 } 1, + { RGF16 } 2, + { Alpha16 } 1, + { RG1616 } 2, + { RGBA16161616 } 3, + { SRGBA8888 } 2, + { R8 } 0 + ); - ISkShader = interface(ISkReferenceCounted) - ['{8453635B-9DE2-4E03-88F7-8EA16FA99620}'] - function MakeWithColorFilter(const AColorFilter: ISkColorFilter): ISkShader; - function MakeWithLocalMatrix(const AMatrix: TMatrix): ISkShader; - end; + SFileNameIsEmpty = 'File name cannot be empty'; + SInvalidOperation = 'Operation is invalid'; + SOutOfMemory = 'Out of memory'; + SParamElementIsNil = 'Parameter %s[%d] cannot be nil'; + SParamIsEmpty = 'Parameter %s cannot be empty'; + SParamIsNil = 'Parameter %s cannot be nil'; + SParamOutOfRange = 'Parameter %s out of range (%d). Must be >= %d and < %d'; + SParamSizeIsOdd = 'Parameter %s size cannot be odd'; + SParamSizeMismatch = 'Parameter %s size mismatch'; - { TSkShader } +implementation - TSkShader = class(TSkReferenceCounted, ISkShader) - strict protected - function MakeWithColorFilter(const AColorFilter: ISkColorFilter): ISkShader; - function MakeWithLocalMatrix(const AMatrix: TMatrix): ISkShader; - public - class function MakeBlend(const AMode: TSkBlendMode; const ADest, ASrc: ISkShader): ISkShader; static; - class function MakeColor(const AColor: TAlphaColor): ISkShader; overload; static; - class function MakeColor(const AColor: TAlphaColorF; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; - class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColor1, AColor2: TAlphaColor; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; - class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColor1, AColor2: TAlphaColor; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; - class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColor1, AColor2: TAlphaColorF; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; - class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColor1, AColor2: TAlphaColorF; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; - class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; - class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; - class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; - class function MakeGradientLinear(const AStart, AEnd: TPointF; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; - class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const ACenterColor, AEdgeColor: TAlphaColor; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; - class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const ACenterColor, AEdgeColor: TAlphaColor; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; - class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const ACenterColor, AEdgeColor: TAlphaColorF; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; - class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const ACenterColor, AEdgeColor: TAlphaColorF; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; - class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; - class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; - class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; - class function MakeGradientRadial(const ACenter: TPointF; const ARadius: Single; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; - class function MakeGradientSweep(const ACenter: TPointF; const AColor1, AColor2: TAlphaColor; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360): ISkShader; overload; static; inline; - class function MakeGradientSweep(const ACenter: TPointF; const AColor1, AColor2: TAlphaColor; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360): ISkShader; overload; static; inline; - class function MakeGradientSweep(const ACenter: TPointF; const AColor1, AColor2: TAlphaColorF; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; - class function MakeGradientSweep(const ACenter: TPointF; const AColor1, AColor2: TAlphaColorF; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; - class function MakeGradientSweep(const ACenter: TPointF; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360): ISkShader; overload; static; - class function MakeGradientSweep(const ACenter: TPointF; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360): ISkShader; overload; static; - class function MakeGradientSweep(const ACenter: TPointF; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; - class function MakeGradientSweep(const ACenter: TPointF; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; const AStartAngle: Single = 0; const AEndAngle: Single = 360; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; - class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColor1, AColor2: TAlphaColor; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; - class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColor1, AColor2: TAlphaColor; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; inline; - class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColor1, AColor2: TAlphaColorF; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; - class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColor1, AColor2: TAlphaColorF; const ALocalMatrix: TMatrix; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; inline; - class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; - class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; static; - class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColors: TArray; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; - class function MakeGradientTwoPointConical(const AStart: TPointF; const AStartRadius: Single; AEnd: TPointF; const AEndRadius: Single; const AColors: TArray; const ALocalMatrix: TMatrix; const APositions: TArray = nil; const ATileMode: TSkTileMode = TSkTileMode.Clamp; AColorSpace: ISkColorSpace = nil): ISkShader; overload; static; - class function MakeImage(const AImage: ISkImage; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - class function MakeImage(const AImage: ISkImage; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - class function MakeImage(const AImage: ISkImage; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - class function MakeImage(const AImage: ISkImage; const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp): ISkShader; overload; - class function MakePerlinNoiseFractalNoise(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single): ISkShader; overload; static; - class function MakePerlinNoiseFractalNoise(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single; const ATileSize: TSize): ISkShader; overload; static; - class function MakePerlinNoiseTurbulence(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single): ISkShader; overload; static; - class function MakePerlinNoiseTurbulence(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single; const ATileSize: TSize): ISkShader; overload; static; - class function MakePicture(const APicture: ISkPicture; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - class function MakePicture(const APicture: ISkPicture; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - class function MakePicture(const APicture: ISkPicture; const ATileRect: TRectF; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - class function MakePicture(const APicture: ISkPicture; const ATileRect: TRectF; const ALocalMatrix: TMatrix; const ATileModeX: TSkTileMode = TSkTileMode.Clamp; const ATileModeY: TSkTileMode = TSkTileMode.Clamp; const AFilterMode: TSkFilterMode = TSkFilterMode.Linear): ISkShader; overload; - end; +uses + { Delphi } + {$IFDEF MSWINDOWS} + Winapi.Windows, + {$ENDIF} + System.Generics.Collections, + System.IOUtils, + System.Math, + System.RTLConsts, + System.TimeSpan; - TSkSurfacePropertiesFlag = (UseDeviceIndependentFonts, DynamicMSAA); - TSkSurfacePropertiesFlags = set of TSkSurfacePropertiesFlag; +type + ISkWStream = interface; - TSkPixelGeometry = (Unknown, RGBHorizontal, BGRHorizontal, RGBVertical, BGRVertical); + TSkDelegateInitializeFunc = reference to function (const AContextProc: Pointer): I; + TSkDelegateInvokeProc = reference to procedure (const AProc: T); + TSkGetStringsFunc = reference to function (const AHandle: THandle; const AStrings: PMarshaledAString): Integer; + TSkSetStringsProc = reference to procedure (const AHandle: THandle; const AStrings: PMarshaledAString); + TSkSetTwoStringsProc = reference to procedure (const AHandle: THandle; const AStrings1, AStrings2: PMarshaledAString); - { TSkSurfaceProperties } + { TSkBindings } - TSkSurfaceProperties = record - Flags: TSkSurfacePropertiesFlags; - PixelGeometry: TSkPixelGeometry; - constructor Create(const AFlags: TSkSurfacePropertiesFlags; const APixelGeometry: TSkPixelGeometry); - class operator Equal(const ASurfaceProperties1, ASurfaceProperties2: TSkSurfaceProperties): Boolean; - class operator NotEqual(const ASurfaceProperties1, ASurfaceProperties2: TSkSurfaceProperties): Boolean; + TSkBindings = record + class function AsDateTime(const AValue: TDateTime): sk_datetime_t; static; inline; + class function AsGrContextOptions(const AValue: TGrContextOptions): gr_contextoptions_t; static; inline; + class function AsGrVkAlloc(const AValue: TGrVkAlloc): gr_vk_alloc_t; static; inline; + class function AsGrVkBackendContext(const AValue: TGrVkBackendContext): gr_vk_backendcontext_t; static; inline; + class function AsGrVkImageInfo(const AValue: TGrVkImageInfo): gr_vk_imageinfo_t; static; inline; + class function AsImageInfo(const AValue: TSkImageInfo): sk_imageinfo_t; static; inline; + class function AsLattice(const AValue: TSkLattice): sk_lattice_t; static; inline; + class function AsPDFMetadata(const AValue: TSkPDFMetadata): sk_pdfmetadata_t; static; inline; + class function AsSurfaceProperties(const AValue: TSkSurfaceProperties): sk_surfaceprops_t; static; inline; + class function GetStrings(const AHandle: THandle; const AFunc: TSkGetStringsFunc): TArray; static; inline; + class function SafeCreate(const AHandle: THandle; const AOwnsHandle: Boolean = True): T; static; inline; + class function SafeHandle(const AObject: ISkObject): THandle; static; inline; + class function ToFontMetrics(const AValue: sk_fontmetrics_t): TSkFontMetrics; static; inline; + class function ToImageInfo(const AValue: sk_imageinfo_t): TSkImageInfo; static; inline; + class function ToParagraphVisitorInfo(const AValue: sk_paragraphvisitorinfo_t): TSkParagraphVisitorInfo; static; inline; + class function ToSurfaceProperties(const AValue: sk_surfaceprops_t): TSkSurfaceProperties; static; inline; + class procedure SetStrings(const AHandle: THandle; const AStrings: TArray; const AProc: TSkSetStringsProc); overload; static; inline; + class procedure SetStrings(const AHandle: THandle; const AStrings1, AStrings2: TArray; const AProc: TSkSetTwoStringsProc); overload; static; inline; + class function __gr_gl_get_proc(context: Pointer; const name: MarshaledAString): Pointer; cdecl; static; + class function __gr_vk_get_proc(context: Pointer; const name: MarshaledAString; instance: gr_vk_instance_t; device: gr_vk_device_t): Pointer; cdecl; static; end; - TSkSurfaceRasterReleaseProc = reference to procedure (const APixels: Pointer); + { TSkDelegate } - { ISkSurface } + TSkDelegate = record + strict private type + TProcWrapper = record + Proc: T; + end; + PProcWrapper = ^TProcWrapper; - ISkSurface = interface(ISkReferenceCounted) - ['{8E740BAA-320F-494C-939C-5982E0643DBB}'] - function GetCanvas: ISkCanvas; - function GetProperties: TSkSurfaceProperties; - function MakeImageSnapshot: ISkImage; overload; - function MakeImageSnapshot(const ABounds: TRect): ISkImage; overload; - function PeekPixels: ISkPixmap; - function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; - function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; - procedure Draw(const ACanvas: ISkCanvas; const AX, AY: Single; const APaint: ISkPaint = nil); - procedure Flush; - procedure FlushAndSubmit(const ASyncCPU: Boolean = False); - property Canvas: ISkCanvas read GetCanvas; - property Properties: TSkSurfaceProperties read GetProperties; + public + class function Initialize(const AProc: T; const AInitializeFunc: TSkDelegateInitializeFunc): I; static; inline; + class procedure Finalize(const AContextProc: Pointer); static; inline; + class procedure Invoke(const AContextProc: Pointer; const AInvokeProc: TSkDelegateInvokeProc); static; inline; end; - { TSkSurface } + { ISkData } - TSkSurface = class(TSkReferenceCounted, ISkSurface) - strict private - FCanvasHolder: ISkCanvas; - class procedure raster_release_proc(pixels: Pointer; context: Pointer); cdecl; static; - strict protected - function GetCanvas: ISkCanvas; - function GetProperties: TSkSurfaceProperties; - function MakeImageSnapshot: ISkImage; overload; - function MakeImageSnapshot(const ABounds: TRect): ISkImage; overload; - function PeekPixels: ISkPixmap; - function ReadPixels(const ADest: ISkPixmap; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; - function ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX: Integer = 0; const ASrcY: Integer = 0): Boolean; overload; - procedure Draw(const ACanvas: ISkCanvas; const AX, AY: Single; const APaint: ISkPaint = nil); - procedure Flush; - procedure FlushAndSubmit(const ASyncCPU: Boolean = False); - public - class function MakeFromCAMetalLayer(const AContext: IGrDirectContext; const ALayer: GrMtlHandle; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; out ADrawable: GrMtlHandle; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; - class function MakeFromCAMetalLayer(const AContext: IGrDirectContext; const ALayer: GrMtlHandle; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; out ADrawable: GrMtlHandle; const AProperties: TSkSurfaceProperties; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; - class function MakeFromMTKView(const AContext: IGrDirectContext; const AView: GrMtlHandle; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; - class function MakeFromMTKView(const AContext: IGrDirectContext; const AView: GrMtlHandle; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; const AProperties: TSkSurfaceProperties; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; - class function MakeFromRenderTarget(const AContext: IGrDirectContext; const ARenderTarget: IGrBackendRenderTarget; const AOrigin: TGrSurfaceOrigin; const AColorType: TSkColorType; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; - class function MakeFromRenderTarget(const AContext: IGrDirectContext; const ARenderTarget: IGrBackendRenderTarget; const AOrigin: TGrSurfaceOrigin; const AColorType: TSkColorType; const AProperties: TSkSurfaceProperties; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; - class function MakeFromTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; - class function MakeFromTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; const ASampleCount: Integer; const AColorType: TSkColorType; const AProperties: TSkSurfaceProperties; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; - class function MakeRaster(const AWidth, AHeight: Integer; const AColorType: TSkColorType = {$IFDEF BIGENDIAN}TSkColorType.RGBA8888{$ELSE}TSkColorType.BGRA8888{$ENDIF}; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; inline; - class function MakeRaster(const AWidth, AHeight: Integer; const AProperties: TSkSurfaceProperties; const AColorType: TSkColorType = {$IFDEF BIGENDIAN}TSkColorType.RGBA8888{$ELSE}TSkColorType.BGRA8888{$ENDIF}; const AAlphaType: TSkAlphaType = TSkAlphaType.Premul; AColorSpace: ISkColorSpace = nil): ISkSurface; overload; static; inline; - class function MakeRaster(const AImageInfo: TSkImageInfo): ISkSurface; overload; static; inline; - class function MakeRaster(const AImageInfo: TSkImageInfo; const AProperties: TSkSurfaceProperties): ISkSurface; overload; static; inline; - class function MakeRaster(const AImageInfo: TSkImageInfo; const ARowBytes: NativeUInt): ISkSurface; overload; static; - class function MakeRaster(const AImageInfo: TSkImageInfo; const ARowBytes: NativeUInt; const AProperties: TSkSurfaceProperties): ISkSurface; overload; static; - class function MakeRasterDirect(const APixmap: ISkPixmap; const ARasterReleaseProc: TSkSurfaceRasterReleaseProc = nil): ISkSurface; overload; static; - class function MakeRasterDirect(const APixmap: ISkPixmap; const AProperties: TSkSurfaceProperties; const ARasterReleaseProc: TSkSurfaceRasterReleaseProc = nil): ISkSurface; overload; static; - class function MakeRasterDirect(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt; const ARasterReleaseProc: TSkSurfaceRasterReleaseProc = nil): ISkSurface; overload; static; - class function MakeRasterDirect(const AImageInfo: TSkImageInfo; const APixels: Pointer; const ARowBytes: NativeUInt; const AProperties: TSkSurfaceProperties; const ARasterReleaseProc: TSkSurfaceRasterReleaseProc = nil): ISkSurface; overload; static; - class function MakeRenderTarget(const AContext: IGrDirectContext; const AIsBudgeted: Boolean; const AImageInfo: TSkImageInfo; const ASampleCount: Integer = 0; const AOrigin: TGrSurfaceOrigin = TGrSurfaceOrigin.BottomLeft; const AShouldCreateWithMips: Boolean = False): ISkSurface; overload; static; - class function MakeRenderTarget(const AContext: IGrDirectContext; const AIsBudgeted: Boolean; const AImageInfo: TSkImageInfo; const AProperties: TSkSurfaceProperties; const ASampleCount: Integer = 0; const AOrigin: TGrSurfaceOrigin = TGrSurfaceOrigin.BottomLeft; const AShouldCreateWithMips: Boolean = False): ISkSurface; overload; static; + ISkData = interface(ISkNonVirtualReferenceCounted) + ['{7C1D6B87-6DCC-4398-B5F1-954E60BDB085}'] end; - TSkSVGCanvasFlag = (ConvertTextToPaths, NoPrettyXML, RelativePathEncoding); - TSkSVGCanvasFlags = set of TSkSVGCanvasFlag; - - { TSkSVGCanvas } + { TSkData } - TSkSVGCanvas = record - class function Make(const ABounds: TRectF; const AStream: TStream; const AFlags: TSkSVGCanvasFlags = []): ISkCanvas; static; + TSkData = class(TSkNonVirtualReferenceCounted, ISkData) + public + class function MakeFromBytes(const ABytes: TBytes): ISkData; static; + class procedure __RefHandle(const AHandle: THandle); override; + class procedure __UnrefHandle(const AHandle: THandle); override; end; - { ISkTextBlob } + { ISkStream } - ISkTextBlob = interface(ISkNonVirtualReferenceCounted) - ['{43D18069-AEA6-47E1-8EA2-1BE0265D75C2}'] - function GetIntercepts(const AUpperBounds, ALowerBounds: Single; const APaint: ISkPaint = nil): TArray; + ISkStream = interface(ISkObject) + ['{E99AB460-4CEE-4F50-85A7-29896A1407AC}'] end; - { TSkTextBlob } + { TSkStreamAdapter } - TSkTextBlob = class(TSkNonVirtualReferenceCounted, ISkTextBlob) - strict protected - function GetIntercepts(const AUpperBounds, ALowerBounds: Single; const APaint: ISkPaint = nil): TArray; + TSkStreamAdapter = class(TSkObject, ISkStream) + strict private + class constructor Create; + class function get_length_proc(context: Pointer): size_t; cdecl; static; + class function get_position_proc(context: Pointer): size_t; cdecl; static; + class function read_proc(context: Pointer; buffer: Pointer; size: size_t): size_t; cdecl; static; + class function seek_proc(context: Pointer; position: size_t): _bool; cdecl; static; public - class function MakeFromText(const AText: string; const AFont: ISkFont): ISkTextBlob; static; - class function MakeFromTextHorizontallyPositioned(const AText: string; const AXPositions: TArray; const AY: Single; const AFont: ISkFont): ISkTextBlob; static; - class function MakeFromTextPositioned(const AText: string; const APositions: TArray; const AFont: ISkFont): ISkTextBlob; static; - class function MakeFromTextTransform(const AText: string; const AMatrices: TArray; const AFont: ISkFont): ISkTextBlob; static; - class procedure RefHandle(const AHandle: THandle); override; - class procedure UnrefHandle(const AHandle: THandle); override; + constructor Create(const AStream: TStream); + class procedure __DestroyHandle(const AHandle: THandle); override; end; - { ISkTraceMemoryDump } + { ISkWStream } - ISkTraceMemoryDump = interface(ISkObject) - ['{96A1FCB6-246E-4E49-958C-95897319FA57}'] + ISkWStream = interface(ISkObject) + ['{C20D663E-459B-495A-9E19-017FE7A08227}'] end; - { TSkTraceMemoryDumpBaseClass } + { TSkWStreamAdapter } - TSkTraceMemoryDumpBaseClass = class abstract(TSkObject, ISkTraceMemoryDump) + TSkWStreamAdapter = class(TSkObject, ISkWStream) strict private class constructor Create; - class procedure dump_numeric_value_proc(context: Pointer; const dump_name, value_name, units: MarshaledAString; value: uint64_t); cdecl; static; - class procedure dump_string_value_proc(context: Pointer; const dump_name, value_name, value: MarshaledAString); cdecl; static; - strict protected - procedure DumpNumericValue(const ADumpName, AValueName, AUnits: string; const AValue: UInt64); virtual; abstract; - procedure DumpStringValue(const ADumpName, AValueName, AValue: string); virtual; abstract; + class function write_proc(context: Pointer; const buffer: Pointer; size: size_t): _bool; cdecl; static; public - constructor Create(const ADetailedDump, ADumpWrappedObjects: Boolean); - class procedure DestroyHandle(const AHandle: THandle); override; - end; - - TSkFontWeight = ( - Invisible = 0, - Thin = 100, - ExtraLight = 200, - Light = 300, - Normal = 400, - Medium = 500, - SemiBold = 600, - Bold = 700, - ExtraBold = 800, - Black = 900, - ExtraBlack = 1000 - ); + constructor Create(const AStream: TStream); + class procedure __DestroyHandle(const AHandle: THandle); override; + end; - { TSkFontWeightConstants } - - TSkFontWeightConstants = record helper for TSkFontWeight - const - Hairline = TSkFontWeight.Thin; - UltraLight = TSkFontWeight.ExtraLight; - Regular = TSkFontWeight.Normal; - DemiBold = TSkFontWeight.SemiBold; - UltraBold = TSkFontWeight.ExtraBold; - Heavy = TSkFontWeight.Black; - UltraBlack = TSkFontWeight.ExtraBlack; - end; - - TSkFontWidth = ( - UltraCondensed = 1, - ExtraCondensed = 2, - Condensed = 3, - SemiCondensed = 4, - Normal = 5, - SemiExpanded = 6, - Expanded = 7, - ExtraExpanded = 8, - UltraExpanded = 9 - ); + { ISkString } + + ISkString = interface(ISkObject) + ['{2648646C-8DC1-4289-A9E2-2F658BB11C1C}'] + function GetText: string; + property Text: string read GetText; + end; - { TSkFontWidthConstants } + { TSkString } - TSkFontWidthConstants = record helper for TSkFontWidth - const - Regular = TSkFontWidth.Normal; + TSkString = class(TSkObject, ISkString) + strict private + function GetText: string; + public + constructor Create; + class procedure __DestroyHandle(const AHandle: THandle); override; end; - TSkFontSlant = (Upright, Italic, Oblique); +{ TSkObject } - { TSkFontSlantConstants } +{$IFNDEF AUTOREFCOUNT} - TSkFontSlantConstants = record helper for TSkFontSlant - const - Regular = TSkFontSlant.Upright; - end; +procedure TSkObject.AfterConstruction; +begin + inherited; + AtomicDecrement(FRefCount); +end; - { TSkFontStyle } +procedure TSkObject.BeforeDestruction; +begin + if RefCount <> 0 then + System.Error(reInvalidPtr); + inherited; +end; - TSkFontStyle = record - Weight: Integer; - Width: Integer; - Slant: TSkFontSlant; - constructor Create(const AWeight, AWidth: Integer; const ASlant: TSkFontSlant); overload; - constructor Create(const AWeight: TSkFontWeight; const AWidth: TSkFontWidth; const ASlant: TSkFontSlant); overload; - class function Normal: TSkFontStyle; static; inline; - class function Bold: TSkFontStyle; static; inline; - class function Italic: TSkFontStyle; static; inline; - class function BoldItalic: TSkFontStyle; static; inline; - class operator Equal(const AFontStyle1, AFontStyle2: TSkFontStyle): Boolean; - class operator NotEqual(const AFontStyle1, AFontStyle2: TSkFontStyle): Boolean; - end; +{$ENDIF} + +class constructor TSkObject.Create; +begin + SkInitialize; +end; - { TSkFontStyleConstants } +constructor TSkObject.Create(const AHandle: THandle); +begin + Wrap(AHandle); +end; - TSkFontStyleConstants = record helper for TSkFontStyle - const - Normal : TSkFontStyle = (Weight: Ord(TSkFontWeight.Normal); Width: Ord(TSkFontWidth.Normal); Slant: TSkFontSlant.Upright); - Bold : TSkFontStyle = (Weight: Ord(TSkFontWeight.Bold); Width: Ord(TSkFontWidth.Normal); Slant: TSkFontSlant.Upright); - Italic : TSkFontStyle = (Weight: Ord(TSkFontWeight.Normal); Width: Ord(TSkFontWidth.Normal); Slant: TSkFontSlant.Italic); - BoldItalic : TSkFontStyle = (Weight: Ord(TSkFontWeight.Bold); Width: Ord(TSkFontWidth.Normal); Slant: TSkFontSlant.Italic); - end; +destructor TSkObject.Destroy; +begin + if FOwnsHandle then + __DestroyHandle(FHandle); + inherited; +end; - { ISkTypeface } +class destructor TSkObject.Destroy; +begin + SkFinalize; +end; - ISkTypeface = interface(ISkReferenceCounted) - ['{DD3BF5F5-2090-4753-8FCE-336AA93D3CA1}'] - function GetFamilyName: string; - function GetSlant: TSkFontSlant; - function GetStyle: TSkFontStyle; - function GetWeight: Integer; - function GetWidth: Integer; - function IsBold: Boolean; - function IsItalic: Boolean; - property FamilyName: string read GetFamilyName; - property Slant: TSkFontSlant read GetSlant; - property Style: TSkFontStyle read GetStyle; - property Weight: Integer read GetWeight; - property Width: Integer read GetWidth; - end; +function TSkObject.GetHandle: THandle; +begin + Result := FHandle; +end; + +{$IFNDEF AUTOREFCOUNT} + +function TSkObject.GetRefCount: Integer; +begin + Result := FRefCount and not objDestroyingFlag; +end; + +class function TSkObject.NewInstance: TObject; +begin + Result := inherited NewInstance; + TSkObject(Result).FRefCount := 1; +end; - { TSkTypeface } +{$ENDIF} - TSkTypeface = class(TSkReferenceCounted, ISkTypeface) - strict protected - function GetFamilyName: string; - function GetSlant: TSkFontSlant; - function GetStyle: TSkFontStyle; - function GetWeight: Integer; - function GetWidth: Integer; - function IsBold: Boolean; - function IsItalic: Boolean; - public - class function MakeDefault: ISkTypeface; static; - class function MakeFromFile(const AFileName: string; const ATTCIndex: Integer = 0): ISkTypeface; static; - class function MakeFromName(const AFamilyName: string; const AStyle: TSkFontStyle): ISkTypeface; static; - class function MakeFromStream(const AStream: TStream; const ATTCIndex: Integer = 0): ISkTypeface; static; - end; +function TSkObject.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; - { TSkVersion } +constructor TSkObject.Wrap(const AHandle: THandle; const AOwnsHandle: Boolean); +begin + inherited Create; + Assert(AHandle <> 0); + FHandle := AHandle; + FOwnsHandle := AOwnsHandle; +end; - TSkVersion = record - strict private - class function GetMajor: Integer; static; - class function GetMinor: Integer; static; - class function GetBuild: Integer; static; - class function GetLibraryMajor: Integer; static; - class function GetLibraryMinor: Integer; static; - class function GetLibraryBuild: Integer; static; - public - class property Major: Integer read GetMajor; - class property Minor: Integer read GetMinor; - class property Build: Integer read GetBuild; - class property LibraryMajor: Integer read GetLibraryMajor; - class property LibraryMinor: Integer read GetLibraryMinor; - class property LibraryBuild: Integer read GetLibraryBuild; +function TSkObject._AddRef: Integer; +begin + {$IFNDEF AUTOREFCOUNT} + Result := AtomicIncrement(FRefCount); + {$ELSE} + Result := __ObjAddRef; + {$ENDIF} + if Result > 1 then + __RefHandle(FHandle); +end; + +function TSkObject._Release: Integer; +begin + {$IFNDEF AUTOREFCOUNT} + Result := AtomicDecrement(FRefCount); + if Result = 0 then + begin + __MarkDestroying(Self); + Destroy; end; + {$ELSE} + Result := __ObjRelease; + {$ENDIF} + if Result > 0 then + __UnrefHandle(FHandle); +end; - TSkVertexMode = (Triangles, TriangleStrip, TriangleFan); +class procedure TSkObject.__DestroyHandle(const AHandle: THandle); +begin + __UnrefHandle(AHandle); +end; - { ISkVertices } +{$IFNDEF AUTOREFCOUNT} - ISkVertices = interface(ISkNonVirtualReferenceCounted) - ['{C0EDA7D9-C6E2-449D-9E51-4C5B07301D40}'] - end; +class procedure TSkObject.__MarkDestroying(const Obj); +var + LRef: Integer; +begin + repeat + LRef := TSkObject(Obj).FRefCount; + until AtomicCmpExchange(TSkObject(Obj).FRefCount, LRef or objDestroyingFlag, LRef) = LRef; +end; - { TSkVertices } +{$ENDIF} - TSkVertices = class(TSkNonVirtualReferenceCounted, ISkVertices) - public - class function MakeCopy(const AVertexMode: TSkVertexMode; const APositions, ATextures: TArray; const AColors: TArray; const AIndices: TArray = nil): ISkVertices; static; - class procedure RefHandle(const AHandle: THandle); override; - class procedure UnrefHandle(const AHandle: THandle); override; - end; +class procedure TSkObject.__RefHandle(const AHandle: THandle); +begin +end; - { TSkParticleUniform } +class function TSkObject.__ReleaseHandle(const AObject: ISkObject): THandle; +var + LObject: TSkObject; +begin + if not Assigned(AObject) then + Exit(0); + LObject := AObject as TSkObject; + Result := LObject.GetHandle; + if not LObject.FOwnsHandle then + raise ESkException.Create('Current object is not owner of the handle'); + LObject.FOwnsHandle := False; +end; - TSkParticleUniform = record - Columns: Integer; - Rows: Integer; - Slot: Integer; - end; +class procedure TSkObject.__UnrefHandle(const AHandle: THandle); +begin +end; - TSkParticleUniformData = array[0..0] of Single; - PSkParticleUniformData = ^TSkParticleUniformData; +{ TSkReferenceCounted } - ISkResourceProvider = interface; +class procedure TSkReferenceCounted.__RefHandle(const AHandle: THandle); +begin + sk4d_refcnt_ref(AHandle); +end; - { ISkParticleEffect } +class procedure TSkReferenceCounted.__UnrefHandle(const AHandle: THandle); +begin + sk4d_refcnt_unref(AHandle); +end; - ISkParticleEffect = interface(ISkReferenceCounted) - ['{9BDF58BE-1ECF-4B18-B538-68A190E4C8AF}'] - function GetPosition: TPointF; - function GetRate: Single; - function GetUniform(const AIndex: NativeUInt): TSkParticleUniform; - function GetUniformCount: NativeUInt; - function GetUniformData: PSkParticleUniformData; - function GetUniformDataCount: Integer; - function GetUniformName(const AIndex: NativeUInt): string; - procedure Render(const ACanvas: ISkCanvas); - procedure SetPosition(const AValue: TPointF); - procedure SetRate(const AValue: Single); - function SetUniform(const AName: string; const AData: TArray): Boolean; - procedure Start(const ANow: Double; const ALooping: Boolean); - procedure Update(const ANow: Double); - property Position: TPointF read GetPosition write SetPosition; - property Rate: Single read GetRate write SetRate; - property Uniforms[const AIndex: NativeUInt]: TSkParticleUniform read GetUniform; - property UniformCount: NativeUInt read GetUniformCount; - property UniformData: PSkParticleUniformData read GetUniformData; - property UniformDataCount: Integer read GetUniformDataCount; - property UniformName[const AIndex: NativeUInt]: string read GetUniformName; - end; +{ TSkEnumerator } - { TSkParticleEffect } +constructor TSkEnumerator.Create(const AEnumerable: TSkEnumerable); +begin + inherited Create; + FEnumerable := AEnumerable; +end; - TSkParticleEffect = class(TSkReferenceCounted, ISkParticleEffect) - strict private - class constructor Create; - strict protected - function GetPosition: TPointF; - function GetRate: Single; - function GetUniform(const AIndex: NativeUInt): TSkParticleUniform; - function GetUniformCount: NativeUInt; - function GetUniformData: PSkParticleUniformData; - function GetUniformDataCount: Integer; - function GetUniformName(const AIndex: NativeUInt): string; - procedure Render(const ACanvas: ISkCanvas); - procedure SetPosition(const AValue: TPointF); - procedure SetRate(const AValue: Single); - function SetUniform(const AName: string; const AData: TArray): Boolean; - procedure Start(const ANow: Double; const ALooping: Boolean); - procedure Update(const ANow: Double); - public - class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil): ISkParticleEffect; static; - class function MakeFromFile(const AFileName: string): ISkParticleEffect; static; - class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil): ISkParticleEffect; static; - end; +function TSkEnumerator.GetCurrent: T; +begin + Result := FEnumerable.GetCurrent; +end; - TSkottieAnimationRenderFlag = (SkipTopLevelIsolation, DisableTopLevelClipping); - TSkottieAnimationRenderFlags = set of TSkottieAnimationRenderFlag; +function TSkEnumerator.MoveNext: Boolean; +begin + Result := FEnumerable.MoveNext; +end; - { ISkottieAnimation } +{ TSkEnumerable } - ISkottieAnimation = interface(ISkNonVirtualReferenceCounted) - ['{E3381710-6350-4A2B-8DA8-E71EA31E8E71}'] - function GetDuration: Double; - function GetFPS: Double; - function GetInPoint: Double; - function GetOutPoint: Double; - function GetSize: TSizeF; - function GetVersion: string; - procedure Render(const ACanvas: ISkCanvas; const ARenderFlags: TSkottieAnimationRenderFlags = []); overload; - procedure Render(const ACanvas: ISkCanvas; const ADest: TRectF; const ARenderFlags: TSkottieAnimationRenderFlags = []); overload; - procedure SeekFrame(const ATick: Double); - procedure SeekFrameTime(const ATick: Double); - property Duration: Double read GetDuration; - property FPS: Double read GetFPS; - property InPoint: Double read GetInPoint; - property OutPoint: Double read GetOutPoint; - property Size: TSizeF read GetSize; - property Version: string read GetVersion; - end; +function TSkEnumerable.GetEnumerator: TSkEnumerator; +begin + Result := TSkEnumerator.Create(Self); +end; - { TSkottieAnimation } +{ TSkColorMatrix } - TSkottieAnimation = class(TSkNonVirtualReferenceCounted, ISkottieAnimation) - strict protected - function GetDuration: Double; - function GetFPS: Double; - function GetInPoint: Double; - function GetOutPoint: Double; - function GetSize: TSizeF; - function GetVersion: string; - procedure Render(const ACanvas: ISkCanvas; const ARenderFlags: TSkottieAnimationRenderFlags = []); overload; - procedure Render(const ACanvas: ISkCanvas; const ADest: TRectF; const ARenderFlags: TSkottieAnimationRenderFlags = []); overload; - procedure SeekFrame(const ATick: Double); - procedure SeekFrameTime(const ATick: Double); - public - class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil): ISkottieAnimation; static; - class function MakeFromFile(const AFileName: string): ISkottieAnimation; static; - class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil): ISkottieAnimation; static; - class procedure RefHandle(const AHandle: THandle); override; - class procedure UnrefHandle(const AHandle: THandle); override; - end; +constructor TSkColorMatrix.Create(const AM11, AM12, AM13, AM14, AM15, AM21, + AM22, AM23, AM24, AM25, AM31, AM32, AM33, AM34, AM35, AM41, AM42, AM43, AM44, + AM45: Single); +begin + M11 := AM11; + M12 := AM12; + M13 := AM13; + M14 := AM14; + M15 := AM15; + M21 := AM21; + M22 := AM22; + M23 := AM23; + M24 := AM24; + M25 := AM25; + M31 := AM31; + M32 := AM32; + M33 := AM33; + M34 := AM34; + M35 := AM35; + M41 := AM41; + M42 := AM42; + M43 := AM43; + M44 := AM44; + M45 := AM45; +end; + +class function TSkColorMatrix.CreateSaturation( + const ASaturation: Single): TSkColorMatrix; +const + HueR = 0.213; + HueG = 0.715; + HueB = 0.072; +var + LB: Single; + LG: Single; + LR: Single; +begin + LR := HueR * (1 - ASaturation); + LG := HueG * (1 - ASaturation); + LB := HueB * (1 - ASaturation); + Result.M11 := LR + ASaturation; + Result.M12 := LG; + Result.M13 := LB; + Result.M14 := 0; + Result.M15 := 0; + Result.M21 := LR; + Result.M22 := LG + ASaturation; + Result.M23 := LB; + Result.M24 := 0; + Result.M25 := 0; + Result.M31 := LR; + Result.M32 := LG; + Result.M33 := LB + ASaturation; + Result.M34 := 0; + Result.M35 := 0; + Result.M41 := 0; + Result.M42 := 0; + Result.M43 := 0; + Result.M44 := 1; + Result.M45 := 0; +end; + +class function TSkColorMatrix.CreateScale(const AScaleR, AScaleG, AScaleB, + AScaleA: Single): TSkColorMatrix; +begin + Result.M11 := AScaleR; + Result.M12 := 0; + Result.M13 := 0; + Result.M14 := 0; + Result.M15 := 0; + Result.M21 := 0; + Result.M22 := AScaleG; + Result.M23 := 0; + Result.M24 := 0; + Result.M25 := 0; + Result.M31 := 0; + Result.M32 := 0; + Result.M33 := AScaleB; + Result.M34 := 0; + Result.M35 := 0; + Result.M41 := 0; + Result.M42 := 0; + Result.M43 := 0; + Result.M44 := AScaleA; + Result.M45 := 0; +end; + +class operator TSkColorMatrix.Equal(const AColorMatrix1, + AColorMatrix2: TSkColorMatrix): Boolean; +begin + Result := (SameValue(AColorMatrix1.M11, AColorMatrix2.M11, Epsilon)) and + (SameValue(AColorMatrix1.M12, AColorMatrix2.M12, Epsilon)) and + (SameValue(AColorMatrix1.M13, AColorMatrix2.M13, Epsilon)) and + (SameValue(AColorMatrix1.M14, AColorMatrix2.M14, Epsilon)) and + (SameValue(AColorMatrix1.M15, AColorMatrix2.M15, Epsilon)) and + (SameValue(AColorMatrix1.M21, AColorMatrix2.M21, Epsilon)) and + (SameValue(AColorMatrix1.M22, AColorMatrix2.M22, Epsilon)) and + (SameValue(AColorMatrix1.M23, AColorMatrix2.M23, Epsilon)) and + (SameValue(AColorMatrix1.M24, AColorMatrix2.M24, Epsilon)) and + (SameValue(AColorMatrix1.M25, AColorMatrix2.M25, Epsilon)) and + (SameValue(AColorMatrix1.M31, AColorMatrix2.M31, Epsilon)) and + (SameValue(AColorMatrix1.M32, AColorMatrix2.M32, Epsilon)) and + (SameValue(AColorMatrix1.M33, AColorMatrix2.M33, Epsilon)) and + (SameValue(AColorMatrix1.M34, AColorMatrix2.M34, Epsilon)) and + (SameValue(AColorMatrix1.M35, AColorMatrix2.M35, Epsilon)) and + (SameValue(AColorMatrix1.M41, AColorMatrix2.M41, Epsilon)) and + (SameValue(AColorMatrix1.M42, AColorMatrix2.M42, Epsilon)) and + (SameValue(AColorMatrix1.M43, AColorMatrix2.M43, Epsilon)) and + (SameValue(AColorMatrix1.M44, AColorMatrix2.M44, Epsilon)) and + (SameValue(AColorMatrix1.M45, AColorMatrix2.M45, Epsilon)); +end; - TSkAffinity = (Upstream, Downstream); +class function TSkColorMatrix.Identity: TSkColorMatrix; +begin + Result := SkColorMatrixIdentity; +end; - { TSkPositionAffinity } +class operator TSkColorMatrix.Multiply(const AColorMatrix1, + AColorMatrix2: TSkColorMatrix): TSkColorMatrix; +begin + Result.M11 := AColorMatrix2.M11 * AColorMatrix1.M11 + AColorMatrix2.M12 * AColorMatrix1.M21 + AColorMatrix2.M13 * AColorMatrix1.M31 + AColorMatrix2.M14 * AColorMatrix1.M41; + Result.M12 := AColorMatrix2.M11 * AColorMatrix1.M12 + AColorMatrix2.M12 * AColorMatrix1.M22 + AColorMatrix2.M13 * AColorMatrix1.M32 + AColorMatrix2.M14 * AColorMatrix1.M42; + Result.M13 := AColorMatrix2.M11 * AColorMatrix1.M13 + AColorMatrix2.M12 * AColorMatrix1.M23 + AColorMatrix2.M13 * AColorMatrix1.M33 + AColorMatrix2.M14 * AColorMatrix1.M43; + Result.M14 := AColorMatrix2.M11 * AColorMatrix1.M14 + AColorMatrix2.M12 * AColorMatrix1.M24 + AColorMatrix2.M13 * AColorMatrix1.M34 + AColorMatrix2.M14 * AColorMatrix1.M44; + Result.M15 := AColorMatrix2.M11 * AColorMatrix1.M15 + AColorMatrix2.M12 * AColorMatrix1.M25 + AColorMatrix2.M13 * AColorMatrix1.M35 + AColorMatrix2.M14 * AColorMatrix1.M45 + AColorMatrix2.M15; + Result.M21 := AColorMatrix2.M21 * AColorMatrix1.M11 + AColorMatrix2.M22 * AColorMatrix1.M21 + AColorMatrix2.M23 * AColorMatrix1.M31 + AColorMatrix2.M24 * AColorMatrix1.M41; + Result.M22 := AColorMatrix2.M21 * AColorMatrix1.M12 + AColorMatrix2.M22 * AColorMatrix1.M22 + AColorMatrix2.M23 * AColorMatrix1.M32 + AColorMatrix2.M24 * AColorMatrix1.M42; + Result.M23 := AColorMatrix2.M21 * AColorMatrix1.M13 + AColorMatrix2.M22 * AColorMatrix1.M23 + AColorMatrix2.M23 * AColorMatrix1.M33 + AColorMatrix2.M24 * AColorMatrix1.M43; + Result.M24 := AColorMatrix2.M21 * AColorMatrix1.M14 + AColorMatrix2.M22 * AColorMatrix1.M24 + AColorMatrix2.M23 * AColorMatrix1.M34 + AColorMatrix2.M24 * AColorMatrix1.M44; + Result.M25 := AColorMatrix2.M21 * AColorMatrix1.M15 + AColorMatrix2.M22 * AColorMatrix1.M25 + AColorMatrix2.M23 * AColorMatrix1.M35 + AColorMatrix2.M24 * AColorMatrix1.M45 + AColorMatrix2.M25; + Result.M31 := AColorMatrix2.M31 * AColorMatrix1.M11 + AColorMatrix2.M32 * AColorMatrix1.M21 + AColorMatrix2.M33 * AColorMatrix1.M31 + AColorMatrix2.M34 * AColorMatrix1.M41; + Result.M32 := AColorMatrix2.M31 * AColorMatrix1.M12 + AColorMatrix2.M32 * AColorMatrix1.M22 + AColorMatrix2.M33 * AColorMatrix1.M32 + AColorMatrix2.M34 * AColorMatrix1.M42; + Result.M33 := AColorMatrix2.M31 * AColorMatrix1.M13 + AColorMatrix2.M32 * AColorMatrix1.M23 + AColorMatrix2.M33 * AColorMatrix1.M33 + AColorMatrix2.M34 * AColorMatrix1.M43; + Result.M34 := AColorMatrix2.M31 * AColorMatrix1.M14 + AColorMatrix2.M32 * AColorMatrix1.M24 + AColorMatrix2.M33 * AColorMatrix1.M34 + AColorMatrix2.M34 * AColorMatrix1.M44; + Result.M35 := AColorMatrix2.M31 * AColorMatrix1.M15 + AColorMatrix2.M32 * AColorMatrix1.M25 + AColorMatrix2.M33 * AColorMatrix1.M35 + AColorMatrix2.M34 * AColorMatrix1.M45 + AColorMatrix2.M35; + Result.M41 := AColorMatrix2.M41 * AColorMatrix1.M11 + AColorMatrix2.M42 * AColorMatrix1.M21 + AColorMatrix2.M43 * AColorMatrix1.M31 + AColorMatrix2.M44 * AColorMatrix1.M41; + Result.M42 := AColorMatrix2.M41 * AColorMatrix1.M12 + AColorMatrix2.M42 * AColorMatrix1.M22 + AColorMatrix2.M43 * AColorMatrix1.M32 + AColorMatrix2.M44 * AColorMatrix1.M42; + Result.M43 := AColorMatrix2.M41 * AColorMatrix1.M13 + AColorMatrix2.M42 * AColorMatrix1.M23 + AColorMatrix2.M43 * AColorMatrix1.M33 + AColorMatrix2.M44 * AColorMatrix1.M43; + Result.M44 := AColorMatrix2.M41 * AColorMatrix1.M14 + AColorMatrix2.M42 * AColorMatrix1.M24 + AColorMatrix2.M43 * AColorMatrix1.M34 + AColorMatrix2.M44 * AColorMatrix1.M44; + Result.M45 := AColorMatrix2.M41 * AColorMatrix1.M15 + AColorMatrix2.M42 * AColorMatrix1.M25 + AColorMatrix2.M43 * AColorMatrix1.M35 + AColorMatrix2.M44 * AColorMatrix1.M45 + AColorMatrix2.M45; +end; - TSkPositionAffinity = record - Position: Integer; - Affinity: TSkAffinity; - class operator Equal(const APositionAffinity1, APositionAffinity2: TSkPositionAffinity): Boolean; - class operator NotEqual(const APositionAffinity1, APositionAffinity2: TSkPositionAffinity): Boolean; - end; +class operator TSkColorMatrix.NotEqual(const AColorMatrix1, + AColorMatrix2: TSkColorMatrix): Boolean; +begin + Result := not (AColorMatrix1 = AColorMatrix2); +end; - { TSkMetrics } +{ TSkColorSpaceXyz } - TSkMetrics = record - StartIndex: NativeUInt; - EndIndex: NativeUInt; - EndExcludingWhitespaces: NativeUInt; - EndIncludingNewline: NativeUInt; - IsHardBreak: Boolean; - Ascent: Double; - Descent: Double; - Height: Double; - Width: Double; - Left: Double; - Baseline: Double; - LineNumber: NativeUInt; - class operator Equal(const AMetrics1, AMetrics2: TSkMetrics): Boolean; - class operator NotEqual(const AMetrics1, AMetrics2: TSkMetrics): Boolean; - end; +function TSkColorSpaceXyz.Adjoint: TSkColorSpaceXyz; +begin + Result.M11 := (M22 * M33 - M32 * M23); + Result.M12 := -(M12 * M33 - M32 * M13); + Result.M13 := (M12 * M23 - M22 * M13); + Result.M21 := -(M21 * M33 - M31 * M23); + Result.M22 := (M11 * M33 - M31 * M13); + Result.M23 := -(M11 * M23 - M21 * M13); + Result.M31 := (M21 * M32 - M31 * M22); + Result.M32 := -(M11 * M32 - M31 * M12); + Result.M33 := (M11 * M22 - M21 * M12); +end; - TSkTextDirection = (RightToLeft, LeftToRight); +class function TSkColorSpaceXyz.AdobeRGB: TSkColorSpaceXyz; +begin + Result := SkColorSpaceXyzAdobeRGB; +end; - { TSkTextBox } +constructor TSkColorSpaceXyz.Create(const AM11, AM12, AM13, AM21, AM22, AM23, + AM31, AM32, AM33: Single); +begin + M11 := AM11; + M12 := AM12; + M13 := AM13; + M21 := AM21; + M22 := AM22; + M23 := AM23; + M31 := AM31; + M32 := AM32; + M33 := AM33; +end; - TSkTextBox = record - Rect: TRectF; - Direction: TSkTextDirection; - class operator Equal(const ATextBox1, ATextBox2: TSkTextBox): Boolean; - class operator NotEqual(const ATextBox1, ATextBox2: TSkTextBox): Boolean; - end; +function TSkColorSpaceXyz.Determinant: Single; +begin + Result := M11 * (M22 * M33 - M32 * M23) - + M12 * (M21 * M33 - M31 * M23) + + M13 * (M21 * M32 - M31 * M22); +end; - TSkRectHeightStyle = (Tight, Max, IncludeLineSpacingMiddle, IncludeLineSpacingTop, IncludeLineSpacingBottom, Strut); +class function TSkColorSpaceXyz.DisplayP3: TSkColorSpaceXyz; +begin + Result := SkColorSpaceXyzDisplayP3; +end; - TSkRectWidthStyle = (Tight, Max); +class operator TSkColorSpaceXyz.Equal(const AColorSpaceXyz1, + AColorSpaceXyz2: TSkColorSpaceXyz): Boolean; +begin + Result := (SameValue(AColorSpaceXyz1.M11, AColorSpaceXyz2.M11, Epsilon)) and + (SameValue(AColorSpaceXyz1.M12, AColorSpaceXyz2.M12, Epsilon)) and + (SameValue(AColorSpaceXyz1.M13, AColorSpaceXyz2.M13, Epsilon)) and + (SameValue(AColorSpaceXyz1.M21, AColorSpaceXyz2.M21, Epsilon)) and + (SameValue(AColorSpaceXyz1.M22, AColorSpaceXyz2.M22, Epsilon)) and + (SameValue(AColorSpaceXyz1.M23, AColorSpaceXyz2.M23, Epsilon)) and + (SameValue(AColorSpaceXyz1.M31, AColorSpaceXyz2.M31, Epsilon)) and + (SameValue(AColorSpaceXyz1.M32, AColorSpaceXyz2.M32, Epsilon)) and + (SameValue(AColorSpaceXyz1.M33, AColorSpaceXyz2.M33, Epsilon)); +end; - { ISkParagraph } +class function TSkColorSpaceXyz.Identity: TSkColorSpaceXyz; +begin + Result := SkColorSpaceXyzIdentity; +end; - ISkParagraph = interface(ISkObject) - ['{27462359-56C6-41DF-9D15-840E1DEC25C9}'] - function DidExceedMaxLines: Boolean; - function GetAlphabeticBaseline: Single; - function GetGlyphPositionAtCoordinate(const ADeltaX, ADeltaY: Single): TSkPositionAffinity; - function GetHeight: Single; - function GetIdeographicBaseline: Single; - function GetLineMetrics: TArray; - function GetLongestLine: Single; - function GetMaxIntrinsicWidth: Single; - function GetMaxWidth: Single; - function GetMinIntrinsicWidth: Single; - function GetRectsForPlaceholders: TArray; - function GetRectsForRange(const AStart, AEnd: Cardinal; const ARectHeightStyle: TSkRectHeightStyle; const ARectWidthStyle: TSkRectWidthStyle): TArray; - procedure GetWordBoundary(const AOffset: Cardinal; out AStart, AEnd: Cardinal); - procedure Layout(const AWidth: Single); - procedure Paint(const ACanvas: ISkCanvas; const AX, AY: Single); - function ToPath: ISkPath; - property AlphabeticBaseline: Single read GetAlphabeticBaseline; - property Height: Single read GetHeight; - property IdeographicBaseline: Single read GetIdeographicBaseline; - property LineMetrics: TArray read GetLineMetrics; - property LongestLine: Single read GetLongestLine; - property MaxIntrinsicWidth: Single read GetMaxIntrinsicWidth; - property MaxWidth: Single read GetMaxWidth; - property MinIntrinsicWidth: Single read GetMinIntrinsicWidth; - end; +function TSkColorSpaceXyz.Inverse: TSkColorSpaceXyz; +var + LDeterminant: Single; + LFactor: Single; +begin + LDeterminant := Self.Determinant; + if IsZero(LDeterminant) then + Exit(TSkColorSpaceXyz.Identity); + LFactor := 1 / LDeterminant; + Result.M11 := M11 * LFactor; + Result.M12 := M12 * LFactor; + Result.M13 := M13 * LFactor; + Result.M21 := M21 * LFactor; + Result.M22 := M22 * LFactor; + Result.M23 := M23 * LFactor; + Result.M31 := M31 * LFactor; + Result.M32 := M32 * LFactor; + Result.M33 := M33 * LFactor; +end; - { TSkParagraph } +class operator TSkColorSpaceXyz.Multiply(const AColorSpaceXyz1, + AColorSpaceXyz2: TSkColorSpaceXyz): TSkColorSpaceXyz; +begin + Result.M11 := AColorSpaceXyz1.M11 * AColorSpaceXyz2.M11 + AColorSpaceXyz1.M12 * AColorSpaceXyz2.M21 + AColorSpaceXyz1.M13 * AColorSpaceXyz2.M31; + Result.M12 := AColorSpaceXyz1.M11 * AColorSpaceXyz2.M12 + AColorSpaceXyz1.M12 * AColorSpaceXyz2.M22 + AColorSpaceXyz1.M13 * AColorSpaceXyz2.M32; + Result.M13 := AColorSpaceXyz1.M11 * AColorSpaceXyz2.M13 + AColorSpaceXyz1.M12 * AColorSpaceXyz2.M23 + AColorSpaceXyz1.M13 * AColorSpaceXyz2.M33; + Result.M21 := AColorSpaceXyz1.M21 * AColorSpaceXyz2.M11 + AColorSpaceXyz1.M22 * AColorSpaceXyz2.M21 + AColorSpaceXyz1.M23 * AColorSpaceXyz2.M31; + Result.M22 := AColorSpaceXyz1.M21 * AColorSpaceXyz2.M12 + AColorSpaceXyz1.M22 * AColorSpaceXyz2.M22 + AColorSpaceXyz1.M23 * AColorSpaceXyz2.M32; + Result.M23 := AColorSpaceXyz1.M21 * AColorSpaceXyz2.M13 + AColorSpaceXyz1.M22 * AColorSpaceXyz2.M23 + AColorSpaceXyz1.M23 * AColorSpaceXyz2.M33; + Result.M31 := AColorSpaceXyz1.M31 * AColorSpaceXyz2.M11 + AColorSpaceXyz1.M32 * AColorSpaceXyz2.M21 + AColorSpaceXyz1.M33 * AColorSpaceXyz2.M31; + Result.M32 := AColorSpaceXyz1.M31 * AColorSpaceXyz2.M12 + AColorSpaceXyz1.M32 * AColorSpaceXyz2.M22 + AColorSpaceXyz1.M33 * AColorSpaceXyz2.M32; + Result.M33 := AColorSpaceXyz1.M31 * AColorSpaceXyz2.M13 + AColorSpaceXyz1.M32 * AColorSpaceXyz2.M23 + AColorSpaceXyz1.M33 * AColorSpaceXyz2.M33; +end; - TSkParagraph = class(TSkObject, ISkParagraph) - strict protected - function DidExceedMaxLines: Boolean; - function GetAlphabeticBaseline: Single; - function GetGlyphPositionAtCoordinate(const ADeltaX, ADeltaY: Single): TSkPositionAffinity; - function GetHeight: Single; - function GetIdeographicBaseline: Single; - function GetLineMetrics: TArray; - function GetLongestLine: Single; - function GetMaxIntrinsicWidth: Single; - function GetMaxWidth: Single; - function GetMinIntrinsicWidth: Single; - function GetRectsForPlaceholders: TArray; - function GetRectsForRange(const AStart, AEnd: Cardinal; const ARectHeightStyle: TSkRectHeightStyle; const ARectWidthStyle: TSkRectWidthStyle): TArray; - procedure GetWordBoundary(const AOffset: Cardinal; out AStart, AEnd: Cardinal); - procedure Layout(const AWidth: Single); - procedure Paint(const ACanvas: ISkCanvas; const AX, AY: Single); - function ToPath: ISkPath; - public - class procedure DestroyHandle(const AHandle: THandle); override; - end; +class operator TSkColorSpaceXyz.NotEqual(const AColorSpaceXyz1, + AColorSpaceXyz2: TSkColorSpaceXyz): Boolean; +begin + Result := not (AColorSpaceXyz1 = AColorSpaceXyz2); +end; - TSkPlaceholderAlignment = (Baseline, AboveBaseline, BelowBaseline, Top, Bottom, Middle); +class function TSkColorSpaceXyz.Rec2020: TSkColorSpaceXyz; +begin + Result := SkColorSpaceXyzRec2020; +end; - TSkTextBaseline = (Alphabetic, Ideographic); +class function TSkColorSpaceXyz.SRGB: TSkColorSpaceXyz; +begin + Result := SkColorSpaceXyzSRGB; +end; - { TSkPlaceholderStyle } +{ TSkColorSpacePrimaries } - TSkPlaceholderStyle = record - Width: Single; - Height: Single; - Alignment: TSkPlaceholderAlignment; - Baseline: TSkTextBaseline; - BaselineOffset: Single; - constructor Create(const AWidth, AHeight: Single; const AAlignment: TSkPlaceholderAlignment; const ABaseline: TSkTextBaseline; const ABaselineOffset: Single); - class operator Equal(const APlaceholderStyle1, APlaceholderStyle2: TSkPlaceholderStyle): Boolean; - class operator NotEqual(const APlaceholderStyle1, APlaceholderStyle2: TSkPlaceholderStyle): Boolean; - end; +constructor TSkColorSpacePrimaries.Create(const ARX, ARY, AGX, AGY, ABX, ABY, + AWX, AWY: Single); +begin + RX := ARX; + RY := ARY; + GX := AGX; + GY := AGY; + BX := ABX; + BY := ABY; + WX := AWX; + WY := AWY; +end; - ISkTextStyle = interface; +class operator TSkColorSpacePrimaries.Equal(const AColorSpacePrimaries1, + AColorSpacePrimaries2: TSkColorSpacePrimaries): Boolean; +begin + Result := (SameValue(AColorSpacePrimaries1.RX, AColorSpacePrimaries2.RX, Epsilon)) and + (SameValue(AColorSpacePrimaries1.RY, AColorSpacePrimaries2.RY, Epsilon)) and + (SameValue(AColorSpacePrimaries1.GX, AColorSpacePrimaries2.GX, Epsilon)) and + (SameValue(AColorSpacePrimaries1.GY, AColorSpacePrimaries2.GY, Epsilon)) and + (SameValue(AColorSpacePrimaries1.BX, AColorSpacePrimaries2.BX, Epsilon)) and + (SameValue(AColorSpacePrimaries1.BY, AColorSpacePrimaries2.BY, Epsilon)) and + (SameValue(AColorSpacePrimaries1.WX, AColorSpacePrimaries2.WX, Epsilon)) and + (SameValue(AColorSpacePrimaries1.WY, AColorSpacePrimaries2.WY, Epsilon)); +end; - ISkParagraphStyle = interface; +class operator TSkColorSpacePrimaries.Implicit( + const AColorSpacePrimaries: TSkColorSpacePrimaries): TSkColorSpaceXyz; +begin + if not sk4d_colorspaceprimaries_to_xyz(@sk_colorspaceprimaries_t(AColorSpacePrimaries), sk_colorspacexyz_t(Result)) then + Result := TSkColorSpaceXyz.Identity; +end; - ISkTypefaceFontProvider = interface; +class operator TSkColorSpacePrimaries.NotEqual(const AColorSpacePrimaries1, + AColorSpacePrimaries2: TSkColorSpacePrimaries): Boolean; +begin + Result := not (AColorSpacePrimaries1 = AColorSpacePrimaries2); +end; - { ISkParagraphBuilder } +{ TSkColorSpaceTransferFunction } - ISkParagraphBuilder = interface(ISkObject) - ['{8214ABB8-CAB4-462C-A855-868230F35EE8}'] - procedure AddPlaceholder(const APlaceholder: TSkPlaceholderStyle); - procedure AddText(const AText: string); - function Build: ISkParagraph; - procedure Pop; - procedure PushStyle(const ATextStyle: ISkTextStyle); - end; +constructor TSkColorSpaceTransferFunction.Create(const AG, AA, AB, AC, AD, AE, + AF: Single); +begin + G := AG; + A := AA; + B := AB; + C := AC; + D := AD; + E := AE; + F := AF; +end; - { TSkParagraphBuilder } +class operator TSkColorSpaceTransferFunction.Equal( + const AColorSpaceTransferFunction1, + AColorSpaceTransferFunction2: TSkColorSpaceTransferFunction): Boolean; +begin + Result := (SameValue(AColorSpaceTransferFunction1.G, AColorSpaceTransferFunction2.G, Epsilon)) and + (SameValue(AColorSpaceTransferFunction1.A, AColorSpaceTransferFunction2.A, Epsilon)) and + (SameValue(AColorSpaceTransferFunction1.B, AColorSpaceTransferFunction2.B, Epsilon)) and + (SameValue(AColorSpaceTransferFunction1.C, AColorSpaceTransferFunction2.C, Epsilon)) and + (SameValue(AColorSpaceTransferFunction1.D, AColorSpaceTransferFunction2.D, Epsilon)) and + (SameValue(AColorSpaceTransferFunction1.E, AColorSpaceTransferFunction2.E, Epsilon)) and + (SameValue(AColorSpaceTransferFunction1.F, AColorSpaceTransferFunction2.F, Epsilon)); +end; - TSkParagraphBuilder = class(TSkObject, ISkParagraphBuilder) - strict protected - procedure AddPlaceholder(const APlaceholder: TSkPlaceholderStyle); - procedure AddText(const AText: string); - function Build: ISkParagraph; - procedure Pop; - procedure PushStyle(const ATextStyle: ISkTextStyle); - public - constructor Create(const AParagraphStyle: ISkParagraphStyle); overload; - constructor Create(const AParagraphStyle: ISkParagraphStyle; const AFontProvider: ISkTypefaceFontProvider; const AEnableFontFallback: Boolean = True); overload; - class procedure DestroyHandle(const AHandle: THandle); override; - end; +class function TSkColorSpaceTransferFunction.HLG: TSkColorSpaceTransferFunction; +begin + Result := SkColorSpaceTransferFunctionHLG; +end; - { ISkStrutStyle } +function TSkColorSpaceTransferFunction.Invert( + out ATransferFunction: TSkColorSpaceTransferFunction): Boolean; +begin + Result := sk4d_colorspacetransferfn_invert(@sk_colorspacetransferfn_t(Self), sk_colorspacetransferfn_t(ATransferFunction)); +end; - ISkStrutStyle = interface(ISkObject) - ['{6A3B8422-7960-437C-B074-2719909566FF}'] - function GetEnabled: Boolean; - function GetFontFamilies: TArray; - function GetFontSize: Single; - function GetFontStyle: TSkFontStyle; - function GetForceHeight: Boolean; - function GetHalfLeading: Boolean; - function GetHeightMultiplier: Single; - function GetLeading: Single; - function IsEqual(const AStrutStyle: ISkStrutStyle): Boolean; - procedure SetEnabled(const AValue: Boolean); - procedure SetFontFamilies(const AValue: TArray); - procedure SetFontSize(const AValue: Single); - procedure SetFontStyle(const AValue: TSkFontStyle); - procedure SetForceHeight(const AValue: Boolean); - procedure SetHalfLeading(const AValue: Boolean); - procedure SetHeightMultiplier(const AValue: Single); - procedure SetLeading(const AValue: Single); - property Enabled: Boolean read GetEnabled write SetEnabled; - property FontFamilies: TArray read GetFontFamilies write SetFontFamilies; - property FontSize: Single read GetFontSize write SetFontSize; - property FontStyle: TSkFontStyle read GetFontStyle write SetFontStyle; - property ForceHeight: Boolean read GetForceHeight write SetForceHeight; - property HalfLeading: Boolean read GetHalfLeading write SetHalfLeading; - property HeightMultiplier: Single read GetHeightMultiplier write SetHeightMultiplier; - property Leading: Single read GetLeading write SetLeading; - end; +class function TSkColorSpaceTransferFunction.Linear: TSkColorSpaceTransferFunction; +begin + Result := SkColorSpaceTransferFunctionLinear; +end; - { TSkStrutStyle } +class operator TSkColorSpaceTransferFunction.NotEqual( + const AColorSpaceTransferFunction1, + AColorSpaceTransferFunction2: TSkColorSpaceTransferFunction): Boolean; +begin + Result := not (AColorSpaceTransferFunction1 = AColorSpaceTransferFunction2); +end; - TSkStrutStyle = class(TSkObject, ISkStrutStyle) - strict protected - function GetEnabled: Boolean; - function GetFontFamilies: TArray; - function GetFontSize: Single; - function GetFontStyle: TSkFontStyle; - function GetForceHeight: Boolean; - function GetHalfLeading: Boolean; - function GetHeightMultiplier: Single; - function GetLeading: Single; - function IsEqual(const AStrutStyle: ISkStrutStyle): Boolean; - procedure SetEnabled(const AValue: Boolean); - procedure SetFontFamilies(const AValue: TArray); - procedure SetFontSize(const AValue: Single); - procedure SetFontStyle(const AValue: TSkFontStyle); - procedure SetForceHeight(const AValue: Boolean); - procedure SetHalfLeading(const AValue: Boolean); - procedure SetHeightMultiplier(const AValue: Single); - procedure SetLeading(const AValue: Single); - public - constructor Create; - class procedure DestroyHandle(const AHandle: THandle); override; - end; +class function TSkColorSpaceTransferFunction.PQ: TSkColorSpaceTransferFunction; +begin + Result := SkColorSpaceTransferFunctionPQ; +end; - TSkTextAlign = (Left, Right, Center, Justify, Start, Terminate); +class function TSkColorSpaceTransferFunction.Rec2020: TSkColorSpaceTransferFunction; +begin + Result := SkColorSpaceTransferFunctionRec2020; +end; - TSkTextHeightBehavior = (DisableFirstAscent, DisableLastDescent); - TSkTextHeightBehaviors = set of TSkTextHeightBehavior; +class function TSkColorSpaceTransferFunction.SRGB: TSkColorSpaceTransferFunction; +begin + Result := SkColorSpaceTransferFunctionSRGB; +end; - { ISkParagraphStyle } +function TSkColorSpaceTransferFunction.Transform(const AX: Single): Single; +begin + Result := sk4d_colorspacetransferfn_transform(@sk_colorspacetransferfn_t(Self), AX); +end; - ISkParagraphStyle = interface(ISkObject) - ['{79C3E735-F3D1-4276-A8B7-BC0CF422A543}'] - procedure DisableHinting; - function GetEllipsis: string; - function GetHeight: Single; - function GetMaxLines: NativeUInt; - function GetStrutStyle: ISkStrutStyle; - function GetTextAlign: TSkTextAlign; - function GetTextDirection: TSkTextDirection; - function GetTextHeightBehaviors: TSkTextHeightBehaviors; - function GetTextStyle: ISkTextStyle; - procedure SetEllipsis(const AValue: string); - procedure SetHeight(const AValue: Single); - procedure SetMaxLines(const AValue: NativeUInt); - procedure SetStrutStyle(AValue: ISkStrutStyle); - procedure SetTextAlign(const AValue: TSkTextAlign); - procedure SetTextDirection(const AValue: TSkTextDirection); - procedure SetTextHeightBehaviors(const AValue: TSkTextHeightBehaviors); - procedure SetTextStyle(AValue: ISkTextStyle); - property Ellipsis: string read GetEllipsis write SetEllipsis; - property Height: Single read GetHeight write SetHeight; - property MaxLines: NativeUInt read GetMaxLines write SetMaxLines; - property StrutStyle: ISkStrutStyle read GetStrutStyle write SetStrutStyle; - property TextAlign: TSkTextAlign read GetTextAlign write SetTextAlign; - property TextDirection: TSkTextDirection read GetTextDirection write SetTextDirection; - property TextHeightBehaviors: TSkTextHeightBehaviors read GetTextHeightBehaviors write SetTextHeightBehaviors; - property TextStyle: ISkTextStyle read GetTextStyle write SetTextStyle; - end; +class function TSkColorSpaceTransferFunction.TwoDotTwo: TSkColorSpaceTransferFunction; +begin + Result := SkColorSpaceTransferFunctionTwoDotTwo; +end; - { TSkParagraphStyle } +{ TSkCubicResampler } - TSkParagraphStyle = class(TSkObject, ISkParagraphStyle) - strict protected - procedure DisableHinting; - function GetEllipsis: string; - function GetHeight: Single; - function GetMaxLines: NativeUInt; - function GetStrutStyle: ISkStrutStyle; - function GetTextAlign: TSkTextAlign; - function GetTextDirection: TSkTextDirection; - function GetTextHeightBehaviors: TSkTextHeightBehaviors; - function GetTextStyle: ISkTextStyle; - procedure SetEllipsis(const AValue: string); - procedure SetHeight(const AValue: Single); - procedure SetMaxLines(const AValue: NativeUInt); - procedure SetStrutStyle(AValue: ISkStrutStyle); - procedure SetTextAlign(const AValue: TSkTextAlign); - procedure SetTextDirection(const AValue: TSkTextDirection); - procedure SetTextHeightBehaviors(const AValue: TSkTextHeightBehaviors); - procedure SetTextStyle(AValue: ISkTextStyle); - public - constructor Create; - class procedure DestroyHandle(const AHandle: THandle); override; - end; +class function TSkCubicResampler.CatmullRom: TSkCubicResampler; +begin + Result := SkCubicResamplerCatmullRom; +end; - { TSkTextShadow } +constructor TSkCubicResampler.Create(const AB, AC: Single); +begin + B := AB; + C := AC; +end; - TSkTextShadow = record - Color: TAlphaColor; - Offset: TPointF; - BlurRadius: Double; - constructor Create(const AColor: TAlphaColor; const AOffset: TPointF; const ABlurRadius: Double); - class operator Equal(const ATextShadow1, ATextShadow2: TSkTextShadow): Boolean; - class operator NotEqual(const ATextShadow1, ATextShadow2: TSkTextShadow): Boolean; - end; +class operator TSkCubicResampler.Equal(const ACubicResampler1, + ACubicResampler2: TSkCubicResampler): Boolean; +begin + Result := (SameValue(ACubicResampler1.B, ACubicResampler2.B, Epsilon)) and + (SameValue(ACubicResampler1.C, ACubicResampler2.C, Epsilon)); +end; - TSkTextDecoration = (Underline, Overline, LineThrough); - TSkTextDecorations = set of TSkTextDecoration; +class function TSkCubicResampler.Mitchell: TSkCubicResampler; +begin + Result := SkCubicResamplerMitchell; +end; - TSkTextDecorationStyle = (Solid, Double, Dotted, Dashed, Wavy); +class operator TSkCubicResampler.NotEqual(const ACubicResampler1, + ACubicResampler2: TSkCubicResampler): Boolean; +begin + Result := not (ACubicResampler1 = ACubicResampler2); +end; - { ISkTextStyle } +{ TSkFontMetrics } - ISkTextStyle = interface(ISkObject) - ['{C7482800-C941-42C3-AAE9-6D59E6D9BE3A}'] - procedure AddFontFeature(const AFeature: string; const AValue: Integer); - procedure AddShadow(const AShadow: TSkTextShadow); - procedure ClearBackgroundColor; - procedure ClearForegroundColor; - function GetBackground: ISkPaint; - function GetColor: TAlphaColor; - function GetDecorationColor: TAlphaColor; - function GetDecorations: TSkTextDecorations; - function GetDecorationStyle: TSkTextDecorationStyle; - function GetDecorationThickness: Single; - function GetFontFamilies: TArray; - function GetFontMetrics: TSkFontMetrics; - function GetFontSize: Single; - function GetFontStyle: TSkFontStyle; - function GetForeground: ISkPaint; - function GetHalfLeading: Boolean; - function GetHeightMultiplier: Single; - function GetLetterSpacing: Single; - function GetLocale: string; - function GetWordSpacing: Single; - function IsEqual(const ATextStyle: ISkTextStyle): Boolean; - procedure ResetFontFeatures; - procedure ResetShadows; - procedure SetBackgroundColor(const APaint: ISkPaint); - procedure SetColor(const AValue: TAlphaColor); - procedure SetDecorationColor(const AValue: TAlphaColor); - procedure SetDecorations(const AValue: TSkTextDecorations); - procedure SetDecorationStyle(const AValue: TSkTextDecorationStyle); - procedure SetDecorationThickness(const AValue: Single); - procedure SetFontFamilies(const AValue: TArray); - procedure SetFontSize(const AValue: Single); - procedure SetFontStyle(const AValue: TSkFontStyle); - procedure SetForegroundColor(const APaint: ISkPaint); - procedure SetHalfLeading(const AValue: Boolean); - procedure SetHeightMultiplier(const AValue: Single); - procedure SetLetterSpacing(const AValue: Single); - procedure SetLocale(const AValue: string); - procedure SetWordSpacing(const AValue: Single); - property Color: TAlphaColor read GetColor write SetColor; - property DecorationColor: TAlphaColor read GetDecorationColor write SetDecorationColor; - property Decorations: TSkTextDecorations read GetDecorations write SetDecorations; - property DecorationStyle: TSkTextDecorationStyle read GetDecorationStyle write SetDecorationStyle; - property DecorationThickness: Single read GetDecorationThickness write SetDecorationThickness; - property FontFamilies: TArray read GetFontFamilies write SetFontFamilies; - property FontMetrics: TSkFontMetrics read GetFontMetrics; - property FontSize: Single read GetFontSize write SetFontSize; - property FontStyle: TSkFontStyle read GetFontStyle write SetFontStyle; - property HalfLeading: Boolean read GetHalfLeading write SetHalfLeading; - property HeightMultiplier: Single read GetHeightMultiplier write SetHeightMultiplier; - property LetterSpacing: Single read GetLetterSpacing write SetLetterSpacing; - property Locale: string read GetLocale write SetLocale; - property WordSpacing: Single read GetWordSpacing write SetWordSpacing; - end; +class operator TSkFontMetrics.Equal(const AFontMetrics1, + AFontMetrics2: TSkFontMetrics): Boolean; +begin + Result := (AFontMetrics1.Flags = AFontMetrics2.Flags) and + (SameValue(AFontMetrics1.Top, AFontMetrics2.Top, Epsilon)) and + (SameValue(AFontMetrics1.Ascent, AFontMetrics2.Ascent, Epsilon)) and + (SameValue(AFontMetrics1.Descent, AFontMetrics2.Descent, Epsilon)) and + (SameValue(AFontMetrics1.Bottom, AFontMetrics2.Bottom, Epsilon)) and + (SameValue(AFontMetrics1.Leading, AFontMetrics2.Leading, Epsilon)) and + (SameValue(AFontMetrics1.AvgCharWidth, AFontMetrics2.AvgCharWidth, Epsilon)) and + (SameValue(AFontMetrics1.MaxCharWidth, AFontMetrics2.MaxCharWidth, Epsilon)) and + (SameValue(AFontMetrics1.XMin, AFontMetrics2.XMin, Epsilon)) and + (SameValue(AFontMetrics1.XMax, AFontMetrics2.XMax, Epsilon)) and + (SameValue(AFontMetrics1.XMax, AFontMetrics2.XMax, Epsilon)) and + (SameValue(AFontMetrics1.XHeight, AFontMetrics2.XHeight, Epsilon)) and + (SameValue(AFontMetrics1.UnderlineThickness, AFontMetrics2.UnderlineThickness, Epsilon)) and + (SameValue(AFontMetrics1.UnderlinePosition, AFontMetrics2.UnderlinePosition, Epsilon)) and + (SameValue(AFontMetrics1.StrikeoutThickness, AFontMetrics2.StrikeoutThickness, Epsilon)) and + (SameValue(AFontMetrics1.StrikeoutPosition, AFontMetrics2.StrikeoutPosition, Epsilon)); +end; - { TSkTextStyle } +class operator TSkFontMetrics.NotEqual(const AFontMetrics1, + AFontMetrics2: TSkFontMetrics): Boolean; +begin + Result := not (AFontMetrics1 = AFontMetrics2); +end; - TSkTextStyle = class(TSkObject, ISkTextStyle) - strict protected - procedure AddFontFeature(const AFeature: string; const AValue: Integer); - procedure AddShadow(const AShadow: TSkTextShadow); - procedure ClearBackgroundColor; - procedure ClearForegroundColor; - function GetBackground: ISkPaint; - function GetColor: TAlphaColor; - function GetDecorationColor: TAlphaColor; - function GetDecorations: TSkTextDecorations; - function GetDecorationStyle: TSkTextDecorationStyle; - function GetDecorationThickness: Single; - function GetFontFamilies: TArray; - function GetFontMetrics: TSkFontMetrics; - function GetFontSize: Single; - function GetFontStyle: TSkFontStyle; - function GetForeground: ISkPaint; - function GetHalfLeading: Boolean; - function GetHeightMultiplier: Single; - function GetLetterSpacing: Single; - function GetLocale: string; - function GetWordSpacing: Single; - function IsEqual(const ATextStyle: ISkTextStyle): Boolean; - procedure ResetFontFeatures; - procedure ResetShadows; - procedure SetBackgroundColor(const APaint: ISkPaint); - procedure SetColor(const AValue: TAlphaColor); - procedure SetDecorationColor(const AValue: TAlphaColor); - procedure SetDecorations(const AValue: TSkTextDecorations); - procedure SetDecorationStyle(const AValue: TSkTextDecorationStyle); - procedure SetDecorationThickness(const AValue: Single); - procedure SetFontFamilies(const AValue: TArray); - procedure SetFontSize(const AValue: Single); - procedure SetFontStyle(const AValue: TSkFontStyle); - procedure SetForegroundColor(const APaint: ISkPaint); - procedure SetHalfLeading(const AValue: Boolean); - procedure SetHeightMultiplier(const AValue: Single); - procedure SetLetterSpacing(const AValue: Single); - procedure SetLocale(const AValue: string); - procedure SetWordSpacing(const AValue: Single); - public - constructor Create; - class procedure DestroyHandle(const AHandle: THandle); override; - end; +{ TSkFontStyle } - { ISkTypefaceFontProvider } +class function TSkFontStyle.Bold: TSkFontStyle; +begin + Result := SkFontStyleBold; +end; - ISkTypefaceFontProvider = interface(ISkReferenceCounted) - ['{6761FD5D-F04D-4C4F-87EE-CBA82B9544F1}'] - procedure RegisterTypeface(const ATypeface: ISkTypeface); overload; - procedure RegisterTypeface(const ATypeface: ISkTypeface; const AFamilyName: string); overload; - end; +class function TSkFontStyle.BoldItalic: TSkFontStyle; +begin + Result := SkFontStyleBoldItalic; +end; - { TSkTypefaceFontProvider } +constructor TSkFontStyle.Create(const AWeight, AWidth: Integer; + const ASlant: TSkFontSlant); +begin + Weight := AWeight; + Width := AWidth; + Slant := ASlant; +end; - TSkTypefaceFontProvider = class(TSkReferenceCounted, ISkTypefaceFontProvider) - strict protected - procedure RegisterTypeface(const ATypeface: ISkTypeface); overload; - procedure RegisterTypeface(const ATypeface: ISkTypeface; const AFamilyName: string); overload; - public - constructor Create; - end; +constructor TSkFontStyle.Create(const AWeight: TSkFontWeight; + const AWidth: TSkFontWidth; const ASlant: TSkFontSlant); +begin + Weight := Ord(AWeight); + Width := Ord(AWidth); + Slant := ASlant; +end; - { ISkResourceProvider } +class operator TSkFontStyle.Equal(const AFontStyle1, + AFontStyle2: TSkFontStyle): Boolean; +begin + Result := (AFontStyle1.Weight = AFontStyle2.Weight) and + (AFontStyle1.Width = AFontStyle2.Width ) and + (AFontStyle1.Slant = AFontStyle2.Slant ); +end; - ISkResourceProvider = interface(ISkReferenceCounted) - ['{A2C2EEC5-57E8-4141-817D-356F3084E7B1}'] - end; +class function TSkFontStyle.Italic: TSkFontStyle; +begin + Result := SkFontStyleItalic; +end; - { TSkResourceProviderBaseClass } +class function TSkFontStyle.Normal: TSkFontStyle; +begin + Result := SkFontStyleNormal; +end; - TSkResourceProviderBaseClass = class abstract(TSkReferenceCounted, ISkResourceProvider) - strict private - class constructor Create; - class function load_proc(context: Pointer; const path, name: MarshaledAString): sk_data_t; cdecl; static; - strict protected - function Load(const APath, AName: string): TBytes; virtual; abstract; - public - constructor Create(const APredecode: Boolean = False); - end; +class operator TSkFontStyle.NotEqual(const AFontStyle1, + AFontStyle2: TSkFontStyle): Boolean; +begin + Result := not (AFontStyle1 = AFontStyle2); +end; - { ISkFileResourceProvider } +{ TSkGraphics } - ISkFileResourceProvider = interface(ISkResourceProvider) - ['{D0654C50-A719-4ED9-8B9D-F57E2A644E13}'] - end; +class procedure TSkGraphics.AllowJIT; +begin + sk4d_graphics_allow_jit(); +end; - { TSkFileResourceProvider } +class procedure TSkGraphics.DumpMemoryStatistics( + const ATraceMemoryDump: ISkTraceMemoryDump); +begin + if not Assigned(ATraceMemoryDump) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATraceMemoryDump']); + sk4d_graphics_dump_memory_statistics(ATraceMemoryDump.Handle); +end; - TSkFileResourceProvider = class(TSkResourceProviderBaseClass, ISkFileResourceProvider) - strict private - FBaseDir: string; - strict protected - function Load(const APath, AName: string): TBytes; override; - public - constructor Create(const APredecode: Boolean = False); overload; - constructor Create(const ABaseDir: string; const APredecode: Boolean = False); overload; - end; +class function TSkGraphics.GetFontCacheCountLimit: Integer; +begin + Result := sk4d_graphics_get_font_cache_count_limit(); +end; - { ISkShaper } +class function TSkGraphics.GetFontCacheCountUsed: Integer; +begin + Result := sk4d_graphics_get_font_cache_count_used(); +end; - ISkShaper = interface(ISkObject) - ['{29BF4EF9-8F70-4456-8ABB-4EDCF9075CDB}'] - function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single): ISkTextBlob; overload; - function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single; const AOffset: TPointF; out AEndPoint: TPointF): ISkTextBlob; overload; - end; +class function TSkGraphics.GetFontCacheLimit: NativeUInt; +begin + Result := sk4d_graphics_get_font_cache_limit(); +end; - { TSkShaper } +class function TSkGraphics.GetFontCacheUsed: NativeUInt; +begin + Result := sk4d_graphics_get_font_cache_used(); +end; - TSkShaper = class(TSkObject, ISkShaper) - strict protected - function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single): ISkTextBlob; overload; - function Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single; const AOffset: TPointF; out AEndPoint: TPointF): ISkTextBlob; overload; - public - constructor Create; - class procedure DestroyHandle(const AHandle: THandle); override; - end; +class function TSkGraphics.GetResourceCacheSingleAllocationByteLimit: NativeUInt; +begin + Result := sk4d_graphics_get_resource_cache_single_allocation_byte_limit(); +end; + +class function TSkGraphics.GetResourceCacheTotalByteLimit: NativeUInt; +begin + Result := sk4d_graphics_get_resource_cache_total_byte_limit(); +end; + +class function TSkGraphics.GetResourceCacheTotalBytesUsed: NativeUInt; +begin + Result := sk4d_graphics_get_resource_cache_total_bytes_used(); +end; - TSkDirection = (LeftToRight, RightToLeft); +class procedure TSkGraphics.Init; +begin + sk4d_graphics_init(); +end; - TSkUnicodeBidiRegionProc = reference to procedure (const AStart, AEnd: Integer; const ALevel: Byte); +class procedure TSkGraphics.PurgeAllCaches; +begin + sk4d_graphics_purge_all_caches(); +end; - TSkBreakType = (Words, Graphemes, Lines); +class procedure TSkGraphics.PurgeFontCache; +begin + sk4d_graphics_purge_font_cache(); +end; - TSkUnicodeBreakProc = reference to procedure (const APosition, AStatus: Integer); +class procedure TSkGraphics.PurgeResourceCache; +begin + sk4d_graphics_purge_resource_cache(); +end; - TSkUnicodeCodepointProc = reference to procedure (const AUnichar, AStart, AEnd: Integer); +class procedure TSkGraphics.SetFontCacheCountLimit(const AValue: Integer); +begin + sk4d_graphics_set_font_cache_count_limit(AValue); +end; - { ISkUnicode } +class procedure TSkGraphics.SetFontCacheLimit(const AValue: NativeUInt); +begin + sk4d_graphics_set_font_cache_limit(AValue); +end; - ISkUnicode = interface(ISkObject) - ['{DA2335ED-0665-44C2-B305-2B38FDEE8EB9}'] - procedure ForEachBidiRegion(const AText: string; const ADirection: TSkDirection; const AProc: TSkUnicodeBidiRegionProc); - procedure ForEachBreak(const AText: string; const AType: TSkBreakType; const AProc: TSkUnicodeBreakProc); - procedure ForEachCodepoint(const AText: string; const AProc: TSkUnicodeCodepointProc); - function GetBreaks(const AText: string; const AType: TSkBreakType): TArray; - end; +class procedure TSkGraphics.SetResourceCacheSingleAllocationByteLimit( + const AValue: NativeUInt); +begin + sk4d_graphics_set_resource_cache_single_allocation_byte_limit(AValue); +end; - { TSkUnicode } +class procedure TSkGraphics.SetResourceCacheTotalByteLimit( + const AValue: NativeUInt); +begin + sk4d_graphics_set_resource_cache_total_byte_limit(AValue); +end; - TSkUnicode = class(TSkObject, ISkUnicode) - strict private - class procedure bidi_region_proc(start, &end: int32_t; level: uint8_t; context: Pointer); cdecl; static; - class procedure break_proc(position, status: int32_t; context: Pointer); cdecl; static; - class procedure codepoint_proc(unichar: sk_unichar_t; start, &end: int32_t; context: Pointer); cdecl; static; - strict protected - procedure ForEachBidiRegion(const AText: string; const ADirection: TSkDirection; const AProc: TSkUnicodeBidiRegionProc); - procedure ForEachBreak(const AText: string; const AType: TSkBreakType; const AProc: TSkUnicodeBreakProc); - procedure ForEachCodepoint(const AText: string; const AProc: TSkUnicodeCodepointProc); - function GetBreaks(const AText: string; const AType: TSkBreakType): TArray; - public - constructor Create; - class procedure DestroyHandle(const AHandle: THandle); override; - end; +{ TSkHighContrastConfig } + +constructor TSkHighContrastConfig.Create(const AGrayscale: Boolean; + const AInvertStyle: TSkContrastInvertStyle; const AContrast: Single); +begin + Grayscale := AGrayscale; + InvertStyle := AInvertStyle; + Contrast := AContrast; +end; + +class operator TSkHighContrastConfig.Equal(const AHighContrastConfig1, + AHighContrastConfig2: TSkHighContrastConfig): Boolean; +begin + Result := (AHighContrastConfig1.Grayscale = AHighContrastConfig2.Grayscale ) and + (AHighContrastConfig1.InvertStyle = AHighContrastConfig2.InvertStyle) and + (SameValue(AHighContrastConfig1.Contrast, AHighContrastConfig2.Contrast, Epsilon)); +end; - ISkSVGNode = interface; +class operator TSkHighContrastConfig.NotEqual(const AHighContrastConfig1, + AHighContrastConfig2: TSkHighContrastConfig): Boolean; +begin + Result := not (AHighContrastConfig1 <> AHighContrastConfig2); +end; - ISkSVGSVG = interface; +{ TSkImageInfo } - { ISkSVGDOM } +function TSkImageInfo.ByteSize(const ARowBytes: NativeUInt): NativeUInt; +begin + Result := ARowBytes * NativeUInt(Height); +end; - ISkSVGDOM = interface(ISkReferenceCounted) - ['{112EAB88-0340-490E-96F7-21263A751173}'] - function FindNodeById(const AId: string): ISkSVGNode; - function GetRoot: ISkSVGSVG; - procedure Render(const ACanvas: ISkCanvas); - procedure SetContainerSize(const AValue: TSizeF); - property Root: ISkSVGSVG read GetRoot; - end; +function TSkImageInfo.BytesPerPixel: Integer; +begin + Result := SkBytesPerPixel[ColorType]; +end; - { TSkSVGDOM } +constructor TSkImageInfo.Create(const AWidth, AHeight: Integer); +begin + Width := AWidth; + Height := AHeight; + ColorType := SkNative32ColorType; + AlphaType := TSkAlphaType.Premul; + ColorSpace := nil; +end; - TSkSVGDOM = class(TSkReferenceCounted, ISkSVGDOM) - strict private - FRootHolder: ISkSVGSVG; - strict protected - function FindNodeById(const AId: string): ISkSVGNode; - function GetRoot: ISkSVGSVG; - procedure Render(const ACanvas: ISkCanvas); - procedure SetContainerSize(const ASize: TSizeF); - public - class function Make(const AData: string; const AResourceProvider: ISkResourceProvider = nil): ISkSVGDOM; static; - class function MakeFromFile(const AFileName: string): ISkSVGDOM; static; - class function MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider = nil): ISkSVGDOM; static; - end; +constructor TSkImageInfo.Create(const AWidth, AHeight: Integer; + const AColorType: TSkColorType; const AAlphaType: TSkAlphaType; + AColorSpace: ISkColorSpace); +begin + Width := AWidth; + Height := AHeight; + ColorType := AColorType; + AlphaType := AAlphaType; + ColorSpace := AColorSpace; +end; - { ISkSVGNode } +class operator TSkImageInfo.Equal(const AImageInfo1, + AImageInfo2: TSkImageInfo): Boolean; +begin + Result := (AImageInfo1.Width = AImageInfo2.Width ) and + (AImageInfo1.Height = AImageInfo2.Height ) and + (AImageInfo1.ColorType = AImageInfo2.ColorType) and + (AImageInfo1.AlphaType = AImageInfo2.AlphaType) and + (Assigned(AImageInfo1.ColorSpace) = Assigned(AImageInfo1.ColorSpace)) and ((not Assigned(AImageInfo1.ColorSpace)) or (AImageInfo1.ColorSpace.IsEqual(AImageInfo2.ColorSpace))); +end; - ISkSVGNode = interface(ISkReferenceCounted) - ['{BFC94F54-A2C3-4BC8-AC2A-B64425E25CC1}'] - function TrySetAttribute(const AName, AValue: string): Boolean; - end; +function TSkImageInfo.IsEmpty: Boolean; +begin + Result := (Width <= 0) or (Height <= 0); +end; - { TSkSVGNode } +function TSkImageInfo.IsOpaque: Boolean; +begin + Result := AlphaType = TSkAlphaType.Opaque; +end; - TSkSVGNode = class(TSkReferenceCounted, ISkSVGNode) - strict protected - function TrySetAttribute(const AName, AValue: string): Boolean; +function TSkImageInfo.IsValid: Boolean; +const + MaxDimension = MaxInt shr 2; +begin + if (IsEmpty) or (Width > MaxDimension) or (Height > MaxDimension) or (ColorType = TSkColorType.Unknown) or (AlphaType = TSkAlphaType.Unknown) then + Exit(False); + case ColorType of + TSkColorType.Alpha8, + TSkColorType.AlphaF16, + TSkColorType.Alpha16: + begin + if (AlphaType <> TSkAlphaType.Opaque) and (AlphaType <> TSkAlphaType.Premul) then + Exit(False); + end; + TSkColorType.RGB565, + TSkColorType.RGB888X, + TSkColorType.RGB101010X, + TSkColorType.BGR101010X, + TSkColorType.Gray8, + TSkColorType.RG88, + TSkColorType.RGF16, + TSkColorType.RG1616: + begin + if AlphaType <> TSkAlphaType.Opaque then + Exit(False); + end; end; + Result := True; +end; - TSkSVGLengthUnit = (Unknown, Number, Percentage, EMS, EXS, PX, CM, MM, &IN, PT, PC); +function TSkImageInfo.IsValidRowBytes(const ARowBytes: NativeUInt): Boolean; +begin + if ARowBytes < MinRowBytes then + Exit(False); + Result := ARowBytes = (ARowBytes shr ShiftPerPixel shl ShiftPerPixel); +end; - { TSkSVGLength } +function TSkImageInfo.MakeAlphaType( + const AAlphaType: TSkAlphaType): TSkImageInfo; +begin + Result.Width := Width; + Result.Height := Height; + Result.ColorType := ColorType; + Result.AlphaType := AAlphaType; + Result.ColorSpace := ColorSpace; +end; - TSkSVGLength = record - Value: Single; - &Unit: TSkSVGLengthUnit; - constructor Create(const AValue: Single; const AUnit: TSkSVGLengthUnit = TSkSVGLengthUnit.Number); - class operator Equal(const ASVGLength1, ASVGLength2: TSkSVGLength): Boolean; - class operator NotEqual(const ASVGLength1, ASVGLength2: TSkSVGLength): Boolean; - end; +function TSkImageInfo.MakeColorSpace(AColorSpace: ISkColorSpace): TSkImageInfo; +begin + Result.Width := Width; + Result.Height := Height; + Result.ColorType := ColorType; + Result.AlphaType := AlphaType; + Result.ColorSpace := AColorSpace; +end; - TSkSVGAspectAlign = (XMinYMin, XMidYMin, XMaxYMin, XMinYMid = 4, XMidYMid, XMaxYMid, XMinYMax = 8, XMidYMax, XMaxYMax, None = 16); +function TSkImageInfo.MakeColorType( + const AColorType: TSkColorType): TSkImageInfo; +begin + Result.Width := Width; + Result.Height := Height; + Result.ColorType := AColorType; + Result.AlphaType := AlphaType; + Result.ColorSpace := ColorSpace; +end; - TSkSVGAspectScale = (Meet, Slice); +function TSkImageInfo.MakeDimensions(const AWidth, + AHeight: Integer): TSkImageInfo; +begin + Result.Width := AWidth; + Result.Height := AHeight; + Result.ColorType := ColorType; + Result.AlphaType := AlphaType; + Result.ColorSpace := ColorSpace; +end; - { TSkSVGPreserveAspectRatio } +function TSkImageInfo.MinByteSize: NativeUInt; +begin + Result := ByteSize(MinRowBytes); +end; - TSkSVGPreserveAspectRatio = record - Align: TSkSVGAspectAlign; - Scale: TSkSVGAspectScale; - constructor Create(const AAlign: TSkSVGAspectAlign; const AScale: TSkSVGAspectScale); - class operator Equal(const ASVGPreserveAspectRatio1, ASVGPreserveAspectRatio2: TSkSVGPreserveAspectRatio): Boolean; - class operator NotEqual(const ASVGPreserveAspectRatio1, ASVGPreserveAspectRatio2: TSkSVGPreserveAspectRatio): Boolean; - end; +function TSkImageInfo.MinRowBytes: NativeUInt; +begin + Result := Width * BytesPerPixel; +end; - { ISkSVGSVG } +class operator TSkImageInfo.NotEqual(const AImageInfo1, + AImageInfo2: TSkImageInfo): Boolean; +begin + Result := not (AImageInfo1 = AImageInfo2); +end; - ISkSVGSVG = interface(ISkSVGNode) - ['{C9B7359F-74C7-4877-A276-964FA62CEC31}'] - function GetHeight: TSkSVGLength; - function GetIntrinsicSize(const AViewPort: TSizeF; const ADPI: Single = 90): TSizeF; - function GetPreserveAspectRatio: TSkSVGPreserveAspectRatio; - function GetWidth: TSkSVGLength; - function GetX: TSkSVGLength; - function GetY: TSkSVGLength; - procedure SetHeight(const AValue: TSkSVGLength); - procedure SetPreserveAspectRatio(const AValue: TSkSVGPreserveAspectRatio); - procedure SetViewBox(const AViewBox: TRectF); - procedure SetWidth(const AValue: TSkSVGLength); - procedure SetX(const AValue: TSkSVGLength); - procedure SetY(const AValue: TSkSVGLength); - function TryGetViewBox(out AViewBox: TRectF): Boolean; - property Height: TSkSVGLength read GetHeight write SetHeight; - property PreserveAspectRatio: TSkSVGPreserveAspectRatio read GetPreserveAspectRatio write SetPreserveAspectRatio; - property Width: TSkSVGLength read GetWidth write SetWidth; - property X: TSkSVGLength read GetX write SetX; - property Y: TSkSVGLength read GetY write SetY; - end; +function TSkImageInfo.ShiftPerPixel: Integer; +begin + Result := SkShiftPerPixel[ColorType]; +end; - { TSkSVGSVG } +{ TSkImageEncoder } - TSkSVGSVG = class(TSkSVGNode, ISkSVGSVG) - strict protected - function GetHeight: TSkSVGLength; - function GetIntrinsicSize(const AViewPort: TSizeF; const ADPI: Single = 90): TSizeF; - function GetPreserveAspectRatio: TSkSVGPreserveAspectRatio; - function GetWidth: TSkSVGLength; - function GetX: TSkSVGLength; - function GetY: TSkSVGLength; - procedure SetHeight(const AValue: TSkSVGLength); - procedure SetPreserveAspectRatio(const AValue: TSkSVGPreserveAspectRatio); - procedure SetViewBox(const AViewBox: TRectF); - procedure SetWidth(const AValue: TSkSVGLength); - procedure SetX(const AValue: TSkSVGLength); - procedure SetY(const AValue: TSkSVGLength); - function TryGetViewBox(out AViewBox: TRectF): Boolean; +class function TSkImageEncoder.Encode(const ASrc: ISkPixmap; + const AEncodedImageFormat: TSkEncodedImageFormat; + const AQuality: Integer): TBytes; +var + LBytesStream: TBytesStream; +begin + LBytesStream := TBytesStream.Create; + try + EncodeToStream(LBytesStream, ASrc, AEncodedImageFormat, AQuality); + Result := Copy(LBytesStream.Bytes, 0, LBytesStream.Size); + finally + LBytesStream.Free; end; +end; -const - SkNative32ColorType: TSkColorType = {$IFDEF BIGENDIAN}TSkColorType.RGBA8888{$ELSE}TSkColorType.BGRA8888{$ENDIF}; - - SkBytesPerPixel: array[TSkColorType] of Integer = ( - { Unknown } 0, - { Alpha8 } 1, - { RGB565 } 2, - { ARGB4444 } 2, - { RGBA8888 } 4, - { RGB888X } 4, - { BGRA8888 } 4, - { RGBA1010102 } 4, - { BGRA1010102 } 4, - { RGB101010X } 4, - { BGR101010X } 4, - { Gray8 } 1, - { RGBAF16 } 8, - { RGBAF16Clamped } 8, - { RGBAF32 } 16, - { RG88 } 2, - { AlphaF16 } 2, - { RGF16 } 4, - { Alpha16 } 2, - { RG1616 } 4, - { RGBA16161616 } 8, - { SRGBA8888 } 4 - ); - - SkShiftPerPixel: array[TSkColorType] of Integer = ( - { Unknown } 0, - { Alpha8 } 0, - { RGB565 } 1, - { ARGB4444 } 1, - { RGBA8888 } 2, - { RGB888X } 2, - { BGRA8888 } 2, - { RGBA1010102 } 2, - { BGRA1010102 } 2, - { RGB101010X } 2, - { BGR101010X } 2, - { Gray8 } 0, - { RGBAF16 } 3, - { RGBAF16Clamped } 3, - { RGBAF32 } 4, - { RG88 } 1, - { AlphaF16 } 1, - { RGF16 } 2, - { Alpha16 } 1, - { RG1616 } 2, - { RGBA16161616 } 3, - { SRGBA8888 } 2 - ); +class function TSkImageEncoder.Encode(const ASrcImageInfo: TSkImageInfo; + const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; + const AEncodedImageFormat: TSkEncodedImageFormat; + const AQuality: Integer): TBytes; +var + LPixmap: ISkPixmap; +begin + LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); + Result := Encode(LPixmap, AEncodedImageFormat, AQuality); +end; - GrGlTexture2D = $0DE1; - GrGlTextureRectangle = $84F5; - GrGlTextureExternal = $8D65; +class function TSkImageEncoder.EncodeToFile(const AFileName: string; + const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; + const ASrcRowBytes: NativeUInt; const AQuality: Integer): Boolean; +begin + Result := EncodeToFile(AFileName, ASrcImageInfo, ASrcPixels, ASrcRowBytes, ExtensionToEncodedImageFormat(TPath.GetExtension(AFileName)), AQuality); +end; - GrGlSizedFormat: array[TSkColorType] of GrGlenum = ( - { Unknown } 0, - { Alpha8 - GR_GL_ALPHA8 } $803C, - { RGB565 - GR_GL_RGB565 } $8D62, - { ARGB4444 - GR_GL_RGBA4 } $8056, - { RGBA8888 - GR_GL_RGBA8 } $8058, - { RGB888X - GR_GL_RGBX8 } $96BA, - { BGRA8888 - GR_GL_BGRA8 } $93A1, - { RGBA1010102 - GR_GL_RGB10_A2 } $8059, - { BGRA1010102 } 0, - { RGB101010X } 0, - { BGR101010X } 0, - { Gray8 - GR_GL_LUMINANCE8 } $8040, - { RGBAF16 - GR_GL_RGBA16F } $881A, - { RGBAF16Clamped - GR_GL_RGBA16F } $881A, - { RGBAF32 - GR_GL_RGBA32F } $8814, - { RG88 - GR_GL_RG8 } $822B, - { AlphaF16 - GR_GL_R16F } $822D, - { RGF16 - GR_GL_RG16F } $822F, - { Alpha16 - GR_GL_R16 } $822A, - { RG1616 - GR_GL_RG16 } $822C, - { RGBA16161616 - GR_GL_RGBA16 } $805B, - { SRGBA8888 - GR_GL_SRGB8_ALPHA8 } $8C43 - ); +class function TSkImageEncoder.EncodeToFile(const AFileName: string; + const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat; + const AQuality: Integer): Boolean; +var + LMarshaller: TMarshaller; +begin + if AFileName.IsEmpty then + raise ESkException.Create(SFileNameIsEmpty); + if not Assigned(ASrc) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ASrc']); + Result := sk4d_imageencoder_encode_to_file(LMarshaller.AsUtf8(AFileName).ToPointer, ASrc.Handle, sk_encodedimageformat_t(AEncodedImageFormat), AQuality); +end; -implementation +class function TSkImageEncoder.EncodeToFile(const AFileName: string; + const ASrc: ISkPixmap; const AQuality: Integer): Boolean; +begin + Result := EncodeToFile(AFileName, ASrc, ExtensionToEncodedImageFormat(TPath.GetExtension(AFileName)), AQuality); +end; -uses - { Delphi } - System.Generics.Collections, - System.IOUtils, - System.Math, - System.RTLConsts, - System.TimeSpan; +class function TSkImageEncoder.EncodeToFile(const AFileName: string; + const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; + const ASrcRowBytes: NativeUInt; + const AEncodedImageFormat: TSkEncodedImageFormat; + const AQuality: Integer): Boolean; +var + LPixmap: ISkPixmap; +begin + LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); + Result := EncodeToFile(AFileName, LPixmap, AEncodedImageFormat, AQuality); +end; -type - { ISkString } +class function TSkImageEncoder.EncodeToStream(const AStream: TStream; + const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat; + const AQuality: Integer): Boolean; +var + LWStream: ISkWStream; +begin + if not Assigned(ASrc) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ASrc']); + LWStream := TSkWStreamAdapter.Create(AStream); + Result := sk4d_imageencoder_encode_to_stream(LWStream.Handle, ASrc.Handle, sk_encodedimageformat_t(AEncodedImageFormat), AQuality); +end; - ISkString = interface(ISkObject) - ['{F6A12950-1C84-4D26-A7CA-FE83D564D0F7}'] - function GetText: string; - procedure SetText(const AValue: string); - property Text: string read GetText write SetText; - end; +class function TSkImageEncoder.EncodeToStream(const AStream: TStream; + const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; + const ASrcRowBytes: NativeUInt; + const AEncodedImageFormat: TSkEncodedImageFormat; + const AQuality: Integer): Boolean; +var + LPixmap: ISkPixmap; +begin + LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); + Result := EncodeToStream(AStream, LPixmap, AEncodedImageFormat, AQuality); +end; - { TSkString } +{ TSkLattice } - TSkString = class(TSkObject, ISkString) - strict protected - function GetText: string; - procedure SetText(const AValue: string); - public - constructor Create; overload; - constructor Create(const AString: string); overload; - class procedure DestroyHandle(const AHandle: THandle); override; +constructor TSkLattice.Create(const AXDivs, AYDivs: TArray; + ABounds: TRect; const ARectTypes: TArray; + const AColors: TArray); +begin + if Length(AXDivs) < 1 then + raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AXDivs']); + if Length(AYDivs) < 1 then + raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AYDivs']); + if (Length(ARectTypes) > 0) then + begin + if Length(ARectTypes) <> ((Length(AXDivs) + 1) * (Length(AYDivs) + 1)) then + raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['ARectTypes']); + if Length(AColors) <> Length(ARectTypes) then + raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['AColors']); end; + FXDivs := AXDivs; + FYDivs := AYDivs; + FRectTypes := ARectTypes; + FColors := AColors; + FUseBounds := True; + FBounds := ABounds; +end; - { ISkStream } - - ISkStream = interface(ISkObject) - ['{F710777C-FFEE-4089-8BEA-06B78FE4A5C4}'] +constructor TSkLattice.Create(const AXDivs, AYDivs: TArray; + const ARectTypes: TArray; + const AColors: TArray); +begin + if Length(AXDivs) < 1 then + raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AXDivs']); + if Length(AYDivs) < 1 then + raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AYDivs']); + if (Length(ARectTypes) > 0) then + begin + if Length(ARectTypes) <> ((Length(AXDivs) + 1) * (Length(AYDivs) + 1)) then + raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['ARectTypes']); + if Length(AColors) <> Length(ARectTypes) then + raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['AColors']); end; + FXDivs := AXDivs; + FYDivs := AYDivs; + FRectTypes := ARectTypes; + FColors := AColors; + FUseBounds := False; +end; - { TSkStreamAdapter } +{ TSkMetrics } - TSkStreamAdapter = class(TSkObject, ISkStream) - strict private - class constructor Create; - class function get_length_proc(context: Pointer): size_t; cdecl; static; - class function get_position_proc(context: Pointer): size_t; cdecl; static; - class function read_proc(context: Pointer; buffer: Pointer; size: size_t): size_t; cdecl; static; - class function seek_proc(context: Pointer; position: size_t): bool; cdecl; static; - public - constructor Create(const AStream: TStream); - class procedure DestroyHandle(const AHandle: THandle); override; - end; +class operator TSkMetrics.Equal(const AMetrics1, + AMetrics2: TSkMetrics): Boolean; +begin + Result := (AMetrics1.StartIndex = AMetrics2.StartIndex ) and + (AMetrics1.EndIndex = AMetrics2.EndIndex ) and + (AMetrics1.EndExcludingWhitespaces = AMetrics2.EndExcludingWhitespaces) and + (AMetrics1.EndIncludingNewline = AMetrics2.EndIncludingNewline ) and + (AMetrics1.IsHardBreak = AMetrics2.IsHardBreak ) and + (AMetrics1.LineNumber = AMetrics2.LineNumber ) and + (SameValue(AMetrics1.Ascent, AMetrics2.Ascent, Epsilon)) and + (SameValue(AMetrics1.Descent, AMetrics2.Descent, Epsilon)) and + (SameValue(AMetrics1.Height, AMetrics2.Height, Epsilon)) and + (SameValue(AMetrics1.Width, AMetrics2.Width, Epsilon)) and + (SameValue(AMetrics1.Left, AMetrics2.Left, Epsilon)) and + (SameValue(AMetrics1.Baseline, AMetrics2.Baseline, Epsilon)); +end; + +class operator TSkMetrics.NotEqual(const AMetrics1, + AMetrics2: TSkMetrics): Boolean; +begin + Result := not (AMetrics1 = AMetrics2); +end; + +{ TSkPDFMetadata } + +constructor TSkPDFMetadata.Create(const ATitle, AAuthor, ASubject, AKeywords, + ACreator, AProducer: string; const ARasterDPI: Single; const APDFA: Boolean; + const AEncodingQuality: Integer); +begin + Title := ATitle; + Author := AAuthor; + Subject := ASubject; + Keywords := AKeywords; + Creator := ACreator; + Producer := AProducer; + Creation := Now; + Modified := Now; + RasterDPI := ARasterDPI; + PDFA := APDFA; + EncodingQuality := AEncodingQuality; +end; + +constructor TSkPDFMetadata.Create(const ATitle, AAuthor, ASubject, AKeywords, + ACreator: string; const ACreation, AModified: TDateTime; + const AProducer: string; const ARasterDPI: Single; const APDFA: Boolean; + const AEncodingQuality: Integer); +begin + Title := ATitle; + Author := AAuthor; + Subject := ASubject; + Keywords := AKeywords; + Creator := ACreator; + Producer := AProducer; + Creation := ACreation; + Modified := AModified; + RasterDPI := ARasterDPI; + PDFA := APDFA; + EncodingQuality := AEncodingQuality; +end; + +class operator TSkPDFMetadata.Equal(const APDFMetadata1, + APDFMetadata2: TSkPDFMetadata): Boolean; +begin + Result := (APDFMetadata1.Title = APDFMetadata2.Title ) and + (APDFMetadata1.Author = APDFMetadata2.Author ) and + (APDFMetadata1.Subject = APDFMetadata2.Subject ) and + (APDFMetadata1.Keywords = APDFMetadata2.Keywords ) and + (APDFMetadata1.Creator = APDFMetadata2.Creator ) and + (APDFMetadata1.Producer = APDFMetadata2.Producer ) and + (APDFMetadata1.Creation = APDFMetadata2.Creation ) and + (APDFMetadata1.Modified = APDFMetadata2.Modified ) and + (APDFMetadata1.PDFA = APDFMetadata2.PDFA ) and + (APDFMetadata1.EncodingQuality = APDFMetadata2.EncodingQuality) and + (SameValue(APDFMetadata1.RasterDPI, APDFMetadata2.RasterDPI, Epsilon)); +end; - { ISkWStream } +class operator TSkPDFMetadata.NotEqual(const APDFMetadata1, + APDFMetadata2: TSkPDFMetadata): Boolean; +begin + Result := not (APDFMetadata1 = APDFMetadata2); +end; - ISkWStream = interface(ISkObject) - ['{F608143C-DF48-4CBB-BD42-DC3E4DCC5EDA}'] - end; +{ TSkPlaceholderStyle } - { TSkWStreamAdapter } +constructor TSkPlaceholderStyle.Create(const AWidth, AHeight: Single; + const AAlignment: TSkPlaceholderAlignment; const ABaseline: TSkTextBaseline; + const ABaselineOffset: Single); +begin + Width := AWidth; + Height := AHeight; + Alignment := AAlignment; + Baseline := ABaseline; + BaselineOffset := ABaselineOffset; +end; - TSkWStreamAdapter = class(TSkObject, ISkWStream) - strict private - class constructor Create; - class function write_proc(context: Pointer; const buffer: Pointer; size: size_t): bool; cdecl; static; - public - constructor Create(const AStream: TStream); - class procedure DestroyHandle(const AHandle: THandle); override; - end; +class operator TSkPlaceholderStyle.Equal(const APlaceholderStyle1, + APlaceholderStyle2: TSkPlaceholderStyle): Boolean; +begin + Result := (APlaceholderStyle1.Alignment = APlaceholderStyle2.Alignment) and + (APlaceholderStyle1.Baseline = APlaceholderStyle2.Baseline ) and + (SameValue(APlaceholderStyle1.Width, APlaceholderStyle2.Width, Epsilon)) and + (SameValue(APlaceholderStyle1.Height, APlaceholderStyle2.Height, Epsilon)) and + ((APlaceholderStyle1.Alignment <> TSkPlaceholderAlignment.Baseline) or (SameValue(APlaceholderStyle1.BaselineOffset, APlaceholderStyle2.BaselineOffset, Epsilon))); +end; - { TSkManagedDocument } +class operator TSkPlaceholderStyle.NotEqual(const APlaceholderStyle1, + APlaceholderStyle2: TSkPlaceholderStyle): Boolean; +begin + Result := not (APlaceholderStyle1 = APlaceholderStyle2); +end; - TSkManagedDocument = class(TSkDocument) - strict private - FWStream: ISkWStream; - public - class function MakePDF(const AStream: TStream): ISkDocument; overload; - class function MakePDF(const AStream: TStream; const AMetadata: TSkPDFMetadata): ISkDocument; overload; - class function MakeXPS(const AStream: TStream; const ADPI: Single = 72): ISkDocument; - end; +{ TSkPositionAffinity } - { TSkManagedSVGCanvas } +class operator TSkPositionAffinity.Equal(const APositionAffinity1, + APositionAffinity2: TSkPositionAffinity): Boolean; +begin + Result := (APositionAffinity1.Position = APositionAffinity2.Position) and + (APositionAffinity1.Affinity = APositionAffinity2.Affinity); +end; - TSkManagedSVGCanvas = class(TSkCanvas) - strict private - FWStream: ISkWStream; - public - class function Make(const ABounds: TRectF; const AStream: TStream; const AFlags: TSkSVGCanvasFlags = []): ISkCanvas; - end; +class operator TSkPositionAffinity.NotEqual(const APositionAffinity1, + APositionAffinity2: TSkPositionAffinity): Boolean; +begin + Result := not (APositionAffinity1 = APositionAffinity2); +end; - { TSkMapping } +{ TSkRotationScaleMatrix } - TSkMapping = record - class function AsDateTime(const AValue: TDateTime): sk_datetime_t; static; inline; - class function AsImageInfo(const AValue: TSkImageInfo): sk_imageinfo_t; static; inline; - class function AsLattice(const AValue: TSkLattice): sk_lattice_t; static; inline; - class function AsPDFMetadata(const AValue: TSkPDFMetadata): sk_pdfmetadata_t; static; inline; - class function AsSurfaceProperties(const AValue: TSkSurfaceProperties): sk_surfaceprops_t; static; inline; - class function ToFontMetrics(const AValue: sk_fontmetrics_t): TSkFontMetrics; static; inline; - class function ToImageInfo(const AValue: sk_imageinfo_t): TSkImageInfo; static; inline; - class function ToSurfaceProperties(const AValue: sk_surfaceprops_t): TSkSurfaceProperties; static; inline; - end; +constructor TSkRotationScaleMatrix.Create(const ASCosinus, ASSinus, ATranslateX, + ATranslateY: Single); +begin + SCosinus := ASCosinus; + SSinus := ASSinus; + TranslateX := ATranslateX; + TranslateY := ATranslateY; +end; -const - SFileNameIsEmpty = 'File name cannot be empty'; - SInvalidExtension = 'Invalid extension'; - SInvalidOperation = 'Operation is invalid'; - SOutOfMemory = 'Out of memory'; - SParamElementIsNil = 'Parameter %s[%d] cannot be nil'; - SParamIsEmpty = 'Parameter %s cannot be empty'; - SParamIsNil = 'Parameter %s cannot be nil'; - SParamOutOfRange = 'Parameter %s out of range (%d). Must be >= %d and < %d'; - SParamSizeIsOdd = 'Parameter %s size cannot be odd'; - SParamSizeMismatch = 'Parameter %s size mismatch'; +class function TSkRotationScaleMatrix.CreateDegrees(const AScale, ADegrees, + ATranslateX, ATranslateY, AAnchorX, AAnchorY: Single): TSkRotationScaleMatrix; +begin + SinCos(DegToRad(ADegrees), Result.SSinus, Result.SCosinus); + Result.SSinus := Result.SSinus * AScale; + Result.SCosinus := Result.SCosinus * AScale; + Result.TranslateX := ATranslateX + -Result.SCosinus * AAnchorX + Result.SSinus * AAnchorY; + Result.TranslateY := ATranslateY + -Result.SSinus * AAnchorX - Result.SCosinus * AAnchorY; +end; -{ TSkString } +class function TSkRotationScaleMatrix.CreateRadians(const AScale, ARadians, + ATranslateX, ATranslateY, AAnchorX, AAnchorY: Single): TSkRotationScaleMatrix; +begin + SinCos(ARadians, Result.SSinus, Result.SCosinus); + Result.SSinus := Result.SSinus * AScale; + Result.SCosinus := Result.SCosinus * AScale; + Result.TranslateX := ATranslateX + -Result.SCosinus * AAnchorX + Result.SSinus * AAnchorY; + Result.TranslateY := ATranslateY + -Result.SSinus * AAnchorX - Result.SCosinus * AAnchorY; +end; -constructor TSkString.Create(const AString: string); +class operator TSkRotationScaleMatrix.Equal(const ARotationScaleMatrix1, + ARotationScaleMatrix2: TSkRotationScaleMatrix): Boolean; begin - Create; - SetText(AString); + Result := (SameValue(ARotationScaleMatrix1.SCosinus, ARotationScaleMatrix2.SCosinus, Epsilon)) and + (SameValue(ARotationScaleMatrix1.SSinus, ARotationScaleMatrix2.SSinus, Epsilon)) and + (SameValue(ARotationScaleMatrix1.TranslateX, ARotationScaleMatrix2.TranslateX, Epsilon)) and + (SameValue(ARotationScaleMatrix1.TranslateY, ARotationScaleMatrix2.TranslateY, Epsilon)); end; -constructor TSkString.Create; +class function TSkRotationScaleMatrix.Identity: TSkRotationScaleMatrix; begin - Wrap(TSkiaAPI.sk4d_string_create()); + Result := SkRotationScaleMatrixIdentity; end; -class procedure TSkString.DestroyHandle(const AHandle: THandle); +class operator TSkRotationScaleMatrix.Implicit( + const ARotationScaleMatrix: TSkRotationScaleMatrix): TMatrix; begin - TSkiaAPI.sk4d_string_destroy(AHandle); + Result.m11 := ARotationScaleMatrix.SCosinus; + Result.m12 := ARotationScaleMatrix.SSinus; + Result.m13 := 0; + Result.m21 := -ARotationScaleMatrix.SSinus; + Result.m22 := ARotationScaleMatrix.SCosinus; + Result.m23 := 0; + Result.m31 := ARotationScaleMatrix.TranslateX; + Result.m32 := ARotationScaleMatrix.TranslateY; + Result.m33 := 1; end; -function TSkString.GetText: string; +class operator TSkRotationScaleMatrix.NotEqual(const ARotationScaleMatrix1, + ARotationScaleMatrix2: TSkRotationScaleMatrix): Boolean; begin - Result := string(TSkiaAPI.sk4d_string_get_text(GetHandle)); + Result := not (ARotationScaleMatrix1 = ARotationScaleMatrix2); end; -procedure TSkString.SetText(const AValue: string); +{ TSkRuntimeEffectFloat2 } + +constructor TSkRuntimeEffectFloat2.Create(const AV1, AV2: Single); begin - TSkiaAPI.sk4d_string_set_text(GetHandle, MarshaledAString(UTF8String(AValue))); + V1 := AV1; + V2 := AV2; end; -{ TSkStreamAdapter } +{ TSkRuntimeEffectFloat3 } -class constructor TSkStreamAdapter.Create; -var - LProcs: sk_streamadapter_procs_t; +constructor TSkRuntimeEffectFloat3.Create(const AV1, AV2, AV3: Single); begin - LProcs.get_length := get_length_proc; - LProcs.get_position := get_position_proc; - LProcs.read := read_proc; - LProcs.seek := seek_proc; - TSkiaAPI.sk4d_streamadapter_set_procs(@LProcs); + V1 := AV1; + V2 := AV2; + V3 := AV3; end; -constructor TSkStreamAdapter.Create(const AStream: TStream); +{ TSkRuntimeEffectFloat4 } + +constructor TSkRuntimeEffectFloat4.Create(const AV1, AV2, AV3, AV4: Single); begin - inherited Create(TSkiaAPI.sk4d_streamadapter_create(AStream)); + V1 := AV1; + V2 := AV2; + V3 := AV3; + V4 := AV4; end; -class procedure TSkStreamAdapter.DestroyHandle(const AHandle: THandle); +{ TSkRuntimeEffectFloat2x2 } + +constructor TSkRuntimeEffectFloat2x2.Create(const AV11, AV12, AV21, + AV22: Single); begin - TSkiaAPI.sk4d_streamadapter_destroy(AHandle); + V11 := AV11; + V12 := AV12; + V21 := AV21; + V22 := AV22; end; -class function TSkStreamAdapter.get_length_proc(context: Pointer): size_t; +{ TSkRuntimeEffectFloat3x3 } + +constructor TSkRuntimeEffectFloat3x3.Create(const AV11, AV12, AV13, AV21, AV22, + AV23, AV31, AV32, AV33: Single); begin - Result := TStream(context).Size; + V11 := AV11; + V12 := AV12; + V13 := AV13; + V21 := AV21; + V22 := AV22; + V23 := AV23; + V31 := AV31; + V32 := AV32; + V33 := AV33; end; -class function TSkStreamAdapter.get_position_proc(context: Pointer): size_t; +{ TSkRuntimeEffectFloat4x4 } + +constructor TSkRuntimeEffectFloat4x4.Create(const AV11, AV12, AV13, AV14, AV21, + AV22, AV23, AV24, AV31, AV32, AV33, AV34, AV41, AV42, AV43, AV44: Single); begin - Result := TStream(context).Position; + V11 := AV11; + V12 := AV12; + V13 := AV13; + V14 := AV14; + V21 := AV21; + V22 := AV22; + V23 := AV23; + V24 := AV24; + V31 := AV31; + V32 := AV32; + V33 := AV33; + V34 := AV34; + V41 := AV41; + V42 := AV42; + V43 := AV43; + V44 := AV44; end; -class function TSkStreamAdapter.read_proc(context, buffer: Pointer; - size: size_t): size_t; +{ TSkRuntimeEffectInt2 } + +constructor TSkRuntimeEffectInt2.Create(const AV1, AV2: Integer); begin - if buffer <> nil then - Result := TStream(context).Read(buffer^, size) - else - begin - Result := Min(Int64(size), TStream(context).Size - TStream(context).Position); - TStream(context).Position := TStream(context).Position + Int64(Result); - end; + V1 := AV1; + V2 := AV2; end; -class function TSkStreamAdapter.seek_proc(context: Pointer; - position: size_t): bool; +{ TSkRuntimeEffectInt3 } + +constructor TSkRuntimeEffectInt3.Create(const AV1, AV2, AV3: Integer); begin - TStream(context).Position := position; - Result := True; + V1 := AV1; + V2 := AV2; + V3 := AV3; end; -{ TSkWStreamAdapter } +{ TSkRuntimeEffectInt4 } -class constructor TSkWStreamAdapter.Create; -var - LProcs: sk_wstreamadapter_procs_t; +constructor TSkRuntimeEffectInt4.Create(const AV1, AV2, AV3, AV4: Integer); begin - LProcs.write := write_proc; - TSkiaAPI.sk4d_wstreamadapter_set_procs(@LProcs); + V1 := AV1; + V2 := AV2; + V3 := AV3; + V4 := AV4; end; -constructor TSkWStreamAdapter.Create(const AStream: TStream); +{ TSkSamplingOptions } + +constructor TSkSamplingOptions.Create(const ACubic: TSkCubicResampler); begin - inherited Create(TSkiaAPI.sk4d_wstreamadapter_create(AStream)); + FMaxAnisotropic := 0; + FUseCubic := True; + FCubic := ACubic; + FFilter := TSkFilterMode.Nearest; + FMipmap := TSkMipmapMode.None; end; -class procedure TSkWStreamAdapter.DestroyHandle(const AHandle: THandle); +constructor TSkSamplingOptions.Create(const AFilter: TSkFilterMode; + const AMipmap: TSkMipmapMode); begin - TSkiaAPI.sk4d_wstreamadapter_destroy(AHandle); + FMaxAnisotropic := 0; + FUseCubic := False; + FCubic := TSkCubicResampler.Create(0, 0); + FFilter := AFilter; + FMipmap := AMipmap; end; -class function TSkWStreamAdapter.write_proc(context: Pointer; - const buffer: Pointer; size: size_t): bool; +constructor TSkSamplingOptions.Create(const AMaxAnisotropic: Integer); begin - TStream(context).Write(buffer^, size); - Result := True; + FMaxAnisotropic := Max(AMaxAnisotropic, 1); + FUseCubic := False; + FCubic := TSkCubicResampler.Create(0, 0); + FFilter := TSkFilterMode.Nearest; + FMipmap := TSkMipmapMode.None; end; -{ TSkManagedDocument } +class operator TSkSamplingOptions.Equal(const ASamplingOptions1, + ASamplingOptions2: TSkSamplingOptions): Boolean; +begin + Result := (ASamplingOptions1.FMaxAnisotropic = ASamplingOptions2.FMaxAnisotropic) and + (ASamplingOptions1.FUseCubic = ASamplingOptions2.FUseCubic ) and + (ASamplingOptions1.FCubic = ASamplingOptions2.FCubic ) and + (ASamplingOptions1.FFilter = ASamplingOptions2.FFilter ) and + (ASamplingOptions1.FMipmap = ASamplingOptions2.FMipmap ); +end; -class function TSkManagedDocument.MakePDF(const AStream: TStream): ISkDocument; -var - LHandle: THandle; - LManagedDocument: TSkManagedDocument; - LWStream: ISkWStream; +class function TSkSamplingOptions.High: TSkSamplingOptions; begin - LWStream := TSkWStreamAdapter.Create(AStream); - LHandle := TSkiaAPI.sk4d_document_make_pdf(LWStream.Handle); - if LHandle = 0 then - Exit(nil); - LManagedDocument := TSkManagedDocument.Wrap(LHandle); - LManagedDocument.FWStream := LWStream; - Result := LManagedDocument; + Result := SkSamplingOptionsHigh; end; -class function TSkManagedDocument.MakePDF(const AStream: TStream; - const AMetadata: TSkPDFMetadata): ISkDocument; -var - LHandle: THandle; - LManagedDocument: TSkManagedDocument; - LMetadata: sk_pdfmetadata_t; - LWStream: ISkWStream; +class function TSkSamplingOptions.Low: TSkSamplingOptions; begin - LWStream := TSkWStreamAdapter.Create(AStream); - LMetadata := TSkMapping.AsPDFMetadata(AMetadata); - LHandle := TSkiaAPI.sk4d_document_make_pdf2(LWStream.Handle, @LMetadata); - if LHandle = 0 then - Exit(nil); - LManagedDocument := TSkManagedDocument.Wrap(LHandle); - LManagedDocument.FWStream := LWStream; - Result := LManagedDocument; + Result := SkSamplingOptionsLow; end; -class function TSkManagedDocument.MakeXPS(const AStream: TStream; - const ADPI: Single): ISkDocument; -var - LHandle: THandle; - LManagedDocument: TSkManagedDocument; - LWStream: ISkWStream; +class function TSkSamplingOptions.Medium: TSkSamplingOptions; begin - LWStream := TSkWStreamAdapter.Create(AStream); - LHandle := TSkiaAPI.sk4d_document_make_xps(LWStream.Handle, ADPI); - if LHandle = 0 then - Exit(nil); - LManagedDocument := TSkManagedDocument.Wrap(LHandle); - LManagedDocument.FWStream := LWStream; - Result := LManagedDocument; + Result := SkSamplingOptionsMedium; end; -{ TSkManagedSVGCanvas } - -class function TSkManagedSVGCanvas.Make(const ABounds: TRectF; - const AStream: TStream; const AFlags: TSkSVGCanvasFlags): ISkCanvas; -var - LHandle: THandle; - LManagedSVGCanvas: TSkManagedSVGCanvas; - LWStream: ISkWStream; +class operator TSkSamplingOptions.NotEqual(const ASamplingOptions1, + ASamplingOptions2: TSkSamplingOptions): Boolean; begin - LWStream := TSkWStreamAdapter.Create(AStream); - LHandle := TSkiaAPI.sk4d_svgcanvas_make(@sk_rect_t(ABounds), LWStream.Handle, Byte(AFlags)); - if LHandle = 0 then - Exit(nil); - LManagedSVGCanvas := TSkManagedSVGCanvas.Wrap(LHandle); - LManagedSVGCanvas.FWStream := LWStream; - Result := LManagedSVGCanvas; + Result := not (ASamplingOptions1 = ASamplingOptions2); end; -{ TSkMapping } +{ TSkSurfaceProperties } -class function TSkMapping.AsDateTime(const AValue: TDateTime): sk_datetime_t; -var - LDay: Word; - LHour: Word; - LMilliSecond: Word; - LMinute: Word; - LMonth: Word; - LSecond: Word; - LYear: Word; +constructor TSkSurfaceProperties.Create(const AFlags: TSkSurfacePropertiesFlags; + const APixelGeometry: TSkPixelGeometry); begin - DecodeDateTime(AValue, LYear, LMonth, LDay, LHour, LMinute, LSecond, LMilliSecond); - Result.time_zone_minutes := Round(TTimeZone.Local.UtcOffset.TotalMinutes); - Result.year := LYear; - Result.month := LMonth; - Result.day_of_week := DayOfWeek(AValue) - 1; - Result.day := LDay; - Result.hour := LHour; - Result.minute := LMinute; - Result.second := LSecond; + Flags := AFlags; + PixelGeometry := APixelGeometry; end; -class function TSkMapping.AsImageInfo( - const AValue: TSkImageInfo): sk_imageinfo_t; +class operator TSkSurfaceProperties.Equal(const ASurfaceProperties1, + ASurfaceProperties2: TSkSurfaceProperties): Boolean; begin - Result.width := AValue.Width; - Result.height := AValue.Height; - Result.color_type := sk_colortype_t(AValue.ColorType); - Result.alpha_type := sk_alphatype_t(AValue.AlphaType); - Result.color_space := TSkBindings.SafeGetHandle(AValue.ColorSpace); + Result := (ASurfaceProperties1.Flags = ASurfaceProperties2.Flags ) and + (ASurfaceProperties1.PixelGeometry = ASurfaceProperties2.PixelGeometry); end; -class function TSkMapping.AsLattice(const AValue: TSkLattice): sk_lattice_t; +class operator TSkSurfaceProperties.NotEqual(const ASurfaceProperties1, + ASurfaceProperties2: TSkSurfaceProperties): Boolean; begin - Result.x_divs := @AValue.FXDivs[0]; - Result.y_divs := @AValue.FYDivs[0]; - Result.x_count := Length(AValue.FXDivs); - Result.y_count := Length(AValue.FYDivs); - if Length(AValue.FRectTypes) > 0 then - begin - Result.rect_types := @AValue.FRectTypes[0]; - Result.colors := @AValue.FColors[0]; - end - else - begin - Result.rect_types := nil; - Result.colors := nil; - end; - if AValue.FUseBounds then - Result.bounds := @sk_irect_t(AValue.FBounds) - else - Result.bounds := nil; + Result := not (ASurfaceProperties1 = ASurfaceProperties2); end; -class function TSkMapping.AsPDFMetadata( - const AValue: TSkPDFMetadata): sk_pdfmetadata_t; +{ TSkSVGLength } + +constructor TSkSVGLength.Create(const AValue: Single; + const AUnit: TSkSVGLengthUnit); begin - Result.title := MarshaledAString(UTF8String(AValue.Title)); - Result.author := MarshaledAString(UTF8String(AValue.Author)); - Result.subject := MarshaledAString(UTF8String(AValue.Subject)); - Result.keywords := MarshaledAString(UTF8String(AValue.Keywords)); - Result.creator := MarshaledAString(UTF8String(AValue.Creator)); - Result.producer := MarshaledAString(UTF8String(AValue.Producer)); - Result.creation := TSkMapping.AsDateTime(AValue.Creation); - Result.modified := TSkMapping.AsDateTime(AValue.Modified); - Result.raster_dpi := AValue.RasterDPI; - Result.pdfa := AValue.PDFA; - Result.encoding_quality := AValue.EncodingQuality; + Value := AValue; + &Unit := AUnit; end; -class function TSkMapping.AsSurfaceProperties( - const AValue: TSkSurfaceProperties): sk_surfaceprops_t; +class operator TSkSVGLength.Equal(const ASVGLength1, + ASVGLength2: TSkSVGLength): Boolean; begin - Result.flags := Byte(AValue.Flags); - Result.pixel_geometry := sk_pixelgeometry_t(AValue.PixelGeometry); + Result := (ASVGLength1.&Unit = ASVGLength2.&Unit) and + (SameValue(ASVGLength1.Value, ASVGLength2.Value, Epsilon)); end; -class function TSkMapping.ToFontMetrics( - const AValue: sk_fontmetrics_t): TSkFontMetrics; +class operator TSkSVGLength.NotEqual(const ASVGLength1, + ASVGLength2: TSkSVGLength): Boolean; begin - Result.Flags := TSkFontMetricsFlags(Byte(AValue.flags)); - Result.Top := AValue.top; - Result.Ascent := AValue.ascent; - Result.Descent := AValue.descent; - Result.Bottom := AValue.bottom; - Result.Leading := AValue.leading; - Result.AvgCharWidth := AValue.avg_char_width; - Result.MaxCharWidth := AValue.max_char_width; - Result.XMin := AValue.x_min; - Result.XMax := AValue.x_max; - Result.XHeight := AValue.x_height; - Result.CapHeight := AValue.cap_height; - Result.UnderlineThickness := AValue.underline_thickness; - Result.UnderlinePosition := AValue.underline_position; - Result.StrikeoutThickness := AValue.strikeout_thickness; - Result.StrikeoutPosition := AValue.strikeout_position; + Result := not (ASVGLength1 = ASVGLength2); end; -class function TSkMapping.ToImageInfo( - const AValue: sk_imageinfo_t): TSkImageInfo; +{ TSkSVGPreserveAspectRatio } + +constructor TSkSVGPreserveAspectRatio.Create(const AAlign: TSkSVGAspectAlign; + const AScale: TSkSVGAspectScale); begin - Result.Width := AValue.width; - Result.Height := AValue.height; - Result.ColorType := TSkColorType(AValue.color_type); - Result.AlphaType := TSkAlphaType(AValue.alpha_type); - Result.ColorSpace := TSkBindings.SafeCreate(AValue.color_space); + Align := AAlign; + Scale := AScale; end; -class function TSkMapping.ToSurfaceProperties( - const AValue: sk_surfaceprops_t): TSkSurfaceProperties; +class operator TSkSVGPreserveAspectRatio.Equal(const ASVGPreserveAspectRatio1, + ASVGPreserveAspectRatio2: TSkSVGPreserveAspectRatio): Boolean; begin - Result.Flags := TSkSurfacePropertiesFlags(Byte(AValue.flags)); - Result.PixelGeometry := TSkPixelGeometry(AValue.pixel_geometry); + Result := (ASVGPreserveAspectRatio1.Align = ASVGPreserveAspectRatio2.Align) and + (ASVGPreserveAspectRatio1.Scale = ASVGPreserveAspectRatio2.Scale); end; -{ TGrGlFramebufferInfo } - -constructor TGrGlFramebufferInfo.Create(const AFBOID: GrGluint; - const AFormat: GrGlenum); +class operator TSkSVGPreserveAspectRatio.NotEqual( + const ASVGPreserveAspectRatio1, + ASVGPreserveAspectRatio2: TSkSVGPreserveAspectRatio): Boolean; begin - FBOID := AFBOID; - Format := AFormat; + Result := not (ASVGPreserveAspectRatio1 = ASVGPreserveAspectRatio2); end; -class operator TGrGlFramebufferInfo.Equal(const AGlFramebufferInfo1, - AGlFramebufferInfo2: TGrGlFramebufferInfo): Boolean; +{ TSkTextBox } + +class operator TSkTextBox.Equal(const ATextBox1, + ATextBox2: TSkTextBox): Boolean; begin - Result := (AGlFramebufferInfo1.FBOID = AGlFramebufferInfo2.FBOID ) and - (AGlFramebufferInfo1.Format = AGlFramebufferInfo2.Format); + Result := (ATextBox1.Rect = ATextBox2.Rect ) and + (ATextBox1.Direction = ATextBox2.Direction); end; -class operator TGrGlFramebufferInfo.NotEqual(const AGlFramebufferInfo1, - AGlFramebufferInfo2: TGrGlFramebufferInfo): Boolean; +class operator TSkTextBox.NotEqual(const ATextBox1, + ATextBox2: TSkTextBox): Boolean; begin - Result := not (AGlFramebufferInfo1 = AGlFramebufferInfo2); + Result := not (ATextBox1 = ATextBox2) end; -{ TGrMtlTextureInfo } +{ TSkTextShadow } -constructor TGrMtlTextureInfo.Create(const ATexture: GrMtlHandle); +constructor TSkTextShadow.Create(const AColor: TAlphaColor; + const AOffset: TPointF; const ABlurRadius: Double); begin - Texture := ATexture; + Color := AColor; + Offset := AOffset; + BlurRadius := ABlurRadius; end; -class operator TGrMtlTextureInfo.Equal(const AMtlTextureInfo1, - AMtlTextureInfo2: TGrMtlTextureInfo): Boolean; +class operator TSkTextShadow.Equal(const ATextShadow1, + ATextShadow2: TSkTextShadow): Boolean; begin - Result := (AMtlTextureInfo1.Texture = AMtlTextureInfo2.Texture); + Result := (ATextShadow1.Color = ATextShadow2.Color ) and + (ATextShadow1.Offset = ATextShadow2.Offset) and + (SameValue(ATextShadow1.BlurRadius, ATextShadow2.BlurRadius, Epsilon)); end; -class operator TGrMtlTextureInfo.NotEqual(const AMtlTextureInfo1, - AMtlTextureInfo2: TGrMtlTextureInfo): Boolean; +class operator TSkTextShadow.NotEqual(const ATextShadow1, + ATextShadow2: TSkTextShadow): Boolean; begin - Result := not (AMtlTextureInfo1 = AMtlTextureInfo2); + Result := not (ATextShadow1 = ATextShadow2); end; { TGrBackendRenderTarget } @@ -4012,72 +5390,57 @@ constructor TGrMtlTextureInfo.Create(const ATexture: GrMtlHandle); constructor TGrBackendRenderTarget.CreateGl(const AWidth, AHeight, ASampleCount, AStencilBits: Integer; const AFramebufferInfo: TGrGlFramebufferInfo); begin - inherited Create(TSkiaAPI.gr4d_backendrendertarget_create_gl(AWidth, AHeight, ASampleCount, AStencilBits, @gr_gl_framebufferinfo_t(AFramebufferInfo))) + inherited Create(gr4d_backendrendertarget_create_gl(AWidth, AHeight, ASampleCount, AStencilBits, @gr_gl_framebufferinfo_t(AFramebufferInfo))) end; constructor TGrBackendRenderTarget.CreateMetal(const AWidth, AHeight: Integer; const ATextureInfo: TGrMtlTextureInfo); begin - inherited Create(TSkiaAPI.gr4d_backendrendertarget_create_mtl(AWidth, AHeight, @gr_mtl_textureinfo_t(ATextureInfo))); + inherited Create(gr4d_backendrendertarget_create_mtl(AWidth, AHeight, @gr_mtl_textureinfo_t(ATextureInfo))); end; -class procedure TGrBackendRenderTarget.DestroyHandle(const AHandle: THandle); +constructor TGrBackendRenderTarget.CreateVulkan(const AWidth, AHeight: Integer; + const AImageInfo: TGrVkImageInfo); +var + LImageInfo: gr_vk_imageinfo_t; begin - TSkiaAPI.gr4d_backendrendertarget_destroy(AHandle); + LImageInfo := TSkBindings.AsGrVkImageInfo(AImageInfo); + inherited Create(gr4d_backendrendertarget_create_vk(AWidth, AHeight, @LImageInfo)); end; function TGrBackendRenderTarget.GetBackendAPI: TGrBackendAPI; begin - Result := TGrBackendAPI(TSkiaAPI.gr4d_backendrendertarget_get_backend_api(GetHandle)); + Result := TGrBackendAPI(gr4d_backendrendertarget_get_backend_api(Handle)); end; function TGrBackendRenderTarget.GetHeight: Integer; begin - Result := TSkiaAPI.gr4d_backendrendertarget_get_height(GetHandle); + Result := gr4d_backendrendertarget_get_height(Handle); end; function TGrBackendRenderTarget.GetSampleCount: Integer; begin - Result := TSkiaAPI.gr4d_backendrendertarget_get_sample_count(GetHandle); + Result := gr4d_backendrendertarget_get_sample_count(Handle); end; function TGrBackendRenderTarget.GetStencilBits: Integer; begin - Result := TSkiaAPI.gr4d_backendrendertarget_get_stencil_bits(GetHandle); + Result := gr4d_backendrendertarget_get_stencil_bits(Handle); end; function TGrBackendRenderTarget.GetWidth: Integer; begin - Result := TSkiaAPI.gr4d_backendrendertarget_get_width(GetHandle); + Result := gr4d_backendrendertarget_get_width(Handle); end; function TGrBackendRenderTarget.IsValid: Boolean; begin - Result := TSkiaAPI.gr4d_backendrendertarget_is_valid(GetHandle); -end; - -{ TGrGlTextureInfo } - -constructor TGrGlTextureInfo.Create(const ATarget: GrGlenum; - const AID: GrGluint; const AFormat: GrGlenum); -begin - Target := ATarget; - ID := AID; - Format := AFormat; -end; - -class operator TGrGlTextureInfo.Equal(const AGlTextureInfo1, - AGlTextureInfo2: TGrGlTextureInfo): Boolean; -begin - Result := (AGlTextureInfo1.Target = AGlTextureInfo2.Target) and - (AGlTextureInfo1.ID = AGlTextureInfo2.ID ) and - (AGlTextureInfo1.Format = AGlTextureInfo2.Format); + Result := gr4d_backendrendertarget_is_valid(Handle); end; -class operator TGrGlTextureInfo.NotEqual(const AGlTextureInfo1, - AGlTextureInfo2: TGrGlTextureInfo): Boolean; +class procedure TGrBackendRenderTarget.__DestroyHandle(const AHandle: THandle); begin - Result := not (AGlTextureInfo1 = AGlTextureInfo2); + gr4d_backendrendertarget_destroy(AHandle); end; { TGrBackendTexture } @@ -4085,99 +5448,65 @@ constructor TGrGlTextureInfo.Create(const ATarget: GrGlenum; constructor TGrBackendTexture.CreateGl(const AWidth, AHeight: Integer; const AIsMipmapped: Boolean; const ATextureInfo: TGrGlTextureInfo); begin - inherited Create(TSkiaAPI.gr4d_backendtexture_create_gl(AWidth, AHeight, AIsMipmapped, @gr_gl_textureinfo_t(ATextureInfo))); + inherited Create(gr4d_backendtexture_create_gl(AWidth, AHeight, AIsMipmapped, @gr_gl_textureinfo_t(ATextureInfo))); end; constructor TGrBackendTexture.CreateMetal(const AWidth, AHeight: Integer; const AIsMipmapped: Boolean; const ATextureInfo: TGrMtlTextureInfo); begin - inherited Create(TSkiaAPI.gr4d_backendtexture_create_mtl(AWidth, AHeight, AIsMipmapped, @gr_mtl_textureinfo_t(ATextureInfo))); + inherited Create(gr4d_backendtexture_create_mtl(AWidth, AHeight, AIsMipmapped, @gr_mtl_textureinfo_t(ATextureInfo))); end; -class procedure TGrBackendTexture.DestroyHandle(const AHandle: THandle); +constructor TGrBackendTexture.CreateVulkan(const AWidth, AHeight: Integer; + const AImageInfo: TGrVkImageInfo); +var + LImageInfo: gr_vk_imageinfo_t; begin - TSkiaAPI.gr4d_backendtexture_destroy(AHandle); + LImageInfo := TSkBindings.AsGrVkImageInfo(AImageInfo); + inherited Create(gr4d_backendtexture_create_vk(AWidth, AHeight, @LImageInfo)); end; function TGrBackendTexture.GetBackendAPI: TGrBackendAPI; begin - Result := TGrBackendAPI(TSkiaAPI.gr4d_backendtexture_get_backend_api(GetHandle)); + Result := TGrBackendAPI(gr4d_backendtexture_get_backend_api(Handle)); end; function TGrBackendTexture.GetGlTextureInfo( out ATextureInfo: TGrGlTextureInfo): Boolean; begin - Result := TSkiaAPI.gr4d_backendtexture_get_gl_framebuffer_info(GetHandle, gr_gl_textureinfo_t(ATextureInfo)); + Result := gr4d_backendtexture_get_gl_framebuffer_info(Handle, gr_gl_textureinfo_t(ATextureInfo)); end; function TGrBackendTexture.GetHeight: Integer; begin - Result := TSkiaAPI.gr4d_backendtexture_get_height(GetHandle); + Result := gr4d_backendtexture_get_height(Handle); end; function TGrBackendTexture.GetWidth: Integer; begin - Result := TSkiaAPI.gr4d_backendtexture_get_width(GetHandle); + Result := gr4d_backendtexture_get_width(Handle); end; function TGrBackendTexture.HasMipmaps: Boolean; begin - Result := TSkiaAPI.gr4d_backendtexture_has_mipmaps(GetHandle); + Result := gr4d_backendtexture_has_mipmaps(Handle); end; function TGrBackendTexture.IsValid: Boolean; begin - Result := TSkiaAPI.gr4d_backendtexture_is_valid(GetHandle); -end; - -{ TGrContextOptions } - -class operator TGrContextOptions.Equal(const AContextOptions1, - AContextOptions2: TGrContextOptions): Boolean; -begin - Result := (AContextOptions1.BufferMapThreshold = AContextOptions2.BufferMapThreshold ) and - (AContextOptions1.DoManualMipmapping = AContextOptions2.DoManualMipmapping ) and - (AContextOptions1.AllowPathMaskCaching = AContextOptions2.AllowPathMaskCaching ) and - (AContextOptions1.GlyphCacheTextureMaximumBytes = AContextOptions2.GlyphCacheTextureMaximumBytes) and - (AContextOptions1.AvoidStencilBuffers = AContextOptions2.AvoidStencilBuffers ) and - (AContextOptions1.RuntimeProgramCacheSize = AContextOptions2.RuntimeProgramCacheSize ); -end; - -class operator TGrContextOptions.NotEqual(const AContextOptions1, - AContextOptions2: TGrContextOptions): Boolean; -begin - Result := not (AContextOptions1 = AContextOptions2); -end; - -{ TGrMtlBackendContext } - -constructor TGrMtlBackendContext.Create(const ADevice, AQueue, - ABinaryArchive: GrMtlHandle); -begin - Device := ADevice; - Queue := AQueue; - BinaryArchive := ABinaryArchive; -end; - -class operator TGrMtlBackendContext.Equal(const AMtlBackendContext1, - AMtlBackendContext2: TGrMtlBackendContext): Boolean; -begin - Result := (AMtlBackendContext1.Device = AMtlBackendContext2.Device ) and - (AMtlBackendContext1.Queue = AMtlBackendContext2.Queue ) and - (AMtlBackendContext1.BinaryArchive = AMtlBackendContext2.BinaryArchive); + Result := gr4d_backendtexture_is_valid(Handle); end; -class operator TGrMtlBackendContext.NotEqual(const AMtlBackendContext1, - AMtlBackendContext2: TGrMtlBackendContext): Boolean; +class procedure TGrBackendTexture.__DestroyHandle(const AHandle: THandle); begin - Result := not (AMtlBackendContext1 = AMtlBackendContext2); + gr4d_backendtexture_destroy(AHandle); end; { TGrDirectContext } procedure TGrDirectContext.AbandonContext; begin - TSkiaAPI.gr4d_directcontext_abandon_context(GetHandle); + gr4d_directcontext_abandon_context(Handle); end; procedure TGrDirectContext.DumpMemoryStatistics( @@ -4185,390 +5514,319 @@ procedure TGrDirectContext.DumpMemoryStatistics( begin if not Assigned(ATraceMemoryDump) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATraceMemoryDump']); - TSkiaAPI.gr4d_directcontext_dump_memory_statistics(GetHandle, ATraceMemoryDump.Handle); + gr4d_directcontext_dump_memory_statistics(Handle, ATraceMemoryDump.Handle); end; procedure TGrDirectContext.Flush; begin - TSkiaAPI.gr4d_directcontext_flush(GetHandle); + gr4d_directcontext_flush(Handle); end; -procedure TGrDirectContext.FlushAndSubmit(const ASyncCPU: Boolean); +procedure TGrDirectContext.FlushAndSubmit(const ASyncCpu: Boolean); begin - TSkiaAPI.gr4d_directcontext_flush_and_submit(GetHandle, ASyncCPU); + gr4d_directcontext_flush_and_submit(Handle, ASyncCpu); end; -procedure TGrDirectContext.FreeGPUResources; +procedure TGrDirectContext.FreeGpuResources; begin - TSkiaAPI.gr4d_directcontext_free_gpu_resources(GetHandle); + gr4d_directcontext_free_gpu_resources(Handle); end; function TGrDirectContext.GetBackendAPI: TGrBackendAPI; begin - Result := TGrBackendAPI(TSkiaAPI.gr4d_directcontext_get_backend_api(GetHandle)); + Result := TGrBackendAPI(gr4d_directcontext_get_backend_api(Handle)); end; function TGrDirectContext.GetMaxSurfaceSampleCountForColorType( const AColorType: TSkColorType): Integer; begin - Result := TSkiaAPI.gr4d_directcontext_get_max_surface_sample_count_for_color_type(GetHandle, sk_colortype_t(AColorType)); + Result := gr4d_directcontext_get_max_surface_sample_count_for_color_type(Handle, sk_colortype_t(AColorType)); end; function TGrDirectContext.GetResourceCacheLimit: NativeUInt; begin - Result := TSkiaAPI.gr4d_directcontext_get_resource_cache_limit(GetHandle); + Result := gr4d_directcontext_get_resource_cache_limit(Handle); end; procedure TGrDirectContext.GetResourceCacheUsage(out AResources: Integer; out AResourcesBytes: NativeUInt); begin - TSkiaAPI.gr4d_directcontext_get_resource_cache_usage(GetHandle, AResources, AResourcesBytes); + gr4d_directcontext_get_resource_cache_usage(Handle, AResources, AResourcesBytes); end; function TGrDirectContext.IsAbandoned: Boolean; begin - Result := TSkiaAPI.gr4d_directcontext_is_abandoned(GetHandle); + Result := gr4d_directcontext_is_abandoned(Handle); end; -class function TGrDirectContext.MakeGl( - AInterface: IGrGlInterface): IGrDirectContext; +class function TGrDirectContext.MakeGl(const AOptions: TGrContextOptions; + const AInterface: IGrGlInterface): IGrDirectContext; +var + LOptions: gr_contextoptions_t; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.gr4d_directcontext_make_gl(TSkBindings.SafeGetHandle(AInterface), nil)); + LOptions := TSkBindings.AsGrContextOptions(AOptions); + Result := TSkBindings.SafeCreate(gr4d_directcontext_make_gl(TSkBindings.SafeHandle(AInterface), @LOptions)); end; -class function TGrDirectContext.MakeGl(const AOptions: TGrContextOptions; - const AInterface: IGrGlInterface): IGrDirectContext; +class function TGrDirectContext.MakeGl( + AInterface: IGrGlInterface): IGrDirectContext; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.gr4d_directcontext_make_gl(TSkBindings.SafeGetHandle(AInterface), @gr_contextoptions_t(AOptions))); + Result := TSkBindings.SafeCreate(gr4d_directcontext_make_gl(TSkBindings.SafeHandle(AInterface), nil)); end; class function TGrDirectContext.MakeMetal( const ABackendContext: TGrMtlBackendContext): IGrDirectContext; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.gr4d_directcontext_make_metal(@gr_mtl_backendcontext_t(ABackendContext), nil)); + Result := TSkBindings.SafeCreate(gr4d_directcontext_make_metal(@gr_mtl_backendcontext_t(ABackendContext), nil)); end; class function TGrDirectContext.MakeMetal( const ABackendContext: TGrMtlBackendContext; const AOptions: TGrContextOptions): IGrDirectContext; +var + LOptions: gr_contextoptions_t; +begin + LOptions := TSkBindings.AsGrContextOptions(AOptions); + Result := TSkBindings.SafeCreate(gr4d_directcontext_make_metal(@gr_mtl_backendcontext_t(ABackendContext), @LOptions)); +end; + +class function TGrDirectContext.MakeVulkan( + const ABackendContext: TGrVkBackendContext; + const AOptions: TGrContextOptions): IGrDirectContext; +var + LBackendContext: gr_vk_backendcontext_t; + LOptions: gr_contextoptions_t; +begin + LBackendContext := TSkBindings.AsGrVkBackendContext(ABackendContext); + LOptions := TSkBindings.AsGrContextOptions(AOptions); + Result := TSkBindings.SafeCreate(gr4d_directcontext_make_vulkan(@LBackendContext, @LOptions)); +end; + +class function TGrDirectContext.MakeVulkan( + const ABackendContext: TGrVkBackendContext): IGrDirectContext; +var + LBackendContext: gr_vk_backendcontext_t; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.gr4d_directcontext_make_metal(@gr_mtl_backendcontext_t(ABackendContext), @gr_contextoptions_t(AOptions))); + LBackendContext := TSkBindings.AsGrVkBackendContext(ABackendContext); + Result := TSkBindings.SafeCreate(gr4d_directcontext_make_vulkan(@LBackendContext, nil)); end; procedure TGrDirectContext.PerformDeferredCleanup(const AMilliseconds: Int64); begin - TSkiaAPI.gr4d_directcontext_perform_deferred_cleanup(GetHandle, AMilliseconds); + gr4d_directcontext_perform_deferred_cleanup(Handle, AMilliseconds); end; procedure TGrDirectContext.PurgeUnlockedResources( const AScratchResourcesOnly: Boolean); begin - TSkiaAPI.gr4d_directcontext_purge_unlocked_resources(GetHandle, AScratchResourcesOnly); + gr4d_directcontext_purge_unlocked_resources(Handle, AScratchResourcesOnly); end; procedure TGrDirectContext.PurgeUnlockedResources( const ABytesToPurge: NativeUInt; const APreferScratchResources: Boolean); begin - TSkiaAPI.gr4d_directcontext_purge_unlocked_resources2(GetHandle, ABytesToPurge, APreferScratchResources); + gr4d_directcontext_purge_unlocked_resources2(Handle, ABytesToPurge, APreferScratchResources); end; procedure TGrDirectContext.ReleaseResourcesAndAbandonContext; begin - TSkiaAPI.gr4d_directcontext_release_resources_and_abandon_context(GetHandle); + gr4d_directcontext_release_resources_and_abandon_context(Handle); end; procedure TGrDirectContext.ResetContext; begin - TSkiaAPI.gr4d_directcontext_reset_context(GetHandle); + gr4d_directcontext_reset_context(Handle); end; procedure TGrDirectContext.SetResourceCacheLimit(const AValue: NativeUInt); begin - TSkiaAPI.gr4d_directcontext_set_resource_cache_limit(GetHandle, AValue); + gr4d_directcontext_set_resource_cache_limit(Handle, AValue); end; -function TGrDirectContext.Submit(const ASyncCPU: Boolean): Boolean; +function TGrDirectContext.Submit(const ASyncCpu: Boolean): Boolean; begin - Result := TSkiaAPI.gr4d_directcontext_submit(GetHandle, ASyncCPU); + Result := gr4d_directcontext_submit(Handle, ASyncCpu); end; { TGrGlInterface } -class function TGrGlInterface.get_proc(context: Pointer; - const name: MarshaledAString): Pointer; -begin - Result := TGrGlGetProc(context^)(string(name)); -end; - -function TGrGlInterface.HasExtension(const AName: string): Boolean; -begin - Result := TSkiaAPI.gr4d_gl_interface_has_extension(GetHandle, MarshaledAString(UTF8String(AName))); -end; - -class function TGrGlInterface.MakeAssembled( - const AProc: TGrGlGetProc): IGrGlInterface; -begin - if not Assigned(AProc) then - Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.gr4d_gl_interface_make_assembled(@AProc, get_proc)); -end; - -class function TGrGlInterface.MakeAssembledGl( - const AProc: TGrGlGetProc): IGrGlInterface; -begin - if not Assigned(AProc) then - Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.gr4d_gl_interface_make_assembled_gl(@AProc, get_proc)); -end; - -class function TGrGlInterface.MakeAssembledGles( - const AProc: TGrGlGetProc): IGrGlInterface; -begin - if not Assigned(AProc) then - Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.gr4d_gl_interface_make_assembled_gles(@AProc, get_proc)); -end; - -class function TGrGlInterface.MakeAssembledWebGl( - const AProc: TGrGlGetProc): IGrGlInterface; -begin - if not Assigned(AProc) then - Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.gr4d_gl_interface_make_assembled_webgl(@AProc, get_proc)); -end; - -class function TGrGlInterface.MakeNative: IGrGlInterface; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.gr4d_gl_interface_make_native()); -end; - -function TGrGlInterface.Validate: Boolean; -begin - Result := TSkiaAPI.gr4d_gl_interface_validate(GetHandle); -end; - -{ TSkBlender } - -class function TSkBlender.MakeArithmetic(const AK1, AK2, AK3, AK4: Single; - const AEnforcePremultipliedColor: Boolean): ISkBlender; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_blender_make_arithmetic(AK1, AK2, AK3, AK4, AEnforcePremultipliedColor)); -end; - -class function TSkBlender.MakeMode(const AMode: TSkBlendMode): ISkBlender; +function TGrGlInterface.HasExtension(const AName: string): Boolean; +var + LMarshaller: TMarshaller; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_blender_make_mode(sk_blendmode_t(AMode))); + Result := gr4d_gl_interface_has_extension(Handle, LMarshaller.AsUtf8(AName).ToPointer); end; -{ TSkRotationScaleMatrix } - -constructor TSkRotationScaleMatrix.Create(const ASCosinus, ASSinus, ATranslateX, - ATranslateY: Single); +class function TGrGlInterface.MakeAssembled( + const AProc: TGrGlGetProc): IGrGlInterface; begin - SCosinus := ASCosinus; - SSinus := ASSinus; - TranslateX := ATranslateX; - TranslateY := ATranslateY; + if not Assigned(AProc) then + Exit(nil); + Result := TSkBindings.SafeCreate(gr4d_gl_interface_make_assembled(@AProc, TSkBindings.__gr_gl_get_proc)); end; -class function TSkRotationScaleMatrix.CreateDegrees(const AScale, ADegrees, - ATranslateX, ATranslateY, AAnchorX, AAnchorY: Single): TSkRotationScaleMatrix; +class function TGrGlInterface.MakeAssembledGl( + const AProc: TGrGlGetProc): IGrGlInterface; begin - SinCos(DegToRad(ADegrees), Result.SSinus, Result.SCosinus); - Result.SSinus := Result.SSinus * AScale; - Result.SCosinus := Result.SCosinus * AScale; - Result.TranslateX := ATranslateX + -Result.SCosinus * AAnchorX + Result.SSinus * AAnchorY; - Result.TranslateY := ATranslateY + -Result.SSinus * AAnchorX - Result.SCosinus * AAnchorY; + if not Assigned(AProc) then + Exit(nil); + Result := TSkBindings.SafeCreate(gr4d_gl_interface_make_assembled_gl(@AProc, TSkBindings.__gr_gl_get_proc)); end; -class function TSkRotationScaleMatrix.CreateRadians(const AScale, ARadians, - ATranslateX, ATranslateY, AAnchorX, AAnchorY: Single): TSkRotationScaleMatrix; +class function TGrGlInterface.MakeAssembledGles( + const AProc: TGrGlGetProc): IGrGlInterface; begin - SinCos(ARadians, Result.SSinus, Result.SCosinus); - Result.SSinus := Result.SSinus * AScale; - Result.SCosinus := Result.SCosinus * AScale; - Result.TranslateX := ATranslateX + -Result.SCosinus * AAnchorX + Result.SSinus * AAnchorY; - Result.TranslateY := ATranslateY + -Result.SSinus * AAnchorX - Result.SCosinus * AAnchorY; + if not Assigned(AProc) then + Exit(nil); + Result := TSkBindings.SafeCreate(gr4d_gl_interface_make_assembled_gles(@AProc, TSkBindings.__gr_gl_get_proc)); end; -class operator TSkRotationScaleMatrix.Equal(const ARotationScaleMatrix1, - ARotationScaleMatrix2: TSkRotationScaleMatrix): Boolean; +class function TGrGlInterface.MakeAssembledWebGl( + const AProc: TGrGlGetProc): IGrGlInterface; begin - Result := (SameValue(ARotationScaleMatrix1.SCosinus, ARotationScaleMatrix2.SCosinus, Epsilon)) and - (SameValue(ARotationScaleMatrix1.SSinus, ARotationScaleMatrix2.SSinus, Epsilon)) and - (SameValue(ARotationScaleMatrix1.TranslateX, ARotationScaleMatrix2.TranslateX, Epsilon)) and - (SameValue(ARotationScaleMatrix1.TranslateY, ARotationScaleMatrix2.TranslateY, Epsilon)); + if not Assigned(AProc) then + Exit(nil); + Result := TSkBindings.SafeCreate(gr4d_gl_interface_make_assembled_webgl(@AProc, TSkBindings.__gr_gl_get_proc)); end; -class operator TSkRotationScaleMatrix.Implicit( - const ARotationScaleMatrix: TSkRotationScaleMatrix): TMatrix; +class function TGrGlInterface.MakeNative: IGrGlInterface; begin - Result.m11 := ARotationScaleMatrix.SCosinus; - Result.m12 := ARotationScaleMatrix.SSinus; - Result.m13 := 0; - Result.m21 := -ARotationScaleMatrix.SSinus; - Result.m22 := ARotationScaleMatrix.SCosinus; - Result.m23 := 0; - Result.m31 := ARotationScaleMatrix.TranslateX; - Result.m32 := ARotationScaleMatrix.TranslateY; - Result.m33 := 1; + Result := TSkBindings.SafeCreate(gr4d_gl_interface_make_native()); end; -class operator TSkRotationScaleMatrix.NotEqual(const ARotationScaleMatrix1, - ARotationScaleMatrix2: TSkRotationScaleMatrix): Boolean; +function TGrGlInterface.Validate: Boolean; begin - Result := not (ARotationScaleMatrix1 = ARotationScaleMatrix2); + Result := gr4d_gl_interface_validate(Handle); end; -{ TSkCubicResampler } +{ TGrPersistentCacheBaseClass } -constructor TSkCubicResampler.Create(const AB, AC: Single); +class constructor TGrPersistentCacheBaseClass.Create; +var + LProcs: gr_persistentcachebaseclass_procs_t; begin - B := AB; - C := AC; + LProcs.load := load_proc; + LProcs.store := store_proc; + gr4d_persistentcachebaseclass_set_procs(@LProcs); end; -class operator TSkCubicResampler.Equal(const ACubicResampler1, - ACubicResampler2: TSkCubicResampler): Boolean; +constructor TGrPersistentCacheBaseClass.Create; begin - Result := (SameValue(ACubicResampler1.B, ACubicResampler2.B, Epsilon)) and - (SameValue(ACubicResampler1.C, ACubicResampler2.C, Epsilon)); + inherited Create(gr4d_persistentcachebaseclass_create(Self)); end; -class operator TSkCubicResampler.NotEqual(const ACubicResampler1, - ACubicResampler2: TSkCubicResampler): Boolean; +class function TGrPersistentCacheBaseClass.load_proc(context: Pointer; + const key_data: Pointer; key_size: size_t): sk_data_t; +var + LKey: TBytes; begin - Result := not (ACubicResampler1 = ACubicResampler2); + SetLength(LKey, key_size); + Move(key_data^, LKey[0], Length(LKey)); + Result := TSkObject.__ReleaseHandle(TSkData.MakeFromBytes(TGrPersistentCacheBaseClass(context).Load(LKey))); end; -{ TSkSamplingOptions } - -constructor TSkSamplingOptions.Create(const ACubic: TSkCubicResampler); +class procedure TGrPersistentCacheBaseClass.store_proc(context: Pointer; + const key_data: Pointer; key_size: size_t; const data: Pointer; size: size_t); +var + LData: TBytes; + LKey: TBytes; begin - FUseCubic := True; - FCubic := ACubic; - FFilter := TSkFilterMode.Nearest; - FMipmap := TSkMipmapMode.None; + SetLength(LKey, key_size); + Move(key_data^, LKey[0], Length(LKey)); + SetLength(LData, size); + Move(data^, LData[0], Length(LData)); + TGrPersistentCacheBaseClass(context).Store(LKey, LData); end; -constructor TSkSamplingOptions.Create(const AFilter: TSkFilterMode; - const AMipmap: TSkMipmapMode); +class procedure TGrPersistentCacheBaseClass.__DestroyHandle( + const AHandle: THandle); begin - FUseCubic := False; - FCubic := TSkCubicResampler.Create(0, 0); - FFilter := AFilter; - FMipmap := AMipmap; + gr4d_persistentcachebaseclass_destroy(AHandle); end; -class operator TSkSamplingOptions.Equal(const ASamplingOptions1, - ASamplingOptions2: TSkSamplingOptions): Boolean; +{ TGrShaderErrorHandlerBaseClass } + +class procedure TGrShaderErrorHandlerBaseClass.compile_error_proc( + context: Pointer; const shader, errors: MarshaledAString); begin - Result := (ASamplingOptions1.FUseCubic = ASamplingOptions2.FUseCubic) and - (ASamplingOptions1.FCubic = ASamplingOptions2.FCubic ) and - (ASamplingOptions1.FFilter = ASamplingOptions2.FFilter ) and - (ASamplingOptions1.FMipmap = ASamplingOptions2.FMipmap ); + TGrShaderErrorHandlerBaseClass(context).CompileError(string(shader), string(errors)); end; -class operator TSkSamplingOptions.NotEqual(const ASamplingOptions1, - ASamplingOptions2: TSkSamplingOptions): Boolean; +class constructor TGrShaderErrorHandlerBaseClass.Create; +var + LProcs: gr_shadererrorhandlerbaseclass_procs_t; begin - Result := not (ASamplingOptions1 = ASamplingOptions2); + LProcs.compile_error := compile_error_proc; + gr4d_shadererrorhandlerbaseclass_set_procs(@LProcs); end; -{ TSkLattice } - -constructor TSkLattice.Create(const AXDivs, AYDivs: TArray; - ABounds: TRect; const ARectTypes: TArray; - const AColors: TArray); +constructor TGrShaderErrorHandlerBaseClass.Create; begin - if Length(AXDivs) < 1 then - raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AXDivs']); - if Length(AYDivs) < 1 then - raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AYDivs']); - if (Length(ARectTypes) > 0) then - begin - if Length(ARectTypes) <> ((Length(AXDivs) + 1) * (Length(AYDivs) + 1)) then - raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['ARectTypes']); - if Length(AColors) <> Length(ARectTypes) then - raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['AColors']); - end; - FXDivs := AXDivs; - FYDivs := AYDivs; - FRectTypes := ARectTypes; - FColors := AColors; - FUseBounds := True; - FBounds := ABounds; + inherited Create(gr4d_shadererrorhandlerbaseclass_create(Self)); end; -constructor TSkLattice.Create(const AXDivs, AYDivs: TArray; - const ARectTypes: TArray; - const AColors: TArray); +class procedure TGrShaderErrorHandlerBaseClass.__DestroyHandle( + const AHandle: THandle); begin - if Length(AXDivs) < 1 then - raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AXDivs']); - if Length(AYDivs) < 1 then - raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AYDivs']); - if (Length(ARectTypes) > 0) then - begin - if Length(ARectTypes) <> ((Length(AXDivs) + 1) * (Length(AYDivs) + 1)) then - raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['ARectTypes']); - if Length(AColors) <> Length(ARectTypes) then - raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['AColors']); - end; - FXDivs := AXDivs; - FYDivs := AYDivs; - FRectTypes := ARectTypes; - FColors := AColors; - FUseBounds := False; + gr4d_shadererrorhandlerbaseclass_destroy(AHandle); end; -class operator TSkLattice.Equal(const ALattice1, - ALattice2: TSkLattice): Boolean; +{ TGrVkExtensions } + +constructor TGrVkExtensions.Create; begin - Result := (ALattice1.FXDivs = ALattice2.FXDivs ) and - (ALattice1.FYDivs = ALattice2.FYDivs ) and - (ALattice1.FRectTypes = ALattice2.FRectTypes) and - (ALattice1.FColors = ALattice2.FColors ) and - (ALattice1.FUseBounds = ALattice2.FUseBounds) and - ((not ALattice1.FUseBounds) or (ALattice1.Bounds = ALattice2.Bounds)); + inherited Create(gr4d_vk_extensions_create()); end; -function TSkLattice.GetColors: TArray; +function TGrVkExtensions.HasExtension(const AName: string; + const AMinVersion: Cardinal): Boolean; +var + LMarshaller: TMarshaller; begin - Result := Copy(FColors); + Result := gr4d_vk_extensions_has_extension(Handle, LMarshaller.AsUtf8(AName).ToPointer, AMinVersion); end; -function TSkLattice.GetRectTypes: TArray; +procedure TGrVkExtensions.Init(const AProc: TGrVkGetProc; + const AInstance: GrVkInstance; const APhysicalDevice: GrVkPhysicalDevice; + const AInstanceExtensions, ADeviceExtensions: TArray); begin - Result := Copy(FRectTypes); + if not Assigned(AProc) then + Exit; + TSkBindings.SetStrings(Handle, AInstanceExtensions, ADeviceExtensions, + procedure (const AHandle: THandle; const AStrings1, AStrings2: PMarshaledAString) + begin + gr4d_vk_extensions_init(Handle, @AProc, TSkBindings.__gr_vk_get_proc, AInstance, APhysicalDevice, AStrings1, Length(AInstanceExtensions), AStrings2, Length(ADeviceExtensions)); + end); end; -function TSkLattice.GetXDivs: TArray; +class procedure TGrVkExtensions.__DestroyHandle(const AHandle: THandle); begin - Result := Copy(FXDivs); + gr4d_vk_extensions_destroy(AHandle); end; -function TSkLattice.GetYDivs: TArray; +{ TSkBlender } + +class function TSkBlender.MakeArithmetic(const AK1, AK2, AK3, AK4: Single; + const AEnforcePremultipliedColor: Boolean): ISkBlender; begin - Result := Copy(FYDivs); + Result := TSkBindings.SafeCreate(sk4d_blender_make_arithmetic(AK1, AK2, AK3, AK4, AEnforcePremultipliedColor)); end; -class operator TSkLattice.NotEqual(const ALattice1, - ALattice2: TSkLattice): Boolean; +class function TSkBlender.MakeMode(const AMode: TSkBlendMode): ISkBlender; begin - Result := not (ALattice1 = ALattice2); + Result := TSkBindings.SafeCreate(sk4d_blender_make_mode(sk_blendmode_t(AMode))); end; { TSkCanvas } procedure TSkCanvas.Clear(const AColor: TAlphaColor); begin - TSkiaAPI.sk4d_canvas_clear(GetHandle, AColor); + sk4d_canvas_clear(Handle, AColor); end; procedure TSkCanvas.Clear(const AColor: TAlphaColorF); begin - TSkiaAPI.sk4d_canvas_clear2(GetHandle, @sk_color4f_t(AColor)); + sk4d_canvas_clear2(Handle, @sk_color4f_t(AColor)); end; procedure TSkCanvas.ClipPath(const APath: ISkPath; const AOp: TSkClipOp; @@ -4576,20 +5834,20 @@ procedure TSkCanvas.ClipPath(const APath: ISkPath; const AOp: TSkClipOp; begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - TSkiaAPI.sk4d_canvas_clip_path(GetHandle, APath.Handle, sk_clipop_t(AOp), AAntiAlias); + sk4d_canvas_clip_path(Handle, APath.Handle, sk_clipop_t(AOp), AAntiAlias); end; procedure TSkCanvas.ClipRect(const ARect: TRectF; const AOp: TSkClipOp; const AAntiAlias: Boolean); begin - TSkiaAPI.sk4d_canvas_clip_rect(GetHandle, @sk_rect_t(ARect), sk_clipop_t(AOp), AAntiAlias); + sk4d_canvas_clip_rect(Handle, @sk_rect_t(ARect), sk_clipop_t(AOp), AAntiAlias); end; procedure TSkCanvas.ClipRegion(const ARegion: ISkRegion; const AOp: TSkClipOp); begin if not Assigned(ARegion) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); - TSkiaAPI.sk4d_canvas_clip_region(GetHandle, ARegion.Handle, sk_clipop_t(AOp)); + sk4d_canvas_clip_region(Handle, ARegion.Handle, sk_clipop_t(AOp)); end; procedure TSkCanvas.ClipRoundRect(const ARoundRect: ISkRoundRect; @@ -4597,45 +5855,44 @@ procedure TSkCanvas.ClipRoundRect(const ARoundRect: ISkRoundRect; begin if not Assigned(ARoundRect) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARoundRect']); - TSkiaAPI.sk4d_canvas_clip_rrect(GetHandle, ARoundRect.Handle, sk_clipop_t(AOp), AAntiAlias); + sk4d_canvas_clip_rrect(Handle, ARoundRect.Handle, sk_clipop_t(AOp), AAntiAlias); end; procedure TSkCanvas.ClipShader(const AShader: ISkShader; const AOp: TSkClipOp); begin if not Assigned(AShader) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AShader']); - TSkiaAPI.sk4d_canvas_clip_shader(GetHandle, AShader.Handle, sk_clipop_t(AOp)); + sk4d_canvas_clip_shader(Handle, AShader.Handle, sk_clipop_t(AOp)); end; procedure TSkCanvas.Concat(const AMatrix: TMatrix); begin - TSkiaAPI.sk4d_canvas_concat2(GetHandle, @sk_matrix_t(AMatrix)); + sk4d_canvas_concat2(Handle, @sk_matrix_t(AMatrix)); end; procedure TSkCanvas.Concat(const AMatrix: TMatrix3D); begin - TSkiaAPI.sk4d_canvas_concat(GetHandle, @sk_matrix44_t(AMatrix)); -end; - -class procedure TSkCanvas.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_canvas_destroy(AHandle); + sk4d_canvas_concat(Handle, @sk_matrix44_t(AMatrix)); end; procedure TSkCanvas.Discard; begin - TSkiaAPI.sk4d_canvas_discard(GetHandle); + sk4d_canvas_discard(Handle); end; procedure TSkCanvas.DrawAnnotation(const ARect: TRectF; const AKey: string; const AValue; const ASize: NativeUInt); +var + LMarshaller: TMarshaller; begin - TSkiaAPI.sk4d_canvas_draw_annotation(GetHandle, @sk_rect_t(ARect), MarshaledAString(UTF8String(AKey)), @AValue, ASize); + sk4d_canvas_draw_annotation(Handle, @sk_rect_t(ARect), LMarshaller.AsUtf8(AKey).ToPointer, @AValue, ASize); end; procedure TSkCanvas.DrawAnnotation(const ARect: TRectF; const AKey: string); +var + LMarshaller: TMarshaller; begin - TSkiaAPI.sk4d_canvas_draw_annotation(GetHandle, @sk_rect_t(ARect), MarshaledAString(UTF8String(AKey)), nil, 0); + sk4d_canvas_draw_annotation(Handle, @sk_rect_t(ARect), LMarshaller.AsUtf8(AKey).ToPointer, nil, 0); end; procedure TSkCanvas.DrawArc(const AOval: TRectF; const AStartAngle, @@ -4643,7 +5900,7 @@ procedure TSkCanvas.DrawArc(const AOval: TRectF; const AStartAngle, begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_arc(GetHandle, @sk_rect_t(AOval), AStartAngle, ASweepAngle, AUseCenter, APaint.Handle); + sk4d_canvas_draw_arc(Handle, @sk_rect_t(AOval), AStartAngle, ASweepAngle, AUseCenter, APaint.Handle); end; procedure TSkCanvas.DrawAtlas(const AAtlas: ISkImage; @@ -4668,7 +5925,16 @@ procedure TSkCanvas.DrawAtlas(const AAtlas: ISkImage; end else LColors := nil; - TSkiaAPI.sk4d_canvas_draw_atlas(GetHandle, AAtlas.Handle, @sk_rotationscalematrix_t(ATansforms[0]), @sk_rect_t(ASprites[0]), LColors, Length(ATansforms), sk_blendmode_t(ABlendMode), @sk_samplingoptions_t(ASampling), nil, TSkBindings.SafeGetHandle(APaint)); + sk4d_canvas_draw_atlas(Handle, AAtlas.Handle, @sk_rotationscalematrix_t(ATansforms[0]), @sk_rect_t(ASprites[0]), LColors, Length(ATansforms), sk_blendmode_t(ABlendMode), @sk_samplingoptions_t(ASampling), nil, TSkBindings.SafeHandle(APaint)); +end; + +procedure TSkCanvas.DrawAtlas(const AAtlas: ISkImage; + const ATansforms: TArray; + const ASprites: TArray; const ABlendMode: TSkBlendMode; + const ACullRect: TRectF; const AColors: TArray; + const APaint: ISkPaint); +begin + DrawAtlas(AAtlas, ATansforms, ASprites, ABlendMode, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), ACullRect, AColors, APaint); end; procedure TSkCanvas.DrawAtlas(const AAtlas: ISkImage; @@ -4693,7 +5959,7 @@ procedure TSkCanvas.DrawAtlas(const AAtlas: ISkImage; end else LColors := nil; - TSkiaAPI.sk4d_canvas_draw_atlas(GetHandle, AAtlas.Handle, @sk_rotationscalematrix_t(ATansforms[0]), @sk_rect_t(ASprites[0]), LColors, Length(ATansforms), sk_blendmode_t(ABlendMode), @sk_samplingoptions_t(ASampling), @sk_rect_t(ACullRect), TSkBindings.SafeGetHandle(APaint)); + sk4d_canvas_draw_atlas(Handle, AAtlas.Handle, @sk_rotationscalematrix_t(ATansforms[0]), @sk_rect_t(ASprites[0]), LColors, Length(ATansforms), sk_blendmode_t(ABlendMode), @sk_samplingoptions_t(ASampling), @sk_rect_t(ACullRect), TSkBindings.SafeHandle(APaint)); end; procedure TSkCanvas.DrawAtlas(const AAtlas: ISkImage; @@ -4704,21 +5970,12 @@ procedure TSkCanvas.DrawAtlas(const AAtlas: ISkImage; DrawAtlas(AAtlas, ATansforms, ASprites, ABlendMode, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), AColors, APaint); end; -procedure TSkCanvas.DrawAtlas(const AAtlas: ISkImage; - const ATansforms: TArray; - const ASprites: TArray; const ABlendMode: TSkBlendMode; - const ACullRect: TRectF; const AColors: TArray; - const APaint: ISkPaint); -begin - DrawAtlas(AAtlas, ATansforms, ASprites, ABlendMode, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), ACullRect, AColors, APaint); -end; - procedure TSkCanvas.DrawCircle(const ACenter: TPointF; ARadius: Single; const APaint: ISkPaint); begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_circle(GetHandle, @sk_point_t(ACenter), ARadius, APaint.Handle); + sk4d_canvas_draw_circle(Handle, @sk_point_t(ACenter), ARadius, APaint.Handle); end; procedure TSkCanvas.DrawCircle(const ACenterX, ACenterY, ARadius: Single; @@ -4727,16 +5984,16 @@ procedure TSkCanvas.DrawCircle(const ACenterX, ACenterY, ARadius: Single; DrawCircle(TPointF.Create(ACenterX, ACenterY), ARadius, APaint); end; -procedure TSkCanvas.DrawColor(const AColor: TAlphaColor; +procedure TSkCanvas.DrawColor(const AColor: TAlphaColorF; const ABlendMode: TSkBlendMode); begin - TSkiaAPI.sk4d_canvas_draw_color(GetHandle, AColor, sk_blendmode_t(ABlendMode)); + sk4d_canvas_draw_color2(Handle, @sk_color4f_t(AColor), sk_blendmode_t(ABlendMode)); end; -procedure TSkCanvas.DrawColor(const AColor: TAlphaColorF; +procedure TSkCanvas.DrawColor(const AColor: TAlphaColor; const ABlendMode: TSkBlendMode); begin - TSkiaAPI.sk4d_canvas_draw_color2(GetHandle, @sk_color4f_t(AColor), sk_blendmode_t(ABlendMode)); + sk4d_canvas_draw_color(Handle, AColor, sk_blendmode_t(ABlendMode)); end; procedure TSkCanvas.DrawGlyphs(const AGlyphs: TArray; @@ -4750,7 +6007,7 @@ procedure TSkCanvas.DrawGlyphs(const AGlyphs: TArray; if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); if Length(AGlyphs) > 0 then - TSkiaAPI.sk4d_canvas_draw_glyphs2(GetHandle, Length(AGlyphs), @AGlyphs[0], @sk_rotationscalematrix_t(AMatrices[0]), @sk_point_t(AOrigin), AFont.Handle, APaint.Handle); + sk4d_canvas_draw_glyphs2(Handle, Length(AGlyphs), @AGlyphs[0], @sk_rotationscalematrix_t(AMatrices[0]), @sk_point_t(AOrigin), AFont.Handle, APaint.Handle); end; procedure TSkCanvas.DrawGlyphs(const AGlyphs: TArray; @@ -4764,7 +6021,7 @@ procedure TSkCanvas.DrawGlyphs(const AGlyphs: TArray; if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); if Length(AGlyphs) > 0 then - TSkiaAPI.sk4d_canvas_draw_glyphs(GetHandle, Length(AGlyphs), @AGlyphs[0], @sk_point_t(APositions[0]), @sk_point_t(AOrigin), AFont.Handle, APaint.Handle); + sk4d_canvas_draw_glyphs(Handle, Length(AGlyphs), @AGlyphs[0], @sk_point_t(APositions[0]), @sk_point_t(AOrigin), AFont.Handle, APaint.Handle); end; procedure TSkCanvas.DrawImage(const AImage: ISkImage; const AX, AY: Single; @@ -4778,7 +6035,7 @@ procedure TSkCanvas.DrawImage(const AImage: ISkImage; const AX, AY: Single; begin if not Assigned(AImage) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AImage']); - TSkiaAPI.sk4d_canvas_draw_image(GetHandle, AImage.Handle, AX, AY, @sk_samplingoptions_t(ASampling), TSkBindings.SafeGetHandle(APaint)); + sk4d_canvas_draw_image(Handle, AImage.Handle, AX, AY, @sk_samplingoptions_t(ASampling), TSkBindings.SafeHandle(APaint)); end; procedure TSkCanvas.DrawImageLattice(const AImage: ISkImage; @@ -4789,8 +6046,8 @@ procedure TSkCanvas.DrawImageLattice(const AImage: ISkImage; begin if not Assigned(AImage) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AImage']); - LLattice := TSkMapping.AsLattice(ALattice); - TSkiaAPI.sk4d_canvas_draw_image_lattice(GetHandle, AImage.Handle, @LLattice, @sk_rect_t(ADest), sk_filtermode_t(AFilterMode), TSkBindings.SafeGetHandle(APaint)); + LLattice := TSkBindings.AsLattice(ALattice); + sk4d_canvas_draw_image_lattice(Handle, AImage.Handle, @LLattice, @sk_rect_t(ADest), sk_filtermode_t(AFilterMode), TSkBindings.SafeHandle(APaint)); end; procedure TSkCanvas.DrawImageNine(const AImage: ISkImage; const ACenter: TRect; @@ -4799,20 +6056,7 @@ procedure TSkCanvas.DrawImageNine(const AImage: ISkImage; const ACenter: TRect; begin if not Assigned(AImage) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AImage']); - TSkiaAPI.sk4d_canvas_draw_image_nine(GetHandle, AImage.Handle, @sk_irect_t(ACenter), @sk_rect_t(ADest), sk_filtermode_t(AFilterMode), TSkBindings.SafeGetHandle(APaint)); -end; - -procedure TSkCanvas.DrawImageRect(const AImage: ISkImage; const ASrc, - ADest: TRectF; const APaint: ISkPaint; - const AConstraint: TSkSrcRectConstraint); -begin - DrawImageRect(AImage, ASrc, ADest, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), APaint, AConstraint); -end; - -procedure TSkCanvas.DrawImageRect(const AImage: ISkImage; const ADest: TRectF; - const APaint: ISkPaint; const AConstraint: TSkSrcRectConstraint); -begin - DrawImageRect(AImage, ADest, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), APaint, AConstraint); + sk4d_canvas_draw_image_nine(Handle, AImage.Handle, @sk_irect_t(ACenter), @sk_rect_t(ADest), sk_filtermode_t(AFilterMode), TSkBindings.SafeHandle(APaint)); end; procedure TSkCanvas.DrawImageRect(const AImage: ISkImage; const ADest: TRectF; @@ -4828,7 +6072,20 @@ procedure TSkCanvas.DrawImageRect(const AImage: ISkImage; const ASrc, begin if not Assigned(AImage) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AImage']); - TSkiaAPI.sk4d_canvas_draw_image_rect(GetHandle, AImage.Handle, @sk_rect_t(ASrc), @sk_rect_t(ADest), @sk_samplingoptions_t(ASampling), TSkBindings.SafeGetHandle(APaint), sk_srcrectconstraint_t(AConstraint)); + sk4d_canvas_draw_image_rect(Handle, AImage.Handle, @sk_rect_t(ASrc), @sk_rect_t(ADest), @sk_samplingoptions_t(ASampling), TSkBindings.SafeHandle(APaint), sk_srcrectconstraint_t(AConstraint)); +end; + +procedure TSkCanvas.DrawImageRect(const AImage: ISkImage; const ASrc, + ADest: TRectF; const APaint: ISkPaint; + const AConstraint: TSkSrcRectConstraint); +begin + DrawImageRect(AImage, ASrc, ADest, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), APaint, AConstraint); +end; + +procedure TSkCanvas.DrawImageRect(const AImage: ISkImage; const ADest: TRectF; + const APaint: ISkPaint; const AConstraint: TSkSrcRectConstraint); +begin + DrawImageRect(AImage, ADest, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), APaint, AConstraint); end; procedure TSkCanvas.DrawLine(const APoint1, APoint2: TPointF; @@ -4836,7 +6093,7 @@ procedure TSkCanvas.DrawLine(const APoint1, APoint2: TPointF; begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_line(GetHandle, @sk_point_t(APoint1), @sk_point_t(APoint2), APaint.Handle); + sk4d_canvas_draw_line(Handle, @sk_point_t(APoint1), @sk_point_t(APoint2), APaint.Handle); end; procedure TSkCanvas.DrawLine(const AX1, AY1, AX2, AY2: Single; @@ -4849,14 +6106,14 @@ procedure TSkCanvas.DrawOval(const AOval: TRectF; const APaint: ISkPaint); begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_oval(GetHandle, @sk_rect_t(AOval), APaint.Handle); + sk4d_canvas_draw_oval(Handle, @sk_rect_t(AOval), APaint.Handle); end; procedure TSkCanvas.DrawPaint(const APaint: ISkPaint); begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_paint(GetHandle, APaint.Handle); + sk4d_canvas_draw_paint(Handle, APaint.Handle); end; procedure TSkCanvas.DrawPatch(const ACubics: TSkPatchCubics; @@ -4865,7 +6122,7 @@ procedure TSkCanvas.DrawPatch(const ACubics: TSkPatchCubics; begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_patch(GetHandle, @sk_point_t(ACubics[0]), @AColors[0], @sk_point_t(ATexCoords[0]), sk_blendmode_t(ABlendMode), APaint.Handle); + sk4d_canvas_draw_patch(Handle, @sk_point_t(ACubics[0]), @AColors[0], @sk_point_t(ATexCoords[0]), sk_blendmode_t(ABlendMode), APaint.Handle); end; procedure TSkCanvas.DrawPath(const APath: ISkPath; const APaint: ISkPaint); @@ -4874,35 +6131,35 @@ procedure TSkCanvas.DrawPath(const APath: ISkPath; const APaint: ISkPaint); raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_path(GetHandle, APath.Handle, APaint.Handle); + sk4d_canvas_draw_path(Handle, APath.Handle, APaint.Handle); end; procedure TSkCanvas.DrawPicture(const APicture: ISkPicture; - const AMatrix: TMatrix; const APaint: ISkPaint); + const APaint: ISkPaint); begin if not Assigned(APicture) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APicture']); - TSkiaAPI.sk4d_canvas_draw_picture(GetHandle, APicture.Handle, @sk_matrix_t(AMatrix), TSkBindings.SafeGetHandle(APaint)); + sk4d_canvas_draw_picture(Handle, APicture.Handle, nil, TSkBindings.SafeHandle(APaint)); end; procedure TSkCanvas.DrawPicture(const APicture: ISkPicture; - const APaint: ISkPaint); + const AMatrix: TMatrix; const APaint: ISkPaint); begin if not Assigned(APicture) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APicture']); - TSkiaAPI.sk4d_canvas_draw_picture(GetHandle, APicture.Handle, nil, TSkBindings.SafeGetHandle(APaint)); -end; - -procedure TSkCanvas.DrawPoint(const AX, AY: Single; const APaint: ISkPaint); -begin - DrawPoint(TPointF.Create(AX, AY), APaint); + sk4d_canvas_draw_picture(Handle, APicture.Handle, @sk_matrix_t(AMatrix), TSkBindings.SafeHandle(APaint)); end; procedure TSkCanvas.DrawPoint(const APoint: TPointF; const APaint: ISkPaint); begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_point(GetHandle, @sk_point_t(APoint), APaint.Handle); + sk4d_canvas_draw_point(Handle, @sk_point_t(APoint), APaint.Handle); +end; + +procedure TSkCanvas.DrawPoint(const AX, AY: Single; const APaint: ISkPaint); +begin + DrawPoint(TPointF.Create(AX, AY), APaint); end; procedure TSkCanvas.DrawPoints(const AMode: TSkDrawPointsMode; @@ -4911,14 +6168,14 @@ procedure TSkCanvas.DrawPoints(const AMode: TSkDrawPointsMode; if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); if Length(APoints) > 0 then - TSkiaAPI.sk4d_canvas_draw_points(GetHandle, sk_drawpointsmode_t(AMode), Length(APoints), @sk_point_t(APoints[0]), APaint.Handle); + sk4d_canvas_draw_points(Handle, sk_drawpointsmode_t(AMode), Length(APoints), @sk_point_t(APoints[0]), APaint.Handle); end; procedure TSkCanvas.DrawRect(const ARect: TRectF; const APaint: ISkPaint); begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_rect(GetHandle, @sk_rect_t(ARect), APaint.Handle); + sk4d_canvas_draw_rect(Handle, @sk_rect_t(ARect), APaint.Handle); end; procedure TSkCanvas.DrawRegion(const ARegion: ISkRegion; @@ -4928,25 +6185,25 @@ procedure TSkCanvas.DrawRegion(const ARegion: ISkRegion; raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_region(GetHandle, ARegion.Handle, APaint.Handle); + sk4d_canvas_draw_region(Handle, ARegion.Handle, APaint.Handle); end; -procedure TSkCanvas.DrawRoundRect(const ARoundRect: ISkRoundRect; - const APaint: ISkPaint); +procedure TSkCanvas.DrawRoundRect(const ARect: TRectF; const ARadiusX, + ARadiusY: Single; const APaint: ISkPaint); begin - if not Assigned(ARoundRect) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARoundRect']); if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_rrect(GetHandle, ARoundRect.Handle, APaint.Handle); + sk4d_canvas_draw_rrect2(Handle, @sk_rect_t(ARect), ARadiusX, ARadiusY, APaint.Handle); end; -procedure TSkCanvas.DrawRoundRect(const ARect: TRectF; const ARadiusX, - ARadiusY: Single; const APaint: ISkPaint); +procedure TSkCanvas.DrawRoundRect(const ARoundRect: ISkRoundRect; + const APaint: ISkPaint); begin + if not Assigned(ARoundRect) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARoundRect']); if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_rrect2(GetHandle, @sk_rect_t(ARect), ARadiusX, ARadiusY, APaint.Handle); + sk4d_canvas_draw_rrect(Handle, ARoundRect.Handle, APaint.Handle); end; procedure TSkCanvas.DrawRoundRectDifference(const AOuter, AInner: ISkRoundRect; @@ -4958,7 +6215,7 @@ procedure TSkCanvas.DrawRoundRectDifference(const AOuter, AInner: ISkRoundRect; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AInner']); if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_rrect_difference(GetHandle, AOuter.Handle, AInner.Handle, APaint.Handle); + sk4d_canvas_draw_rrect_difference(Handle, AOuter.Handle, AInner.Handle, APaint.Handle); end; procedure TSkCanvas.DrawSimpleText(const AText: string; const AX, AY: Single; @@ -4969,7 +6226,7 @@ procedure TSkCanvas.DrawSimpleText(const AText: string; const AX, AY: Single; if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); if not AText.IsEmpty then - TSkiaAPI.sk4d_canvas_draw_simple_text(GetHandle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING, AX, AY, AFont.Handle, APaint.Handle); + sk4d_canvas_draw_simple_text(Handle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING, AX, AY, AFont.Handle, APaint.Handle); end; procedure TSkCanvas.DrawSimpleTextGlyphs(const AGlyphs: TArray; const AX, @@ -4980,7 +6237,7 @@ procedure TSkCanvas.DrawSimpleTextGlyphs(const AGlyphs: TArray; const AX, if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); if Length(AGlyphs) > 0 then - TSkiaAPI.sk4d_canvas_draw_simple_text(GetHandle, @AGlyphs[Low(AGlyphs)], Length(AGlyphs) * SizeOf(Word), sk_textencoding_t.GLYPH_ID_SK_TEXTENCODING, AX, AY, AFont.Handle, APaint.Handle); + sk4d_canvas_draw_simple_text(Handle, @AGlyphs[Low(AGlyphs)], Length(AGlyphs) * SizeOf(Word), sk_textencoding_t.GLYPH_ID_SK_TEXTENCODING, AX, AY, AFont.Handle, APaint.Handle); end; procedure TSkCanvas.DrawTextBlob(const ATextBlob: ISkTextBlob; const AX, @@ -4990,7 +6247,7 @@ procedure TSkCanvas.DrawTextBlob(const ATextBlob: ISkTextBlob; const AX, raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATextBlob']); if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_text_blob(GetHandle, ATextBlob.Handle, AX, AY, APaint.Handle); + sk4d_canvas_draw_text_blob(Handle, ATextBlob.Handle, AX, AY, APaint.Handle); end; procedure TSkCanvas.DrawVertices(const AVertices: ISkVertices; @@ -5000,69 +6257,105 @@ procedure TSkCanvas.DrawVertices(const AVertices: ISkVertices; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AVertices']); if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_canvas_draw_vertices(GetHandle, AVertices.Handle, sk_blendmode_t(ABlendMode), APaint.Handle); + sk4d_canvas_draw_vertices(Handle, AVertices.Handle, sk_blendmode_t(ABlendMode), APaint.Handle); +end; + +function TSkCanvas.GetBaseProperties: TSkSurfaceProperties; +var + LResult: sk_surfaceprops_t; +begin + sk4d_canvas_get_base_props(Handle, LResult); + Result := TSkBindings.ToSurfaceProperties(LResult); end; function TSkCanvas.GetDeviceClipBounds: TRect; begin - TSkiaAPI.sk4d_canvas_get_device_clip_bounds(GetHandle, sk_irect_t(Result)); + sk4d_canvas_get_device_clip_bounds(Handle, sk_irect_t(Result)); end; function TSkCanvas.GetLocalClipBounds: TRectF; begin - TSkiaAPI.sk4d_canvas_get_local_clip_bounds(GetHandle, sk_rect_t(Result)); + sk4d_canvas_get_local_clip_bounds(Handle, sk_rect_t(Result)); end; function TSkCanvas.GetLocalToDevice: TMatrix3D; begin - TSkiaAPI.sk4d_canvas_get_local_to_device(GetHandle, sk_matrix44_t(Result)); + sk4d_canvas_get_local_to_device(Handle, sk_matrix44_t(Result)); end; function TSkCanvas.GetLocalToDeviceAs3x3: TMatrix; begin - TSkiaAPI.sk4d_canvas_get_local_to_device_as_3x3(GetHandle, sk_matrix_t(Result)); + sk4d_canvas_get_local_to_device_as_3x3(Handle, sk_matrix_t(Result)); end; function TSkCanvas.GetSaveCount: Integer; begin - Result := TSkiaAPI.sk4d_canvas_get_save_count(GetHandle); + Result := sk4d_canvas_get_save_count(Handle); +end; + +function TSkCanvas.GetTopProperties: TSkSurfaceProperties; +var + LResult: sk_surfaceprops_t; +begin + sk4d_canvas_get_top_props(Handle, LResult); + Result := TSkBindings.ToSurfaceProperties(LResult); +end; + +function TSkCanvas.MakeSurface(const AImageInfo: TSkImageInfo): ISkSurface; +var + LImageInfo: sk_imageinfo_t; +begin + LImageInfo := TSkBindings.AsImageInfo(AImageInfo); + Result := TSkBindings.SafeCreate(sk4d_canvas_make_surface(Handle, @LImageInfo, nil)); +end; + +function TSkCanvas.MakeSurface(const AImageInfo: TSkImageInfo; + const AProperties: TSkSurfaceProperties): ISkSurface; +var + LImageInfo: sk_imageinfo_t; + LProperties: sk_surfaceprops_t; +begin + LImageInfo := TSkBindings.AsImageInfo(AImageInfo); + LProperties := TSkBindings.AsSurfaceProperties(AProperties); + Result := TSkBindings.SafeCreate(sk4d_canvas_make_surface(Handle, @LImageInfo, @LProperties)); end; + function TSkCanvas.QuickReject(const ARect: TRectF): Boolean; begin - Result := TSkiaAPI.sk4d_canvas_quick_reject(GetHandle, @sk_rect_t(ARect)); + Result := sk4d_canvas_quick_reject(Handle, @sk_rect_t(ARect)); end; function TSkCanvas.QuickReject(const APath: ISkPath): Boolean; begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - Result := TSkiaAPI.sk4d_canvas_quick_reject2(GetHandle, APath.Handle); + Result := sk4d_canvas_quick_reject2(Handle, APath.Handle); end; procedure TSkCanvas.ResetMatrix; begin - TSkiaAPI.sk4d_canvas_reset_matrix(GetHandle); + sk4d_canvas_reset_matrix(Handle); end; procedure TSkCanvas.Restore; begin - TSkiaAPI.sk4d_canvas_restore(GetHandle); + sk4d_canvas_restore(Handle); end; procedure TSkCanvas.RestoreToCount(const ASaveCount: Integer); begin - TSkiaAPI.sk4d_canvas_restore_to_count(GetHandle, ASaveCount); + sk4d_canvas_restore_to_count(Handle, ASaveCount); end; procedure TSkCanvas.Rotate(const ADegrees, APX, APY: Single); begin - TSkiaAPI.sk4d_canvas_rotate2(GetHandle, ADegrees, APX, APY); + sk4d_canvas_rotate2(Handle, ADegrees, APX, APY); end; procedure TSkCanvas.Rotate(const ADegrees: Single); begin - TSkiaAPI.sk4d_canvas_rotate(GetHandle, ADegrees); + sk4d_canvas_rotate(Handle, ADegrees); end; procedure TSkCanvas.RotateRadians(const ARadians: Single); @@ -5072,69 +6365,69 @@ procedure TSkCanvas.RotateRadians(const ARadians: Single); function TSkCanvas.Save: Integer; begin - Result := TSkiaAPI.sk4d_canvas_save(GetHandle); + Result := sk4d_canvas_save(Handle); end; -procedure TSkCanvas.SaveLayer(const ABounds: TRectF; const APaint: ISkPaint); +procedure TSkCanvas.SaveLayer(const APaint: ISkPaint); begin - TSkiaAPI.sk4d_canvas_save_layer(GetHandle, @sk_rect_t(ABounds), TSkBindings.SafeGetHandle(APaint)); + sk4d_canvas_save_layer(Handle, nil, TSkBindings.SafeHandle(APaint)); end; -procedure TSkCanvas.SaveLayer(const APaint: ISkPaint); +procedure TSkCanvas.SaveLayer(const ABounds: TRectF; const APaint: ISkPaint); begin - TSkiaAPI.sk4d_canvas_save_layer(GetHandle, nil, TSkBindings.SafeGetHandle(APaint)); + sk4d_canvas_save_layer(Handle, @sk_rect_t(ABounds), TSkBindings.SafeHandle(APaint)); end; -procedure TSkCanvas.SaveLayerAlpha(const ABounds: TRectF; const AAlpha: Byte); +procedure TSkCanvas.SaveLayerAlpha(const AAlpha: Byte); begin - TSkiaAPI.sk4d_canvas_save_layer_alpha(GetHandle, @sk_rect_t(ABounds), AAlpha); + sk4d_canvas_save_layer_alpha(Handle, nil, AAlpha); end; -procedure TSkCanvas.SaveLayerAlpha(const AAlpha: Byte); +procedure TSkCanvas.SaveLayerAlpha(const ABounds: TRectF; const AAlpha: Byte); begin - TSkiaAPI.sk4d_canvas_save_layer_alpha(GetHandle, nil, AAlpha); + sk4d_canvas_save_layer_alpha(Handle, @sk_rect_t(ABounds), AAlpha); end; procedure TSkCanvas.Scale(const AScaleX, AScaleY: Single); begin - TSkiaAPI.sk4d_canvas_scale(GetHandle, AScaleX, AScaleY); + sk4d_canvas_scale(Handle, AScaleX, AScaleY); end; procedure TSkCanvas.SetMatrix(const AMatrix: TMatrix); begin - TSkiaAPI.sk4d_canvas_set_matrix2(GetHandle, @sk_matrix_t(AMatrix)); + sk4d_canvas_set_matrix2(Handle, @sk_matrix_t(AMatrix)); end; procedure TSkCanvas.SetMatrix(const AMatrix: TMatrix3D); begin - TSkiaAPI.sk4d_canvas_set_matrix(GetHandle, @sk_matrix44_t(AMatrix)); + sk4d_canvas_set_matrix(Handle, @sk_matrix44_t(AMatrix)); end; procedure TSkCanvas.Skew(const ASkewX, ASkewY: Single); begin - TSkiaAPI.sk4d_canvas_skew(GetHandle, ASkewX, ASkewY); + sk4d_canvas_skew(Handle, ASkewX, ASkewY); end; procedure TSkCanvas.Translate(const ADeltaX, ADeltaY: Single); begin - TSkiaAPI.sk4d_canvas_translate(GetHandle, ADeltaX, ADeltaY); + sk4d_canvas_translate(Handle, ADeltaX, ADeltaY); end; -{ TSkCodec } - -class procedure TSkCodec.DestroyHandle(const AHandle: THandle); +class procedure TSkCanvas.__DestroyHandle(const AHandle: THandle); begin - TSkiaAPI.sk4d_codec_destroy(AHandle); + sk4d_canvas_destroy(AHandle); end; +{ TSkCodec } + function TSkCodec.GetDimensions: TSize; begin - TSkiaAPI.sk4d_codec_get_dimensions(GetHandle, sk_isize_t(Result)); + sk4d_codec_get_dimensions(Handle, sk_isize_t(Result)); end; function TSkCodec.GetEncodedImageFormat: TSkEncodedImageFormat; begin - Result := TSkEncodedImageFormat(TSkiaAPI.sk4d_codec_get_encoded_image_format(GetHandle)); + Result := TSkEncodedImageFormat(sk4d_codec_get_encoded_image_format(Handle)); end; function TSkCodec.GetHeight: Integer; @@ -5143,16 +6436,16 @@ function TSkCodec.GetHeight: Integer; end; function TSkCodec.GetImage(const AColorType: TSkColorType; - const AAlphaType: TSkAlphaType; const AColorSpace: ISkColorSpace): ISkImage; + const AAlphaType: TSkAlphaType; AColorSpace: ISkColorSpace): ISkImage; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_codec_get_image(GetHandle, sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeGetHandle(AColorSpace))); + Result := TSkBindings.SafeCreate(sk4d_codec_get_image(Handle, sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeHandle(AColorSpace))); end; function TSkCodec.GetPixels(const APixels: Pointer; const ARowBytes: NativeUInt; const AColorType: TSkColorType; const AAlphaType: TSkAlphaType; - const AColorSpace: ISkColorSpace): Boolean; + AColorSpace: ISkColorSpace): Boolean; begin - Result := TSkiaAPI.sk4d_codec_get_pixels(GetHandle, APixels, ARowBytes, sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeGetHandle(AColorSpace)); + Result := sk4d_codec_get_pixels(Handle, APixels, ARowBytes, sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeHandle(AColorSpace)); end; function TSkCodec.GetWidth: Integer; @@ -5161,10 +6454,12 @@ function TSkCodec.GetWidth: Integer; end; class function TSkCodec.MakeFromFile(const AFileName: string): ISkCodec; +var + LMarshaller: TMarshaller; begin if AFileName.IsEmpty then raise ESkException.Create(SFileNameIsEmpty); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_codec_make_from_file(MarshaledAString(UTF8String(AFileName)))); + Result := TSkBindings.SafeCreate(sk4d_codec_make_from_file(LMarshaller.AsUtf8(AFileName).ToPointer)); end; class function TSkCodec.MakeFromStream(const AStream: TStream): ISkCodec; @@ -5172,7 +6467,7 @@ class function TSkCodec.MakeFromStream(const AStream: TStream): ISkCodec; LStream: ISkStream; begin LStream := TSkStreamAdapter.Create(AStream); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_codec_make_from_stream(TSkObject.ReleaseHandle(LStream))); + Result := TSkBindings.SafeCreate(sk4d_codec_make_from_stream(TSkObject.__ReleaseHandle(LStream))); end; class function TSkCodec.MakeWithCopy(const AData: Pointer; @@ -5180,7 +6475,7 @@ class function TSkCodec.MakeWithCopy(const AData: Pointer; begin if ASize = 0 then Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_codec_make_with_copy(AData, ASize)); + Result := TSkBindings.SafeCreate(sk4d_codec_make_with_copy(AData, ASize)); end; class function TSkCodec.MakeWithoutCopy(const AData: Pointer; @@ -5188,29 +6483,29 @@ class function TSkCodec.MakeWithoutCopy(const AData: Pointer; begin if ASize = 0 then Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_codec_make_without_copy(AData, ASize)); + Result := TSkBindings.SafeCreate(sk4d_codec_make_without_copy(AData, ASize)); end; -{ TSkAnimationCodecPlayer } - -class procedure TSkAnimationCodecPlayer.DestroyHandle(const AHandle: THandle); +class procedure TSkCodec.__DestroyHandle(const AHandle: THandle); begin - TSkiaAPI.sk4d_animcodecplayer_destroy(AHandle); + sk4d_codec_destroy(AHandle); end; +{ TSkAnimationCodecPlayer } + function TSkAnimationCodecPlayer.GetDimensions: TSize; begin - TSkiaAPI.sk4d_animcodecplayer_get_dimensions(GetHandle, sk_isize_t(Result)); + sk4d_animcodecplayer_get_dimensions(Handle, sk_isize_t(Result)); end; function TSkAnimationCodecPlayer.GetDuration: Cardinal; begin - Result := TSkiaAPI.sk4d_animcodecplayer_get_duration(GetHandle); + Result := sk4d_animcodecplayer_get_duration(Handle); end; function TSkAnimationCodecPlayer.GetFrame: ISkImage; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_animcodecplayer_get_frame(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_animcodecplayer_get_frame(Handle)); end; function TSkAnimationCodecPlayer.GetHeight: Integer; @@ -5225,10 +6520,12 @@ function TSkAnimationCodecPlayer.GetWidth: Integer; class function TSkAnimationCodecPlayer.MakeFromFile( const AFileName: string): ISkAnimationCodecPlayer; +var + LMarshaller: TMarshaller; begin if AFileName.IsEmpty then raise ESkException.Create(SFileNameIsEmpty); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_animcodecplayer_make_from_file(MarshaledAString(UTF8String(AFileName)))); + Result := TSkBindings.SafeCreate(sk4d_animcodecplayer_make_from_file(LMarshaller.AsUtf8(AFileName).ToPointer)); end; class function TSkAnimationCodecPlayer.MakeFromStream( @@ -5237,416 +6534,123 @@ class function TSkAnimationCodecPlayer.MakeFromStream( LStream: ISkStream; begin LStream := TSkStreamAdapter.Create(AStream); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_animcodecplayer_make_from_stream(TSkObject.ReleaseHandle(LStream))); + Result := TSkBindings.SafeCreate(sk4d_animcodecplayer_make_from_stream(TSkObject.__ReleaseHandle(LStream))); end; function TSkAnimationCodecPlayer.Seek(const AMilliseconds: Cardinal): Boolean; begin - Result := TSkiaAPI.sk4d_animcodecplayer_seek(GetHandle, AMilliseconds); -end; - -{ TSkHighContrastConfig } - -constructor TSkHighContrastConfig.Create(const AGrayscale: Boolean; - const AInvertStyle: TSkContrastInvertStyle; const AContrast: Single); -begin - Grayscale := AGrayscale; - InvertStyle := AInvertStyle; - Contrast := AContrast; -end; - -class operator TSkHighContrastConfig.Equal(const AHighContrastConfig1, - AHighContrastConfig2: TSkHighContrastConfig): Boolean; -begin - Result := (AHighContrastConfig1.Grayscale = AHighContrastConfig2.Grayscale ) and - (AHighContrastConfig1.InvertStyle = AHighContrastConfig2.InvertStyle) and - (SameValue(AHighContrastConfig1.Contrast, AHighContrastConfig2.Contrast, Epsilon)); -end; - -class operator TSkHighContrastConfig.NotEqual(const AHighContrastConfig1, - AHighContrastConfig2: TSkHighContrastConfig): Boolean; -begin - Result := not (AHighContrastConfig1 <> AHighContrastConfig2); -end; - -{ TSkColorMatrix } - -constructor TSkColorMatrix.Create(const AM11, AM12, AM13, AM14, AM15, AM21, - AM22, AM23, AM24, AM25, AM31, AM32, AM33, AM34, AM35, AM41, AM42, AM43, AM44, - AM45: Single); -begin - M11 := AM11; - M12 := AM12; - M13 := AM13; - M14 := AM14; - M15 := AM15; - M21 := AM21; - M22 := AM22; - M23 := AM23; - M24 := AM24; - M25 := AM25; - M31 := AM31; - M32 := AM32; - M33 := AM33; - M34 := AM34; - M35 := AM35; - M41 := AM41; - M42 := AM42; - M43 := AM43; - M44 := AM44; - M45 := AM45; -end; - -class function TSkColorMatrix.CreateSaturation( - const ASaturation: Single): TSkColorMatrix; -const - HueR = 0.213; - HueG = 0.715; - HueB = 0.072; -var - LB: Single; - LG: Single; - LR: Single; -begin - LR := HueR * (1 - ASaturation); - LG := HueG * (1 - ASaturation); - LB := HueB * (1 - ASaturation); - Result.M11 := LR + ASaturation; - Result.M12 := LG; - Result.M13 := LB; - Result.M14 := 0; - Result.M15 := 0; - Result.M21 := LR; - Result.M22 := LG + ASaturation; - Result.M23 := LB; - Result.M24 := 0; - Result.M25 := 0; - Result.M31 := LR; - Result.M32 := LG; - Result.M33 := LB + ASaturation; - Result.M34 := 0; - Result.M35 := 0; - Result.M41 := 0; - Result.M42 := 0; - Result.M43 := 0; - Result.M44 := 1; - Result.M45 := 0; -end; - -class function TSkColorMatrix.CreateScale(const AScaleR, AScaleG, AScaleB, - AScaleA: Single): TSkColorMatrix; -begin - Result.M11 := AScaleR; - Result.M12 := 0; - Result.M13 := 0; - Result.M14 := 0; - Result.M15 := 0; - Result.M21 := 0; - Result.M22 := AScaleG; - Result.M23 := 0; - Result.M24 := 0; - Result.M25 := 0; - Result.M31 := 0; - Result.M32 := 0; - Result.M33 := AScaleB; - Result.M34 := 0; - Result.M35 := 0; - Result.M41 := 0; - Result.M42 := 0; - Result.M43 := 0; - Result.M44 := AScaleA; - Result.M45 := 0; + Result := sk4d_animcodecplayer_seek(Handle, AMilliseconds); end; -class operator TSkColorMatrix.Equal(const AColorMatrix1, - AColorMatrix2: TSkColorMatrix): Boolean; +class procedure TSkAnimationCodecPlayer.__DestroyHandle(const AHandle: THandle); begin - Result := (SameValue(AColorMatrix1.M11, AColorMatrix2.M11, Epsilon)) and - (SameValue(AColorMatrix1.M12, AColorMatrix2.M12, Epsilon)) and - (SameValue(AColorMatrix1.M13, AColorMatrix2.M13, Epsilon)) and - (SameValue(AColorMatrix1.M14, AColorMatrix2.M14, Epsilon)) and - (SameValue(AColorMatrix1.M15, AColorMatrix2.M15, Epsilon)) and - (SameValue(AColorMatrix1.M21, AColorMatrix2.M21, Epsilon)) and - (SameValue(AColorMatrix1.M22, AColorMatrix2.M22, Epsilon)) and - (SameValue(AColorMatrix1.M23, AColorMatrix2.M23, Epsilon)) and - (SameValue(AColorMatrix1.M24, AColorMatrix2.M24, Epsilon)) and - (SameValue(AColorMatrix1.M25, AColorMatrix2.M25, Epsilon)) and - (SameValue(AColorMatrix1.M31, AColorMatrix2.M31, Epsilon)) and - (SameValue(AColorMatrix1.M32, AColorMatrix2.M32, Epsilon)) and - (SameValue(AColorMatrix1.M33, AColorMatrix2.M33, Epsilon)) and - (SameValue(AColorMatrix1.M34, AColorMatrix2.M34, Epsilon)) and - (SameValue(AColorMatrix1.M35, AColorMatrix2.M35, Epsilon)) and - (SameValue(AColorMatrix1.M41, AColorMatrix2.M41, Epsilon)) and - (SameValue(AColorMatrix1.M42, AColorMatrix2.M42, Epsilon)) and - (SameValue(AColorMatrix1.M43, AColorMatrix2.M43, Epsilon)) and - (SameValue(AColorMatrix1.M44, AColorMatrix2.M44, Epsilon)) and - (SameValue(AColorMatrix1.M45, AColorMatrix2.M45, Epsilon)); + sk4d_animcodecplayer_destroy(AHandle); end; -class operator TSkColorMatrix.Multiply(const AColorMatrix1, - AColorMatrix2: TSkColorMatrix): TSkColorMatrix; -begin - Result.M11 := AColorMatrix2.M11 * AColorMatrix1.M11 + AColorMatrix2.M12 * AColorMatrix1.M21 + AColorMatrix2.M13 * AColorMatrix1.M31 + AColorMatrix2.M14 * AColorMatrix1.M41; - Result.M12 := AColorMatrix2.M11 * AColorMatrix1.M12 + AColorMatrix2.M12 * AColorMatrix1.M22 + AColorMatrix2.M13 * AColorMatrix1.M32 + AColorMatrix2.M14 * AColorMatrix1.M42; - Result.M13 := AColorMatrix2.M11 * AColorMatrix1.M13 + AColorMatrix2.M12 * AColorMatrix1.M23 + AColorMatrix2.M13 * AColorMatrix1.M33 + AColorMatrix2.M14 * AColorMatrix1.M43; - Result.M14 := AColorMatrix2.M11 * AColorMatrix1.M14 + AColorMatrix2.M12 * AColorMatrix1.M24 + AColorMatrix2.M13 * AColorMatrix1.M34 + AColorMatrix2.M14 * AColorMatrix1.M44; - Result.M15 := AColorMatrix2.M11 * AColorMatrix1.M15 + AColorMatrix2.M12 * AColorMatrix1.M25 + AColorMatrix2.M13 * AColorMatrix1.M35 + AColorMatrix2.M14 * AColorMatrix1.M45 + AColorMatrix2.M15; - Result.M21 := AColorMatrix2.M21 * AColorMatrix1.M11 + AColorMatrix2.M22 * AColorMatrix1.M21 + AColorMatrix2.M23 * AColorMatrix1.M31 + AColorMatrix2.M24 * AColorMatrix1.M41; - Result.M22 := AColorMatrix2.M21 * AColorMatrix1.M12 + AColorMatrix2.M22 * AColorMatrix1.M22 + AColorMatrix2.M23 * AColorMatrix1.M32 + AColorMatrix2.M24 * AColorMatrix1.M42; - Result.M23 := AColorMatrix2.M21 * AColorMatrix1.M13 + AColorMatrix2.M22 * AColorMatrix1.M23 + AColorMatrix2.M23 * AColorMatrix1.M33 + AColorMatrix2.M24 * AColorMatrix1.M43; - Result.M24 := AColorMatrix2.M21 * AColorMatrix1.M14 + AColorMatrix2.M22 * AColorMatrix1.M24 + AColorMatrix2.M23 * AColorMatrix1.M34 + AColorMatrix2.M24 * AColorMatrix1.M44; - Result.M25 := AColorMatrix2.M21 * AColorMatrix1.M15 + AColorMatrix2.M22 * AColorMatrix1.M25 + AColorMatrix2.M23 * AColorMatrix1.M35 + AColorMatrix2.M24 * AColorMatrix1.M45 + AColorMatrix2.M25; - Result.M31 := AColorMatrix2.M31 * AColorMatrix1.M11 + AColorMatrix2.M32 * AColorMatrix1.M21 + AColorMatrix2.M33 * AColorMatrix1.M31 + AColorMatrix2.M34 * AColorMatrix1.M41; - Result.M32 := AColorMatrix2.M31 * AColorMatrix1.M12 + AColorMatrix2.M32 * AColorMatrix1.M22 + AColorMatrix2.M33 * AColorMatrix1.M32 + AColorMatrix2.M34 * AColorMatrix1.M42; - Result.M33 := AColorMatrix2.M31 * AColorMatrix1.M13 + AColorMatrix2.M32 * AColorMatrix1.M23 + AColorMatrix2.M33 * AColorMatrix1.M33 + AColorMatrix2.M34 * AColorMatrix1.M43; - Result.M34 := AColorMatrix2.M31 * AColorMatrix1.M14 + AColorMatrix2.M32 * AColorMatrix1.M24 + AColorMatrix2.M33 * AColorMatrix1.M34 + AColorMatrix2.M34 * AColorMatrix1.M44; - Result.M35 := AColorMatrix2.M31 * AColorMatrix1.M15 + AColorMatrix2.M32 * AColorMatrix1.M25 + AColorMatrix2.M33 * AColorMatrix1.M35 + AColorMatrix2.M34 * AColorMatrix1.M45 + AColorMatrix2.M35; - Result.M41 := AColorMatrix2.M41 * AColorMatrix1.M11 + AColorMatrix2.M42 * AColorMatrix1.M21 + AColorMatrix2.M43 * AColorMatrix1.M31 + AColorMatrix2.M44 * AColorMatrix1.M41; - Result.M42 := AColorMatrix2.M41 * AColorMatrix1.M12 + AColorMatrix2.M42 * AColorMatrix1.M22 + AColorMatrix2.M43 * AColorMatrix1.M32 + AColorMatrix2.M44 * AColorMatrix1.M42; - Result.M43 := AColorMatrix2.M41 * AColorMatrix1.M13 + AColorMatrix2.M42 * AColorMatrix1.M23 + AColorMatrix2.M43 * AColorMatrix1.M33 + AColorMatrix2.M44 * AColorMatrix1.M43; - Result.M44 := AColorMatrix2.M41 * AColorMatrix1.M14 + AColorMatrix2.M42 * AColorMatrix1.M24 + AColorMatrix2.M43 * AColorMatrix1.M34 + AColorMatrix2.M44 * AColorMatrix1.M44; - Result.M45 := AColorMatrix2.M41 * AColorMatrix1.M15 + AColorMatrix2.M42 * AColorMatrix1.M25 + AColorMatrix2.M43 * AColorMatrix1.M35 + AColorMatrix2.M44 * AColorMatrix1.M45 + AColorMatrix2.M45; -end; +{ TSkColorFilter } -class operator TSkColorMatrix.NotEqual(const AColorMatrix1, - AColorMatrix2: TSkColorMatrix): Boolean; +class function TSkColorFilter.MakeBlend(const AColor: TAlphaColorF; + AColorSpace: ISkColorSpace; const AMode: TSkBlendMode): ISkColorFilter; begin - Result := not (AColorMatrix1 = AColorMatrix2); + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_blend2(@sk_color4f_t(AColor), TSkBindings.SafeHandle(AColorSpace), sk_blendmode_t(AMode))); end; -{ TSkColorFilter } - class function TSkColorFilter.MakeBlend(const AColor: TAlphaColor; const AMode: TSkBlendMode): ISkColorFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_blend(AColor, sk_blendmode_t(AMode))); + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_blend(AColor, sk_blendmode_t(AMode))); end; class function TSkColorFilter.MakeCompose(const AOuter, AInner: ISkColorFilter): ISkColorFilter; begin - if not Assigned(AOuter) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['AOuter']); - if not Assigned(AInner) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['AInner']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_compose(AOuter.Handle, AInner.Handle)); -end; - -class function TSkColorFilter.MakeHighContrast( - const AConfig: TSkHighContrastConfig): ISkColorFilter; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_high_contrast(@sk_highcontrastconfig_t(AConfig))); -end; - -class function TSkColorFilter.MakeHSLAMatrix( - const AMatrix: TSkColorMatrix): ISkColorFilter; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_hsla_matrix(@sk_colormatrix_t(AMatrix))); -end; - -class function TSkColorFilter.MakeLighting(const AMultiply, - AAdd: TAlphaColor): ISkColorFilter; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_lighting(AMultiply, AAdd)); -end; - -class function TSkColorFilter.MakeLinearToSRGBGamma: ISkColorFilter; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_linear_to_srgb_gamma()); -end; - -class function TSkColorFilter.MakeLumaColor: ISkColorFilter; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_luma_color()); -end; - -class function TSkColorFilter.MakeMatrix( - const AMatrix: TSkColorMatrix): ISkColorFilter; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_matrix(@sk_colormatrix_t(AMatrix))); -end; - -class function TSkColorFilter.MakeOverdraw( - const AColors: TSkOverdrawColor): ISkColorFilter; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_overdraw(@AColors)); -end; - -class function TSkColorFilter.MakeTable(const ATableA, ATableR, ATableG, - ATableB: TSkTableFilter): ISkColorFilter; -begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorfilter_make_table(@ATableA, @ATableR, @ATableG, @ATableB)); -end; - -class function TSkColorFilter.MakeTable( - const ATable: TSkTableFilter): ISkColorFilter; -begin - Result := MakeTable(ATable, ATable, ATable, ATable); -end; - -{ TSkColorSpaceXyz } - -function TSkColorSpaceXyz.Adjoint: TSkColorSpaceXyz; -begin - Result.M11 := (M22 * M33 - M32 * M23); - Result.M12 := -(M12 * M33 - M32 * M13); - Result.M13 := (M12 * M23 - M22 * M13); - Result.M21 := -(M21 * M33 - M31 * M23); - Result.M22 := (M11 * M33 - M31 * M13); - Result.M23 := -(M11 * M23 - M21 * M13); - Result.M31 := (M21 * M32 - M31 * M22); - Result.M32 := -(M11 * M32 - M31 * M12); - Result.M33 := (M11 * M22 - M21 * M12); -end; - -constructor TSkColorSpaceXyz.Create(const AM11, AM12, AM13, AM21, AM22, AM23, - AM31, AM32, AM33: Single); -begin - M11 := AM11; - M12 := AM12; - M13 := AM13; - M21 := AM21; - M22 := AM22; - M23 := AM23; - M31 := AM31; - M32 := AM32; - M33 := AM33; -end; - -function TSkColorSpaceXyz.Determinant: Single; -begin - Result := M11 * (M22 * M33 - M32 * M23) - - M12 * (M21 * M33 - M31 * M23) + - M13 * (M21 * M32 - M31 * M22); + if not Assigned(AOuter) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['AOuter']); + if not Assigned(AInner) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['AInner']); + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_compose(AOuter.Handle, AInner.Handle)); end; -class operator TSkColorSpaceXyz.Equal(const AColorSpaceXyz1, - AColorSpaceXyz2: TSkColorSpaceXyz): Boolean; +class function TSkColorFilter.MakeHighContrast( + const AConfig: TSkHighContrastConfig): ISkColorFilter; begin - Result := (SameValue(AColorSpaceXyz1.M11, AColorSpaceXyz2.M11, Epsilon)) and - (SameValue(AColorSpaceXyz1.M12, AColorSpaceXyz2.M12, Epsilon)) and - (SameValue(AColorSpaceXyz1.M13, AColorSpaceXyz2.M13, Epsilon)) and - (SameValue(AColorSpaceXyz1.M21, AColorSpaceXyz2.M21, Epsilon)) and - (SameValue(AColorSpaceXyz1.M22, AColorSpaceXyz2.M22, Epsilon)) and - (SameValue(AColorSpaceXyz1.M23, AColorSpaceXyz2.M23, Epsilon)) and - (SameValue(AColorSpaceXyz1.M31, AColorSpaceXyz2.M31, Epsilon)) and - (SameValue(AColorSpaceXyz1.M32, AColorSpaceXyz2.M32, Epsilon)) and - (SameValue(AColorSpaceXyz1.M33, AColorSpaceXyz2.M33, Epsilon)); + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_high_contrast(@sk_highcontrastconfig_t(AConfig))); end; -function TSkColorSpaceXyz.Inverse: TSkColorSpaceXyz; -var - LDeterminant: Single; - LFactor: Single; +class function TSkColorFilter.MakeHSLAMatrix( + const AMatrix: TSkColorMatrix): ISkColorFilter; begin - LDeterminant := Self.Determinant; - if IsZero(LDeterminant) then - Exit(TSkColorSpaceXyz.Identity); - LFactor := 1 / LDeterminant; - Result.M11 := M11 * LFactor; - Result.M12 := M12 * LFactor; - Result.M13 := M13 * LFactor; - Result.M21 := M21 * LFactor; - Result.M22 := M22 * LFactor; - Result.M23 := M23 * LFactor; - Result.M31 := M31 * LFactor; - Result.M32 := M32 * LFactor; - Result.M33 := M33 * LFactor; + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_hsla_matrix(@sk_colormatrix_t(AMatrix))); end; -class operator TSkColorSpaceXyz.Multiply(const AColorSpaceXyz1, - AColorSpaceXyz2: TSkColorSpaceXyz): TSkColorSpaceXyz; +class function TSkColorFilter.MakeLighting(const AMultiply, + AAdd: TAlphaColor): ISkColorFilter; begin - Result.M11 := AColorSpaceXyz1.M11 * AColorSpaceXyz2.M11 + AColorSpaceXyz1.M12 * AColorSpaceXyz2.M21 + AColorSpaceXyz1.M13 * AColorSpaceXyz2.M31; - Result.M12 := AColorSpaceXyz1.M11 * AColorSpaceXyz2.M12 + AColorSpaceXyz1.M12 * AColorSpaceXyz2.M22 + AColorSpaceXyz1.M13 * AColorSpaceXyz2.M32; - Result.M13 := AColorSpaceXyz1.M11 * AColorSpaceXyz2.M13 + AColorSpaceXyz1.M12 * AColorSpaceXyz2.M23 + AColorSpaceXyz1.M13 * AColorSpaceXyz2.M33; - Result.M21 := AColorSpaceXyz1.M21 * AColorSpaceXyz2.M11 + AColorSpaceXyz1.M22 * AColorSpaceXyz2.M21 + AColorSpaceXyz1.M23 * AColorSpaceXyz2.M31; - Result.M22 := AColorSpaceXyz1.M21 * AColorSpaceXyz2.M12 + AColorSpaceXyz1.M22 * AColorSpaceXyz2.M22 + AColorSpaceXyz1.M23 * AColorSpaceXyz2.M32; - Result.M23 := AColorSpaceXyz1.M21 * AColorSpaceXyz2.M13 + AColorSpaceXyz1.M22 * AColorSpaceXyz2.M23 + AColorSpaceXyz1.M23 * AColorSpaceXyz2.M33; - Result.M31 := AColorSpaceXyz1.M31 * AColorSpaceXyz2.M11 + AColorSpaceXyz1.M32 * AColorSpaceXyz2.M21 + AColorSpaceXyz1.M33 * AColorSpaceXyz2.M31; - Result.M32 := AColorSpaceXyz1.M31 * AColorSpaceXyz2.M12 + AColorSpaceXyz1.M32 * AColorSpaceXyz2.M22 + AColorSpaceXyz1.M33 * AColorSpaceXyz2.M32; - Result.M33 := AColorSpaceXyz1.M31 * AColorSpaceXyz2.M13 + AColorSpaceXyz1.M32 * AColorSpaceXyz2.M23 + AColorSpaceXyz1.M33 * AColorSpaceXyz2.M33; + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_lighting(AMultiply, AAdd)); end; -class operator TSkColorSpaceXyz.NotEqual(const AColorSpaceXyz1, - AColorSpaceXyz2: TSkColorSpaceXyz): Boolean; +class function TSkColorFilter.MakeLinearToSRGBGamma: ISkColorFilter; begin - Result := not (AColorSpaceXyz1 = AColorSpaceXyz2); + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_linear_to_srgb_gamma()); end; -{ TSkColorSpaceTransferFunction } - -constructor TSkColorSpaceTransferFunction.Create(const AG, AA, AB, AC, AD, AE, - AF: Single); +class function TSkColorFilter.MakeLumaColor: ISkColorFilter; begin - G := AG; - A := AA; - B := AB; - C := AC; - D := AD; - E := AE; - F := AF; + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_luma_color()); end; -class operator TSkColorSpaceTransferFunction.Equal( - const AColorSpaceTransferFunction1, - AColorSpaceTransferFunction2: TSkColorSpaceTransferFunction): Boolean; +class function TSkColorFilter.MakeMatrix( + const AMatrix: TSkColorMatrix): ISkColorFilter; begin - Result := (SameValue(AColorSpaceTransferFunction1.G, AColorSpaceTransferFunction2.G, Epsilon)) and - (SameValue(AColorSpaceTransferFunction1.A, AColorSpaceTransferFunction2.A, Epsilon)) and - (SameValue(AColorSpaceTransferFunction1.B, AColorSpaceTransferFunction2.B, Epsilon)) and - (SameValue(AColorSpaceTransferFunction1.C, AColorSpaceTransferFunction2.C, Epsilon)) and - (SameValue(AColorSpaceTransferFunction1.D, AColorSpaceTransferFunction2.D, Epsilon)) and - (SameValue(AColorSpaceTransferFunction1.E, AColorSpaceTransferFunction2.E, Epsilon)) and - (SameValue(AColorSpaceTransferFunction1.F, AColorSpaceTransferFunction2.F, Epsilon)); + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_matrix(@sk_colormatrix_t(AMatrix))); end; -function TSkColorSpaceTransferFunction.Invert( - out ATransferFunction: TSkColorSpaceTransferFunction): Boolean; +class function TSkColorFilter.MakeOverdraw( + const AColors: TSkOverdrawColor): ISkColorFilter; begin - Result := TSkiaAPI.sk4d_colorspacetransferfn_invert(@sk_colorspacetransferfn_t(Self), sk_colorspacetransferfn_t(ATransferFunction)); + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_overdraw(@AColors)); end; -class operator TSkColorSpaceTransferFunction.NotEqual( - const AColorSpaceTransferFunction1, - AColorSpaceTransferFunction2: TSkColorSpaceTransferFunction): Boolean; +class function TSkColorFilter.MakeTable(const ATableA, ATableR, ATableG, + ATableB: TSkTableFilter): ISkColorFilter; begin - Result := not (AColorSpaceTransferFunction1 = AColorSpaceTransferFunction2); + Result := TSkBindings.SafeCreate(sk4d_colorfilter_make_table(@ATableA, @ATableR, @ATableG, @ATableB)); end; -function TSkColorSpaceTransferFunction.Transform(const AX: Single): Single; +class function TSkColorFilter.MakeTable( + const ATable: TSkTableFilter): ISkColorFilter; begin - Result := TSkiaAPI.sk4d_colorspacetransferfn_transform(@sk_colorspacetransferfn_t(Self), AX); + Result := MakeTable(ATable, ATable, ATable, ATable); end; { TSkColorSpace } function TSkColorSpace.GammaCloseToSRGB: Boolean; begin - Result := TSkiaAPI.sk4d_colorspace_gamma_close_to_srgb(GetHandle); + Result := sk4d_colorspace_gamma_close_to_srgb(Handle); end; function TSkColorSpace.GammaIsLinear: Boolean; begin - Result := TSkiaAPI.sk4d_colorspace_gamma_is_linear(GetHandle); + Result := sk4d_colorspace_gamma_is_linear(Handle); end; function TSkColorSpace.IsEqual(const AColorSpace: ISkColorSpace): Boolean; begin if not Assigned(AColorSpace) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AColorSpace']); - Result := TSkiaAPI.sk4d_colorspace_is_equal(GetHandle, AColorSpace.Handle); + Result := sk4d_colorspace_is_equal(Handle, AColorSpace.Handle); end; function TSkColorSpace.IsNumericalTransferFunction( out ATransferFunction: TSkColorSpaceTransferFunction): Boolean; begin - Result := TSkiaAPI.sk4d_colorspace_is_numerical_transfer_fn(GetHandle, sk_colorspacetransferfn_t(ATransferFunction)); + Result := sk4d_colorspace_is_numerical_transfer_fn(Handle, sk_colorspacetransferfn_t(ATransferFunction)); end; function TSkColorSpace.IsSRGB: Boolean; begin - Result := TSkiaAPI.sk4d_colorspace_is_srgb(GetHandle); + Result := sk4d_colorspace_is_srgb(Handle); end; class function TSkColorSpace.Make( @@ -5654,69 +6658,64 @@ class function TSkColorSpace.Make( begin if not Assigned(AProfile) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AProfile']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorspace_make(AProfile.Handle)); + Result := TSkBindings.SafeCreate(sk4d_colorspace_make(AProfile.Handle)); end; function TSkColorSpace.MakeLinearGamma: ISkColorSpace; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorspace_make_linear_gamma(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_colorspace_make_linear_gamma(Handle)); end; class function TSkColorSpace.MakeRGB( const ATransferFunction: TSkColorSpaceTransferFunction; const AToXyzD50: TSkColorSpaceXyz): ISkColorSpace; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorspace_make_rgb(@sk_colorspacetransferfn_t(ATransferFunction), @sk_colorspacexyz_t(AToXyzD50))); + Result := TSkBindings.SafeCreate(sk4d_colorspace_make_rgb(@sk_colorspacetransferfn_t(ATransferFunction), @sk_colorspacexyz_t(AToXyzD50))); end; class function TSkColorSpace.MakeSRGB: ISkColorSpace; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorspace_make_srgb()); + Result := TSkBindings.SafeCreate(sk4d_colorspace_make_srgb()); end; function TSkColorSpace.MakeSRGBGamma: ISkColorSpace; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorspace_make_srgb_gamma(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_colorspace_make_srgb_gamma(Handle)); end; class function TSkColorSpace.MakeSRGBLinear: ISkColorSpace; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorspace_make_srgb_linear()); -end; - -class procedure TSkColorSpace.RefHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_colorspace_ref(AHandle); + Result := TSkBindings.SafeCreate(sk4d_colorspace_make_srgb_linear()); end; function TSkColorSpace.ToProfile: ISkColorSpaceICCProfile; begin - Result := TSkColorSpaceICCProfile.Wrap(TSkiaAPI.sk4d_colorspace_to_profile(GetHandle)); + Result := TSkColorSpaceICCProfile.Wrap(sk4d_colorspace_to_profile(Handle)); end; function TSkColorSpace.ToXyz(out ADest: TSkColorSpaceXyz): Boolean; begin - Result := TSkiaAPI.sk4d_colorspace_to_xyz(GetHandle, sk_colorspacexyz_t(ADest)); + Result := sk4d_colorspace_to_xyz(Handle, sk_colorspacexyz_t(ADest)); end; -class procedure TSkColorSpace.UnrefHandle(const AHandle: THandle); +class procedure TSkColorSpace.__RefHandle(const AHandle: THandle); begin - TSkiaAPI.sk4d_colorspace_unref(AHandle); + sk4d_colorspace_ref(AHandle); end; -{ TSkColorSpaceICCProfile } - -class procedure TSkColorSpaceICCProfile.DestroyHandle(const AHandle: THandle); +class procedure TSkColorSpace.__UnrefHandle(const AHandle: THandle); begin - TSkiaAPI.sk4d_colorspaceiccprofile_destroy(AHandle); + sk4d_colorspace_unref(AHandle); end; +{ TSkColorSpaceICCProfile } + class function TSkColorSpaceICCProfile.MakeFromBytes( const ABytes: TBytes): ISkColorSpaceICCProfile; begin if Length(ABytes) < 1 then Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_colorspaceiccprofile_make_with_parse(@ABytes[0], Length(ABytes))); + Result := TSkBindings.SafeCreate(sk4d_colorspaceiccprofile_make_with_parse(@ABytes[0], Length(ABytes))); end; function TSkColorSpaceICCProfile.ToBytes: TBytes; @@ -5724,7 +6723,7 @@ function TSkColorSpaceICCProfile.ToBytes: TBytes; LBuffer: Pointer; LSize: Cardinal; begin - LBuffer := TSkiaAPI.sk4d_colorspaceiccprofile_get_buffer(GetHandle, @LSize); + LBuffer := sk4d_colorspaceiccprofile_get_buffer(Handle, @LSize); SetLength(Result, LSize); if Length(Result) > 0 then Move(LBuffer^, Result[0], Length(Result)); @@ -5732,206 +6731,109 @@ function TSkColorSpaceICCProfile.ToBytes: TBytes; function TSkColorSpaceICCProfile.ToXyz(out ADest: TSkColorSpaceXyz): Boolean; begin - Result := TSkiaAPI.sk4d_colorspaceiccprofile_to_xyz(GetHandle, sk_colorspacexyz_t(ADest)); -end; - -{ TSkColorSpacePrimaries } - -constructor TSkColorSpacePrimaries.Create(const ARX, ARY, AGX, AGY, ABX, ABY, - AWX, AWY: Single); -begin - RX := ARX; - RY := ARY; - GX := AGX; - GY := AGY; - BX := ABX; - BY := ABY; - WX := AWX; - WY := AWY; -end; - -class operator TSkColorSpacePrimaries.Equal(const AColorSpacePrimaries1, - AColorSpacePrimaries2: TSkColorSpacePrimaries): Boolean; -begin - Result := (SameValue(AColorSpacePrimaries1.RX, AColorSpacePrimaries2.RX, Epsilon)) and - (SameValue(AColorSpacePrimaries1.RY, AColorSpacePrimaries2.RY, Epsilon)) and - (SameValue(AColorSpacePrimaries1.GX, AColorSpacePrimaries2.GX, Epsilon)) and - (SameValue(AColorSpacePrimaries1.GY, AColorSpacePrimaries2.GY, Epsilon)) and - (SameValue(AColorSpacePrimaries1.BX, AColorSpacePrimaries2.BX, Epsilon)) and - (SameValue(AColorSpacePrimaries1.BY, AColorSpacePrimaries2.BY, Epsilon)) and - (SameValue(AColorSpacePrimaries1.WX, AColorSpacePrimaries2.WX, Epsilon)) and - (SameValue(AColorSpacePrimaries1.WY, AColorSpacePrimaries2.WY, Epsilon)); -end; - -class operator TSkColorSpacePrimaries.Implicit( - const AColorSpacePrimaries: TSkColorSpacePrimaries): TSkColorSpaceXyz; -begin - if not TSkiaAPI.sk4d_colorspaceprimaries_to_xyz(@sk_colorspaceprimaries_t(AColorSpacePrimaries), sk_colorspacexyz_t(Result)) then - Result := TSkColorSpaceXyz.Identity; -end; - -class operator TSkColorSpacePrimaries.NotEqual(const AColorSpacePrimaries1, - AColorSpacePrimaries2: TSkColorSpacePrimaries): Boolean; -begin - Result := not (AColorSpacePrimaries1 = AColorSpacePrimaries2); -end; - -{ TSkPDFMetadata } - -constructor TSkPDFMetadata.Create(const ATitle, AAuthor, ASubject, AKeywords, - ACreator, AProducer: string; const ARasterDPI: Single; const APDFA: Boolean; - const AEncodingQuality: Integer); -begin - Title := ATitle; - Author := AAuthor; - Subject := ASubject; - Keywords := AKeywords; - Creator := ACreator; - Producer := AProducer; - Creation := Now; - Modified := Now; - RasterDPI := ARasterDPI; - PDFA := APDFA; - EncodingQuality := AEncodingQuality; -end; - -constructor TSkPDFMetadata.Create(const ATitle, AAuthor, ASubject, AKeywords, - ACreator: string; const ACreation, AModified: TDateTime; - const AProducer: string; const ARasterDPI: Single; const APDFA: Boolean; - const AEncodingQuality: Integer); -begin - Title := ATitle; - Author := AAuthor; - Subject := ASubject; - Keywords := AKeywords; - Creator := ACreator; - Producer := AProducer; - Creation := ACreation; - Modified := AModified; - RasterDPI := ARasterDPI; - PDFA := APDFA; - EncodingQuality := AEncodingQuality; -end; - -class operator TSkPDFMetadata.Equal(const APDFMetadata1, - APDFMetadata2: TSkPDFMetadata): Boolean; -begin - Result := (APDFMetadata1.Title = APDFMetadata2.Title ) and - (APDFMetadata1.Author = APDFMetadata2.Author ) and - (APDFMetadata1.Subject = APDFMetadata2.Subject ) and - (APDFMetadata1.Keywords = APDFMetadata2.Keywords ) and - (APDFMetadata1.Creator = APDFMetadata2.Creator ) and - (APDFMetadata1.Producer = APDFMetadata2.Producer ) and - (APDFMetadata1.Creation = APDFMetadata2.Creation ) and - (APDFMetadata1.Modified = APDFMetadata2.Modified ) and - (APDFMetadata1.PDFA = APDFMetadata2.PDFA ) and - (APDFMetadata1.EncodingQuality = APDFMetadata2.EncodingQuality) and - (SameValue(APDFMetadata1.RasterDPI, APDFMetadata2.RasterDPI, Epsilon)); + Result := sk4d_colorspaceiccprofile_to_xyz(Handle, sk_colorspacexyz_t(ADest)); end; -class operator TSkPDFMetadata.NotEqual(const APDFMetadata1, - APDFMetadata2: TSkPDFMetadata): Boolean; +class procedure TSkColorSpaceICCProfile.__DestroyHandle(const AHandle: THandle); begin - Result := not (APDFMetadata1 = APDFMetadata2); + sk4d_colorspaceiccprofile_destroy(AHandle); end; { TSkDocument } function TSkDocument.BeginPage(const AWidth, AHeight: Single): ISkCanvas; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_document_begin_page(GetHandle, AWidth, AHeight, nil), False); + Result := TSkBindings.SafeCreate(sk4d_document_begin_page(Handle, AWidth, AHeight, nil), False); end; function TSkDocument.BeginPage(const AWidth, AHeight: Single; const AContent: TRectF): ISkCanvas; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_document_begin_page(GetHandle, AWidth, AHeight, @sk_rect_t(AContent)), False); + Result := TSkBindings.SafeCreate(sk4d_document_begin_page(Handle, AWidth, AHeight, @sk_rect_t(AContent)), False); end; procedure TSkDocument.Close; begin - TSkiaAPI.sk4d_document_close(GetHandle); + sk4d_document_close(Handle); end; procedure TSkDocument.EndPage; begin - TSkiaAPI.sk4d_document_end_page(GetHandle); + sk4d_document_end_page(Handle); end; class function TSkDocument.MakePDF(const AStream: TStream): ISkDocument; +var + LDocument: TSkDocument; + LHandle: THandle; + LWStream: ISkWStream; begin - Result := TSkManagedDocument.MakePDF(AStream); + LWStream := TSkWStreamAdapter.Create(AStream); + LHandle := sk4d_document_make_pdf(LWStream.Handle); + if LHandle = 0 then + Exit(nil); + LDocument := TSkDocument.Wrap(LHandle); + LDocument.FHolder := LWStream; + Result := LDocument; end; class function TSkDocument.MakePDF(const AStream: TStream; const AMetadata: TSkPDFMetadata): ISkDocument; +var + LDocument: TSkDocument; + LHandle: THandle; + LMetadata: sk_pdfmetadata_t; + LWStream: ISkWStream; begin - Result := TSkManagedDocument.MakePDF(AStream, AMetadata); + LWStream := TSkWStreamAdapter.Create(AStream); + LMetadata := TSkBindings.AsPDFMetadata(AMetadata); + LHandle := sk4d_document_make_pdf2(LWStream.Handle, @LMetadata); + if LHandle = 0 then + Exit(nil); + LDocument := TSkDocument.Wrap(LHandle); + LDocument.FHolder := LWStream; + Result := LDocument; end; class function TSkDocument.MakeXPS(const AStream: TStream; const ADPI: Single): ISkDocument; +var + LDocument: TSkDocument; + LHandle: THandle; + LWStream: ISkWStream; begin - Result := TSkManagedDocument.MakeXPS(AStream, ADPI); + LWStream := TSkWStreamAdapter.Create(AStream); + LHandle := sk4d_document_make_xps(LWStream.Handle, ADPI); + if LHandle = 0 then + Exit(nil); + LDocument := TSkDocument.Wrap(LHandle); + LDocument.FHolder := LWStream; + Result := LDocument; end; procedure TSkDocument.Terminate; begin - TSkiaAPI.sk4d_document_terminate(GetHandle); -end; - -{ TSkFontMetrics } - -class operator TSkFontMetrics.Equal(const AFontMetrics1, - AFontMetrics2: TSkFontMetrics): Boolean; -begin - Result := (AFontMetrics1.Flags = AFontMetrics2.Flags) and - (SameValue(AFontMetrics1.Top, AFontMetrics2.Top, Epsilon)) and - (SameValue(AFontMetrics1.Ascent, AFontMetrics2.Ascent, Epsilon)) and - (SameValue(AFontMetrics1.Descent, AFontMetrics2.Descent, Epsilon)) and - (SameValue(AFontMetrics1.Bottom, AFontMetrics2.Bottom, Epsilon)) and - (SameValue(AFontMetrics1.Leading, AFontMetrics2.Leading, Epsilon)) and - (SameValue(AFontMetrics1.AvgCharWidth, AFontMetrics2.AvgCharWidth, Epsilon)) and - (SameValue(AFontMetrics1.MaxCharWidth, AFontMetrics2.MaxCharWidth, Epsilon)) and - (SameValue(AFontMetrics1.XMin, AFontMetrics2.XMin, Epsilon)) and - (SameValue(AFontMetrics1.XMax, AFontMetrics2.XMax, Epsilon)) and - (SameValue(AFontMetrics1.XMax, AFontMetrics2.XMax, Epsilon)) and - (SameValue(AFontMetrics1.XHeight, AFontMetrics2.XHeight, Epsilon)) and - (SameValue(AFontMetrics1.UnderlineThickness, AFontMetrics2.UnderlineThickness, Epsilon)) and - (SameValue(AFontMetrics1.UnderlinePosition, AFontMetrics2.UnderlinePosition, Epsilon)) and - (SameValue(AFontMetrics1.StrikeoutThickness, AFontMetrics2.StrikeoutThickness, Epsilon)) and - (SameValue(AFontMetrics1.StrikeoutPosition, AFontMetrics2.StrikeoutPosition, Epsilon)); -end; - -class operator TSkFontMetrics.NotEqual(const AFontMetrics1, - AFontMetrics2: TSkFontMetrics): Boolean; -begin - Result := not (AFontMetrics1 = AFontMetrics2); + sk4d_document_terminate(Handle); end; { TSkFont } -constructor TSkFont.Create(const AFont: ISkFont); -begin - if not Assigned(AFont) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); - inherited Create(TSkiaAPI.sk4d_font_create2(AFont.Handle)); -end; - constructor TSkFont.Create(ATypeface: ISkTypeface; const ASize, AScaleX, ASkewX: Single); begin - inherited Create(TSkiaAPI.sk4d_font_create(TSkBindings.SafeGetHandle(ATypeface), ASize, AScaleX, ASkewX)); + inherited Create(sk4d_font_create(TSkBindings.SafeHandle(ATypeface), ASize, AScaleX, ASkewX)); end; -class procedure TSkFont.DestroyHandle(const AHandle: THandle); +constructor TSkFont.Create(const AFont: ISkFont); begin - TSkiaAPI.sk4d_font_destroy(AHandle); + if not Assigned(AFont) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); + inherited Create(sk4d_font_create2(AFont.Handle)); end; function TSkFont.GetBaselineSnap: Boolean; begin - Result := TSkiaAPI.sk4d_font_get_baseline_snap(GetHandle); + Result := sk4d_font_get_baseline_snap(Handle); end; function TSkFont.GetBounds(const AGlyphs: TArray; @@ -5940,27 +6842,27 @@ function TSkFont.GetBounds(const AGlyphs: TArray; if Length(AGlyphs) = 0 then Exit(nil); SetLength(Result, Length(AGlyphs)); - TSkiaAPI.sk4d_font_get_widths_bounds(GetHandle, @AGlyphs[0], Length(AGlyphs), nil, @sk_rect_t(Result[0]), TSkBindings.SafeGetHandle(APaint)); + sk4d_font_get_widths_bounds(Handle, @AGlyphs[0], Length(AGlyphs), nil, @sk_rect_t(Result[0]), TSkBindings.SafeHandle(APaint)); end; function TSkFont.GetEdging: TSkFontEdging; begin - Result := TSkFontEdging(TSkiaAPI.sk4d_font_get_edging(GetHandle)); + Result := TSkFontEdging(sk4d_font_get_edging(Handle)); end; function TSkFont.GetEmbeddedBitmaps: Boolean; begin - Result := TSkiaAPI.sk4d_font_get_embedded_bitmaps(GetHandle); + Result := sk4d_font_get_embedded_bitmaps(Handle); end; function TSkFont.GetEmbolden: Boolean; begin - Result := TSkiaAPI.sk4d_font_get_embolden(GetHandle); + Result := sk4d_font_get_embolden(Handle); end; function TSkFont.GetForceAutoHinting: Boolean; begin - Result := TSkiaAPI.sk4d_font_get_force_auto_hinting(GetHandle); + Result := sk4d_font_get_force_auto_hinting(Handle); end; function TSkFont.GetGlyphs(const AText: string): TArray; @@ -5969,16 +6871,16 @@ function TSkFont.GetGlyphs(const AText: string): TArray; begin if AText.IsEmpty then Exit(nil); - LCount := TSkiaAPI.sk4d_font_get_glyphs_count(GetHandle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING); + LCount := sk4d_font_get_glyphs_count(Handle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING); if LCount = 0 then Exit(nil); SetLength(Result, LCount); - TSkiaAPI.sk4d_font_get_glyphs(GetHandle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING, @Result[0], LCount); + sk4d_font_get_glyphs(Handle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING, @Result[0], LCount); end; function TSkFont.GetHinting: TSkFontHinting; begin - Result := TSkFontHinting(TSkiaAPI.sk4d_font_get_hinting(GetHandle)); + Result := TSkFontHinting(sk4d_font_get_hinting(Handle)); end; function TSkFont.GetHorizontalPositions(const AGlyphs: TArray; @@ -5987,7 +6889,7 @@ function TSkFont.GetHorizontalPositions(const AGlyphs: TArray; if Length(AGlyphs) = 0 then Exit(nil); SetLength(Result, Length(AGlyphs)); - TSkiaAPI.sk4d_font_get_horizontal_positions(GetHandle, @AGlyphs[0], Length(AGlyphs), @Result[0], AOrigin); + sk4d_font_get_horizontal_positions(Handle, @AGlyphs[0], Length(AGlyphs), @Result[0], AOrigin); end; function TSkFont.GetIntercepts(const AGlyphs: TArray; @@ -6003,36 +6905,41 @@ function TSkFont.GetIntercepts(const AGlyphs: TArray; raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['APositions']); LBounds[0] := AUpperBounds; LBounds[1] := ALowerBounds; - LCount := TSkiaAPI.sk4d_textblob_get_intercepts(GetHandle, @LBounds[0], nil, TSkBindings.SafeGetHandle(APaint)); + LCount := sk4d_textblob_get_intercepts(Handle, @LBounds[0], nil, TSkBindings.SafeHandle(APaint)); if LCount = 0 then Exit(nil); SetLength(Result, LCount); - TSkiaAPI.sk4d_font_get_intercepts(GetHandle, @AGlyphs[0], Length(AGlyphs), @sk_point_t(APositions[0]), @LBounds[0], @Result[0], TSkBindings.SafeGetHandle(APaint)); + sk4d_font_get_intercepts(Handle, @AGlyphs[0], Length(AGlyphs), @sk_point_t(APositions[0]), @LBounds[0], @Result[0], TSkBindings.SafeHandle(APaint)); end; function TSkFont.GetLinearMetrics: Boolean; begin - Result := TSkiaAPI.sk4d_font_get_linear_metrics(GetHandle); + Result := sk4d_font_get_linear_metrics(Handle); end; function TSkFont.GetMetrics(out AMetrics: TSkFontMetrics): Single; var LMetrics: sk_fontmetrics_t; begin - Result := TSkiaAPI.sk4d_font_get_metrics(GetHandle, @LMetrics); - AMetrics := TSkMapping.ToFontMetrics(LMetrics); + Result := sk4d_font_get_metrics(Handle, @LMetrics); + AMetrics := TSkBindings.ToFontMetrics(LMetrics); end; function TSkFont.GetPath(const AGlyph: Word): ISkPath; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_font_get_path(GetHandle, AGlyph)); + Result := TSkBindings.SafeCreate(sk4d_font_get_path(Handle, AGlyph)); end; procedure TSkFont.GetPaths(const AGlyphs: TArray; const AProc: TSkFontPathProc); begin if (Length(AGlyphs) > 0) and (Assigned(AProc)) then - TSkiaAPI.sk4d_font_get_paths(GetHandle, @AGlyphs[0], Length(AGlyphs), path_proc, @AProc); + sk4d_font_get_paths(Handle, @AGlyphs[0], Length(AGlyphs), path_proc, @AProc); +end; + +function TSkFont.GetPositions(const AGlyphs: TArray): TArray; +begin + Result := GetPositions(AGlyphs, TPointF.Create(0, 0)); end; function TSkFont.GetPositions(const AGlyphs: TArray; @@ -6041,47 +6948,42 @@ function TSkFont.GetPositions(const AGlyphs: TArray; if Length(AGlyphs) = 0 then Exit(nil); SetLength(Result, Length(AGlyphs)); - TSkiaAPI.sk4d_font_get_positions(GetHandle, @AGlyphs[0], Length(AGlyphs), @sk_point_t(Result[0]), @sk_point_t(AOrigin)); -end; - -function TSkFont.GetPositions(const AGlyphs: TArray): TArray; -begin - Result := GetPositions(AGlyphs, TPointF.Create(0, 0)); + sk4d_font_get_positions(Handle, @AGlyphs[0], Length(AGlyphs), @sk_point_t(Result[0]), @sk_point_t(AOrigin)); end; function TSkFont.GetScaleX: Single; begin - Result := TSkiaAPI.sk4d_font_get_scale_x(GetHandle); + Result := sk4d_font_get_scale_x(Handle); end; function TSkFont.GetSize: Single; begin - Result := TSkiaAPI.sk4d_font_get_size(GetHandle); + Result := sk4d_font_get_size(Handle); end; function TSkFont.GetSkewX: Single; begin - Result := TSkiaAPI.sk4d_font_get_skew_x(GetHandle); + Result := sk4d_font_get_skew_x(Handle); end; function TSkFont.GetSpacing: Single; begin - Result := TSkiaAPI.sk4d_font_get_metrics(GetHandle, nil); + Result := sk4d_font_get_metrics(Handle, nil); end; function TSkFont.GetSubpixel: Boolean; begin - Result := TSkiaAPI.sk4d_font_get_subpixel(GetHandle); + Result := sk4d_font_get_subpixel(Handle); end; function TSkFont.GetTypeface: ISkTypeface; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_font_get_typeface(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_font_get_typeface(Handle)); end; function TSkFont.GetTypefaceOrDefault: ISkTypeface; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_font_get_typeface_or_default(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_font_get_typeface_or_default(Handle)); end; function TSkFont.GetWidths(const AGlyphs: TArray; @@ -6090,7 +6992,7 @@ function TSkFont.GetWidths(const AGlyphs: TArray; if Length(AGlyphs) = 0 then Exit(nil); SetLength(Result, Length(AGlyphs)); - TSkiaAPI.sk4d_font_get_widths_bounds(GetHandle, @AGlyphs[0], Length(AGlyphs), @Result[0], nil, TSkBindings.SafeGetHandle(APaint)); + sk4d_font_get_widths_bounds(Handle, @AGlyphs[0], Length(AGlyphs), @Result[0], nil, TSkBindings.SafeHandle(APaint)); end; procedure TSkFont.GetWidthsAndBounds(const AGlyphs: TArray; @@ -6101,14 +7003,14 @@ procedure TSkFont.GetWidthsAndBounds(const AGlyphs: TArray; SetLength(ABounds, Length(AGlyphs)); if Length(AGlyphs) = 0 then Exit; - TSkiaAPI.sk4d_font_get_widths_bounds(GetHandle, @AGlyphs[0], Length(AGlyphs), @AWidths[0], @sk_rect_t(ABounds[0]), TSkBindings.SafeGetHandle(APaint)); + sk4d_font_get_widths_bounds(Handle, @AGlyphs[0], Length(AGlyphs), @AWidths[0], @sk_rect_t(ABounds[0]), TSkBindings.SafeHandle(APaint)); end; function TSkFont.IsEqual(const AFont: ISkFont): Boolean; begin if not Assigned(AFont) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); - Result := TSkiaAPI.sk4d_font_is_equal(GetHandle, AFont.Handle); + Result := sk4d_font_is_equal(Handle, AFont.Handle); end; function TSkFont.MakeWithSize(const ASize: Single): ISkFont; @@ -6125,7 +7027,7 @@ function TSkFont.MeasureText(const AText: string; out ABounds: TRectF; ABounds := TRectF.Empty; Exit(0); end; - Result := TSkiaAPI.sk4d_font_measure_text(GetHandle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING, @sk_rect_t(ABounds), TSkBindings.SafeGetHandle(APaint)); + Result := sk4d_font_measure_text(Handle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING, @sk_rect_t(ABounds), TSkBindings.SafeHandle(APaint)); end; function TSkFont.MeasureText(const AText: string; @@ -6133,26 +7035,26 @@ function TSkFont.MeasureText(const AText: string; begin if AText.IsEmpty then Exit(0); - Result := TSkiaAPI.sk4d_font_measure_text(GetHandle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING, nil, TSkBindings.SafeGetHandle(APaint)); + Result := sk4d_font_measure_text(Handle, @AText[Low(AText)], Length(AText) * 2, sk_textencoding_t.UTF16_SK_TEXTENCODING, nil, TSkBindings.SafeHandle(APaint)); end; function TSkFont.MeasureTextGlyphs(const AGlyphs: TArray; - const APaint: ISkPaint): Single; + out ABounds: TRectF; const APaint: ISkPaint): Single; begin if Length(AGlyphs) = 0 then + begin + ABounds := TRectF.Empty; Exit(0); - Result := TSkiaAPI.sk4d_font_measure_text(GetHandle, @AGlyphs[Low(AGlyphs)], Length(AGlyphs) * SizeOf(Word), sk_textencoding_t.GLYPH_ID_SK_TEXTENCODING, nil, TSkBindings.SafeGetHandle(APaint)); + end; + Result := sk4d_font_measure_text(Handle, @AGlyphs[Low(AGlyphs)], Length(AGlyphs) * SizeOf(Word), sk_textencoding_t.GLYPH_ID_SK_TEXTENCODING, @sk_rect_t(ABounds), TSkBindings.SafeHandle(APaint)); end; function TSkFont.MeasureTextGlyphs(const AGlyphs: TArray; - out ABounds: TRectF; const APaint: ISkPaint): Single; + const APaint: ISkPaint): Single; begin if Length(AGlyphs) = 0 then - begin - ABounds := TRectF.Empty; Exit(0); - end; - Result := TSkiaAPI.sk4d_font_measure_text(GetHandle, @AGlyphs[Low(AGlyphs)], Length(AGlyphs) * SizeOf(Word), sk_textencoding_t.GLYPH_ID_SK_TEXTENCODING, @sk_rect_t(ABounds), TSkBindings.SafeGetHandle(APaint)); + Result := sk4d_font_measure_text(Handle, @AGlyphs[Low(AGlyphs)], Length(AGlyphs) * SizeOf(Word), sk_textencoding_t.GLYPH_ID_SK_TEXTENCODING, nil, TSkBindings.SafeHandle(APaint)); end; class procedure TSkFont.path_proc(const path: sk_path_t; @@ -6166,62 +7068,62 @@ class procedure TSkFont.path_proc(const path: sk_path_t; procedure TSkFont.SetBaselineSnap(const AValue: Boolean); begin - TSkiaAPI.sk4d_font_set_baseline_snap(GetHandle, AValue); + sk4d_font_set_baseline_snap(Handle, AValue); end; procedure TSkFont.SetEdging(const AValue: TSkFontEdging); begin - TSkiaAPI.sk4d_font_set_edging(GetHandle, sk_fontedging_t(AValue)); + sk4d_font_set_edging(Handle, sk_fontedging_t(AValue)); end; procedure TSkFont.SetEmbeddedBitmaps(const AValue: Boolean); begin - TSkiaAPI.sk4d_font_set_embedded_bitmaps(GetHandle, AValue); + sk4d_font_set_embedded_bitmaps(Handle, AValue); end; procedure TSkFont.SetEmbolden(const AValue: Boolean); begin - TSkiaAPI.sk4d_font_set_embolden(GetHandle, AValue); + sk4d_font_set_embolden(Handle, AValue); end; procedure TSkFont.SetForceAutoHinting(const AValue: Boolean); begin - TSkiaAPI.sk4d_font_set_force_auto_hinting(GetHandle, AValue); + sk4d_font_set_force_auto_hinting(Handle, AValue); end; procedure TSkFont.SetHinting(const AValue: TSkFontHinting); begin - TSkiaAPI.sk4d_font_set_hinting(GetHandle, sk_fonthinting_t(AValue)); + sk4d_font_set_hinting(Handle, sk_fonthinting_t(AValue)); end; procedure TSkFont.SetLinearMetrics(const AValue: Boolean); begin - TSkiaAPI.sk4d_font_set_linear_metrics(GetHandle, AValue); + sk4d_font_set_linear_metrics(Handle, AValue); end; procedure TSkFont.SetScaleX(const AValue: Single); begin - TSkiaAPI.sk4d_font_set_scale_x(GetHandle, AValue); + sk4d_font_set_scale_x(Handle, AValue); end; procedure TSkFont.SetSize(const AValue: Single); begin - TSkiaAPI.sk4d_font_set_size(GetHandle, AValue); + sk4d_font_set_size(Handle, AValue); end; procedure TSkFont.SetSkewX(const AValue: Single); begin - TSkiaAPI.sk4d_font_set_skew_x(GetHandle, AValue); + sk4d_font_set_skew_x(Handle, AValue); end; procedure TSkFont.SetSubpixel(const AValue: Boolean); begin - TSkiaAPI.sk4d_font_set_subpixel(GetHandle, AValue); + sk4d_font_set_subpixel(Handle, AValue); end; procedure TSkFont.SetTypeface(AValue: ISkTypeface); begin - TSkiaAPI.sk4d_font_set_typeface(GetHandle, TSkBindings.SafeGetHandle(AValue)); + sk4d_font_set_typeface(Handle, TSkBindings.SafeHandle(AValue)); end; function TSkFont.UnicharsToGlyphs( @@ -6230,268 +7132,17 @@ function TSkFont.UnicharsToGlyphs( if Length(AUnichars) = 0 then Exit(nil); SetLength(Result, Length(AUnichars)); - TSkiaAPI.sk4d_font_unichars_to_glyphs(GetHandle, @AUnichars[0], Length(AUnichars), @Result[0]); + sk4d_font_unichars_to_glyphs(Handle, @AUnichars[0], Length(AUnichars), @Result[0]); end; function TSkFont.UnicharToGlyph(const AUnichar: Integer): Word; begin - Result := TSkiaAPI.sk4d_font_unichar_to_glyph(GetHandle, AUnichar); -end; - -{ TSkGraphics } - -class procedure TSkGraphics.AllowJIT; -begin - TSkiaAPI.sk4d_graphics_allow_jit(); -end; - -class procedure TSkGraphics.DumpMemoryStatistics( - const ATraceMemoryDump: ISkTraceMemoryDump); -begin - if not Assigned(ATraceMemoryDump) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATraceMemoryDump']); - TSkiaAPI.sk4d_graphics_dump_memory_statistics(ATraceMemoryDump.Handle); -end; - -class function TSkGraphics.GetFontCacheCountLimit: Integer; -begin - Result := TSkiaAPI.sk4d_graphics_get_font_cache_count_limit(); -end; - -class function TSkGraphics.GetFontCacheCountUsed: Integer; -begin - Result := TSkiaAPI.sk4d_graphics_get_font_cache_count_used(); -end; - -class function TSkGraphics.GetFontCacheLimit: NativeUInt; -begin - Result := TSkiaAPI.sk4d_graphics_get_font_cache_limit(); -end; - -class function TSkGraphics.GetFontCacheUsed: NativeUInt; -begin - Result := TSkiaAPI.sk4d_graphics_get_font_cache_used(); -end; - -class function TSkGraphics.GetResourceCacheSingleAllocationByteLimit: NativeUInt; -begin - Result := TSkiaAPI.sk4d_graphics_get_resource_cache_single_allocation_byte_limit(); -end; - -class function TSkGraphics.GetResourceCacheTotalByteLimit: NativeUInt; -begin - Result := TSkiaAPI.sk4d_graphics_get_resource_cache_total_byte_limit(); -end; - -class function TSkGraphics.GetResourceCacheTotalBytesUsed: NativeUInt; -begin - Result := TSkiaAPI.sk4d_graphics_get_resource_cache_total_bytes_used(); -end; - -class procedure TSkGraphics.Init; -begin - TSkiaAPI.sk4d_graphics_init(); -end; - -class procedure TSkGraphics.PurgeAllCaches; -begin - TSkiaAPI.sk4d_graphics_purge_all_caches(); -end; - -class procedure TSkGraphics.PurgeFontCache; -begin - TSkiaAPI.sk4d_graphics_purge_font_cache(); -end; - -class procedure TSkGraphics.PurgeResourceCache; -begin - TSkiaAPI.sk4d_graphics_purge_resource_cache(); -end; - -class procedure TSkGraphics.SetFontCacheCountLimit(const AValue: Integer); -begin - TSkiaAPI.sk4d_graphics_set_font_cache_count_limit(AValue); -end; - -class procedure TSkGraphics.SetFontCacheLimit(const AValue: NativeUInt); -begin - TSkiaAPI.sk4d_graphics_set_font_cache_limit(AValue); -end; - -class procedure TSkGraphics.SetResourceCacheSingleAllocationByteLimit( - const AValue: NativeUInt); -begin - TSkiaAPI.sk4d_graphics_set_resource_cache_single_allocation_byte_limit(AValue); -end; - -class procedure TSkGraphics.SetResourceCacheTotalByteLimit( - const AValue: NativeUInt); -begin - TSkiaAPI.sk4d_graphics_set_resource_cache_total_byte_limit(AValue); -end; - -{ TSkEncodedImageFormatHelper } - -class function TSkEncodedImageFormatHelper.FromExtension( - const AExtension: string): TSkEncodedImageFormat; -begin - if (string.Compare('.jpg', AExtension, [TCompareOption.coIgnoreCase]) = 0) or (string.Compare('.jpeg', AExtension, [TCompareOption.coIgnoreCase]) = 0) then - Result := TSkEncodedImageFormat.JPEG - else if string.Compare('.webp', AExtension, [TCompareOption.coIgnoreCase]) = 0 then - Result := TSkEncodedImageFormat.WEBP - else if string.Compare('.png', AExtension, [TCompareOption.coIgnoreCase]) = 0 then - Result := TSkEncodedImageFormat.PNG - else - raise ESkArgumentException.Create(SInvalidExtension); -end; - -{ TSkImageInfo } - -function TSkImageInfo.ByteSize(const ARowBytes: NativeUInt): NativeUInt; -begin - Result := ARowBytes * NativeUInt(Height); -end; - -function TSkImageInfo.BytesPerPixel: Integer; -begin - Result := SkBytesPerPixel[ColorType]; -end; - -constructor TSkImageInfo.Create(const AWidth, AHeight: Integer); -begin - Width := AWidth; - Height := AHeight; - ColorType := SkNative32ColorType; - AlphaType := TSkAlphaType.Premul; - ColorSpace := nil; -end; - -constructor TSkImageInfo.Create(const AWidth, AHeight: Integer; - const AColorType: TSkColorType; const AAlphaType: TSkAlphaType; - AColorSpace: ISkColorSpace); -begin - Width := AWidth; - Height := AHeight; - ColorType := AColorType; - AlphaType := AAlphaType; - ColorSpace := AColorSpace; -end; - -class operator TSkImageInfo.Equal(const AImageInfo1, - AImageInfo2: TSkImageInfo): Boolean; -begin - Result := (AImageInfo1.Width = AImageInfo2.Width ) and - (AImageInfo1.Height = AImageInfo2.Height ) and - (AImageInfo1.ColorType = AImageInfo2.ColorType) and - (AImageInfo1.AlphaType = AImageInfo2.AlphaType) and - (Assigned(AImageInfo1.ColorSpace) = Assigned(AImageInfo1.ColorSpace)) and ((not Assigned(AImageInfo1.ColorSpace)) or (AImageInfo1.ColorSpace.IsEqual(AImageInfo2.ColorSpace))); -end; - -function TSkImageInfo.IsEmpty: Boolean; -begin - Result := (Width <= 0) or (Height <= 0); -end; - -function TSkImageInfo.IsOpaque: Boolean; -begin - Result := AlphaType = TSkAlphaType.Opaque; -end; - -function TSkImageInfo.IsValid: Boolean; -const - MaxDimension = MaxInt shr 2; -begin - if (IsEmpty) or (Width > MaxDimension) or (Height > MaxDimension) or (ColorType = TSkColorType.Unknown) or (AlphaType = TSkAlphaType.Unknown) then - Exit(False); - case ColorType of - TSkColorType.Alpha8, - TSkColorType.AlphaF16, - TSkColorType.Alpha16: - begin - if (AlphaType <> TSkAlphaType.Opaque) and (AlphaType <> TSkAlphaType.Premul) then - Exit(False); - end; - TSkColorType.RGB565, - TSkColorType.RGB888X, - TSkColorType.RGB101010X, - TSkColorType.BGR101010X, - TSkColorType.Gray8, - TSkColorType.RG88, - TSkColorType.RGF16, - TSkColorType.RG1616: - begin - if AlphaType <> TSkAlphaType.Opaque then - Exit(False); - end; - end; - Result := True; -end; - -function TSkImageInfo.IsValidRowBytes(const ARowBytes: NativeUInt): Boolean; -begin - if ARowBytes < MinRowBytes then - Exit(False); - Result := ARowBytes = (ARowBytes shr ShiftPerPixel shl ShiftPerPixel); -end; - -function TSkImageInfo.MakeAlphaType( - const AAlphaType: TSkAlphaType): TSkImageInfo; -begin - Result.Width := Width; - Result.Height := Height; - Result.ColorType := ColorType; - Result.AlphaType := AAlphaType; - Result.ColorSpace := ColorSpace; -end; - -function TSkImageInfo.MakeColorSpace(AColorSpace: ISkColorSpace): TSkImageInfo; -begin - Result.Width := Width; - Result.Height := Height; - Result.ColorType := ColorType; - Result.AlphaType := AlphaType; - Result.ColorSpace := AColorSpace; -end; - -function TSkImageInfo.MakeColorType( - const AColorType: TSkColorType): TSkImageInfo; -begin - Result.Width := Width; - Result.Height := Height; - Result.ColorType := AColorType; - Result.AlphaType := AlphaType; - Result.ColorSpace := ColorSpace; -end; - -function TSkImageInfo.MakeDimensions(const AWidth, - AHeight: Integer): TSkImageInfo; -begin - Result.Width := AWidth; - Result.Height := AHeight; - Result.ColorType := ColorType; - Result.AlphaType := AlphaType; - Result.ColorSpace := ColorSpace; -end; - -function TSkImageInfo.MinByteSize: NativeUInt; -begin - Result := ByteSize(MinRowBytes); -end; - -function TSkImageInfo.MinRowBytes: NativeUInt; -begin - Result := Width * BytesPerPixel; -end; - -class operator TSkImageInfo.NotEqual(const AImageInfo1, - AImageInfo2: TSkImageInfo): Boolean; -begin - Result := not (AImageInfo1 = AImageInfo2); + Result := sk4d_font_unichar_to_glyph(Handle, AUnichar); end; -function TSkImageInfo.ShiftPerPixel: Integer; +class procedure TSkFont.__DestroyHandle(const AHandle: THandle); begin - Result := SkShiftPerPixel[ColorType]; + sk4d_font_destroy(AHandle); end; { TSkImage } @@ -6501,7 +7152,7 @@ function TSkImage.Encode(const AEncodedImageFormat: TSkEncodedImageFormat; var LBytesStream: TBytesStream; begin - LBytesStream := TBytesStream.Create(nil); + LBytesStream := TBytesStream.Create; try EncodeToStream(LBytesStream, AEncodedImageFormat, AQuality); Result := Copy(LBytesStream.Bytes, 0, LBytesStream.Size); @@ -6513,16 +7164,18 @@ function TSkImage.Encode(const AEncodedImageFormat: TSkEncodedImageFormat; function TSkImage.EncodeToFile(const AFileName: string; const AQuality: Integer): Boolean; begin - Result := EncodeToFile(AFileName, TSkEncodedImageFormat.FromExtension(TPath.GetExtension(AFileName)), AQuality); + Result := EncodeToFile(AFileName, ExtensionToEncodedImageFormat(TPath.GetExtension(AFileName)), AQuality); end; function TSkImage.EncodeToFile(const AFileName: string; const AEncodedImageFormat: TSkEncodedImageFormat; const AQuality: Integer): Boolean; +var + LMarshaller: TMarshaller; begin if AFileName.IsEmpty then raise ESkException.Create(SFileNameIsEmpty); - Result := TSkiaAPI.sk4d_image_encode_to_file(GetHandle, MarshaledAString(UTF8String(AFileName)), sk_encodedimageformat_t(AEncodedImageFormat), AQuality); + Result := sk4d_image_encode_to_file(Handle, LMarshaller.AsUtf8(AFileName).ToPointer, sk_encodedimageformat_t(AEncodedImageFormat), AQuality); end; function TSkImage.EncodeToStream(const AStream: TStream; @@ -6532,45 +7185,45 @@ function TSkImage.EncodeToStream(const AStream: TStream; LWStream: ISkWStream; begin LWStream := TSkWStreamAdapter.Create(AStream); - Result := TSkiaAPI.sk4d_image_encode_to_stream(GetHandle, LWStream.Handle, sk_encodedimageformat_t(AEncodedImageFormat), AQuality); + Result := sk4d_image_encode_to_stream(Handle, LWStream.Handle, sk_encodedimageformat_t(AEncodedImageFormat), AQuality); end; function TSkImage.GetAlphaType: TSkAlphaType; begin - Result := TSkAlphaType(TSkiaAPI.sk4d_image_get_alpha_type(GetHandle)); + Result := TSkAlphaType(sk4d_image_get_alpha_type(Handle)); end; function TSkImage.GetColorSpace: ISkColorSpace; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_get_color_space(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_image_get_color_space(Handle)); end; function TSkImage.GetColorType: TSkColorType; begin - Result := TSkColorType(TSkiaAPI.sk4d_image_get_color_type(GetHandle)); + Result := TSkColorType(sk4d_image_get_color_type(Handle)); end; function TSkImage.GetHeight: Integer; begin - Result := TSkiaAPI.sk4d_image_get_height(GetHandle); + Result := sk4d_image_get_height(Handle); end; function TSkImage.GetImageInfo: TSkImageInfo; var LResult: sk_imageinfo_t; begin - TSkiaAPI.sk4d_image_get_image_info(GetHandle, LResult); - Result := TSkMapping.ToImageInfo(LResult); + sk4d_image_get_image_info(Handle, LResult); + Result := TSkBindings.ToImageInfo(LResult); end; function TSkImage.GetUniqueId: NativeUInt; begin - Result := TSkiaAPI.sk4d_image_get_unique_id(GetHandle); + Result := sk4d_image_get_unique_id(Handle); end; function TSkImage.GetWidth: Integer; begin - Result := TSkiaAPI.sk4d_image_get_width(GetHandle); + Result := sk4d_image_get_width(Handle); end; function TSkImage.IsAlphaOnly: Boolean; @@ -6586,7 +7239,7 @@ function TSkImage.IsAlphaOnly: Boolean; function TSkImage.IsLazyGenerated: Boolean; begin - Result := TSkiaAPI.sk4d_image_is_lazy_generated(GetHandle); + Result := sk4d_image_is_lazy_generated(Handle); end; function TSkImage.IsOpaque: Boolean; @@ -6596,32 +7249,46 @@ function TSkImage.IsOpaque: Boolean; function TSkImage.IsTextureBacked: Boolean; begin - Result := TSkiaAPI.sk4d_image_is_texture_backed(GetHandle); + Result := sk4d_image_is_texture_backed(Handle); end; function TSkImage.IsValid(AContext: IGrDirectContext): Boolean; begin - Result := TSkiaAPI.sk4d_image_is_valid(GetHandle, TSkBindings.SafeGetHandle(AContext)); + Result := sk4d_image_is_valid(Handle, TSkBindings.SafeHandle(AContext)); end; -function TSkImage.MakeBackendTexture( - const AContext: IGrDirectContext): IGrBackendTexture; +class function TSkImage.MakeCrossContext(const AContext: IGrDirectContext; + const APixmap: ISkPixmap; const ABuildMips, + ALimitToMaxTextureSize: Boolean): ISkImage; +begin + if not Assigned(AContext) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); + if not Assigned(APixmap) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['APixmap']); + Result := TSkBindings.SafeCreate(sk4d_image_make_cross_context(AContext.Handle, APixmap.Handle, ABuildMips, ALimitToMaxTextureSize)); +end; + +class function TSkImage.MakeCrossContext(const AContext: IGrDirectContext; + const AImageInfo: TSkImageInfo; const APixels: Pointer; + const ARowBytes: NativeUInt; const ABuildMips, + ALimitToMaxTextureSize: Boolean): ISkImage; +var + LPixmap: ISkPixmap; begin - if not Assigned(AContext) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_backend_texture(GetHandle, AContext.Handle)); + LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); + Result := MakeCrossContext(AContext, LPixmap, ABuildMips, ALimitToMaxTextureSize); end; class function TSkImage.MakeFromAdoptedTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; AColorType: TSkColorType; const AAlphaType: TSkAlphaType; - const AColorSpace: ISkColorSpace): ISkImage; + AColorSpace: ISkColorSpace): ISkImage; begin if not Assigned(AContext) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); if not Assigned(ATexture) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATexture']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_from_adopted_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeGetHandle(AColorSpace))); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_adopted_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeHandle(AColorSpace))); end; class function TSkImage.MakeFromEncoded(const ABytes: TBytes): ISkImage; @@ -6639,10 +7306,12 @@ class function TSkImage.MakeFromEncoded(const ABytes: TBytes): ISkImage; end; class function TSkImage.MakeFromEncodedFile(const AFileName: string): ISkImage; +var + LMarshaller: TMarshaller; begin if AFileName.IsEmpty then raise ESkException.Create(SFileNameIsEmpty); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_from_encoded_file(MarshaledAString(UTF8String(AFileName)))); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_encoded_file(LMarshaller.AsUtf8(AFileName).ToPointer)); end; class function TSkImage.MakeFromEncodedStream(const AStream: TStream): ISkImage; @@ -6650,17 +7319,50 @@ class function TSkImage.MakeFromEncodedStream(const AStream: TStream): ISkImage; LStream: ISkStream; begin LStream := TSkStreamAdapter.Create(AStream); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_from_encoded_stream(LStream.Handle)); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_encoded_stream(LStream.Handle)); end; -class function TSkImage.MakeFromRaster(const AImageInfo: TSkImageInfo; - const APixels: Pointer; const ARowBytes: NativeUInt; - const ARasterReleaseProc: TSkImageRasterReleaseProc): ISkImage; +class function TSkImage.MakeFromPicture(const APicture: ISkPicture; + const ADimensions: TSize; const AMatrix: TMatrix; + const AProperties: TSkSurfaceProperties; const APaint: ISkPaint; + AColorSpace: ISkColorSpace): ISkImage; var - LPixmap: ISkPixmap; + LProperties: sk_surfaceprops_t; begin - LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); - Result := MakeFromRaster(LPixmap, ARasterReleaseProc); + if not Assigned(APicture) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['APicture']); + LProperties := TSkBindings.AsSurfaceProperties(AProperties); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_picture(APicture.Handle, @sk_isize_t(ADimensions), @sk_matrix_t(AMatrix), TSkBindings.SafeHandle(APaint), TSkBindings.SafeHandle(AColorSpace), @LProperties)); +end; + +class function TSkImage.MakeFromPicture(const APicture: ISkPicture; + const ADimensions: TSize; const AProperties: TSkSurfaceProperties; + const APaint: ISkPaint; AColorSpace: ISkColorSpace): ISkImage; +var + LProperties: sk_surfaceprops_t; +begin + if not Assigned(APicture) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['APicture']); + LProperties := TSkBindings.AsSurfaceProperties(AProperties); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_picture(APicture.Handle, @sk_isize_t(ADimensions), nil, TSkBindings.SafeHandle(APaint), TSkBindings.SafeHandle(AColorSpace), @LProperties)); +end; + +class function TSkImage.MakeFromPicture(const APicture: ISkPicture; + const ADimensions: TSize; const APaint: ISkPaint; + AColorSpace: ISkColorSpace): ISkImage; +begin + if not Assigned(APicture) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['APicture']); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_picture(APicture.Handle, @sk_isize_t(ADimensions), nil, TSkBindings.SafeHandle(APaint), TSkBindings.SafeHandle(AColorSpace), nil)); +end; + +class function TSkImage.MakeFromPicture(const APicture: ISkPicture; + const ADimensions: TSize; const AMatrix: TMatrix; const APaint: ISkPaint; + AColorSpace: ISkColorSpace): ISkImage; +begin + if not Assigned(APicture) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['APicture']); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_picture(APicture.Handle, @sk_isize_t(ADimensions), @sk_matrix_t(AMatrix), TSkBindings.SafeHandle(APaint), TSkBindings.SafeHandle(AColorSpace), nil)); end; class function TSkImage.MakeFromRaster(const APixmap: ISkPixmap; @@ -6673,17 +7375,27 @@ class function TSkImage.MakeFromRaster(const APixmap: ISkPixmap; Result := TSkDelegate.Initialize(ARasterReleaseProc, function (const AContextProc: Pointer): ISkImage begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_from_raster(APixmap.Handle, raster_release_proc, AContextProc)); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_raster(APixmap.Handle, raster_release_proc, AContextProc)); end); end else - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_from_raster(APixmap.Handle, nil, nil)); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_raster(APixmap.Handle, nil, nil)); +end; + +class function TSkImage.MakeFromRaster(const AImageInfo: TSkImageInfo; + const APixels: Pointer; const ARowBytes: NativeUInt; + const ARasterReleaseProc: TSkImageRasterReleaseProc): ISkImage; +var + LPixmap: ISkPixmap; +begin + LPixmap := TSkPixmap.Create(AImageInfo, APixels, ARowBytes); + Result := MakeFromRaster(LPixmap, ARasterReleaseProc); end; class function TSkImage.MakeFromTexture(const AContext: IGrDirectContext; const ATexture: IGrBackendTexture; const AOrigin: TGrSurfaceOrigin; AColorType: TSkColorType; const AAlphaType: TSkAlphaType; - const AColorSpace: ISkColorSpace; + AColorSpace: ISkColorSpace; const ATextureReleaseProc: TSkImageTextureReleaseProc): ISkImage; begin if not Assigned(AContext) then @@ -6695,16 +7407,16 @@ class function TSkImage.MakeFromTexture(const AContext: IGrDirectContext; Result := TSkDelegate.Initialize(ATextureReleaseProc, function (const AContextProc: Pointer): ISkImage begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_from_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeGetHandle(AColorSpace), texture_release_proc, AContextProc)); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeHandle(AColorSpace), texture_release_proc, AContextProc)); end); end else - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_from_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeGetHandle(AColorSpace), nil, nil)); + Result := TSkBindings.SafeCreate(sk4d_image_make_from_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), sk_alphatype_t(AAlphaType), TSkBindings.SafeHandle(AColorSpace), nil, nil)); end; function TSkImage.MakeNonTextureImage: ISkImage; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_non_texture_image(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_image_make_non_texture_image(Handle)); end; class function TSkImage.MakeRasterCopy(const AImageInfo: TSkImageInfo; @@ -6720,18 +7432,12 @@ class function TSkImage.MakeRasterCopy(const APixmap: ISkPixmap): ISkImage; begin if not Assigned(APixmap) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APixmap']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_raster_copy(APixmap.Handle)); + Result := TSkBindings.SafeCreate(sk4d_image_make_raster_copy(APixmap.Handle)); end; function TSkImage.MakeRasterImage: ISkImage; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_raster_image(GetHandle)); -end; - -function TSkImage.MakeRawShader(const ATileModeX, - ATileModeY: TSkTileMode): ISkShader; -begin - Result := MakeRawShader(TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), ATileModeX, ATileModeY); + Result := TSkBindings.SafeCreate(sk4d_image_make_raster_image(Handle)); end; function TSkImage.MakeRawShader(const ALocalMatrix: TMatrix; const ATileModeX, @@ -6743,20 +7449,20 @@ function TSkImage.MakeRawShader(const ALocalMatrix: TMatrix; const ATileModeX, function TSkImage.MakeRawShader(const ASampling: TSkSamplingOptions; const ATileModeX, ATileModeY: TSkTileMode): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_raw_shader(GetHandle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), @sk_samplingoptions_t(ASampling), nil)); + Result := TSkBindings.SafeCreate(sk4d_image_make_raw_shader(Handle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), @sk_samplingoptions_t(ASampling), nil)); end; function TSkImage.MakeRawShader(const ALocalMatrix: TMatrix; const ASampling: TSkSamplingOptions; const ATileModeX, ATileModeY: TSkTileMode): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_raw_shader(GetHandle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), @sk_samplingoptions_t(ASampling), @sk_matrix_t(ALocalMatrix))); + Result := TSkBindings.SafeCreate(sk4d_image_make_raw_shader(Handle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), @sk_samplingoptions_t(ASampling), @sk_matrix_t(ALocalMatrix))); end; -function TSkImage.MakeShader(const ALocalMatrix: TMatrix; const ATileModeX, +function TSkImage.MakeRawShader(const ATileModeX, ATileModeY: TSkTileMode): ISkShader; begin - Result := MakeShader(ALocalMatrix, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), ATileModeX, ATileModeY); + Result := MakeRawShader(TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), ATileModeX, ATileModeY); end; function TSkImage.MakeShader(const ATileModeX, @@ -6765,23 +7471,29 @@ function TSkImage.MakeShader(const ATileModeX, Result := MakeShader(TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), ATileModeX, ATileModeY); end; -function TSkImage.MakeShader(const ALocalMatrix: TMatrix; - const ASampling: TSkSamplingOptions; const ATileModeX, +function TSkImage.MakeShader(const ALocalMatrix: TMatrix; const ATileModeX, ATileModeY: TSkTileMode): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_shader(GetHandle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), @sk_samplingoptions_t(ASampling), @sk_matrix_t(ALocalMatrix))); + Result := MakeShader(ALocalMatrix, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None), ATileModeX, ATileModeY); end; function TSkImage.MakeShader(const ASampling: TSkSamplingOptions; const ATileModeX, ATileModeY: TSkTileMode): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_shader(GetHandle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), @sk_samplingoptions_t(ASampling), nil)); + Result := TSkBindings.SafeCreate(sk4d_image_make_shader(Handle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), @sk_samplingoptions_t(ASampling), nil)); +end; + +function TSkImage.MakeShader(const ALocalMatrix: TMatrix; + const ASampling: TSkSamplingOptions; const ATileModeX, + ATileModeY: TSkTileMode): ISkShader; +begin + Result := TSkBindings.SafeCreate(sk4d_image_make_shader(Handle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), @sk_samplingoptions_t(ASampling), @sk_matrix_t(ALocalMatrix))); end; function TSkImage.MakeSubset(const ASubset: TRect; AContext: IGrDirectContext): ISkImage; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_subset(GetHandle, @sk_irect_t(ASubset), TSkBindings.SafeGetHandle(AContext))); + Result := TSkBindings.SafeCreate(sk4d_image_make_subset(Handle, @sk_irect_t(ASubset), TSkBindings.SafeHandle(AContext))); end; function TSkImage.MakeTextureImage(const AContext: IGrDirectContext; @@ -6789,7 +7501,7 @@ function TSkImage.MakeTextureImage(const AContext: IGrDirectContext; begin if not Assigned(AContext) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_texture_image(GetHandle, AContext.Handle, AIsMipmapped)); + Result := TSkBindings.SafeCreate(sk4d_image_make_texture_image(Handle, AContext.Handle, AIsMipmapped)); end; function TSkImage.MakeWithFilter(const AFilter: ISkImageFilter; const ASubset, @@ -6798,12 +7510,12 @@ function TSkImage.MakeWithFilter(const AFilter: ISkImageFilter; const ASubset, begin if not Assigned(AFilter) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFilter']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_make_with_filter(GetHandle, TSkBindings.SafeGetHandle(AContext), AFilter.Handle, @sk_irect_t(ASubset), @sk_irect_t(AClipBounds), sk_irect_t(AOutSubset), sk_ipoint_t(AOffset))); + Result := TSkBindings.SafeCreate(sk4d_image_make_with_filter(Handle, TSkBindings.SafeHandle(AContext), AFilter.Handle, @sk_irect_t(ASubset), @sk_irect_t(AClipBounds), sk_irect_t(AOutSubset), sk_ipoint_t(AOffset))); end; function TSkImage.PeekPixels: ISkPixmap; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_image_peek_pixels(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_image_peek_pixels(Handle)); end; class procedure TSkImage.raster_release_proc(const pixels: Pointer; @@ -6817,6 +7529,15 @@ class procedure TSkImage.raster_release_proc(const pixels: Pointer; TSkDelegate.Finalize(context); end; +function TSkImage.ReadPixels(const ADest: ISkPixmap; const ASrcX, + ASrcY: Integer; const ACachingHint: TSkImageCachingHint; + AContext: IGrDirectContext): Boolean; +begin + if not Assigned(ADest) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADest']); + Result := sk4d_image_read_pixels(Handle, TSkBindings.SafeHandle(AContext), ADest.Handle, ASrcX, ASrcY, sk_imagecachinghint_t(ACachingHint)); +end; + function TSkImage.ReadPixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASrcX, ASrcY: Integer; const ACachingHint: TSkImageCachingHint; @@ -6828,15 +7549,6 @@ function TSkImage.ReadPixels(const ADestImageInfo: TSkImageInfo; Result := ReadPixels(LPixmap, ASrcX, ASrcY, ACachingHint, AContext); end; -function TSkImage.ReadPixels(const ADest: ISkPixmap; const ASrcX, - ASrcY: Integer; const ACachingHint: TSkImageCachingHint; - AContext: IGrDirectContext): Boolean; -begin - if not Assigned(ADest) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADest']); - Result := TSkiaAPI.sk4d_image_read_pixels(GetHandle, TSkBindings.SafeGetHandle(AContext), ADest.Handle, ASrcX, ASrcY, sk_imagecachinghint_t(ACachingHint)); -end; - function TSkImage.ScalePixels(const ADestImageInfo: TSkImageInfo; const ADestPixels: Pointer; const ADestRowBytes: NativeUInt; const ASampling: TSkSamplingOptions; @@ -6864,7 +7576,7 @@ function TSkImage.ScalePixels(const ADest: ISkPixmap; begin if not Assigned(ADest) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADest']); - Result := TSkiaAPI.sk4d_image_scale_pixels(GetHandle, ADest.Handle, @sk_samplingoptions_t(ASampling), sk_imagecachinghint_t(ACachingHint)); + Result := sk4d_image_scale_pixels(Handle, ADest.Handle, @sk_samplingoptions_t(ASampling), sk_imagecachinghint_t(ACachingHint)); end; function TSkImage.ScalePixels(const ADest: ISkPixmap; @@ -6883,94 +7595,6 @@ class procedure TSkImage.texture_release_proc(context: Pointer); TSkDelegate.Finalize(context); end; -{ TSkImageEncoder } - -class function TSkImageEncoder.Encode(const ASrc: ISkPixmap; - const AEncodedImageFormat: TSkEncodedImageFormat; - const AQuality: Integer): TBytes; -var - LBytesStream: TBytesStream; -begin - LBytesStream := TBytesStream.Create(nil); - try - EncodeToStream(LBytesStream, ASrc, AEncodedImageFormat, AQuality); - Result := Copy(LBytesStream.Bytes, 0, LBytesStream.Size); - finally - LBytesStream.Free; - end; -end; - -class function TSkImageEncoder.Encode(const ASrcImageInfo: TSkImageInfo; - const ASrcPixels: Pointer; const ASrcRowBytes: NativeUInt; - const AEncodedImageFormat: TSkEncodedImageFormat; - const AQuality: Integer): TBytes; -var - LPixmap: ISkPixmap; -begin - LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); - Result := Encode(LPixmap, AEncodedImageFormat, AQuality); -end; - -class function TSkImageEncoder.EncodeToFile(const AFileName: string; - const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; - const ASrcRowBytes: NativeUInt; const AQuality: Integer): Boolean; -begin - Result := EncodeToFile(AFileName, ASrcImageInfo, ASrcPixels, ASrcRowBytes, TSkEncodedImageFormat.FromExtension(TPath.GetExtension(AFileName)), AQuality); -end; - -class function TSkImageEncoder.EncodeToFile(const AFileName: string; - const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat; - const AQuality: Integer): Boolean; -begin - if AFileName.IsEmpty then - raise ESkException.Create(SFileNameIsEmpty); - if not Assigned(ASrc) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ASrc']); - Result := TSkiaAPI.sk4d_imageencoder_encode_to_file(MarshaledAString(UTF8String(AFileName)), ASrc.Handle, sk_encodedimageformat_t(AEncodedImageFormat), AQuality); -end; - -class function TSkImageEncoder.EncodeToFile(const AFileName: string; - const ASrc: ISkPixmap; const AQuality: Integer): Boolean; -begin - Result := EncodeToFile(AFileName, ASrc, TSkEncodedImageFormat.FromExtension(TPath.GetExtension(AFileName)), AQuality); -end; - -class function TSkImageEncoder.EncodeToFile(const AFileName: string; - const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; - const ASrcRowBytes: NativeUInt; - const AEncodedImageFormat: TSkEncodedImageFormat; - const AQuality: Integer): Boolean; -var - LPixmap: ISkPixmap; -begin - LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); - Result := EncodeToFile(AFileName, LPixmap, AEncodedImageFormat, AQuality); -end; - -class function TSkImageEncoder.EncodeToStream(const AStream: TStream; - const ASrc: ISkPixmap; const AEncodedImageFormat: TSkEncodedImageFormat; - const AQuality: Integer): Boolean; -var - LWStream: ISkWStream; -begin - if not Assigned(ASrc) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ASrc']); - LWStream := TSkWStreamAdapter.Create(AStream); - Result := TSkiaAPI.sk4d_imageencoder_encode_to_stream(LWStream.Handle, ASrc.Handle, sk_encodedimageformat_t(AEncodedImageFormat), AQuality); -end; - -class function TSkImageEncoder.EncodeToStream(const AStream: TStream; - const ASrcImageInfo: TSkImageInfo; const ASrcPixels: Pointer; - const ASrcRowBytes: NativeUInt; - const AEncodedImageFormat: TSkEncodedImageFormat; - const AQuality: Integer): Boolean; -var - LPixmap: ISkPixmap; -begin - LPixmap := TSkPixmap.Create(ASrcImageInfo, ASrcPixels, ASrcRowBytes); - Result := EncodeToStream(AStream, LPixmap, AEncodedImageFormat, AQuality); -end; - { TSkImageFilter } class function TSkImageFilter.MakeAlphaThreshold(const ARegion: TRect; @@ -6988,7 +7612,7 @@ class function TSkImageFilter.MakeAlphaThreshold(const ARegion: ISkRegion; begin if not Assigned(ARegion) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_alpha_threshold(ARegion.Handle, AInnerMin, AOuterMax, TSkBindings.SafeGetHandle(AInput))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_alpha_threshold(ARegion.Handle, AInnerMin, AOuterMax, TSkBindings.SafeHandle(AInput))); end; class function TSkImageFilter.MakeArithmetic(const AK1, AK2, AK3, AK4: Single; @@ -6997,7 +7621,7 @@ class function TSkImageFilter.MakeArithmetic(const AK1, AK2, AK3, AK4: Single; begin if not Assigned(ABackground) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ABackground']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_arithmetic(AK1, AK2, AK3, AK4, AEnforcePremultipliedColor, ABackground.Handle, TSkBindings.SafeGetHandle(AForeground), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_arithmetic(AK1, AK2, AK3, AK4, AEnforcePremultipliedColor, ABackground.Handle, TSkBindings.SafeHandle(AForeground), nil)); end; class function TSkImageFilter.MakeArithmetic(const AK1, AK2, AK3, AK4: Single; @@ -7006,7 +7630,7 @@ class function TSkImageFilter.MakeArithmetic(const AK1, AK2, AK3, AK4: Single; begin if not Assigned(ABackground) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ABackground']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_arithmetic(AK1, AK2, AK3, AK4, AEnforcePremultipliedColor, ABackground.Handle, TSkBindings.SafeGetHandle(AForeground), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_arithmetic(AK1, AK2, AK3, AK4, AEnforcePremultipliedColor, ABackground.Handle, TSkBindings.SafeHandle(AForeground), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeBlend(const AMode: TSkBlendMode; @@ -7015,7 +7639,7 @@ class function TSkImageFilter.MakeBlend(const AMode: TSkBlendMode; begin if not Assigned(ABackground) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ABackground']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_blend(sk_blendmode_t(AMode), ABackground.Handle, TSkBindings.SafeGetHandle(AForeground), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_blend(sk_blendmode_t(AMode), ABackground.Handle, TSkBindings.SafeHandle(AForeground), nil)); end; class function TSkImageFilter.MakeBlend(const AMode: TSkBlendMode; @@ -7024,20 +7648,20 @@ class function TSkImageFilter.MakeBlend(const AMode: TSkBlendMode; begin if not Assigned(ABackground) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ABackground']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_blend(sk_blendmode_t(AMode), ABackground.Handle, TSkBindings.SafeGetHandle(AForeground), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_blend(sk_blendmode_t(AMode), ABackground.Handle, TSkBindings.SafeHandle(AForeground), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeBlur(const ASigmaX, ASigmaY: Single; AInput: ISkImageFilter; const ATileMode: TSkTileMode): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_blur(ASigmaX, ASigmaY, sk_tilemode_t(ATileMode), TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_blur(ASigmaX, ASigmaY, sk_tilemode_t(ATileMode), TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeBlur(const ASigmaX, ASigmaY: Single; const ACropRect: TRectF; AInput: ISkImageFilter; const ATileMode: TSkTileMode): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_blur(ASigmaX, ASigmaY, sk_tilemode_t(ATileMode), TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_blur(ASigmaX, ASigmaY, sk_tilemode_t(ATileMode), TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeColorFilter( @@ -7046,7 +7670,7 @@ class function TSkImageFilter.MakeColorFilter( begin if not Assigned(AColorFilter) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AColorFilter']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_colorfilter(AColorFilter.Handle, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_colorfilter(AColorFilter.Handle, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeColorFilter( @@ -7054,7 +7678,7 @@ class function TSkImageFilter.MakeColorFilter( begin if not Assigned(AColorFilter) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AColorFilter']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_colorfilter(AColorFilter.Handle, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_colorfilter(AColorFilter.Handle, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeCompose(const AOuter, @@ -7064,19 +7688,19 @@ class function TSkImageFilter.MakeCompose(const AOuter, raise ESkArgumentException.CreateFmt(SParamIsNil, ['AOuter']); if not Assigned(AInner) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AInner']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_compose(AOuter.Handle, AInner.Handle)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_compose(AOuter.Handle, AInner.Handle)); end; class function TSkImageFilter.MakeDilate(const ARadiusX, ARadiusY: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_dilate(ARadiusX, ARadiusY, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_dilate(ARadiusX, ARadiusY, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeDilate(const ARadiusX, ARadiusY: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_dilate(ARadiusX, ARadiusY, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_dilate(ARadiusX, ARadiusY, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeDisplacementMap(const AXChannelSelector, @@ -7085,7 +7709,7 @@ class function TSkImageFilter.MakeDisplacementMap(const AXChannelSelector, begin if not Assigned(ADisplacement) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADisplacement']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_displacement_map(sk_colorchannel_t(AXChannelSelector), sk_colorchannel_t(AYChannelSelector), AScale, ADisplacement.Handle, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_displacement_map(sk_colorchannel_t(AXChannelSelector), sk_colorchannel_t(AYChannelSelector), AScale, ADisplacement.Handle, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeDisplacementMap(const AXChannelSelector, @@ -7095,75 +7719,75 @@ class function TSkImageFilter.MakeDisplacementMap(const AXChannelSelector, begin if not Assigned(ADisplacement) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADisplacement']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_displacement_map(sk_colorchannel_t(AXChannelSelector), sk_colorchannel_t(AYChannelSelector), AScale, ADisplacement.Handle, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_displacement_map(sk_colorchannel_t(AXChannelSelector), sk_colorchannel_t(AYChannelSelector), AScale, ADisplacement.Handle, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeDistantLitDiffuse(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_distant_lit_diffuse(@sk_point3_t(ADirection), ALightColor, ASurfaceScale, AKd, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_distant_lit_diffuse(@sk_point3_t(ADirection), ALightColor, ASurfaceScale, AKd, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeDistantLitDiffuse(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_distant_lit_diffuse(@sk_point3_t(ADirection), ALightColor, ASurfaceScale, AKd, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_distant_lit_diffuse(@sk_point3_t(ADirection), ALightColor, ASurfaceScale, AKd, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeDistantLitSpecular(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_distant_lit_specular(@sk_point3_t(ADirection), ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_distant_lit_specular(@sk_point3_t(ADirection), ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeDistantLitSpecular(const ADirection: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_distant_lit_specular(@sk_point3_t(ADirection), ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_distant_lit_specular(@sk_point3_t(ADirection), ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeDropShadow(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_drop_shadow(ADeltaX, ADeltaY, ASigmaX, ASigmaY, AColor, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_drop_shadow(ADeltaX, ADeltaY, ASigmaX, ASigmaY, AColor, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeDropShadow(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_drop_shadow(ADeltaX, ADeltaY, ASigmaX, ASigmaY, AColor, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_drop_shadow(ADeltaX, ADeltaY, ASigmaX, ASigmaY, AColor, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeDropShadowOnly(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_drop_shadow_only(ADeltaX, ADeltaY, ASigmaX, ASigmaY, AColor, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_drop_shadow_only(ADeltaX, ADeltaY, ASigmaX, ASigmaY, AColor, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeDropShadowOnly(const ADeltaX, ADeltaY, ASigmaX, ASigmaY: Single; const AColor: TAlphaColor; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_drop_shadow_only( ADeltaX, ADeltaY, ASigmaX, ASigmaY, AColor, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_drop_shadow_only(ADeltaX, ADeltaY, ASigmaX, ASigmaY, AColor, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeErode(const ARadiusX, ARadiusY: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_erode(ARadiusX, ARadiusY, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_erode(ARadiusX, ARadiusY, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeErode(const ARadiusX, ARadiusY: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_erode(ARadiusX, ARadiusY, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_erode(ARadiusX, ARadiusY, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeImage(const AImage: ISkImage; @@ -7188,20 +7812,20 @@ class function TSkImageFilter.MakeImage(const AImage: ISkImage; const ASrc, begin if not Assigned(AImage) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AImage']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_image(AImage.Handle, @sk_rect_t(ASrc), @sk_rect_t(ADest), @sk_samplingoptions_t(ASampling))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_image(AImage.Handle, @sk_rect_t(ASrc), @sk_rect_t(ADest), @sk_samplingoptions_t(ASampling))); end; class function TSkImageFilter.MakeMagnifier(const ASrc: TRectF; const AInset: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_magnifier(@sk_rect_t(ASrc), AInset, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_magnifier(@sk_rect_t(ASrc), AInset, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeMagnifier(const ASrc: TRectF; const AInset: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_magnifier(@sk_rect_t(ASrc), AInset, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_magnifier(@sk_rect_t(ASrc), AInset, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeMatrixConvolution(const AKernelSize: TSize; @@ -7214,7 +7838,7 @@ class function TSkImageFilter.MakeMatrixConvolution(const AKernelSize: TSize; raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AKernel']); if Length(AKernel) <> (AKernelSize.Width * AKernelSize.Height) then raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['AKernel']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_matrix_convolution(@sk_isize_t(AKernelSize), @AKernel[0], AGain, ABias, @sk_ipoint_t(AKernelOffset), sk_tilemode_t(ATileMode), AConvolveAlpha, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_matrix_convolution(@sk_isize_t(AKernelSize), @AKernel[0], AGain, ABias, @sk_ipoint_t(AKernelOffset), sk_tilemode_t(ATileMode), AConvolveAlpha, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeMatrixConvolution(const AKernelSize: TSize; @@ -7226,13 +7850,13 @@ class function TSkImageFilter.MakeMatrixConvolution(const AKernelSize: TSize; raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AKernel']); if Length(AKernel) <> (AKernelSize.Width * AKernelSize.Height) then raise ESkArgumentException.CreateFmt(SParamSizeMismatch, ['AKernel']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_matrix_convolution(@sk_isize_t(AKernelSize), @AKernel[0], AGain, ABias, @sk_ipoint_t(AKernelOffset), sk_tilemode_t(ATileMode), AConvolveAlpha, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_matrix_convolution(@sk_isize_t(AKernelSize), @AKernel[0], AGain, ABias, @sk_ipoint_t(AKernelOffset), sk_tilemode_t(ATileMode), AConvolveAlpha, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeMatrixTransform(const AMatrix: TMatrix; const ASampling: TSkSamplingOptions; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_matrix_transform(@sk_matrix_t(AMatrix), @sk_samplingoptions_t(ASampling), TSkBindings.SafeGetHandle(AInput))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_matrix_transform(@sk_matrix_t(AMatrix), @sk_samplingoptions_t(ASampling), TSkBindings.SafeHandle(AInput))); end; class function TSkImageFilter.MakeMatrixTransform(const AMatrix: TMatrix; @@ -7262,7 +7886,7 @@ class function TSkImageFilter.MakeMerge(const AFilters: TArray; raise ESkArgumentException.CreateFmt(SParamElementIsNil, ['AFilters', I]); LFilters[I] := AFilters[I].Handle; end; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_merge(@LFilters[0], Length(LFilters), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_merge(@LFilters[0], Length(LFilters), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeMerge(const AFilter1, @@ -7286,19 +7910,19 @@ class function TSkImageFilter.MakeMerge( raise ESkArgumentException.CreateFmt(SParamElementIsNil, ['AFilters', I]); LFilters[I] := AFilters[I].Handle; end; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_merge(@LFilters[0], Length(LFilters), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_merge(@LFilters[0], Length(LFilters), nil)); end; class function TSkImageFilter.MakeOffset(const ADeltaX, ADeltaY: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_offset(ADeltaX, ADeltaY, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_offset(ADeltaX, ADeltaY, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeOffset(const ADeltaX, ADeltaY: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_offset(ADeltaX, ADeltaY, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_offset(ADeltaX, ADeltaY, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakePicture(const APicture: ISkPicture; @@ -7306,7 +7930,7 @@ class function TSkImageFilter.MakePicture(const APicture: ISkPicture; begin if not Assigned(APicture) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APicture']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_picture(APicture.Handle, @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_picture(APicture.Handle, @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakePicture( @@ -7314,35 +7938,35 @@ class function TSkImageFilter.MakePicture( begin if not Assigned(APicture) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APicture']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_picture(APicture.Handle, nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_picture(APicture.Handle, nil)); end; class function TSkImageFilter.MakePointLitDiffuse(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_point_lit_diffuse(@sk_point3_t(ALocation), ALightColor, ASurfaceScale, AKd, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_point_lit_diffuse(@sk_point3_t(ALocation), ALightColor, ASurfaceScale, AKd, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakePointLitDiffuse(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_point_lit_diffuse(@sk_point3_t(ALocation), ALightColor, ASurfaceScale, AKd, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_point_lit_diffuse(@sk_point3_t(ALocation), ALightColor, ASurfaceScale, AKd, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakePointLitSpecular(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_point_lit_specular(@sk_point3_t(ALocation), ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_point_lit_specular(@sk_point3_t(ALocation), ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakePointLitSpecular(const ALocation: TPoint3D; const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_point_lit_specular(@sk_point3_t(ALocation), ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_point_lit_specular(@sk_point3_t(ALocation), ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeShader(const AShader: ISkShader; @@ -7350,7 +7974,7 @@ class function TSkImageFilter.MakeShader(const AShader: ISkShader; begin if not Assigned(AShader) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AShader']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_shader(AShader.Handle, ADither, @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_shader(AShader.Handle, ADither, @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeShader(const AShader: ISkShader; @@ -7358,7 +7982,7 @@ class function TSkImageFilter.MakeShader(const AShader: ISkShader; begin if not Assigned(AShader) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AShader']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_shader(AShader.Handle, ADither, nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_shader(AShader.Handle, ADither, nil)); end; class function TSkImageFilter.MakeSpotLitDiffuse(const ALocation, @@ -7366,7 +7990,7 @@ class function TSkImageFilter.MakeSpotLitDiffuse(const ALocation, const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_spot_lit_diffuse(@sk_point3_t(ALocation), @sk_point3_t(ATarget), AFalloffExponent, ACutoffAngle, ALightColor, ASurfaceScale, AKd, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_spot_lit_diffuse(@sk_point3_t(ALocation), @sk_point3_t(ATarget), AFalloffExponent, ACutoffAngle, ALightColor, ASurfaceScale, AKd, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeSpotLitDiffuse(const ALocation, @@ -7374,7 +7998,7 @@ class function TSkImageFilter.MakeSpotLitDiffuse(const ALocation, const ALightColor: TAlphaColor; const ASurfaceScale, AKd: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_spot_lit_diffuse(@sk_point3_t(ALocation), @sk_point3_t(ATarget), AFalloffExponent, ACutoffAngle, ALightColor, ASurfaceScale, AKd, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_spot_lit_diffuse(@sk_point3_t(ALocation), @sk_point3_t(ATarget), AFalloffExponent, ACutoffAngle, ALightColor, ASurfaceScale, AKd, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeSpotLitSpecular(const ALocation, @@ -7382,7 +8006,7 @@ class function TSkImageFilter.MakeSpotLitSpecular(const ALocation, const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_spot_lit_specular(@sk_point3_t(ALocation), @sk_point3_t(ATarget), AFalloffExponent, ACutoffAngle, ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeGetHandle(AInput), nil)); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_spot_lit_specular(@sk_point3_t(ALocation), @sk_point3_t(ATarget), AFalloffExponent, ACutoffAngle, ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeHandle(AInput), nil)); end; class function TSkImageFilter.MakeSpotLitSpecular(const ALocation, @@ -7390,19 +8014,19 @@ class function TSkImageFilter.MakeSpotLitSpecular(const ALocation, const ALightColor: TAlphaColor; const ASurfaceScale, AKs, AShininess: Single; const ACropRect: TRectF; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_spot_lit_specular(@sk_point3_t(ALocation), @sk_point3_t(ATarget), AFalloffExponent, ACutoffAngle, ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeGetHandle(AInput), @sk_rect_t(ACropRect))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_spot_lit_specular(@sk_point3_t(ALocation), @sk_point3_t(ATarget), AFalloffExponent, ACutoffAngle, ALightColor, ASurfaceScale, AKs, AShininess, TSkBindings.SafeHandle(AInput), @sk_rect_t(ACropRect))); end; class function TSkImageFilter.MakeTile(const ASrc, ADest: TRect; AInput: ISkImageFilter): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_tile(@sk_rect_t(ASrc), @sk_rect_t(ADest), TSkBindings.SafeGetHandle(AInput))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_tile(@sk_rect_t(ASrc), @sk_rect_t(ADest), TSkBindings.SafeHandle(AInput))); end; function TSkImageFilter.MakeWithLocalMatrix( const AMatrix: TMatrix): ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_imagefilter_make_with_local_matrix(GetHandle, @sk_matrix_t(AMatrix))); + Result := TSkBindings.SafeCreate(sk4d_imagefilter_make_with_local_matrix(Handle, @sk_matrix_t(AMatrix))); end; { TSkMaskFilter } @@ -7410,7 +8034,7 @@ function TSkImageFilter.MakeWithLocalMatrix( class function TSkMaskFilter.MakeBlur(const AStyle: TSkBlurStyle; const ASigma: Single; const ARespectCTM: Boolean): ISkMaskFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_maskfilter_make_blur(sk_blurstyle_t(AStyle), ASigma, ARespectCTM)); + Result := TSkBindings.SafeCreate(sk4d_maskfilter_make_blur(sk_blurstyle_t(AStyle), ASigma, ARespectCTM)); end; class function TSkMaskFilter.MakeShader( @@ -7418,39 +8042,39 @@ class function TSkMaskFilter.MakeShader( begin if not Assigned(AShader) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AShader']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_maskfilter_make_shader(AShader.Handle)); + Result := TSkBindings.SafeCreate(sk4d_maskfilter_make_shader(AShader.Handle)); end; class function TSkMaskFilter.MakeTable( const ATable: TSkTableFilter): ISkMaskFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_maskfilter_make_table(@ATable)); + Result := TSkBindings.SafeCreate(sk4d_maskfilter_make_table(@ATable)); end; class function TSkMaskFilter.MakeTableClip(const AMin, AMax: Byte): ISkMaskFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_maskfilter_make_table_clip(AMin, AMax)); + Result := TSkBindings.SafeCreate(sk4d_maskfilter_make_table_clip(AMin, AMax)); end; class function TSkMaskFilter.MakeTableGamma( const AGamma: Single): ISkMaskFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_maskfilter_make_table_gamma(AGamma)); + Result := TSkBindings.SafeCreate(sk4d_maskfilter_make_table_gamma(AGamma)); end; { TSkPaint } constructor TSkPaint.Create; begin - inherited Create(TSkiaAPI.sk4d_paint_create()); + inherited Create(sk4d_paint_create()); end; constructor TSkPaint.Create(const APaint: ISkPaint); begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - inherited Create(TSkiaAPI.sk4d_paint_create2(APaint.Handle)); + inherited Create(sk4d_paint_create2(APaint.Handle)); end; constructor TSkPaint.Create(const AStyle: TSkPaintStyle); @@ -7459,49 +8083,44 @@ constructor TSkPaint.Create(const AStyle: TSkPaintStyle); SetStyle(AStyle); end; -class procedure TSkPaint.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_paint_destroy(AHandle); -end; - function TSkPaint.GetAlpha: Byte; begin - Result := TSkiaAPI.sk4d_paint_get_alpha(GetHandle); + Result := sk4d_paint_get_alpha(Handle); end; function TSkPaint.GetAlphaF: Single; begin - Result := TSkiaAPI.sk4d_paint_get_alphaf(GetHandle); + Result := sk4d_paint_get_alphaf(Handle); end; function TSkPaint.GetAntiAlias: Boolean; begin - Result := TSkiaAPI.sk4d_paint_get_anti_alias(GetHandle); + Result := sk4d_paint_get_anti_alias(Handle); end; function TSkPaint.GetBlender: ISkBlender; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_paint_get_blender(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_paint_get_blender(Handle)); end; function TSkPaint.GetColor: TAlphaColor; begin - Result := TSkiaAPI.sk4d_paint_get_color(GetHandle); + Result := sk4d_paint_get_color(Handle); end; function TSkPaint.GetColorF: TAlphaColorF; begin - TSkiaAPI.sk4d_paint_get_colorf(GetHandle, sk_color4f_t(Result)); + sk4d_paint_get_colorf(Handle, sk_color4f_t(Result)); end; function TSkPaint.GetColorFilter: ISkColorFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_paint_get_color_filter(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_paint_get_color_filter(Handle)); end; function TSkPaint.GetDither: Boolean; begin - Result := TSkiaAPI.sk4d_paint_get_dither(GetHandle); + Result := sk4d_paint_get_dither(Handle); end; function TSkPaint.GetFillPath(const APath: ISkPath; const ACullRect: TRectF; @@ -7509,155 +8128,160 @@ function TSkPaint.GetFillPath(const APath: ISkPath; const ACullRect: TRectF; begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_paint_get_fill_path(GetHandle, APath.Handle, @sk_rect_t(ACullRect), AResScale)); + Result := TSkBindings.SafeCreate(sk4d_paint_get_fill_path(Handle, APath.Handle, @sk_rect_t(ACullRect), AResScale)); end; function TSkPaint.GetFillPath(const APath: ISkPath): ISkPath; begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_paint_get_fill_path(GetHandle, APath.Handle, nil, 1)); + Result := TSkBindings.SafeCreate(sk4d_paint_get_fill_path(Handle, APath.Handle, nil, 1)); end; function TSkPaint.GetImageFilter: ISkImageFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_paint_get_image_filter(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_paint_get_image_filter(Handle)); end; function TSkPaint.GetMaskFilter: ISkMaskFilter; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_paint_get_mask_filter(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_paint_get_mask_filter(Handle)); end; function TSkPaint.GetPathEffect: ISkPathEffect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_paint_get_path_effect(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_paint_get_path_effect(Handle)); end; function TSkPaint.GetShader: ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_paint_get_shader(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_paint_get_shader(Handle)); end; function TSkPaint.GetStrokeCap: TSkStrokeCap; begin - Result := TSkStrokeCap(TSkiaAPI.sk4d_paint_get_stroke_cap(GetHandle)); + Result := TSkStrokeCap(sk4d_paint_get_stroke_cap(Handle)); end; function TSkPaint.GetStrokeJoin: TSkStrokeJoin; begin - Result := TSkStrokeJoin(TSkiaAPI.sk4d_paint_get_stroke_join(GetHandle)); + Result := TSkStrokeJoin(sk4d_paint_get_stroke_join(Handle)); end; function TSkPaint.GetStrokeMiter: Single; begin - Result := TSkiaAPI.sk4d_paint_get_stroke_miter(GetHandle); + Result := sk4d_paint_get_stroke_miter(Handle); end; function TSkPaint.GetStrokeWidth: Single; begin - Result := TSkiaAPI.sk4d_paint_get_stroke_width(GetHandle); + Result := sk4d_paint_get_stroke_width(Handle); end; function TSkPaint.GetStyle: TSkPaintStyle; begin - Result := TSkPaintStyle(TSkiaAPI.sk4d_paint_get_style(GetHandle)) + Result := TSkPaintStyle(sk4d_paint_get_style(Handle)) end; procedure TSkPaint.Reset; begin - TSkiaAPI.sk4d_paint_reset(GetHandle); + sk4d_paint_reset(Handle); end; procedure TSkPaint.SetAlpha(const AValue: Byte); begin - TSkiaAPI.sk4d_paint_set_alpha(GetHandle, AValue); + sk4d_paint_set_alpha(Handle, AValue); end; procedure TSkPaint.SetAlphaF(const AValue: Single); begin - TSkiaAPI.sk4d_paint_set_alphaf(GetHandle, AValue); + sk4d_paint_set_alphaf(Handle, AValue); end; procedure TSkPaint.SetAntiAlias(const AValue: Boolean); begin - TSkiaAPI.sk4d_paint_set_antialias(GetHandle, AValue); + sk4d_paint_set_antialias(Handle, AValue); end; procedure TSkPaint.SetARGB(const A, R, G, B: Byte); begin - TSkiaAPI.sk4d_paint_set_argb(GetHandle, A, R, G, B); + sk4d_paint_set_argb(Handle, A, R, G, B); end; procedure TSkPaint.SetBlender(AValue: ISkBlender); begin - TSkiaAPI.sk4d_paint_set_blender(GetHandle, TSkBindings.SafeGetHandle(AValue)); + sk4d_paint_set_blender(Handle, TSkBindings.SafeHandle(AValue)); end; procedure TSkPaint.SetColor(const AValue: TAlphaColor); begin - TSkiaAPI.sk4d_paint_set_color(GetHandle, AValue); + sk4d_paint_set_color(Handle, AValue); end; procedure TSkPaint.SetColorF(const AValue: TAlphaColorF; AColorSpace: ISkColorSpace); begin - TSkiaAPI.sk4d_paint_set_colorf(GetHandle, @sk_color4f_t(AValue), TSkBindings.SafeGetHandle(AColorSpace)); + sk4d_paint_set_colorf(Handle, @sk_color4f_t(AValue), TSkBindings.SafeHandle(AColorSpace)); end; procedure TSkPaint.SetColorFilter(AValue: ISkColorFilter); begin - TSkiaAPI.sk4d_paint_set_color_filter(GetHandle, TSkBindings.SafeGetHandle(AValue)); + sk4d_paint_set_color_filter(Handle, TSkBindings.SafeHandle(AValue)); end; procedure TSkPaint.SetDither(const AValue: Boolean); begin - TSkiaAPI.sk4d_paint_set_dither(GetHandle, AValue); + sk4d_paint_set_dither(Handle, AValue); end; procedure TSkPaint.SetImageFilter(AValue: ISkImageFilter); begin - TSkiaAPI.sk4d_paint_set_image_filter(GetHandle, TSkBindings.SafeGetHandle(AValue)); + sk4d_paint_set_image_filter(Handle, TSkBindings.SafeHandle(AValue)); end; procedure TSkPaint.SetMaskFilter(AValue: ISkMaskFilter); begin - TSkiaAPI.sk4d_paint_set_mask_filter(GetHandle, TSkBindings.SafeGetHandle(AValue)); + sk4d_paint_set_mask_filter(Handle, TSkBindings.SafeHandle(AValue)); end; procedure TSkPaint.SetPathEffect(AValue: ISkPathEffect); begin - TSkiaAPI.sk4d_paint_set_path_effect(GetHandle, TSkBindings.SafeGetHandle(AValue)); + sk4d_paint_set_path_effect(Handle, TSkBindings.SafeHandle(AValue)); end; procedure TSkPaint.SetShader(AValue: ISkShader); begin - TSkiaAPI.sk4d_paint_set_shader(GetHandle, TSkBindings.SafeGetHandle(AValue)); + sk4d_paint_set_shader(Handle, TSkBindings.SafeHandle(AValue)); end; procedure TSkPaint.SetStrokeCap(const AValue: TSkStrokeCap); begin - TSkiaAPI.sk4d_paint_set_stroke_cap(GetHandle, sk_strokecap_t(AValue)); + sk4d_paint_set_stroke_cap(Handle, sk_strokecap_t(AValue)); end; procedure TSkPaint.SetStrokeJoin(const AValue: TSkStrokeJoin); begin - TSkiaAPI.sk4d_paint_set_stroke_join(GetHandle, sk_strokejoin_t(AValue)); + sk4d_paint_set_stroke_join(Handle, sk_strokejoin_t(AValue)); end; procedure TSkPaint.SetStrokeMiter(const AValue: Single); begin - TSkiaAPI.sk4d_paint_set_stroke_miter(GetHandle, AValue); + sk4d_paint_set_stroke_miter(Handle, AValue); end; procedure TSkPaint.SetStrokeWidth(const AValue: Single); begin - TSkiaAPI.sk4d_paint_set_stroke_width(GetHandle, AValue); + sk4d_paint_set_stroke_width(Handle, AValue); end; procedure TSkPaint.SetStyle(const AValue: TSkPaintStyle); begin - TSkiaAPI.sk4d_paint_set_style(GetHandle, sk_paintstyle_t(AValue)); + sk4d_paint_set_style(Handle, sk_paintstyle_t(AValue)); +end; + +class procedure TSkPaint.__DestroyHandle(const AHandle: THandle); +begin + sk4d_paint_destroy(AHandle); end; { TSkOpBuilder } @@ -7666,29 +8290,29 @@ procedure TSkOpBuilder.Add(const APath: ISkPath; const AOp: TSkPathOp); begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - TSkiaAPI.sk4d_opbuilder_add(GetHandle, APath.Handle, sk_pathop_t(AOp)); + sk4d_opbuilder_add(Handle, APath.Handle, sk_pathop_t(AOp)); end; constructor TSkOpBuilder.Create; begin - inherited Create(TSkiaAPI.sk4d_opbuilder_create()); + inherited Create(sk4d_opbuilder_create()); end; -class procedure TSkOpBuilder.DestroyHandle(const AHandle: THandle); +function TSkOpBuilder.Detach: ISkPath; begin - TSkiaAPI.sk4d_opbuilder_destroy(AHandle); + Result := TSkBindings.SafeCreate(sk4d_opbuilder_detach(Handle)); end; -function TSkOpBuilder.Detach: ISkPath; +class procedure TSkOpBuilder.__DestroyHandle(const AHandle: THandle); begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_opbuilder_detach(GetHandle)); + sk4d_opbuilder_destroy(AHandle); end; { TSkPath } function TSkPath.Contains(const AX, AY: Single): Boolean; begin - Result := TSkiaAPI.sk4d_path_contains(GetHandle, AX, AY); + Result := sk4d_path_contains(Handle, AX, AY); end; class function TSkPath.ConvertConicToQuads(const APoint1, APoint2, @@ -7697,17 +8321,19 @@ class function TSkPath.ConvertConicToQuads(const APoint1, APoint2, begin SetLength(Result, 1 + 2 * (1 shl APower2)); if Length(Result) > 0 then - TSkiaAPI.sk4d_path_convert_conic_to_quads(@sk_point_t(APoint1), @sk_point_t(APoint2), @sk_point_t(APoint3), AWeight, @sk_point_t(Result[0]), APower2); + sk4d_path_convert_conic_to_quads(@sk_point_t(APoint1), @sk_point_t(APoint2), @sk_point_t(APoint3), AWeight, @sk_point_t(Result[0]), APower2); end; constructor TSkPath.Create(const ASVG: string); +var + LMarshaller: TMarshaller; begin - inherited Create(TSkiaAPI.sk4d_path_create(MarshaledAString(UTF8String(ASVG)))); + inherited Create(sk4d_path_create(MarshaledAString(LMarshaller.AsUtf8(ASVG).ToPointer))); end; constructor TSkPath.Create(const ABytes: TBytes); var - LStream: TBytesStream; + LStream: TStream; begin LStream := TBytesStream.Create(ABytes); try @@ -7722,22 +8348,17 @@ constructor TSkPath.Create(const AStream: TStream); LStream: ISkStream; begin LStream := TSkStreamAdapter.Create(AStream); - inherited Create(TSkiaAPI.sk4d_path_create2(LStream.Handle)); -end; - -class procedure TSkPath.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_path_destroy(AHandle); + inherited Create(sk4d_path_create2(LStream.Handle)); end; function TSkPath.GetBounds: TRectF; begin - TSkiaAPI.sk4d_path_get_bounds(GetHandle, sk_rect_t(Result)); + sk4d_path_get_bounds(Handle, sk_rect_t(Result)); end; function TSkPath.GetFillType: TSkPathFillType; begin - Result := TSkPathFillType(TSkiaAPI.sk4d_path_get_fill_type(GetHandle)); + Result := TSkPathFillType(sk4d_path_get_fill_type(Handle)); end; function TSkPath.GetIterator(const AForceClose: Boolean): ISkPathIterator; @@ -7747,18 +8368,18 @@ function TSkPath.GetIterator(const AForceClose: Boolean): ISkPathIterator; function TSkPath.GetLastPoint: TPointF; begin - if not TSkiaAPI.sk4d_path_get_last_point(GetHandle, sk_point_t(Result)) then + if not sk4d_path_get_last_point(Handle, sk_point_t(Result)) then Result := TPointF.Create(0, 0); end; function TSkPath.GetSegmentMasks: TSkSegmentMasks; begin - Result := TSkSegmentMasks(Byte(TSkiaAPI.sk4d_path_get_segment_masks(GetHandle))); + Result := TSkSegmentMasks(Byte(sk4d_path_get_segment_masks(Handle))); end; function TSkPath.GetTightBounds: TRectF; begin - TSkiaAPI.sk4d_path_get_tight_bounds(GetHandle, sk_rect_t(Result)); + sk4d_path_get_tight_bounds(Handle, sk_rect_t(Result)); end; function TSkPath.Interpolate(const AEnding: ISkPath; @@ -7766,34 +8387,39 @@ function TSkPath.Interpolate(const AEnding: ISkPath; begin if not Assigned(AEnding) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AEnding']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_path_interpolate(GetHandle, AEnding.Handle, AWeight)); + Result := TSkBindings.SafeCreate(sk4d_path_interpolate(Handle, AEnding.Handle, AWeight)); end; function TSkPath.IsConvex: Boolean; begin - Result := TSkiaAPI.sk4d_path_is_convex(GetHandle); + Result := sk4d_path_is_convex(Handle); end; function TSkPath.IsEmpty: Boolean; begin - Result := TSkiaAPI.sk4d_path_is_empty(GetHandle); + Result := sk4d_path_is_empty(Handle); end; function TSkPath.IsFinite: Boolean; begin - Result := TSkiaAPI.sk4d_path_is_finite(GetHandle); + Result := sk4d_path_is_finite(Handle); end; function TSkPath.IsInterpolatable(const APath: ISkPath): Boolean; begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - Result := TSkiaAPI.sk4d_path_is_interpolatable(GetHandle, APath.Handle); + Result := sk4d_path_is_interpolatable(Handle, APath.Handle); end; function TSkPath.IsLastContourClosed: Boolean; begin - Result := TSkiaAPI.sk4d_path_is_last_contour_closed(GetHandle); + Result := sk4d_path_is_last_contour_closed(Handle); +end; + +function TSkPath.IsLine: Boolean; +begin + Result := sk4d_path_is_line(Handle, nil); end; function TSkPath.IsLine(out APoint1, APoint2: TPointF): Boolean; @@ -7802,32 +8428,27 @@ function TSkPath.IsLine(out APoint1, APoint2: TPointF): Boolean; begin LLines[0] := APoint1; LLines[1] := APoint2; - Result := TSkiaAPI.sk4d_path_is_line(GetHandle, @sk_point_t(LLines[0])); -end; - -function TSkPath.IsLine: Boolean; -begin - Result := TSkiaAPI.sk4d_path_is_line(GetHandle, nil); + Result := sk4d_path_is_line(Handle, @sk_point_t(LLines[0])); end; function TSkPath.IsOval(out ARect: TRectF): Boolean; begin - Result := TSkiaAPI.sk4d_path_is_oval(GetHandle, @sk_rect_t(ARect)); + Result := sk4d_path_is_oval(Handle, @sk_rect_t(ARect)); end; function TSkPath.IsOval: Boolean; begin - Result := TSkiaAPI.sk4d_path_is_oval(GetHandle, nil); + Result := sk4d_path_is_oval(Handle, nil); end; -function TSkPath.IsRect: Boolean; +function TSkPath.IsRect(out ARect: TRectF): Boolean; begin - Result := TSkiaAPI.sk4d_path_is_rect(GetHandle, nil); + Result := sk4d_path_is_rect(Handle, @sk_rect_t(ARect)); end; -function TSkPath.IsRect(out ARect: TRectF): Boolean; +function TSkPath.IsRect: Boolean; begin - Result := TSkiaAPI.sk4d_path_is_rect(GetHandle, @sk_rect_t(ARect)); + Result := sk4d_path_is_rect(Handle, nil); end; function TSkPath.IsRoundRect(out ARoundRect: ISkRoundRect): Boolean; @@ -7835,26 +8456,33 @@ function TSkPath.IsRoundRect(out ARoundRect: ISkRoundRect): Boolean; LRoundRect: ISkRoundRect; begin LRoundRect := TSkRoundRect.Create; - Result := TSkiaAPI.sk4d_path_is_rrect(GetHandle, TSkBindings.SafeGetHandle(LRoundRect)); + Result := sk4d_path_is_rrect(Handle, TSkBindings.SafeHandle(LRoundRect)); if Result then ARoundRect := LRoundRect; end; function TSkPath.IsRoundRect: Boolean; begin - Result := TSkiaAPI.sk4d_path_is_rrect(GetHandle, 0); + Result := sk4d_path_is_rrect(Handle, 0); +end; + +function TSkPath.Op(const APath: ISkPath; const AOp: TSkPathOp): ISkPath; +begin + if not Assigned(APath) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); + Result := TSkBindings.SafeCreate(sk4d_path_op(Handle, APath.Handle, sk_pathop_t(AOp))); end; function TSkPath.Serialize: TBytes; var - LStream: TBytesStream; + LBytesStream: TBytesStream; begin - LStream := TBytesStream.Create(nil); + LBytesStream := TBytesStream.Create; try - SerializeToStream(LStream); - Result := Copy(LStream.Bytes, 0, LStream.Size); + SerializeToStream(LBytesStream); + Result := Copy(LBytesStream.Bytes, 0, LBytesStream.Size); finally - LStream.Free; + LBytesStream.Free; end; end; @@ -7863,20 +8491,25 @@ procedure TSkPath.SerializeToStream(const AStream: TStream); LWStream: ISkWStream; begin LWStream := TSkWStreamAdapter.Create(AStream); - TSkiaAPI.sk4d_path_serialize_to_stream(GetHandle, LWStream.Handle); + sk4d_path_serialize_to_stream(Handle, LWStream.Handle); end; function TSkPath.ToSVG: string; var LResult: ISkString; begin - LResult := TSkString.Wrap(TSkiaAPI.sk4d_path_to_svg(GetHandle)); + LResult := TSkString.Wrap(sk4d_path_to_svg(Handle)); Result := LResult.Text; end; function TSkPath.Transform(const AMatrix: TMatrix): ISkPath; begin - Result := TSkPath.Wrap(TSkiaAPI.sk4d_path_transform(GetHandle, @sk_matrix_t(AMatrix))); + Result := TSkPath.Wrap(sk4d_path_transform(Handle, @sk_matrix_t(AMatrix))); +end; + +class procedure TSkPath.__DestroyHandle(const AHandle: THandle); +begin + sk4d_path_destroy(AHandle); end; { TSkPath.TPathIterator } @@ -7884,12 +8517,7 @@ function TSkPath.Transform(const AMatrix: TMatrix): ISkPath; constructor TSkPath.TPathIterator.Create(const APath: ISkPath; const AForceClose: Boolean); begin - inherited Create(TSkiaAPI.sk4d_pathiterator_create(APath.Handle, AForceClose)); -end; - -class procedure TSkPath.TPathIterator.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_pathiterator_destroy(AHandle); + inherited Create(sk4d_pathiterator_create(APath.Handle, AForceClose)); end; function TSkPath.TPathIterator.GetCurrent: TSkPathIteratorElem; @@ -7899,7 +8527,12 @@ function TSkPath.TPathIterator.GetCurrent: TSkPathIteratorElem; function TSkPath.TPathIterator.MoveNext: Boolean; begin - Result := TSkiaAPI.sk4d_pathiterator_next(GetHandle, sk_pathiteratorelem_t(FCurrent)); + Result := sk4d_pathiterator_next(Handle, sk_pathiteratorelem_t(FCurrent)); +end; + +class procedure TSkPath.TPathIterator.__DestroyHandle(const AHandle: THandle); +begin + sk4d_pathiterator_destroy(AHandle); end; { TSkPathBuilder } @@ -7907,45 +8540,45 @@ function TSkPath.TPathIterator.MoveNext: Boolean; procedure TSkPathBuilder.AddArc(const AOval: TRectF; const AStartAngle, ASweepAngle: Single); begin - TSkiaAPI.sk4d_pathbuilder_add_arc(GetHandle, @sk_rect_t(AOval), AStartAngle, ASweepAngle); + sk4d_pathbuilder_add_arc(Handle, @sk_rect_t(AOval), AStartAngle, ASweepAngle); end; -procedure TSkPathBuilder.AddCircle(const ACenter: TPointF; ARadius: Single; +procedure TSkPathBuilder.AddCircle(const ACenterX, ACenterY, ARadius: Single; ADirection: TSkPathDirection); begin - AddCircle(ACenter.X, ACenter.Y, ARadius, ADirection); + sk4d_pathbuilder_add_circle(Handle,ACenterX, ACenterY, ARadius, sk_pathdirection_t(ADirection)); end; -procedure TSkPathBuilder.AddCircle(const ACenterX, ACenterY, ARadius: Single; +procedure TSkPathBuilder.AddCircle(const ACenter: TPointF; ARadius: Single; ADirection: TSkPathDirection); begin - TSkiaAPI.sk4d_pathbuilder_add_circle(GetHandle,ACenterX, ACenterY, ARadius, sk_pathdirection_t(ADirection)); + AddCircle(ACenter.X, ACenter.Y, ARadius, ADirection); end; procedure TSkPathBuilder.AddOval(const ARect: TRectF; - ADirection: TSkPathDirection); + ADirection: TSkPathDirection; AStartIndex: Cardinal); begin - AddOval(ARect, ADirection, 1); + sk4d_pathbuilder_add_oval(Handle, @sk_rect_t(ARect), sk_pathdirection_t(ADirection), AStartIndex); end; procedure TSkPathBuilder.AddOval(const ARect: TRectF; - ADirection: TSkPathDirection; AStartIndex: Cardinal); + ADirection: TSkPathDirection); begin - TSkiaAPI.sk4d_pathbuilder_add_oval(GetHandle, @sk_rect_t(ARect), sk_pathdirection_t(ADirection), AStartIndex); + AddOval(ARect, ADirection, 1); end; procedure TSkPathBuilder.AddPath(const APath: ISkPath); begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - TSkiaAPI.sk4d_pathbuilder_add_path(GetHandle, APath.Handle); + sk4d_pathbuilder_add_path(Handle, APath.Handle); end; procedure TSkPathBuilder.AddPolygon(const APolygon: TPolygon; const IsClosed: Boolean); begin if Length(APolygon) > 0 then - TSkiaAPI.sk4d_pathbuilder_add_polygon(GetHandle, @sk_point_t(APolygon[0]), Length(APolygon), IsClosed); + sk4d_pathbuilder_add_polygon(Handle, @sk_point_t(APolygon[0]), Length(APolygon), IsClosed); end; procedure TSkPathBuilder.AddRect(const ARect: TRectF; @@ -7953,7 +8586,7 @@ procedure TSkPathBuilder.AddRect(const ARect: TRectF; begin if AStartIndex > 3 then raise ESkArgumentException.CreateFmt(SParamOutOfRange, ['AStartIndex', AStartIndex, 0, 4]); - TSkiaAPI.sk4d_pathbuilder_add_rect(GetHandle, @sk_rect_t(ARect), sk_pathdirection_t(ADirection), AStartIndex); + sk4d_pathbuilder_add_rect(Handle, @sk_rect_t(ARect), sk_pathdirection_t(ADirection), AStartIndex); end; procedure TSkPathBuilder.AddRect(const ARect: TRectF; @@ -7963,57 +8596,57 @@ procedure TSkPathBuilder.AddRect(const ARect: TRectF; end; procedure TSkPathBuilder.AddRoundRect(const ARoundRect: ISkRoundRect; - ADirection: TSkPathDirection; AStartIndex: Cardinal); + ADirection: TSkPathDirection); begin - if not Assigned(ARoundRect) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARoundRect']); - TSkiaAPI.sk4d_pathbuilder_add_rrect(GetHandle, ARoundRect.Handle, sk_pathdirection_t(ADirection), AStartIndex); + AddRoundRect(ARoundRect, ADirection, IfThen(ADirection = TSkPathDirection.CW, 6, 7)); end; procedure TSkPathBuilder.AddRoundRect(const ARoundRect: ISkRoundRect; - ADirection: TSkPathDirection); + ADirection: TSkPathDirection; AStartIndex: Cardinal); begin - AddRoundRect(ARoundRect, ADirection, IfThen(ADirection = TSkPathDirection.CW, 6, 7)); + if not Assigned(ARoundRect) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARoundRect']); + sk4d_pathbuilder_add_rrect(Handle, ARoundRect.Handle, sk_pathdirection_t(ADirection), AStartIndex); end; procedure TSkPathBuilder.ArcTo(const APoint1, APoint2: TPointF; const ARadius: Single); begin - TSkiaAPI.sk4d_pathbuilder_arc_to3(GetHandle, @sk_point_t(APoint1), @sk_point_t(APoint2), ARadius); + sk4d_pathbuilder_arc_to3(Handle, @sk_point_t(APoint1), @sk_point_t(APoint2), ARadius); end; procedure TSkPathBuilder.ArcTo(const AOval: TRectF; const AStartAngle, ASweepAngle: Single; const AForceMoveTo: Boolean); begin - TSkiaAPI.sk4d_pathbuilder_arc_to2(GetHandle, @sk_rect_t(AOval), AStartAngle, ASweepAngle, AForceMoveTo); + sk4d_pathbuilder_arc_to2(Handle, @sk_rect_t(AOval), AStartAngle, ASweepAngle, AForceMoveTo); end; procedure TSkPathBuilder.ArcTo(const ARadius: TPointF; const XAxisRotate: Single; const ALargeArc: TSkPathArcSize; const ASweep: TSkPathDirection; const AXY: TPointF); begin - TSkiaAPI.sk4d_pathbuilder_arc_to(GetHandle, @sk_point_t(ARadius), XAxisRotate, sk_patharcsize_t(ALargeArc), sk_pathdirection_t(ASweep), @sk_point_t(AXY)); + sk4d_pathbuilder_arc_to(Handle, @sk_point_t(ARadius), XAxisRotate, sk_patharcsize_t(ALargeArc), sk_pathdirection_t(ASweep), @sk_point_t(AXY)); end; procedure TSkPathBuilder.Close; begin - TSkiaAPI.sk4d_pathbuilder_close(GetHandle); + sk4d_pathbuilder_close(Handle); end; -procedure TSkPathBuilder.ConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); +procedure TSkPathBuilder.ConicTo(const APoint1, APoint2: TPointF; + const AWeight: Single); begin - ConicTo(TPointF.Create(AX1, AY1), TPointF.Create(AX2, AY2), AWeight); + sk4d_pathbuilder_conic_to(Handle, @sk_point_t(APoint1), @sk_point_t(APoint2), AWeight); end; -procedure TSkPathBuilder.ConicTo(const APoint1, APoint2: TPointF; - const AWeight: Single); +procedure TSkPathBuilder.ConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); begin - TSkiaAPI.sk4d_pathbuilder_conic_to(GetHandle, @sk_point_t(APoint1), @sk_point_t(APoint2), AWeight); + ConicTo(TPointF.Create(AX1, AY1), TPointF.Create(AX2, AY2), AWeight); end; constructor TSkPathBuilder.Create; begin - inherited Create(TSkiaAPI.sk4d_pathbuilder_create()); + inherited Create(sk4d_pathbuilder_create()); end; constructor TSkPathBuilder.Create(const AFillType: TSkPathFillType); @@ -8026,12 +8659,12 @@ constructor TSkPathBuilder.Create(const APathBuilder: ISkPathBuilder); begin if not Assigned(APathBuilder) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APathBuilder']); - inherited Create(TSkiaAPI.sk4d_pathbuilder_create2(APathBuilder.Handle)); + inherited Create(sk4d_pathbuilder_create2(APathBuilder.Handle)); end; procedure TSkPathBuilder.CubicTo(const APoint1, APoint2, APoint3: TPointF); begin - TSkiaAPI.sk4d_pathbuilder_cubic_to(GetHandle, @sk_point_t(APoint1), @sk_point_t(APoint2), @sk_point_t(APoint3)); + sk4d_pathbuilder_cubic_to(Handle, @sk_point_t(APoint1), @sk_point_t(APoint2), @sk_point_t(APoint3)); end; procedure TSkPathBuilder.CubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); @@ -8039,30 +8672,19 @@ procedure TSkPathBuilder.CubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); CubicTo(TPointF.Create(AX1, AY1), TPointF.Create(AX2, AY2), TPointF.Create(AX3, AY3)); end; -class procedure TSkPathBuilder.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_pathbuilder_destroy(AHandle); -end; - function TSkPathBuilder.Detach: ISkPath; begin - Result := TSkPath.Wrap(TSkiaAPI.sk4d_pathbuilder_detach(GetHandle)); + Result := TSkPath.Wrap(sk4d_pathbuilder_detach(Handle)); end; function TSkPathBuilder.GetBounds: TRectF; begin - TSkiaAPI.sk4d_pathbuilder_get_bounds(GetHandle, sk_rect_t(Result)); + sk4d_pathbuilder_get_bounds(Handle, sk_rect_t(Result)); end; function TSkPathBuilder.GetFillType: TSkPathFillType; begin - Result := TSkPathFillType(TSkiaAPI.sk4d_pathbuilder_get_fill_type(GetHandle)); -end; - -procedure TSkPathBuilder.IncReserve(const AExtraPointCount, - AExtraVerbCount: Integer); -begin - TSkiaAPI.sk4d_pathbuilder_inc_reserve(GetHandle, AExtraPointCount, AExtraVerbCount); + Result := TSkPathFillType(sk4d_pathbuilder_get_fill_type(Handle)); end; procedure TSkPathBuilder.IncReserve(const AExtraPointCount: Integer); @@ -8070,9 +8692,10 @@ procedure TSkPathBuilder.IncReserve(const AExtraPointCount: Integer); IncReserve(AExtraPointCount, AExtraPointCount); end; -procedure TSkPathBuilder.LineTo(const APoint: TPointF); +procedure TSkPathBuilder.IncReserve(const AExtraPointCount, + AExtraVerbCount: Integer); begin - TSkiaAPI.sk4d_pathbuilder_line_to(GetHandle, @sk_point_t(APoint)); + sk4d_pathbuilder_inc_reserve(Handle, AExtraPointCount, AExtraVerbCount); end; procedure TSkPathBuilder.LineTo(const AX, AY: Single); @@ -8080,6 +8703,11 @@ procedure TSkPathBuilder.LineTo(const AX, AY: Single); LineTo(TPointF.Create(AX, AY)); end; +procedure TSkPathBuilder.LineTo(const APoint: TPointF); +begin + sk4d_pathbuilder_line_to(Handle, @sk_point_t(APoint)); +end; + procedure TSkPathBuilder.MoveTo(const AX, AY: Single); begin MoveTo(TPointF.Create(AX, AY)); @@ -8087,18 +8715,18 @@ procedure TSkPathBuilder.MoveTo(const AX, AY: Single); procedure TSkPathBuilder.MoveTo(const APoint: TPointF); begin - TSkiaAPI.sk4d_pathbuilder_move_to(GetHandle, @sk_point_t(APoint)); + sk4d_pathbuilder_move_to(Handle, @sk_point_t(APoint)); end; procedure TSkPathBuilder.Offset(const ADeltaX, ADeltaY: Single); begin - TSkiaAPI.sk4d_pathbuilder_offset(GetHandle, ADeltaX, ADeltaY); + sk4d_pathbuilder_offset(Handle, ADeltaX, ADeltaY); end; procedure TSkPathBuilder.PolylineTo(const APoints: TArray); begin if Length(APoints) > 0 then - TSkiaAPI.sk4d_pathbuilder_polyline_to(GetHandle, @sk_point_t(APoints[0]), Length(APoints)); + sk4d_pathbuilder_polyline_to(Handle, @sk_point_t(APoints[0]), Length(APoints)); end; procedure TSkPathBuilder.QuadTo(const AX1, AY1, AX2, AY2: Single); @@ -8108,18 +8736,18 @@ procedure TSkPathBuilder.QuadTo(const AX1, AY1, AX2, AY2: Single); procedure TSkPathBuilder.QuadTo(const APoint1, APoint2: TPointF); begin - TSkiaAPI.sk4d_pathbuilder_quad_to(GetHandle, @sk_point_t(APoint1), @sk_point_t(APoint2)); + sk4d_pathbuilder_quad_to(Handle, @sk_point_t(APoint1), @sk_point_t(APoint2)); end; -procedure TSkPathBuilder.RConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); +procedure TSkPathBuilder.RConicTo(const APoint1, APoint2: TPointF; + const AWeight: Single); begin - RConicTo(TPointF.Create(AX1, AY1), TPointF.Create(AX2, AY2), AWeight); + sk4d_pathbuilder_r_conic_to(Handle, @sk_point_t(APoint1), @sk_point_t(APoint2), AWeight); end; -procedure TSkPathBuilder.RConicTo(const APoint1, APoint2: TPointF; - const AWeight: Single); +procedure TSkPathBuilder.RConicTo(const AX1, AY1, AX2, AY2, AWeight: Single); begin - TSkiaAPI.sk4d_pathbuilder_r_conic_to(GetHandle, @sk_point_t(APoint1), @sk_point_t(APoint2), AWeight); + RConicTo(TPointF.Create(AX1, AY1), TPointF.Create(AX2, AY2), AWeight); end; procedure TSkPathBuilder.RCubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); @@ -8129,17 +8757,12 @@ procedure TSkPathBuilder.RCubicTo(const AX1, AY1, AX2, AY2, AX3, AY3: Single); procedure TSkPathBuilder.RCubicTo(const APoint1, APoint2, APoint3: TPointF); begin - TSkiaAPI.sk4d_pathbuilder_r_cubic_to(GetHandle, @sk_point_t(APoint1), @sk_point_t(APoint2), @sk_point_t(APoint3)); + sk4d_pathbuilder_r_cubic_to(Handle, @sk_point_t(APoint1), @sk_point_t(APoint2), @sk_point_t(APoint3)); end; procedure TSkPathBuilder.Reset; begin - TSkiaAPI.sk4d_pathbuilder_reset(GetHandle); -end; - -procedure TSkPathBuilder.RLineTo(const APoint: TPointF); -begin - TSkiaAPI.sk4d_pathbuilder_r_line_to(GetHandle, @sk_point_t(APoint)); + sk4d_pathbuilder_reset(Handle); end; procedure TSkPathBuilder.RLineTo(const AX, AY: Single); @@ -8147,9 +8770,9 @@ procedure TSkPathBuilder.RLineTo(const AX, AY: Single); RLineTo(TPointF.Create(AX, AY)); end; -procedure TSkPathBuilder.RQuadTo(const APoint1, APoint2: TPointF); +procedure TSkPathBuilder.RLineTo(const APoint: TPointF); begin - TSkiaAPI.sk4d_pathbuilder_r_quad_to(GetHandle, @sk_point_t(APoint1), @sk_point_t(APoint2)); + sk4d_pathbuilder_r_line_to(Handle, @sk_point_t(APoint)); end; procedure TSkPathBuilder.RQuadTo(const AX1, AY1, AX2, AY2: Single); @@ -8157,19 +8780,29 @@ procedure TSkPathBuilder.RQuadTo(const AX1, AY1, AX2, AY2: Single); RQuadTo(TPointF.Create(AX1, AY1), TPointF.Create(AX2, AY2)); end; +procedure TSkPathBuilder.RQuadTo(const APoint1, APoint2: TPointF); +begin + sk4d_pathbuilder_r_quad_to(Handle, @sk_point_t(APoint1), @sk_point_t(APoint2)); +end; + procedure TSkPathBuilder.SetFillType(const AValue: TSkPathFillType); begin - TSkiaAPI.sk4d_pathbuilder_set_filltype(GetHandle, sk_pathfilltype_t(AValue)); + sk4d_pathbuilder_set_filltype(Handle, sk_pathfilltype_t(AValue)); end; function TSkPathBuilder.Snapshot: ISkPath; begin - Result := TSkPath.Wrap(TSkiaAPI.sk4d_pathbuilder_snapshot(GetHandle)); + Result := TSkPath.Wrap(sk4d_pathbuilder_snapshot(Handle)); end; procedure TSkPathBuilder.ToggleInverseFillType; begin - TSkiaAPI.sk4d_pathbuilder_toggle_inverse_filltype(GetHandle); + sk4d_pathbuilder_toggle_inverse_filltype(Handle); +end; + +class procedure TSkPathBuilder.__DestroyHandle(const AHandle: THandle); +begin + sk4d_pathbuilder_destroy(AHandle); end; { TSkPathEffect } @@ -8179,13 +8812,13 @@ class function TSkPathEffect.Make1DPath(const APath: ISkPath; const AAdvance, begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_1dpath(APath.Handle, AAdvance, APhase, sk_patheffect1dstyle_t(AStyle))); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_1dpath(APath.Handle, AAdvance, APhase, sk_patheffect1dstyle_t(AStyle))); end; class function TSkPathEffect.Make2DLine(const AWidth: Single; const AMatrix: TMatrix): ISkPathEffect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_2dline(AWidth, @sk_matrix_t(AMatrix))); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_2dline(AWidth, @sk_matrix_t(AMatrix))); end; class function TSkPathEffect.Make2DPath(const AMatrix: TMatrix; @@ -8193,7 +8826,7 @@ class function TSkPathEffect.Make2DPath(const AMatrix: TMatrix; begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_2dpath(@sk_matrix_t(AMatrix), APath.Handle)); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_2dpath(@sk_matrix_t(AMatrix), APath.Handle)); end; class function TSkPathEffect.MakeCompose(const AOuter, @@ -8203,12 +8836,12 @@ class function TSkPathEffect.MakeCompose(const AOuter, raise ESkArgumentException.CreateFmt(SParamIsNil, ['AOuter']); if not Assigned(AInner) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AInner']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_compose(AOuter.Handle, AInner.Handle)); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_compose(AOuter.Handle, AInner.Handle)); end; class function TSkPathEffect.MakeCorner(const ARadius: Single): ISkPathEffect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_corner(ARadius)); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_corner(ARadius)); end; class function TSkPathEffect.MakeDash(const AIntervals: TArray; @@ -8218,18 +8851,18 @@ class function TSkPathEffect.MakeDash(const AIntervals: TArray; raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AIntervals']); if Odd(Length(AIntervals)) then raise ESkArgumentException.CreateFmt(SParamSizeIsOdd, ['AIntervals']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_dash(@AIntervals[0], Length(AIntervals), APhase)); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_dash(@AIntervals[0], Length(AIntervals), APhase)); end; class function TSkPathEffect.MakeDiscrete(const ASegLength, ADeviation: Single; const ASeedAssist: Cardinal): ISkPathEffect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_discrete(ASegLength, ADeviation, ASeedAssist)); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_discrete(ASegLength, ADeviation, ASeedAssist)); end; class function TSkPathEffect.MakeMatrix(const AMatrix: TMatrix): ISkPathEffect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_matrix(@sk_matrix_t(AMatrix))); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_matrix(@sk_matrix_t(AMatrix))); end; class function TSkPathEffect.MakeMerge(const AEffect1, AEffect2: ISkPathEffect; @@ -8239,19 +8872,19 @@ class function TSkPathEffect.MakeMerge(const AEffect1, AEffect2: ISkPathEffect; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AEffect1']); if not Assigned(AEffect2) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AEffect2']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_merge(AEffect1.Handle, AEffect2.Handle, sk_pathop_t(AOp))); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_merge(AEffect1.Handle, AEffect2.Handle, sk_pathop_t(AOp))); end; class function TSkPathEffect.MakeStroke(const AWidth: Single; const AJoin: TSkStrokeJoin; const ACap: TSkStrokeCap; const AMiter: Single): ISkPathEffect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_stroke(AWidth, sk_strokejoin_t(AJoin), sk_strokecap_t(ACap), AMiter)); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_stroke(AWidth, sk_strokejoin_t(AJoin), sk_strokecap_t(ACap), AMiter)); end; class function TSkPathEffect.MakeStrokeAndFill: ISkPathEffect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_stroke_and_fill()); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_stroke_and_fill()); end; class function TSkPathEffect.MakeSum(const AEffect1, @@ -8261,19 +8894,19 @@ class function TSkPathEffect.MakeSum(const AEffect1, raise ESkArgumentException.CreateFmt(SParamIsNil, ['AEffect1']); if not Assigned(AEffect2) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AEffect2']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_sum(AEffect1.Handle, AEffect2.Handle)); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_sum(AEffect1.Handle, AEffect2.Handle)); end; class function TSkPathEffect.MakeTranslate(const ADeltaX, ADeltaY: Single): ISkPathEffect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_translate(ADeltaX, ADeltaY)); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_translate(ADeltaX, ADeltaY)); end; class function TSkPathEffect.MakeTrim(const AStart, AStop: Single; const AMode: TSkPathEffectTrimMode): ISkPathEffect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_patheffect_make_trim(AStart, AStop, sk_patheffecttrimmode_t(AMode))); + Result := TSkBindings.SafeCreate(sk4d_patheffect_make_trim(AStart, AStop, sk_patheffecttrimmode_t(AMode))); end; { TSkPathMeasure } @@ -8283,57 +8916,57 @@ constructor TSkPathMeasure.Create(const APath: ISkPath; begin if not Assigned(APath) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); - inherited Create(TSkiaAPI.sk4d_pathmeasure_create(APath.Handle, AForceClosed, AResScale)); -end; - -class procedure TSkPathMeasure.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_pathmeasure_destroy(AHandle); + inherited Create(sk4d_pathmeasure_create(APath.Handle, AForceClosed, AResScale)); end; function TSkPathMeasure.GetLength: Single; begin - Result := TSkiaAPI.sk4d_pathmeasure_get_length(GetHandle); + Result := sk4d_pathmeasure_get_length(Handle); end; function TSkPathMeasure.GetMatrix(const ADistance: Single; out AMatrix: TMatrix; const AMatrixFlags: TSkPathMeasureMatrixFlags): Boolean; begin - Result := TSkiaAPI.sk4d_pathmeasure_get_matrix(GetHandle, ADistance, sk_matrix_t(AMatrix), Byte(AMatrixFlags)); + Result := sk4d_pathmeasure_get_matrix(Handle, ADistance, sk_matrix_t(AMatrix), Byte(AMatrixFlags)); end; function TSkPathMeasure.GetPositionAndTangent(const ADistance: Single; out APosition, ATangent: TPointF): Boolean; begin - Result := TSkiaAPI.sk4d_pathmeasure_get_position_and_tangent(GetHandle, ADistance, sk_point_t(APosition), sk_vector_t(ATangent)); + Result := sk4d_pathmeasure_get_position_and_tangent(Handle, ADistance, sk_point_t(APosition), sk_vector_t(ATangent)); end; function TSkPathMeasure.GetSegment(const AStart, AStop: Single; const AStartWithMoveTo: Boolean): ISkPath; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_pathmeasure_get_segment(GetHandle, AStart, AStop, AStartWithMoveTo)); + Result := TSkBindings.SafeCreate(sk4d_pathmeasure_get_segment(Handle, AStart, AStop, AStartWithMoveTo)); end; function TSkPathMeasure.IsClosed: Boolean; begin - Result := TSkiaAPI.sk4d_pathmeasure_is_closed(GetHandle); + Result := sk4d_pathmeasure_is_closed(Handle); end; function TSkPathMeasure.NextContour: Boolean; begin - Result := TSkiaAPI.sk4d_pathmeasure_next_contour(GetHandle); + Result := sk4d_pathmeasure_next_contour(Handle); +end; + +class procedure TSkPathMeasure.__DestroyHandle(const AHandle: THandle); +begin + sk4d_pathmeasure_destroy(AHandle); end; { TSkPicture } function TSkPicture.GetCullRect: TRectF; begin - TSkiaAPI.sk4d_picture_get_cull_rect(GetHandle, sk_rect_t(Result)); + sk4d_picture_get_cull_rect(Handle, sk_rect_t(Result)); end; class function TSkPicture.MakeFromBytes(const ABytes: TBytes): ISkPicture; var - LStream: TBytesStream; + LStream: TStream; begin LStream := TBytesStream.Create(ABytes); try @@ -8348,51 +8981,51 @@ class function TSkPicture.MakeFromStream(const AStream: TStream): ISkPicture; LStream: ISkStream; begin LStream := TSkStreamAdapter.Create(AStream); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_picture_make_from_stream(LStream.Handle)); + Result := TSkBindings.SafeCreate(sk4d_picture_make_from_stream(LStream.Handle)); end; function TSkPicture.MakeShader(const ALocalMatrix: TMatrix; const ATileModeX, ATileModeY: TSkTileMode; const AFilterMode: TSkFilterMode): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_picture_make_shader(GetHandle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), sk_filtermode_t(AFilterMode), @sk_matrix_t(ALocalMatrix), nil)); + Result := TSkBindings.SafeCreate(sk4d_picture_make_shader(Handle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), sk_filtermode_t(AFilterMode), @sk_matrix_t(ALocalMatrix), nil)); end; function TSkPicture.MakeShader(const ATileModeX, ATileModeY: TSkTileMode; const AFilterMode: TSkFilterMode): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_picture_make_shader(GetHandle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), sk_filtermode_t(AFilterMode), nil, nil)); + Result := TSkBindings.SafeCreate(sk4d_picture_make_shader(Handle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), sk_filtermode_t(AFilterMode), nil, nil)); end; function TSkPicture.MakeShader(const ATileRect: TRectF; const ATileModeX, ATileModeY: TSkTileMode; const AFilterMode: TSkFilterMode): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_picture_make_shader(GetHandle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), sk_filtermode_t(AFilterMode), nil, @sk_rect_t(ATileRect))); + Result := TSkBindings.SafeCreate(sk4d_picture_make_shader(Handle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), sk_filtermode_t(AFilterMode), nil, @sk_rect_t(ATileRect))); end; function TSkPicture.MakeShader(const ATileRect: TRectF; const ALocalMatrix: TMatrix; const ATileModeX, ATileModeY: TSkTileMode; const AFilterMode: TSkFilterMode): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_picture_make_shader(GetHandle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), sk_filtermode_t(AFilterMode), @sk_matrix_t(ALocalMatrix), @sk_rect_t(ATileRect))); + Result := TSkBindings.SafeCreate(sk4d_picture_make_shader(Handle, sk_tilemode_t(ATileModeX), sk_tilemode_t(ATileModeY), sk_filtermode_t(AFilterMode), @sk_matrix_t(ALocalMatrix), @sk_rect_t(ATileRect))); end; procedure TSkPicture.Playback(const ACanvas: ISkCanvas); begin if not Assigned(ACanvas) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); - TSkiaAPI.sk4d_picture_playback(GetHandle, ACanvas.Handle); + sk4d_picture_playback(Handle, ACanvas.Handle); end; function TSkPicture.Serialize: TBytes; var - LStream: TBytesStream; + LBytesStream: TBytesStream; begin - LStream := TBytesStream.Create(nil); + LBytesStream := TBytesStream.Create; try - SerializeToStream(LStream); - Result := Copy(LStream.Bytes, 0, LStream.Size); + SerializeToStream(LBytesStream); + Result := Copy(LBytesStream.Bytes, 0, LBytesStream.Size); finally - LStream.Free; + LBytesStream.Free; end; end; @@ -8401,7 +9034,7 @@ procedure TSkPicture.SerializeToStream(const AStream: TStream); LWStream: ISkWStream; begin LWStream := TSkWStreamAdapter.Create(AStream); - TSkiaAPI.sk4d_picture_serialize_to_stream(GetHandle, LWStream.Handle); + sk4d_picture_serialize_to_stream(Handle, LWStream.Handle); end; { TSkPictureRecorder } @@ -8414,28 +9047,28 @@ function TSkPictureRecorder.BeginRecording(const AWidth, function TSkPictureRecorder.BeginRecording(const ABounds: TRectF): ISkCanvas; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_picturerecorder_begin_recording(GetHandle, @sk_rect_t(ABounds)), False); + Result := TSkBindings.SafeCreate(sk4d_picturerecorder_begin_recording(Handle, @sk_rect_t(ABounds)), False); end; constructor TSkPictureRecorder.Create; begin - inherited Create(TSkiaAPI.sk4d_picturerecorder_create()); -end; - -class procedure TSkPictureRecorder.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_picturerecorder_destroy(AHandle); + inherited Create(sk4d_picturerecorder_create()); end; function TSkPictureRecorder.FinishRecording: ISkPicture; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_picturerecorder_finish_recording(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_picturerecorder_finish_recording(Handle)); end; function TSkPictureRecorder.FinishRecording( const ACullRect: TRectF): ISkPicture; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_picturerecorder_finish_recording2(GetHandle, @sk_rect_t(ACullRect))); + Result := TSkBindings.SafeCreate(sk4d_picturerecorder_finish_recording2(Handle, @sk_rect_t(ACullRect))); +end; + +class procedure TSkPictureRecorder.__DestroyHandle(const AHandle: THandle); +begin + sk4d_picturerecorder_destroy(AHandle); end; { TSkPixmap } @@ -8445,36 +9078,31 @@ constructor TSkPixmap.Create(const AImageInfo: TSkImageInfo; var LImageInfo: sk_imageinfo_t; begin - LImageInfo := TSkMapping.AsImageInfo(AImageInfo); - inherited Create(TSkiaAPI.sk4d_pixmap_create(@LImageInfo, APixels, ARowBytes)); -end; - -class procedure TSkPixmap.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_pixmap_destroy(AHandle); + LImageInfo := TSkBindings.AsImageInfo(AImageInfo); + inherited Create(sk4d_pixmap_create(@LImageInfo, APixels, ARowBytes)); end; function TSkPixmap.Erase(const AColor: TAlphaColorF; const ASubset: TRectF; AColorSpace: ISkColorSpace): Boolean; begin - Result := TSkiaAPI.sk4d_pixmap_erase2(GetHandle, @sk_color4f_t(AColor), TSkBindings.SafeGetHandle(AColorSpace), @sk_irect_t(ASubset)); + Result := sk4d_pixmap_erase2(Handle, @sk_color4f_t(AColor), TSkBindings.SafeHandle(AColorSpace), @sk_irect_t(ASubset)); end; -function TSkPixmap.Erase(const AColor: TAlphaColor; - const ASubset: TRectF): Boolean; +function TSkPixmap.Erase(const AColor: TAlphaColor): Boolean; begin - Result := TSkiaAPI.sk4d_pixmap_erase(GetHandle, AColor, @sk_irect_t(ASubset)); + Result := sk4d_pixmap_erase(Handle, AColor, nil); end; function TSkPixmap.Erase(const AColor: TAlphaColorF; AColorSpace: ISkColorSpace): Boolean; begin - Result := TSkiaAPI.sk4d_pixmap_erase2(GetHandle, @sk_color4f_t(AColor), TSkBindings.SafeGetHandle(AColorSpace), nil); + Result := sk4d_pixmap_erase2(Handle, @sk_color4f_t(AColor), TSkBindings.SafeHandle(AColorSpace), nil); end; -function TSkPixmap.Erase(const AColor: TAlphaColor): Boolean; +function TSkPixmap.Erase(const AColor: TAlphaColor; + const ASubset: TRectF): Boolean; begin - Result := TSkiaAPI.sk4d_pixmap_erase(GetHandle, AColor, nil); + Result := sk4d_pixmap_erase(Handle, AColor, @sk_irect_t(ASubset)); end; function TSkPixmap.ExtractSubset(const ADest: ISkPixmap; @@ -8482,65 +9110,70 @@ function TSkPixmap.ExtractSubset(const ADest: ISkPixmap; begin if not Assigned(ADest) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADest']); - Result := TSkiaAPI.sk4d_pixmap_extract_subset(GetHandle, ADest.Handle, @sk_irect_t(AArea)); + Result := sk4d_pixmap_extract_subset(Handle, ADest.Handle, @sk_irect_t(AArea)); end; function TSkPixmap.GetAlpha(const AX, AY: Integer): Single; begin - Result := TSkiaAPI.sk4d_pixmap_get_alpha(GetHandle, AX, AY); + Result := sk4d_pixmap_get_alpha(Handle, AX, AY); end; function TSkPixmap.GetAlphaType: TSkAlphaType; begin - Result := TSkAlphaType(TSkiaAPI.sk4d_pixmap_get_alpha_type(GetHandle)); + Result := TSkAlphaType(sk4d_pixmap_get_alpha_type(Handle)); end; function TSkPixmap.GetColor(const AX, AY: Integer): TAlphaColor; begin - Result := TSkiaAPI.sk4d_pixmap_get_color(GetHandle, AX, AY); + Result := sk4d_pixmap_get_color(Handle, AX, AY); +end; + +function TSkPixmap.GetColorF(const AX, AY: Integer): TAlphaColorF; +begin + sk4d_pixmap_get_colorf(Handle, AX, AY, sk_color4f_t(Result)); end; function TSkPixmap.GetColorSpace: ISkColorSpace; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_pixmap_get_color_space(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_pixmap_get_color_space(Handle)); end; function TSkPixmap.GetColorType: TSkColorType; begin - Result := TSkColorType(TSkiaAPI.sk4d_pixmap_get_color_type(GetHandle)); + Result := TSkColorType(sk4d_pixmap_get_color_type(Handle)); end; function TSkPixmap.GetHeight: Integer; begin - Result := TSkiaAPI.sk4d_pixmap_get_height(GetHandle); + Result := sk4d_pixmap_get_height(Handle); end; function TSkPixmap.GetImageInfo: TSkImageInfo; var LResult: sk_imageinfo_t; begin - TSkiaAPI.sk4d_pixmap_get_image_info(GetHandle, LResult); - Result := TSkMapping.ToImageInfo(LResult); + sk4d_pixmap_get_image_info(Handle, LResult); + Result := TSkBindings.ToImageInfo(LResult); end; function TSkPixmap.GetPixelAddr(const AX, AY: Integer): Pointer; begin - Result := TSkiaAPI.sk4d_pixmap_get_pixel_addr(GetHandle, AX, AY); + Result := sk4d_pixmap_get_pixel_addr(Handle, AX, AY); end; function TSkPixmap.GetPixels: Pointer; begin - Result := TSkiaAPI.sk4d_pixmap_get_pixels(GetHandle); + Result := sk4d_pixmap_get_pixels(Handle); end; function TSkPixmap.GetRowBytes: NativeUInt; begin - Result := TSkiaAPI.sk4d_pixmap_get_row_bytes(GetHandle); + Result := sk4d_pixmap_get_row_bytes(Handle); end; function TSkPixmap.GetWidth: Integer; begin - Result := TSkiaAPI.sk4d_pixmap_get_width(GetHandle); + Result := sk4d_pixmap_get_width(Handle); end; function TSkPixmap.ReadPixels(const ADest: ISkPixmap; const ASrcX, @@ -8548,7 +9181,7 @@ function TSkPixmap.ReadPixels(const ADest: ISkPixmap; const ASrcX, begin if not Assigned(ADest) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADest']); - Result := TSkiaAPI.sk4d_pixmap_read_pixels(GetHandle, ADest.Handle, ASrcX, ASrcY); + Result := sk4d_pixmap_read_pixels(Handle, ADest.Handle, ASrcX, ASrcY); end; function TSkPixmap.ReadPixels(const ADestImageInfo: TSkImageInfo; @@ -8571,9 +9204,13 @@ function TSkPixmap.ScalePixels(const ADestImageInfo: TSkImageInfo; Result := ScalePixels(LPixmap, ASampling); end; -function TSkPixmap.ScalePixels(const ADest: ISkPixmap): Boolean; +function TSkPixmap.ScalePixels(const ADestImageInfo: TSkImageInfo; + const ADestPixels: Pointer; const ADestRowBytes: NativeUInt): Boolean; +var + LPixmap: ISkPixmap; begin - Result := ScalePixels(ADest, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None)); + LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); + Result := ScalePixels(LPixmap); end; function TSkPixmap.ScalePixels(const ADest: ISkPixmap; @@ -8581,40 +9218,41 @@ function TSkPixmap.ScalePixels(const ADest: ISkPixmap; begin if not Assigned(ADest) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADest']); - Result := TSkiaAPI.sk4d_pixmap_scale_pixels(GetHandle, ADest.Handle, @sk_samplingoptions_t(ASampling)); + Result := sk4d_pixmap_scale_pixels(Handle, ADest.Handle, @sk_samplingoptions_t(ASampling)); end; -function TSkPixmap.ScalePixels(const ADestImageInfo: TSkImageInfo; - const ADestPixels: Pointer; const ADestRowBytes: NativeUInt): Boolean; -var - LPixmap: ISkPixmap; +function TSkPixmap.ScalePixels(const ADest: ISkPixmap): Boolean; begin - LPixmap := TSkPixmap.Create(ADestImageInfo, ADestPixels, ADestRowBytes); - Result := ScalePixels(LPixmap); + Result := ScalePixels(ADest, TSkSamplingOptions.Create(TSkFilterMode.Nearest, TSkMipmapMode.None)); end; procedure TSkPixmap.SetColorSpace(AValue: ISkColorSpace); begin - TSkiaAPI.sk4d_pixmap_set_colorspace(GetHandle, TSkBindings.SafeGetHandle(AValue)); + sk4d_pixmap_set_colorspace(Handle, TSkBindings.SafeHandle(AValue)); +end; + +class procedure TSkPixmap.__DestroyHandle(const AHandle: THandle); +begin + sk4d_pixmap_destroy(AHandle); end; { TSkRegion } -function TSkRegion.Contains(const AX, AY: Integer): Boolean; +function TSkRegion.Contains(const ARegion: ISkRegion): Boolean; begin - Result := TSkiaAPI.sk4d_region_contains3(GetHandle, AX, AY); + if not Assigned(ARegion) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); + Result := sk4d_region_contains(Handle, ARegion.Handle); end; function TSkRegion.Contains(const ARect: TRect): Boolean; begin - Result := TSkiaAPI.sk4d_region_contains2(GetHandle, @sk_irect_t(ARect)); + Result := sk4d_region_contains2(Handle, @sk_irect_t(ARect)); end; -function TSkRegion.Contains(const ARegion: ISkRegion): Boolean; +function TSkRegion.Contains(const AX, AY: Integer): Boolean; begin - if not Assigned(ARegion) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); - Result := TSkiaAPI.sk4d_region_contains(GetHandle, ARegion.Handle); + Result := sk4d_region_contains3(Handle, AX, AY); end; constructor TSkRegion.Create(const ARect: TRect); @@ -8627,27 +9265,22 @@ constructor TSkRegion.Create(const ARegion: ISkRegion); begin if not Assigned(ARegion) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); - inherited Create(TSkiaAPI.sk4d_region_create2(ARegion.Handle)); + inherited Create(sk4d_region_create2(ARegion.Handle)); end; constructor TSkRegion.Create; begin - inherited Create(TSkiaAPI.sk4d_region_create()); -end; - -class procedure TSkRegion.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_region_destroy(AHandle); + inherited Create(sk4d_region_create()); end; function TSkRegion.GetBoundaryPath: ISkPath; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_region_get_boundary_path(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_region_get_boundary_path(Handle)); end; function TSkRegion.GetBounds: TRect; begin - TSkiaAPI.sk4d_region_get_bounds(GetHandle, sk_irect_t(Result)); + sk4d_region_get_bounds(Handle, sk_irect_t(Result)); end; function TSkRegion.GetCliperator(const AClip: TRect): ISkRegionCliperator; @@ -8666,38 +9299,38 @@ function TSkRegion.GetSpanerator(const AY, ALeft, Result := TRegionSpanerator.Create(Self, AY, ALeft, ARight); end; -function TSkRegion.Intersects(const ARegion: ISkRegion): Boolean; +function TSkRegion.Intersects(const ARect: TRect): Boolean; begin - if not Assigned(ARegion) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); - Result := TSkiaAPI.sk4d_region_intersects(GetHandle, ARegion.Handle); + Result := sk4d_region_intersects2(Handle, @sk_irect_t(ARect)); end; -function TSkRegion.Intersects(const ARect: TRect): Boolean; +function TSkRegion.Intersects(const ARegion: ISkRegion): Boolean; begin - Result := TSkiaAPI.sk4d_region_intersects2(GetHandle, @sk_irect_t(ARect)); + if not Assigned(ARegion) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); + Result := sk4d_region_intersects(Handle, ARegion.Handle); end; function TSkRegion.IsComplex: Boolean; begin - Result := TSkiaAPI.sk4d_region_is_complex(GetHandle); + Result := sk4d_region_is_complex(Handle); end; function TSkRegion.IsEmpty: Boolean; begin - Result := TSkiaAPI.sk4d_region_is_empty(GetHandle); + Result := sk4d_region_is_empty(Handle); end; function TSkRegion.IsEqual(const ARegion: ISkRegion): Boolean; begin if not Assigned(ARegion) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); - Result := TSkiaAPI.sk4d_region_is_equal(GetHandle, ARegion.Handle); + Result := sk4d_region_is_equal(Handle, ARegion.Handle); end; function TSkRegion.IsRect: Boolean; begin - Result := TSkiaAPI.sk4d_region_is_rect(GetHandle); + Result := sk4d_region_is_rect(Handle); end; function TSkRegion.Op(const ARegion: ISkRegion; @@ -8705,34 +9338,34 @@ function TSkRegion.Op(const ARegion: ISkRegion; begin if not Assigned(ARegion) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); - Result := TSkiaAPI.sk4d_region_op(GetHandle, ARegion.Handle, sk_regionop_t(AOp)); + Result := sk4d_region_op(Handle, ARegion.Handle, sk_regionop_t(AOp)); end; function TSkRegion.Op(const ARect: TRect; const AOp: TSkRegionOp): Boolean; begin - Result := TSkiaAPI.sk4d_region_op2(GetHandle, @sk_irect_t(ARect), sk_regionop_t(AOp)); + Result := sk4d_region_op2(Handle, @sk_irect_t(ARect), sk_regionop_t(AOp)); end; function TSkRegion.QuickContains(const ARect: TRect): Boolean; begin - Result := TSkiaAPI.sk4d_region_quick_contains(GetHandle, @sk_irect_t(ARect)); + Result := sk4d_region_quick_contains(Handle, @sk_irect_t(ARect)); end; function TSkRegion.QuickReject(const ARect: TRect): Boolean; begin - Result := TSkiaAPI.sk4d_region_quick_reject2(GetHandle, @sk_irect_t(ARect)); + Result := sk4d_region_quick_reject2(Handle, @sk_irect_t(ARect)); end; function TSkRegion.QuickReject(const ARegion: ISkRegion): Boolean; begin if not Assigned(ARegion) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARegion']); - Result := TSkiaAPI.sk4d_region_quick_reject(GetHandle, ARegion.Handle); + Result := sk4d_region_quick_reject(Handle, ARegion.Handle); end; procedure TSkRegion.SetEmpty; begin - TSkiaAPI.sk4d_region_set_empty(GetHandle); + sk4d_region_set_empty(Handle); end; function TSkRegion.SetPath(const APath: ISkPath; @@ -8742,24 +9375,29 @@ function TSkRegion.SetPath(const APath: ISkPath; raise ESkArgumentException.CreateFmt(SParamIsNil, ['APath']); if not Assigned(AClip) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AClip']); - Result := TSkiaAPI.sk4d_region_set_path(GetHandle, APath.Handle, AClip.Handle); + Result := sk4d_region_set_path(Handle, APath.Handle, AClip.Handle); end; function TSkRegion.SetRect(const ARect: TRect): Boolean; begin - Result := TSkiaAPI.sk4d_region_set_rect(GetHandle, @sk_irect_t(ARect)); + Result := sk4d_region_set_rect(Handle, @sk_irect_t(ARect)); end; function TSkRegion.SetRects(const ARects: TArray): Boolean; begin if Length(ARects) < 1 then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ARects']); - Result := TSkiaAPI.sk4d_region_set_rects(GetHandle, @sk_rect_t(ARects[0]), Length(ARects)); + Result := sk4d_region_set_rects(Handle, @sk_rect_t(ARects[0]), Length(ARects)); end; procedure TSkRegion.Translate(const ADeltaX, ADeltaY: Integer); begin - TSkiaAPI.sk4d_region_translate(GetHandle, ADeltaX, ADeltaY); + sk4d_region_translate(Handle, ADeltaX, ADeltaY); +end; + +class procedure TSkRegion.__DestroyHandle(const AHandle: THandle); +begin + sk4d_region_destroy(AHandle); end; { TSkRegion.TRegionCliperator } @@ -8767,50 +9405,46 @@ procedure TSkRegion.Translate(const ADeltaX, ADeltaY: Integer); constructor TSkRegion.TRegionCliperator.Create(const ARegion: ISkRegion; const AClip: TRect); begin - inherited Create(TSkiaAPI.sk4d_regioncliperator_create(ARegion.Handle, @sk_irect_t(AClip))); + inherited Create(sk4d_regioncliperator_create(ARegion.Handle, @sk_irect_t(AClip))); end; -class procedure TSkRegion.TRegionCliperator.DestroyHandle( - const AHandle: THandle); +function TSkRegion.TRegionCliperator.GetCurrent: TRect; begin - TSkiaAPI.sk4d_regioncliperator_destroy(AHandle); + sk4d_regioncliperator_get_current(Handle, sk_irect_t(Result)); end; -function TSkRegion.TRegionCliperator.GetCurrent: TRect; +function TSkRegion.TRegionCliperator.MoveNext: Boolean; begin - TSkiaAPI.sk4d_regioncliperator_get_current(GetHandle, sk_irect_t(Result)); + Result := sk4d_regioncliperator_move_next(Handle); end; -function TSkRegion.TRegionCliperator.MoveNext: Boolean; +class procedure TSkRegion.TRegionCliperator.__DestroyHandle( + const AHandle: THandle); begin - Result := TSkiaAPI.sk4d_regioncliperator_move_next(GetHandle); + sk4d_regioncliperator_destroy(AHandle); end; { TSkRegion.TRegionIterator } constructor TSkRegion.TRegionIterator.Create(const ARegion: ISkRegion); begin - inherited Create(TSkiaAPI.sk4d_regioniterator_create(ARegion.Handle)); -end; - -class procedure TSkRegion.TRegionIterator.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_regioniterator_destroy(AHandle); + inherited Create(sk4d_regioniterator_create(ARegion.Handle)); end; function TSkRegion.TRegionIterator.GetCurrent: TRect; begin - TSkiaAPI.sk4d_regioniterator_get_current(GetHandle, sk_irect_t(Result)); + sk4d_regioniterator_get_current(Handle, sk_irect_t(Result)); end; function TSkRegion.TRegionIterator.MoveNext: Boolean; begin - Result := TSkiaAPI.sk4d_regioniterator_move_next(GetHandle); + Result := sk4d_regioniterator_move_next(Handle); end; -procedure TSkRegion.TRegionIterator.Reset; +class procedure TSkRegion.TRegionIterator.__DestroyHandle( + const AHandle: THandle); begin - TSkiaAPI.sk4d_regioniterator_reset(GetHandle); + sk4d_regioniterator_destroy(AHandle); end; { TSkRegion.TRegionSpanerator } @@ -8818,13 +9452,7 @@ procedure TSkRegion.TRegionIterator.Reset; constructor TSkRegion.TRegionSpanerator.Create(const ARegion: ISkRegion; const AY, ALeft, ARight: Integer); begin - inherited Create(TSkiaAPI.sk4d_regionspanerator_create(ARegion.Handle, AY, ALeft, ARight)); -end; - -class procedure TSkRegion.TRegionSpanerator.DestroyHandle( - const AHandle: THandle); -begin - TSkiaAPI.sk4d_regionspanerator_destroy(AHandle); + inherited Create(sk4d_regionspanerator_create(ARegion.Handle, AY, ALeft, ARight)); end; function TSkRegion.TRegionSpanerator.GetCurrent: TPoint; @@ -8834,14 +9462,20 @@ function TSkRegion.TRegionSpanerator.GetCurrent: TPoint; function TSkRegion.TRegionSpanerator.MoveNext: Boolean; begin - Result := TSkiaAPI.sk4d_regionspanerator_next(GetHandle, sk_ipoint_t(FCurrent)); + Result := sk4d_regionspanerator_next(Handle, sk_ipoint_t(FCurrent)); +end; + +class procedure TSkRegion.TRegionSpanerator.__DestroyHandle( + const AHandle: THandle); +begin + sk4d_regionspanerator_destroy(AHandle); end; { TSkRoundRect } function TSkRoundRect.Contains(const ARect: TRect): Boolean; begin - Result := TSkiaAPI.sk4d_rrect_contains(GetHandle, @sk_rect_t(ARect)); + Result := sk4d_rrect_contains(Handle, @sk_rect_t(ARect)); end; constructor TSkRoundRect.Create(const ARect: TRectF; const ARadiusX, @@ -8855,12 +9489,12 @@ constructor TSkRoundRect.Create(const ARoundRect: ISkRoundRect); begin if not Assigned(ARoundRect) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARoundRect']); - inherited Create(TSkiaAPI.sk4d_rrect_create2(ARoundRect.Handle)); + inherited Create(sk4d_rrect_create2(ARoundRect.Handle)); end; constructor TSkRoundRect.Create; begin - inherited Create(TSkiaAPI.sk4d_rrect_create()); + inherited Create(sk4d_rrect_create()); end; constructor TSkRoundRect.Create(const ARect: TRectF; @@ -8872,254 +9506,127 @@ constructor TSkRoundRect.Create(const ARect: TRectF; procedure TSkRoundRect.Deflate(const ADeltaX, ADeltaY: Single); begin - TSkiaAPI.sk4d_rrect_deflate(GetHandle, ADeltaX, ADeltaY); -end; - -class procedure TSkRoundRect.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_rrect_destroy(AHandle); + sk4d_rrect_deflate(Handle, ADeltaX, ADeltaY); end; function TSkRoundRect.GetHeight: Single; begin - Result := TSkiaAPI.sk4d_rrect_get_height(GetHandle); + Result := sk4d_rrect_get_height(Handle); end; function TSkRoundRect.GetRadii(const ACorner: TSkRoundRectCorner): TPointF; begin - TSkiaAPI.sk4d_rrect_get_radii(GetHandle, sk_rrectcorner_t(ACorner), sk_vector_t(Result)); + sk4d_rrect_get_radii(Handle, sk_rrectcorner_t(ACorner), sk_vector_t(Result)); end; function TSkRoundRect.GetRect: TRectF; begin - TSkiaAPI.sk4d_rrect_get_rect(GetHandle, sk_rect_t(Result)); + sk4d_rrect_get_rect(Handle, sk_rect_t(Result)); end; function TSkRoundRect.GetSimpleRadii: TPointF; begin - TSkiaAPI.sk4d_rrect_get_simple_radii(GetHandle, sk_vector_t(Result)); + sk4d_rrect_get_simple_radii(Handle, sk_vector_t(Result)); end; function TSkRoundRect.GetWidth: Single; begin - Result := TSkiaAPI.sk4d_rrect_get_width(GetHandle); + Result := sk4d_rrect_get_width(Handle); end; procedure TSkRoundRect.Inflate(const ADeltaX, ADeltaY: Single); begin - TSkiaAPI.sk4d_rrect_inflate(GetHandle, ADeltaX, ADeltaY); + sk4d_rrect_inflate(Handle, ADeltaX, ADeltaY); end; function TSkRoundRect.IsComplex: Boolean; begin - Result := TSkiaAPI.sk4d_rrect_is_complex(GetHandle); + Result := sk4d_rrect_is_complex(Handle); end; function TSkRoundRect.IsEmpty: Boolean; begin - Result := TSkiaAPI.sk4d_rrect_is_empty(GetHandle); + Result := sk4d_rrect_is_empty(Handle); end; function TSkRoundRect.IsEqual(const ARoundRect: ISkRoundRect): Boolean; begin if not Assigned(ARoundRect) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARoundRect']); - Result := TSkiaAPI.sk4d_rrect_is_equal(GetHandle, ARoundRect.Handle); + Result := sk4d_rrect_is_equal(Handle, ARoundRect.Handle); end; function TSkRoundRect.IsNinePatch: Boolean; begin - Result := TSkiaAPI.sk4d_rrect_is_nine_patch(GetHandle); + Result := sk4d_rrect_is_nine_patch(Handle); end; function TSkRoundRect.IsOval: Boolean; begin - Result := TSkiaAPI.sk4d_rrect_is_oval(GetHandle); + Result := sk4d_rrect_is_oval(Handle); end; function TSkRoundRect.IsRect: Boolean; begin - Result := TSkiaAPI.sk4d_rrect_is_rect(GetHandle); + Result := sk4d_rrect_is_rect(Handle); end; function TSkRoundRect.IsSimple: Boolean; begin - Result := TSkiaAPI.sk4d_rrect_is_simple(GetHandle); + Result := sk4d_rrect_is_simple(Handle); end; function TSkRoundRect.IsValid: Boolean; begin - Result := TSkiaAPI.sk4d_rrect_is_valid(GetHandle); + Result := sk4d_rrect_is_valid(Handle); end; procedure TSkRoundRect.Offset(const ADeltaX, ADeltaY: Single); begin - TSkiaAPI.sk4d_rrect_offset(GetHandle, ADeltaX, ADeltaY); + sk4d_rrect_offset(Handle, ADeltaX, ADeltaY); end; procedure TSkRoundRect.SetEmpty; begin - TSkiaAPI.sk4d_rrect_set_empty(GetHandle); + sk4d_rrect_set_empty(Handle); end; procedure TSkRoundRect.SetNinePatch(const ARect: TRectF; const ARadiusLeft, ARadiusTop, ARadiusRight, ARadiusBottom: Single); begin - TSkiaAPI.sk4d_rrect_set_nine_patch(GetHandle, @sk_rect_t(ARect), ARadiusLeft, ARadiusTop, ARadiusRight, ARadiusBottom); + sk4d_rrect_set_nine_patch(Handle, @sk_rect_t(ARect), ARadiusLeft, ARadiusTop, ARadiusRight, ARadiusBottom); end; procedure TSkRoundRect.SetOval(const ARect: TRectF); begin - TSkiaAPI.sk4d_rrect_set_oval(GetHandle, @sk_rect_t(ARect)); + sk4d_rrect_set_oval(Handle, @sk_rect_t(ARect)); end; procedure TSkRoundRect.SetRect(const ARect: TRectF; const ARadii: TSkRoundRectRadii); begin - TSkiaAPI.sk4d_rrect_set_rect2(GetHandle, @sk_rect_t(ARect), @ARadii); + sk4d_rrect_set_rect2(Handle, @sk_rect_t(ARect), @ARadii); end; procedure TSkRoundRect.SetRect(const ARect: TRectF; const ARadiusX, ARadiusY: Single); begin - TSkiaAPI.sk4d_rrect_set_rect3(GetHandle, @sk_rect_t(ARect), ARadiusX, ARadiusY); + sk4d_rrect_set_rect3(Handle, @sk_rect_t(ARect), ARadiusX, ARadiusY); end; procedure TSkRoundRect.SetRect(const ARect: TRectF); begin - TSkiaAPI.sk4d_rrect_set_rect(GetHandle, @sk_rect_t(ARect)); + sk4d_rrect_set_rect(Handle, @sk_rect_t(ARect)); end; function TSkRoundRect.Transform(const AMatrix: TMatrix): ISkRoundRect; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_rrect_transform(GetHandle, @sk_matrix_t(AMatrix))); -end; - -{ TSkRuntimeEffectFloat2 } - -constructor TSkRuntimeEffectFloat2.Create(const AV1, AV2: Single); -begin - V1 := AV1; - V2 := AV2; -end; - -class operator TSkRuntimeEffectFloat2.Implicit( - const APoint: TPointF): TSkRuntimeEffectFloat2; -begin - Result.V1 := APoint.X; - Result.V2 := APoint.Y; -end; - -{ TSkRuntimeEffectFloat3 } - -constructor TSkRuntimeEffectFloat3.Create(const AV1, AV2, AV3: Single); -begin - V1 := AV1; - V2 := AV2; - V3 := AV3; -end; - -{ TSkRuntimeEffectFloat4 } - -constructor TSkRuntimeEffectFloat4.Create(const AV1, AV2, AV3, AV4: Single); -begin - V1 := AV1; - V2 := AV2; - V3 := AV3; - V4 := AV4; -end; - -class operator TSkRuntimeEffectFloat4.Implicit( - const AColor: TAlphaColorF): TSkRuntimeEffectFloat4; -begin - Result.V1 := AColor.R; - Result.V2 := AColor.G; - Result.V3 := AColor.B; - Result.V4 := AColor.A; -end; - -{ TSkRuntimeEffectFloat2x2 } - -constructor TSkRuntimeEffectFloat2x2.Create(const AV11, AV12, AV21, - AV22: Single); -begin - V11 := AV11; - V12 := AV12; - V21 := AV21; - V22 := AV22; -end; - -{ TSkRuntimeEffectFloat3x3 } - -constructor TSkRuntimeEffectFloat3x3.Create(const AV11, AV12, AV13, AV21, AV22, - AV23, AV31, AV32, AV33: Single); -begin - V11 := AV11; - V12 := AV12; - V13 := AV13; - V21 := AV21; - V22 := AV22; - V23 := AV23; - V31 := AV31; - V32 := AV32; - V33 := AV33; -end; - -{ TSkRuntimeEffectFloat4x4 } - -constructor TSkRuntimeEffectFloat4x4.Create(const AV11, AV12, AV13, AV14, AV21, - AV22, AV23, AV24, AV31, AV32, AV33, AV34, AV41, AV42, AV43, AV44: Single); -begin - V11 := AV11; - V12 := AV12; - V13 := AV13; - V14 := AV14; - V21 := AV21; - V22 := AV22; - V23 := AV23; - V24 := AV24; - V31 := AV31; - V32 := AV32; - V33 := AV33; - V34 := AV34; - V41 := AV41; - V42 := AV42; - V43 := AV43; - V44 := AV44; -end; - -{ TSkRuntimeEffectInt2 } - -constructor TSkRuntimeEffectInt2.Create(const AV1, AV2: Integer); -begin - V1 := AV1; - V2 := AV2; -end; - -class operator TSkRuntimeEffectInt2.Implicit( - const APoint: TPoint): TSkRuntimeEffectInt2; -begin - Result.V1 := APoint.X; - Result.V2 := APoint.Y; -end; - -{ TSkRuntimeEffectInt3 } - -constructor TSkRuntimeEffectInt3.Create(const AV1, AV2, AV3: Integer); -begin - V1 := AV1; - V2 := AV2; - V3 := AV3; + Result := TSkBindings.SafeCreate(sk4d_rrect_transform(Handle, @sk_matrix_t(AMatrix))); end; -{ TSkRuntimeEffectInt4 } - -constructor TSkRuntimeEffectInt4.Create(const AV1, AV2, AV3, AV4: Integer); +class procedure TSkRoundRect.__DestroyHandle(const AHandle: THandle); begin - V1 := AV1; - V2 := AV2; - V3 := AV3; - V4 := AV4; + sk4d_rrect_destroy(AHandle); end; { TSkRuntimeEffect } @@ -9149,7 +9656,8 @@ function TSkRuntimeEffect.GetChildBlender(const AIndex: Integer): ISkBlender; Result := FChildren[AIndex] as ISkBlender; end; -function TSkRuntimeEffect.GetChildBlender(const AName: string): ISkBlender; +function TSkRuntimeEffect.GetChildBlenderByName( + const AName: string): ISkBlender; begin Result := GetChildBlender(IndexOfChild(AName)); end; @@ -9162,7 +9670,7 @@ function TSkRuntimeEffect.GetChildColorFilter( Result := FChildren[AIndex] as ISkColorFilter; end; -function TSkRuntimeEffect.GetChildColorFilter( +function TSkRuntimeEffect.GetChildColorFilterByName( const AName: string): ISkColorFilter; begin Result := GetChildColorFilter(IndexOfChild(AName)); @@ -9170,19 +9678,14 @@ function TSkRuntimeEffect.GetChildColorFilter( function TSkRuntimeEffect.GetChildCount: Integer; begin - Result := TSkiaAPI.sk4d_runtimeeffect_get_child_count(GetHandle); + Result := sk4d_runtimeeffect_get_child_count(Handle); end; function TSkRuntimeEffect.GetChildName(const AIndex: Integer): string; begin if (AIndex < 0) or (AIndex >= GetChildCount) then raise ESkArgumentException.CreateFmt(SParamOutOfRange, ['AIndex', AIndex, 0, GetChildCount]); - Result := string(TSkiaAPI.sk4d_runtimeeffect_get_child_name(GetHandle, AIndex)); -end; - -function TSkRuntimeEffect.GetChildShader(const AName: string): ISkShader; -begin - Result := GetChildShader(IndexOfChild(AName)); + Result := string(sk4d_runtimeeffect_get_child_name(Handle, AIndex)); end; function TSkRuntimeEffect.GetChildShader(const AIndex: Integer): ISkShader; @@ -9192,25 +9695,25 @@ function TSkRuntimeEffect.GetChildShader(const AIndex: Integer): ISkShader; Result := FChildren[AIndex] as ISkShader; end; +function TSkRuntimeEffect.GetChildShaderByName(const AName: string): ISkShader; +begin + Result := GetChildShader(IndexOfChild(AName)); +end; + function TSkRuntimeEffect.GetChildType( const AIndex: Integer): TSkRuntimeEffectChildType; begin if (AIndex < 0) or (AIndex >= GetChildCount) then raise ESkArgumentException.CreateFmt(SParamOutOfRange, ['AIndex', AIndex, 0, GetChildCount]); - Result := TSkRuntimeEffectChildType(TSkiaAPI.sk4d_runtimeeffect_get_child_type(GetHandle, AIndex)); + Result := TSkRuntimeEffectChildType(sk4d_runtimeeffect_get_child_type(Handle, AIndex)); end; -function TSkRuntimeEffect.GetChildType( +function TSkRuntimeEffect.GetChildTypeByName( const AName: string): TSkRuntimeEffectChildType; begin Result := GetChildType(IndexOfChild(AName)); end; -function TSkRuntimeEffect.GetUniform(const AName: string): Pointer; -begin - Result := GetUniform(IndexOfUniform(AName)); -end; - function TSkRuntimeEffect.GetUniform(const AIndex: Integer): Pointer; begin if (AIndex < 0) or (AIndex >= GetUniformCount) then @@ -9218,9 +9721,14 @@ function TSkRuntimeEffect.GetUniform(const AIndex: Integer): Pointer; Result := Pointer(NativeUInt(FUniformData) + GetUniformOffset(AIndex)); end; +function TSkRuntimeEffect.GetUniformByName(const AName: string): Pointer; +begin + Result := GetUniform(IndexOfUniform(AName)); +end; + function TSkRuntimeEffect.GetUniformCount: Integer; begin - Result := TSkiaAPI.sk4d_runtimeeffect_get_uniform_count(GetHandle); + Result := sk4d_runtimeeffect_get_uniform_count(Handle); end; function TSkRuntimeEffect.GetUniformData: Pointer; @@ -9230,24 +9738,25 @@ function TSkRuntimeEffect.GetUniformData: Pointer; function TSkRuntimeEffect.GetUniformDataSize: NativeUInt; begin - Result := TSkiaAPI.sk4d_runtimeeffect_get_uniform_data_size(GetHandle); + Result := sk4d_runtimeeffect_get_uniform_data_size(Handle); end; function TSkRuntimeEffect.GetUniformName(const AIndex: Integer): string; begin if (AIndex < 0) or (AIndex >= GetUniformCount) then raise ESkArgumentException.CreateFmt(SParamOutOfRange, ['AIndex', AIndex, 0, GetUniformCount]); - Result := string(TSkiaAPI.sk4d_runtimeeffect_get_uniform_name(GetHandle, AIndex)); + Result := string(sk4d_runtimeeffect_get_uniform_name(Handle, AIndex)); end; function TSkRuntimeEffect.GetUniformOffset(const AIndex: Integer): NativeUInt; begin if (AIndex < 0) or (AIndex >= GetUniformCount) then raise ESkArgumentException.CreateFmt(SParamOutOfRange, ['AIndex', AIndex, 0, GetUniformCount]); - Result := TSkiaAPI.sk4d_runtimeeffect_get_uniform_offset(GetHandle, AIndex); + Result := sk4d_runtimeeffect_get_uniform_offset(Handle, AIndex); end; -function TSkRuntimeEffect.GetUniformOffset(const AName: string): NativeUInt; +function TSkRuntimeEffect.GetUniformOffsetByName( + const AName: string): NativeUInt; begin Result := GetUniformOffset(IndexOfUniform(AName)); end; @@ -9257,35 +9766,40 @@ function TSkRuntimeEffect.GetUniformType( begin if (AIndex < 0) or (AIndex >= GetUniformCount) then raise ESkArgumentException.CreateFmt(SParamOutOfRange, ['AIndex', AIndex, 0, GetUniformCount]); - Result := TSkRuntimeEffectUniformType(TSkiaAPI.sk4d_runtimeeffect_get_uniform_type(GetHandle, AIndex)); + Result := TSkRuntimeEffectUniformType(sk4d_runtimeeffect_get_uniform_type(Handle, AIndex)); end; -function TSkRuntimeEffect.GetUniformType( +function TSkRuntimeEffect.GetUniformTypeByName( const AName: string): TSkRuntimeEffectUniformType; begin Result := GetUniformType(IndexOfUniform(AName)); end; -function TSkRuntimeEffect.GetUniformTypeCount(const AName: string): Integer; -begin - Result := GetUniformTypeCount(IndexOfUniform(AName)); -end; - function TSkRuntimeEffect.GetUniformTypeCount(const AIndex: Integer): Integer; begin if (AIndex < 0) or (AIndex >= GetUniformCount) then raise ESkArgumentException.CreateFmt(SParamOutOfRange, ['AIndex', AIndex, 0, GetUniformCount]); - Result := TSkiaAPI.sk4d_runtimeeffect_get_uniform_type_count(GetHandle, AIndex); + Result := sk4d_runtimeeffect_get_uniform_type_count(Handle, AIndex); +end; + +function TSkRuntimeEffect.GetUniformTypeCountByName( + const AName: string): Integer; +begin + Result := GetUniformTypeCount(IndexOfUniform(AName)); end; function TSkRuntimeEffect.IndexOfChild(const AName: string): Integer; +var + LMarshaller: TMarshaller; begin - Result := TSkiaAPI.sk4d_runtimeeffect_index_of_child(GetHandle, MarshaledAString(UTF8String(AName))); + Result := sk4d_runtimeeffect_index_of_child(Handle, LMarshaller.AsUtf8(AName).ToPointer); end; function TSkRuntimeEffect.IndexOfUniform(const AName: string): Integer; +var + LMarshaller: TMarshaller; begin - Result := TSkiaAPI.sk4d_runtimeeffect_index_of_uniform(GetHandle, MarshaledAString(UTF8String(AName))); + Result := sk4d_runtimeeffect_index_of_uniform(Handle, LMarshaller.AsUtf8(AName).ToPointer); end; function TSkRuntimeEffect.IsUniformTypeOrdinal(const AIndex: Integer): Boolean; @@ -9293,7 +9807,8 @@ function TSkRuntimeEffect.IsUniformTypeOrdinal(const AIndex: Integer): Boolean; Result := (GetUniformType(AIndex) in [TSkRuntimeEffectUniformType.Int, TSkRuntimeEffectUniformType.Int2, TSkRuntimeEffectUniformType.Int3, TSkRuntimeEffectUniformType.Int4]); end; -function TSkRuntimeEffect.IsUniformTypeOrdinal(const AName: string): Boolean; +function TSkRuntimeEffect.IsUniformTypeOrdinalByName( + const AName: string): Boolean; begin Result := IsUniformTypeOrdinal(IndexOfUniform(AName)); end; @@ -9308,12 +9823,12 @@ function TSkRuntimeEffect.MakeBlender: ISkBlender; begin SetLength(LHandles, Length(FChildren)); for I := 0 to Length(FChildren) - 1 do - LHandles[I] := TSkBindings.SafeGetHandle(FChildren[I]); + LHandles[I] := TSkBindings.SafeHandle(FChildren[I]); LChildren := @LHandles[0]; end else LChildren := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_blender(GetHandle, GetUniformData, LChildren)); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_blender(Handle, GetUniformData, LChildren)); end; function TSkRuntimeEffect.MakeColorFilter: ISkColorFilter; @@ -9326,77 +9841,85 @@ function TSkRuntimeEffect.MakeColorFilter: ISkColorFilter; begin SetLength(LHandles, Length(FChildren)); for I := 0 to Length(FChildren) - 1 do - LHandles[I] := TSkBindings.SafeGetHandle(FChildren[I]); + LHandles[I] := TSkBindings.SafeHandle(FChildren[I]); LChildren := @LHandles[0]; end else LChildren := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_color_filter(GetHandle, GetUniformData, LChildren)); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_color_filter(Handle, GetUniformData, LChildren)); end; class function TSkRuntimeEffect.MakeForBlender(const ASkSL: string; out AErrorText: string): ISkRuntimeEffect; var LErrorText: ISkString; + LMarshaller: TMarshaller; begin if ASKSL.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ASKSL']); LErrorText := TSkString.Create; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_for_blender(MarshaledAString(UTF8String(ASkSL)), LErrorText.Handle)); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_for_blender(LMarshaller.AsUtf8(ASkSL).ToPointer, LErrorText.Handle)); AErrorText := LErrorText.Text; end; class function TSkRuntimeEffect.MakeForBlender( const ASkSL: string): ISkRuntimeEffect; +var + LMarshaller: TMarshaller; begin if ASKSL.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ASKSL']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_for_blender(MarshaledAString(UTF8String(ASkSL)), 0)); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_for_blender(LMarshaller.AsUtf8(ASkSL).ToPointer, 0)); end; -class function TSkRuntimeEffect.MakeForColorFilter(const ASkSL: string; - out AErrorText: string): ISkRuntimeEffect; +class function TSkRuntimeEffect.MakeForColorFilter( + const ASkSL: string): ISkRuntimeEffect; var - LErrorText: ISkString; + LMarshaller: TMarshaller; begin if ASKSL.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ASKSL']); - LErrorText := TSkString.Create; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_for_color_filter(MarshaledAString(UTF8String(ASkSL)), LErrorText.Handle)); - AErrorText := LErrorText.Text; + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_for_color_filter(LMarshaller.AsUtf8(ASkSL).ToPointer, 0)); end; -class function TSkRuntimeEffect.MakeForColorFilter( - const ASkSL: string): ISkRuntimeEffect; +class function TSkRuntimeEffect.MakeForColorFilter(const ASkSL: string; + out AErrorText: string): ISkRuntimeEffect; +var + LErrorText: ISkString; + LMarshaller: TMarshaller; begin if ASKSL.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ASKSL']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_for_color_filter(MarshaledAString(UTF8String(ASkSL)), 0)); + LErrorText := TSkString.Create; + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_for_color_filter(LMarshaller.AsUtf8(ASkSL).ToPointer, LErrorText.Handle)); + AErrorText := LErrorText.Text; end; class function TSkRuntimeEffect.MakeForShader(const ASkSL: string; out AErrorText: string): ISkRuntimeEffect; var LErrorText: ISkString; + LMarshaller: TMarshaller; begin if ASKSL.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ASKSL']); LErrorText := TSkString.Create; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_for_shader(MarshaledAString(UTF8String(ASkSL)), LErrorText.Handle)); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_for_shader(LMarshaller.AsUtf8(ASkSL).ToPointer, LErrorText.Handle)); AErrorText := LErrorText.Text; end; class function TSkRuntimeEffect.MakeForShader( const ASkSL: string): ISkRuntimeEffect; +var + LMarshaller: TMarshaller; begin if ASKSL.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['ASKSL']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_for_shader(MarshaledAString(UTF8String(ASkSL)), 0)); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_for_shader(LMarshaller.AsUtf8(ASkSL).ToPointer, 0)); end; function TSkRuntimeEffect.MakeImage(const AImageInfo: TSkImageInfo; - const ALocalMatrix: TMatrix; const AIsMipmapped: Boolean; - const AContext: IGrDirectContext): ISkImage; + const AMipmapped: Boolean; const AContext: IGrDirectContext): ISkImage; var I: Integer; LChildren: Pointer; @@ -9407,17 +9930,18 @@ function TSkRuntimeEffect.MakeImage(const AImageInfo: TSkImageInfo; begin SetLength(LHandles, Length(FChildren)); for I := 0 to Length(FChildren) - 1 do - LHandles[I] := TSkBindings.SafeGetHandle(FChildren[I]); + LHandles[I] := TSkBindings.SafeHandle(FChildren[I]); LChildren := @LHandles[0]; end else LChildren := nil; - LImageInfo := TSkMapping.AsImageInfo(AImageInfo); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_image(GetHandle, TSkBindings.SafeGetHandle(AContext), GetUniformData, LChildren, @sk_matrix_t(ALocalMatrix), @LImageInfo, AIsMipmapped)); + LImageInfo := TSkBindings.AsImageInfo(AImageInfo); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_image(Handle, TSkBindings.SafeHandle(AContext), GetUniformData, LChildren, nil, @LImageInfo, AMipmapped)); end; function TSkRuntimeEffect.MakeImage(const AImageInfo: TSkImageInfo; - const AIsMipmapped: Boolean; const AContext: IGrDirectContext): ISkImage; + const ALocalMatrix: TMatrix; const AMipmapped: Boolean; + const AContext: IGrDirectContext): ISkImage; var I: Integer; LChildren: Pointer; @@ -9428,17 +9952,16 @@ function TSkRuntimeEffect.MakeImage(const AImageInfo: TSkImageInfo; begin SetLength(LHandles, Length(FChildren)); for I := 0 to Length(FChildren) - 1 do - LHandles[I] := TSkBindings.SafeGetHandle(FChildren[I]); + LHandles[I] := TSkBindings.SafeHandle(FChildren[I]); LChildren := @LHandles[0]; end else LChildren := nil; - LImageInfo := TSkMapping.AsImageInfo(AImageInfo); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_image(GetHandle, TSkBindings.SafeGetHandle(AContext), GetUniformData, LChildren, nil, @LImageInfo, AIsMipmapped)); + LImageInfo := TSkBindings.AsImageInfo(AImageInfo); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_image(Handle, TSkBindings.SafeHandle(AContext), GetUniformData, LChildren, @sk_matrix_t(ALocalMatrix), @LImageInfo, AMipmapped)); end; - -function TSkRuntimeEffect.MakeShader(const AOpaque: Boolean): ISkShader; +function TSkRuntimeEffect.MakeShader(const ALocalMatrix: TMatrix): ISkShader; var I: Integer; LChildren: Pointer; @@ -9448,16 +9971,15 @@ function TSkRuntimeEffect.MakeShader(const AOpaque: Boolean): ISkShader; begin SetLength(LHandles, Length(FChildren)); for I := 0 to Length(FChildren) - 1 do - LHandles[I] := TSkBindings.SafeGetHandle(FChildren[I]); + LHandles[I] := TSkBindings.SafeHandle(FChildren[I]); LChildren := @LHandles[0]; end else LChildren := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_shader(GetHandle, GetUniformData, LChildren, nil, AOpaque)); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_shader(Handle, GetUniformData, LChildren, @sk_matrix_t(ALocalMatrix))); end; -function TSkRuntimeEffect.MakeShader(const ALocalMatrix: TMatrix; - const AOpaque: Boolean): ISkShader; +function TSkRuntimeEffect.MakeShader: ISkShader; var I: Integer; LChildren: Pointer; @@ -9467,12 +9989,12 @@ function TSkRuntimeEffect.MakeShader(const ALocalMatrix: TMatrix; begin SetLength(LHandles, Length(FChildren)); for I := 0 to Length(FChildren) - 1 do - LHandles[I] := TSkBindings.SafeGetHandle(FChildren[I]); + LHandles[I] := TSkBindings.SafeHandle(FChildren[I]); LChildren := @LHandles[0]; end else LChildren := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_runtimeeffect_make_shader(GetHandle, GetUniformData, LChildren, @sk_matrix_t(ALocalMatrix), AOpaque)); + Result := TSkBindings.SafeCreate(sk4d_runtimeeffect_make_shader(Handle, GetUniformData, LChildren, nil)); end; procedure TSkRuntimeEffect.SetChildBlender(const AIndex: Integer; @@ -9483,7 +10005,7 @@ procedure TSkRuntimeEffect.SetChildBlender(const AIndex: Integer; FChildren[AIndex] := AValue; end; -procedure TSkRuntimeEffect.SetChildBlender(const AName: string; +procedure TSkRuntimeEffect.SetChildBlenderByName(const AName: string; const AValue: ISkBlender); begin SetChildBlender(IndexOfChild(AName), AValue); @@ -9497,7 +10019,7 @@ procedure TSkRuntimeEffect.SetChildColorFilter(const AIndex: Integer; FChildren[AIndex] := AValue; end; -procedure TSkRuntimeEffect.SetChildColorFilter(const AName: string; +procedure TSkRuntimeEffect.SetChildColorFilterByName(const AName: string; const AValue: ISkColorFilter); begin SetChildColorFilter(IndexOfChild(AName), AValue); @@ -9511,29 +10033,24 @@ procedure TSkRuntimeEffect.SetChildShader(const AIndex: Integer; FChildren[AIndex] := AValue; end; -procedure TSkRuntimeEffect.SetChildShader(const AName: string; +procedure TSkRuntimeEffect.SetChildShaderByName(const AName: string; const AValue: ISkShader); begin SetChildShader(IndexOfChild(AName), AValue); end; procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; - const AValue: TArray); + const AValue: TPoint); var - LValue: TArray; - I: Integer; + LValue: TSkRuntimeEffectFloat2; begin - if Length(AValue) = 0 then - raise ESkException.Create(SInvalidOperation); if not IsUniformTypeOrdinal(AIndex) then begin - SetLength(LValue, Length(AValue)); - for I := 0 to Length(AValue) - 1 do - LValue[I] := AValue[I]; + LValue := TSkRuntimeEffectFloat2.Create(AValue.X, AValue.Y); SetUniform(AIndex, LValue); end else - SetUniform(AIndex, AValue[0], Length(AValue) * SizeOf(Integer)); + SetUniform(AIndex, AValue, SizeOf(AValue)); end; procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; @@ -9550,13 +10067,14 @@ procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; SetUniform(AIndex, AValue, SizeOf(AValue)); end; -procedure TSkRuntimeEffect.SetUniform(const AIndex, AValue: Integer); +procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; + const AValue: TSkRuntimeEffectInt3); var - LValue: Single; + LValue: TSkRuntimeEffectFloat3; begin if not IsUniformTypeOrdinal(AIndex) then begin - LValue := AValue; + LValue := TSkRuntimeEffectFloat3.Create(AValue.V1, AValue.V2, AValue.V3); SetUniform(AIndex, LValue); end else @@ -9579,20 +10097,58 @@ procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; const AData; WriteUniform(GetUniformOffset(AIndex), AData, ASize); end; +procedure TSkRuntimeEffect.SetUniform(const AIndex, AValue: Integer); +var + LValue: Single; +begin + if not IsUniformTypeOrdinal(AIndex) then + begin + LValue := AValue; + SetUniform(AIndex, LValue); + end + else + SetUniform(AIndex, AValue, SizeOf(AValue)); +end; + procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; - const AValue: TSkRuntimeEffectInt3); + const AValue: TArray); var - LValue: TSkRuntimeEffectFloat3; + I: Integer; + LValue: TArray; begin + if Length(AValue) = 0 then + raise ESkException.Create(SInvalidOperation); if not IsUniformTypeOrdinal(AIndex) then begin - LValue := TSkRuntimeEffectFloat3.Create(AValue.V1, AValue.V2, AValue.V3); + SetLength(LValue, Length(AValue)); + for I := 0 to Length(AValue) - 1 do + LValue[I] := AValue[I]; + SetUniform(AIndex, LValue); + end + else + SetUniform(AIndex, AValue[0], Length(AValue) * SizeOf(Integer)); +end; + +procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; + const AValue: TSkRuntimeEffectInt4); +var + LValue: TSkRuntimeEffectFloat4; +begin + if not IsUniformTypeOrdinal(AIndex) then + begin + LValue := TSkRuntimeEffectFloat4.Create(AValue.V1, AValue.V2, AValue.V3, AValue.V4); SetUniform(AIndex, LValue); end else SetUniform(AIndex, AValue, SizeOf(AValue)); end; +procedure TSkRuntimeEffect.SetUniform(const AName: string; + const AValue: Single); +begin + SetUniform(IndexOfUniform(AName), AValue); +end; + procedure TSkRuntimeEffect.SetUniform(const AName: string; const AValue: TArray); begin @@ -9600,13 +10156,13 @@ procedure TSkRuntimeEffect.SetUniform(const AName: string; end; procedure TSkRuntimeEffect.SetUniform(const AName: string; - const AValue: Single); + const AValue: TPointF); begin SetUniform(IndexOfUniform(AName), AValue); end; procedure TSkRuntimeEffect.SetUniform(const AName: string; - const AValue: TSkRuntimeEffectInt4); + const AValue: TSkRuntimeEffectInt2); begin SetUniform(IndexOfUniform(AName), AValue); end; @@ -9618,19 +10174,19 @@ procedure TSkRuntimeEffect.SetUniform(const AName: string; end; procedure TSkRuntimeEffect.SetUniform(const AName: string; - const AValue: TSkRuntimeEffectInt2); + const AValue: TSkRuntimeEffectInt4); begin SetUniform(IndexOfUniform(AName), AValue); end; procedure TSkRuntimeEffect.SetUniform(const AName: string; - const AValue: TSkRuntimeEffectFloat2); + const AValue: TAlphaColorF); begin SetUniform(IndexOfUniform(AName), AValue); end; procedure TSkRuntimeEffect.SetUniform(const AName: string; - const AValue: TSkRuntimeEffectFloat4x4); + const AValue: TSkRuntimeEffectFloat2x2); begin SetUniform(IndexOfUniform(AName), AValue); end; @@ -9642,13 +10198,13 @@ procedure TSkRuntimeEffect.SetUniform(const AName: string; end; procedure TSkRuntimeEffect.SetUniform(const AName: string; - const AValue: TSkRuntimeEffectFloat2x2); + const AValue: TSkRuntimeEffectFloat4x4); begin SetUniform(IndexOfUniform(AName), AValue); end; procedure TSkRuntimeEffect.SetUniform(const AName: string; - const AValue: TSkRuntimeEffectFloat4); + const AValue: TSkRuntimeEffectFloat2); begin SetUniform(IndexOfUniform(AName), AValue); end; @@ -9660,41 +10216,33 @@ procedure TSkRuntimeEffect.SetUniform(const AName: string; end; procedure TSkRuntimeEffect.SetUniform(const AName: string; - const AValue: TArray); + const AValue: TSkRuntimeEffectFloat4); begin SetUniform(IndexOfUniform(AName), AValue); end; -procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; - const AValue: TSkRuntimeEffectFloat2); +procedure TSkRuntimeEffect.SetUniform(const AName: string; + const AValue: TPoint); begin - SetUniform(AIndex, AValue, SizeOf(AValue)); + SetUniform(IndexOfUniform(AName), AValue); end; procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; - const AValue: TSkRuntimeEffectFloat3); + const AValue: TAlphaColorF); begin SetUniform(AIndex, AValue, SizeOf(AValue)); end; procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; - const AValue: TSkRuntimeEffectFloat4); + const AValue: TSkRuntimeEffectFloat2); begin SetUniform(AIndex, AValue, SizeOf(AValue)); end; procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; - const AValue: TSkRuntimeEffectInt4); -var - LValue: TSkRuntimeEffectFloat4; + const AValue: TSkRuntimeEffectFloat3); begin - if not IsUniformTypeOrdinal(AIndex) then - begin - LValue := TSkRuntimeEffectFloat4.Create(AValue.V1, AValue.V2, AValue.V3, AValue.V4); - SetUniform(AIndex, LValue); - end - else - SetUniform(AIndex, AValue, SizeOf(AValue)); + SetUniform(AIndex, AValue, SizeOf(AValue)); end; procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; @@ -9711,10 +10259,16 @@ procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; SetUniform(AIndex, AValue[0], Length(AValue) * SizeOf(Single)); end; -procedure TSkRuntimeEffect.SetUniform(const AName: string; - const AValue: Integer); +procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; + const AValue: TPointF); begin - SetUniform(IndexOfUniform(AName), AValue); + SetUniform(AIndex, AValue, SizeOf(AValue)); +end; + +procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; + const AValue: TSkRuntimeEffectFloat4); +begin + SetUniform(AIndex, AValue, SizeOf(AValue)); end; procedure TSkRuntimeEffect.SetUniform(const AName: string; const AData; @@ -9723,6 +10277,18 @@ procedure TSkRuntimeEffect.SetUniform(const AName: string; const AData; SetUniform(IndexOfUniform(AName), AData, ASize); end; +procedure TSkRuntimeEffect.SetUniform(const AName: string; + const AValue: Integer); +begin + SetUniform(IndexOfUniform(AName), AValue); +end; + +procedure TSkRuntimeEffect.SetUniform(const AName: string; + const AValue: TArray); +begin + SetUniform(IndexOfUniform(AName), AValue); +end; + procedure TSkRuntimeEffect.SetUniform(const AIndex: Integer; const AValue: TSkRuntimeEffectFloat4x4); begin @@ -9763,18 +10329,18 @@ class function TSkShader.MakeBlend(const AMode: TSkBlendMode; const ADest, raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADest']); if not Assigned(ASrc) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ASrc']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_blend(sk_blendmode_t(AMode), ADest.Handle, ASrc.Handle)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_blend(sk_blendmode_t(AMode), ADest.Handle, ASrc.Handle)); end; class function TSkShader.MakeColor(const AColor: TAlphaColor): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_color(AColor)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_color(AColor)); end; class function TSkShader.MakeColor(const AColor: TAlphaColorF; AColorSpace: ISkColorSpace): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_color2(@sk_color4f_t(AColor), TSkBindings.SafeGetHandle(AColorSpace))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_color2(@sk_color4f_t(AColor), TSkBindings.SafeHandle(AColorSpace))); end; class function TSkShader.MakeGradientLinear(const AStart, AEnd: TPointF; @@ -9823,7 +10389,7 @@ class function TSkShader.MakeGradientLinear(const AStart, AEnd: TPointF; LPositions := nil; LPoints[0] := sk_point_t(AStart); LPoints[1] := sk_point_t(AEnd); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_linear(@LPoints[0], @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_linear(@LPoints[0], @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); end; class function TSkShader.MakeGradientLinear(const AStart, AEnd: TPointF; @@ -9846,7 +10412,7 @@ class function TSkShader.MakeGradientLinear(const AStart, AEnd: TPointF; LPositions := nil; LPoints[0] := sk_point_t(AStart); LPoints[1] := sk_point_t(AEnd); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_linear2(@LPoints[0], @sk_color4f_t(AColors[0]), TSkBindings.SafeGetHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_linear2(@LPoints[0], @sk_color4f_t(AColors[0]), TSkBindings.SafeHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); end; class function TSkShader.MakeGradientLinear(const AStart, AEnd: TPointF; @@ -9868,7 +10434,7 @@ class function TSkShader.MakeGradientLinear(const AStart, AEnd: TPointF; LPositions := nil; LPoints[0] := sk_point_t(AStart); LPoints[1] := sk_point_t(AEnd); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_linear2(@LPoints[0], @sk_color4f_t(AColors[0]), TSkBindings.SafeGetHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_linear2(@LPoints[0], @sk_color4f_t(AColors[0]), TSkBindings.SafeHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); end; class function TSkShader.MakeGradientLinear(const AStart, AEnd: TPointF; @@ -9890,7 +10456,7 @@ class function TSkShader.MakeGradientLinear(const AStart, AEnd: TPointF; LPositions := nil; LPoints[0] := sk_point_t(AStart); LPoints[1] := sk_point_t(AEnd); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_linear(@LPoints[0], @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_linear(@LPoints[0], @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); end; class function TSkShader.MakeGradientRadial(const ACenter: TPointF; @@ -9917,7 +10483,7 @@ class function TSkShader.MakeGradientRadial(const ACenter: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_radial(@sk_point_t(ACenter), ARadius, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_radial(@sk_point_t(ACenter), ARadius, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); end; class function TSkShader.MakeGradientRadial(const ACenter: TPointF; @@ -9958,7 +10524,7 @@ class function TSkShader.MakeGradientRadial(const ACenter: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_radial(@sk_point_t(ACenter), ARadius, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_radial(@sk_point_t(ACenter), ARadius, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); end; class function TSkShader.MakeGradientRadial(const ACenter: TPointF; @@ -9978,7 +10544,7 @@ class function TSkShader.MakeGradientRadial(const ACenter: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_radial2(@sk_point_t(ACenter), ARadius, @sk_color4f_t(AColors[0]), TSkBindings.SafeGetHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_radial2(@sk_point_t(ACenter), ARadius, @sk_color4f_t(AColors[0]), TSkBindings.SafeHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); end; class function TSkShader.MakeGradientRadial(const ACenter: TPointF; @@ -9998,7 +10564,7 @@ class function TSkShader.MakeGradientRadial(const ACenter: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_radial2(@sk_point_t(ACenter), ARadius, @sk_color4f_t(AColors[0]), TSkBindings.SafeGetHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_radial2(@sk_point_t(ACenter), ARadius, @sk_color4f_t(AColors[0]), TSkBindings.SafeHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); end; class function TSkShader.MakeGradientSweep(const ACenter: TPointF; @@ -10018,7 +10584,7 @@ class function TSkShader.MakeGradientSweep(const ACenter: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_sweep2(ACenter.X, ACenter.Y, @sk_color4f_t(AColors[0]), TSkBindings.SafeGetHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), AStartAngle, AEndAngle, @sk_matrix_t(ALocalMatrix))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_sweep2(ACenter.X, ACenter.Y, @sk_color4f_t(AColors[0]), TSkBindings.SafeHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), AStartAngle, AEndAngle, @sk_matrix_t(ALocalMatrix))); end; class function TSkShader.MakeGradientSweep(const ACenter: TPointF; @@ -10038,7 +10604,7 @@ class function TSkShader.MakeGradientSweep(const ACenter: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_sweep2(ACenter.X, ACenter.Y, @sk_color4f_t(AColors[0]), TSkBindings.SafeGetHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), AStartAngle, AEndAngle, nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_sweep2(ACenter.X, ACenter.Y, @sk_color4f_t(AColors[0]), TSkBindings.SafeHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), AStartAngle, AEndAngle, nil)); end; class function TSkShader.MakeGradientSweep(const ACenter: TPointF; @@ -10073,7 +10639,7 @@ class function TSkShader.MakeGradientSweep(const ACenter: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_sweep(ACenter.X, ACenter.Y, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), AStartAngle, AEndAngle, nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_sweep(ACenter.X, ACenter.Y, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), AStartAngle, AEndAngle, nil)); end; class function TSkShader.MakeGradientSweep(const ACenter: TPointF; @@ -10093,7 +10659,7 @@ class function TSkShader.MakeGradientSweep(const ACenter: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_sweep(ACenter.X, ACenter.Y, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), AStartAngle, AEndAngle, @sk_matrix_t(ALocalMatrix))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_sweep(ACenter.X, ACenter.Y, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), AStartAngle, AEndAngle, @sk_matrix_t(ALocalMatrix))); end; class function TSkShader.MakeGradientSweep(const ACenter: TPointF; @@ -10128,7 +10694,7 @@ class function TSkShader.MakeGradientTwoPointConical(const AStart: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_two_point_conical(@sk_point_t(AStart), AStartRadius, @sk_point_t(AEnd), AEndRadius, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_two_point_conical(@sk_point_t(AStart), AStartRadius, @sk_point_t(AEnd), AEndRadius, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); end; class function TSkShader.MakeGradientTwoPointConical(const AStart: TPointF; @@ -10148,7 +10714,7 @@ class function TSkShader.MakeGradientTwoPointConical(const AStart: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_two_point_conical(@sk_point_t(AStart), AStartRadius, @sk_point_t(AEnd), AEndRadius, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_two_point_conical(@sk_point_t(AStart), AStartRadius, @sk_point_t(AEnd), AEndRadius, @AColors[0], LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); end; class function TSkShader.MakeGradientTwoPointConical(const AStart: TPointF; @@ -10200,7 +10766,7 @@ class function TSkShader.MakeGradientTwoPointConical(const AStart: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_two_point_conical2(@sk_point_t(AStart), AStartRadius, @sk_point_t(AEnd), AEndRadius, @sk_color4f_t(AColors[0]), TSkBindings.SafeGetHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_two_point_conical2(@sk_point_t(AStart), AStartRadius, @sk_point_t(AEnd), AEndRadius, @sk_color4f_t(AColors[0]), TSkBindings.SafeHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), @sk_matrix_t(ALocalMatrix))); end; class function TSkShader.MakeGradientTwoPointConical(const AStart: TPointF; @@ -10220,7 +10786,7 @@ class function TSkShader.MakeGradientTwoPointConical(const AStart: TPointF; end else LPositions := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_gradient_two_point_conical2(@sk_point_t(AStart), AStartRadius, @sk_point_t(AEnd), AEndRadius, @sk_color4f_t(AColors[0]), TSkBindings.SafeGetHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_gradient_two_point_conical2(@sk_point_t(AStart), AStartRadius, @sk_point_t(AEnd), AEndRadius, @sk_color4f_t(AColors[0]), TSkBindings.SafeHandle(AColorSpace), LPositions, Length(AColors), sk_tilemode_t(ATileMode), nil)); end; class function TSkShader.MakeImage(const AImage: ISkImage; @@ -10262,28 +10828,28 @@ class function TSkShader.MakePerlinNoiseFractalNoise(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single; const ATileSize: TSize): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_perlin_noise_fractal_noise(ABaseFrequencyX, ABaseFrequencyY, ANumOctaves, ASeed, @sk_isize_t(ATileSize))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_perlin_noise_fractal_noise(ABaseFrequencyX, ABaseFrequencyY, ANumOctaves, ASeed, @sk_isize_t(ATileSize))); end; class function TSkShader.MakePerlinNoiseFractalNoise(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_perlin_noise_fractal_noise(ABaseFrequencyX, ABaseFrequencyY, ANumOctaves, ASeed, nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_perlin_noise_fractal_noise(ABaseFrequencyX, ABaseFrequencyY, ANumOctaves, ASeed, nil)); end; class function TSkShader.MakePerlinNoiseTurbulence(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single; const ATileSize: TSize): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_perlin_noise_turbulence(ABaseFrequencyX, ABaseFrequencyY, ANumOctaves, ASeed, @sk_isize_t(ATileSize))); + Result := TSkBindings.SafeCreate(sk4d_shader_make_perlin_noise_turbulence(ABaseFrequencyX, ABaseFrequencyY, ANumOctaves, ASeed, @sk_isize_t(ATileSize))); end; class function TSkShader.MakePerlinNoiseTurbulence(const ABaseFrequencyX, ABaseFrequencyY: Single; const ANumOctaves: Integer; const ASeed: Single): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_perlin_noise_turbulence(ABaseFrequencyX, ABaseFrequencyY, ANumOctaves, ASeed, nil)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_perlin_noise_turbulence(ABaseFrequencyX, ABaseFrequencyY, ANumOctaves, ASeed, nil)); end; class function TSkShader.MakePicture(const APicture: ISkPicture; @@ -10327,34 +10893,12 @@ function TSkShader.MakeWithColorFilter( begin if not Assigned(AColorFilter) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AColorFilter']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_with_color_filter(GetHandle, AColorFilter.Handle)); + Result := TSkBindings.SafeCreate(sk4d_shader_make_with_color_filter(Handle, AColorFilter.Handle)); end; function TSkShader.MakeWithLocalMatrix(const AMatrix: TMatrix): ISkShader; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shader_make_with_local_matrix(GetHandle, @sk_matrix_t(AMatrix))); -end; - -{ TSkSurfaceProperties } - -constructor TSkSurfaceProperties.Create(const AFlags: TSkSurfacePropertiesFlags; - const APixelGeometry: TSkPixelGeometry); -begin - Flags := AFlags; - PixelGeometry := APixelGeometry; -end; - -class operator TSkSurfaceProperties.Equal(const ASurfaceProperties1, - ASurfaceProperties2: TSkSurfaceProperties): Boolean; -begin - Result := (ASurfaceProperties1.Flags = ASurfaceProperties2.Flags ) and - (ASurfaceProperties1.PixelGeometry = ASurfaceProperties2.PixelGeometry); -end; - -class operator TSkSurfaceProperties.NotEqual(const ASurfaceProperties1, - ASurfaceProperties2: TSkSurfaceProperties): Boolean; -begin - Result := not (ASurfaceProperties1 = ASurfaceProperties2); + Result := TSkBindings.SafeCreate(sk4d_shader_make_with_local_matrix(Handle, @sk_matrix_t(AMatrix))); end; { TSkSurface } @@ -10364,56 +10908,32 @@ procedure TSkSurface.Draw(const ACanvas: ISkCanvas; const AX, AY: Single; begin if not Assigned(ACanvas) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); - TSkiaAPI.sk4d_surface_draw(GetHandle, ACanvas.Handle, AX, AY, TSkBindings.SafeGetHandle(APaint)); + sk4d_surface_draw(Handle, ACanvas.Handle, AX, AY, TSkBindings.SafeHandle(APaint)); end; procedure TSkSurface.Flush; begin - TSkiaAPI.sk4d_surface_flush(GetHandle); + sk4d_surface_flush(Handle); end; -procedure TSkSurface.FlushAndSubmit(const ASyncCPU: Boolean); +procedure TSkSurface.FlushAndSubmit(const ASyncCpu: Boolean); begin - TSkiaAPI.sk4d_surface_flush_and_submit(GetHandle, ASyncCPU); + sk4d_surface_flush_and_submit(Handle, ASyncCpu); end; function TSkSurface.GetCanvas: ISkCanvas; begin - if not Assigned(FCanvasHolder) then - FCanvasHolder := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_get_canvas(GetHandle), False); - Result := FCanvasHolder; + if not Assigned(FCanvas) then + FCanvas := TSkBindings.SafeCreate(sk4d_surface_get_canvas(Handle), False); + Result := FCanvas; end; function TSkSurface.GetProperties: TSkSurfaceProperties; var LResult: sk_surfaceprops_t; begin - TSkiaAPI.sk4d_surface_get_props(GetHandle, LResult); - Result := TSkMapping.ToSurfaceProperties(LResult); -end; - -class function TSkSurface.MakeFromCAMetalLayer(const AContext: IGrDirectContext; - const ALayer: GrMtlHandle; const AOrigin: TGrSurfaceOrigin; - const ASampleCount: Integer; const AColorType: TSkColorType; - out ADrawable: GrMtlHandle; const AProperties: TSkSurfaceProperties; - AColorSpace: ISkColorSpace): ISkSurface; -var - LProperties: sk_surfaceprops_t; -begin - if not Assigned(AContext) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); - LProperties := TSkMapping.AsSurfaceProperties(AProperties); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_from_ca_metal_layer(AContext.Handle, ALayer, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeGetHandle(AColorSpace), @LProperties, ADrawable)); -end; - -class function TSkSurface.MakeFromCAMetalLayer(const AContext: IGrDirectContext; - const ALayer: GrMtlHandle; const AOrigin: TGrSurfaceOrigin; - const ASampleCount: Integer; const AColorType: TSkColorType; - out ADrawable: GrMtlHandle; AColorSpace: ISkColorSpace): ISkSurface; -begin - if not Assigned(AContext) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_from_ca_metal_layer(AContext.Handle, ALayer, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeGetHandle(AColorSpace), nil, ADrawable)); + sk4d_surface_get_props(Handle, LResult); + Result := TSkBindings.ToSurfaceProperties(LResult); end; class function TSkSurface.MakeFromMTKView(const AContext: IGrDirectContext; @@ -10426,8 +10946,8 @@ class function TSkSurface.MakeFromMTKView(const AContext: IGrDirectContext; begin if not Assigned(AContext) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); - LProperties := TSkMapping.AsSurfaceProperties(AProperties); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_from_mtk_view(AContext.Handle, AView, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeGetHandle(AColorSpace), @LProperties)); + LProperties := TSkBindings.AsSurfaceProperties(AProperties); + Result := TSkBindings.SafeCreate(sk4d_surface_make_from_mtk_view(AContext.Handle, AView, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeHandle(AColorSpace), @LProperties)); end; class function TSkSurface.MakeFromMTKView(const AContext: IGrDirectContext; @@ -10437,7 +10957,7 @@ class function TSkSurface.MakeFromMTKView(const AContext: IGrDirectContext; begin if not Assigned(AContext) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_from_mtk_view(AContext.Handle, AView, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeGetHandle(AColorSpace), nil)); + Result := TSkBindings.SafeCreate(sk4d_surface_make_from_mtk_view(AContext.Handle, AView, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeHandle(AColorSpace), nil)); end; class function TSkSurface.MakeFromRenderTarget(const AContext: IGrDirectContext; @@ -10451,8 +10971,8 @@ class function TSkSurface.MakeFromRenderTarget(const AContext: IGrDirectContext; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); if not Assigned(ARenderTarget) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARenderTarget']); - LProperties := TSkMapping.AsSurfaceProperties(AProperties); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_from_render_target(AContext.Handle, ARenderTarget.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), TSkBindings.SafeGetHandle(AColorSpace), @LProperties)); + LProperties := TSkBindings.AsSurfaceProperties(AProperties); + Result := TSkBindings.SafeCreate(sk4d_surface_make_from_render_target(AContext.Handle, ARenderTarget.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), TSkBindings.SafeHandle(AColorSpace), @LProperties)); end; class function TSkSurface.MakeFromRenderTarget(const AContext: IGrDirectContext; @@ -10463,7 +10983,7 @@ class function TSkSurface.MakeFromRenderTarget(const AContext: IGrDirectContext; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); if not Assigned(ARenderTarget) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ARenderTarget']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_from_render_target(AContext.Handle, ARenderTarget.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), TSkBindings.SafeGetHandle(AColorSpace), nil)); + Result := TSkBindings.SafeCreate(sk4d_surface_make_from_render_target(AContext.Handle, ARenderTarget.Handle, gr_surfaceorigin_t(AOrigin), sk_colortype_t(AColorType), TSkBindings.SafeHandle(AColorSpace), nil)); end; class function TSkSurface.MakeFromTexture(const AContext: IGrDirectContext; @@ -10478,8 +10998,8 @@ class function TSkSurface.MakeFromTexture(const AContext: IGrDirectContext; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); if not Assigned(ATexture) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATexture']); - LProperties := TSkMapping.AsSurfaceProperties(AProperties); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_from_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeGetHandle(AColorSpace), @LProperties)); + LProperties := TSkBindings.AsSurfaceProperties(AProperties); + Result := TSkBindings.SafeCreate(sk4d_surface_make_from_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeHandle(AColorSpace), @LProperties)); end; class function TSkSurface.MakeFromTexture(const AContext: IGrDirectContext; @@ -10491,17 +11011,17 @@ class function TSkSurface.MakeFromTexture(const AContext: IGrDirectContext; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); if not Assigned(ATexture) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATexture']); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_from_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeGetHandle(AColorSpace), nil)); + Result := TSkBindings.SafeCreate(sk4d_surface_make_from_texture(AContext.Handle, ATexture.Handle, gr_surfaceorigin_t(AOrigin), ASampleCount, sk_colortype_t(AColorType), TSkBindings.SafeHandle(AColorSpace), nil)); end; function TSkSurface.MakeImageSnapshot(const ABounds: TRect): ISkImage; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_image_snapshot2(GetHandle, @sk_irect_t(ABounds))); + Result := TSkBindings.SafeCreate(sk4d_surface_make_image_snapshot2(Handle, @sk_irect_t(ABounds))); end; function TSkSurface.MakeImageSnapshot: ISkImage; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_image_snapshot(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_surface_make_image_snapshot(Handle)); end; class function TSkSurface.MakeRaster(const AImageInfo: TSkImageInfo; @@ -10509,8 +11029,8 @@ class function TSkSurface.MakeRaster(const AImageInfo: TSkImageInfo; var LImageInfo: sk_imageinfo_t; begin - LImageInfo := TSkMapping.AsImageInfo(AImageInfo); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_raster(@LImageInfo, ARowBytes, nil)); + LImageInfo := TSkBindings.AsImageInfo(AImageInfo); + Result := TSkBindings.SafeCreate(sk4d_surface_make_raster(@LImageInfo, ARowBytes, nil)); end; class function TSkSurface.MakeRaster(const AImageInfo: TSkImageInfo; @@ -10520,9 +11040,9 @@ class function TSkSurface.MakeRaster(const AImageInfo: TSkImageInfo; LImageInfo: sk_imageinfo_t; LProperties: sk_surfaceprops_t; begin - LImageInfo := TSkMapping.AsImageInfo(AImageInfo); - LProperties := TSkMapping.AsSurfaceProperties(AProperties); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_raster(@LImageInfo, ARowBytes, @LProperties)); + LImageInfo := TSkBindings.AsImageInfo(AImageInfo); + LProperties := TSkBindings.AsSurfaceProperties(AProperties); + Result := TSkBindings.SafeCreate(sk4d_surface_make_raster(@LImageInfo, ARowBytes, @LProperties)); end; class function TSkSurface.MakeRaster(const AWidth, AHeight: Integer; @@ -10559,17 +11079,17 @@ class function TSkSurface.MakeRasterDirect(const APixmap: ISkPixmap; begin if not Assigned(APixmap) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APixmap']); - LProperties := TSkMapping.AsSurfaceProperties(AProperties); + LProperties := TSkBindings.AsSurfaceProperties(AProperties); if Assigned(ARasterReleaseProc) then begin Result := TSkDelegate.Initialize(ARasterReleaseProc, function (const AContextProc: Pointer): ISkSurface begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_raster_direct(APixmap.Handle, raster_release_proc, AContextProc, @LProperties)); + Result := TSkBindings.SafeCreate(sk4d_surface_make_raster_direct(APixmap.Handle, raster_release_proc, AContextProc, @LProperties)); end); end else - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_raster_direct(APixmap.Handle, nil, nil, @LProperties)); + Result := TSkBindings.SafeCreate(sk4d_surface_make_raster_direct(APixmap.Handle, nil, nil, @LProperties)); end; class function TSkSurface.MakeRasterDirect(const AImageInfo: TSkImageInfo; @@ -10603,11 +11123,11 @@ class function TSkSurface.MakeRasterDirect(const APixmap: ISkPixmap; Result := TSkDelegate.Initialize(ARasterReleaseProc, function (const AContextProc: Pointer): ISkSurface begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_raster_direct(APixmap.Handle, raster_release_proc, AContextProc, nil)); + Result := TSkBindings.SafeCreate(sk4d_surface_make_raster_direct(APixmap.Handle, raster_release_proc, AContextProc, nil)); end); end else - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_raster_direct(APixmap.Handle, nil, nil, nil)); + Result := TSkBindings.SafeCreate(sk4d_surface_make_raster_direct(APixmap.Handle, nil, nil, nil)); end; class function TSkSurface.MakeRenderTarget(const AContext: IGrDirectContext; @@ -10619,8 +11139,8 @@ class function TSkSurface.MakeRenderTarget(const AContext: IGrDirectContext; begin if not Assigned(AContext) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); - LImageInfo := TSkMapping.AsImageInfo(AImageInfo); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_render_target(AContext.Handle, AIsBudgeted, @LImageInfo, ASampleCount, gr_surfaceorigin_t(AOrigin), nil, AShouldCreateWithMips)); + LImageInfo := TSkBindings.AsImageInfo(AImageInfo); + Result := TSkBindings.SafeCreate(sk4d_surface_make_render_target(AContext.Handle, AIsBudgeted, @LImageInfo, ASampleCount, gr_surfaceorigin_t(AOrigin), nil, AShouldCreateWithMips)); end; class function TSkSurface.MakeRenderTarget(const AContext: IGrDirectContext; @@ -10634,14 +11154,14 @@ class function TSkSurface.MakeRenderTarget(const AContext: IGrDirectContext; begin if not Assigned(AContext) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AContext']); - LImageInfo := TSkMapping.AsImageInfo(AImageInfo); - LProperties := TSkMapping.AsSurfaceProperties(AProperties); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_make_render_target(AContext.Handle, AIsBudgeted, @LImageInfo, ASampleCount, gr_surfaceorigin_t(AOrigin), @LProperties, AShouldCreateWithMips)); + LImageInfo := TSkBindings.AsImageInfo(AImageInfo); + LProperties := TSkBindings.AsSurfaceProperties(AProperties); + Result := TSkBindings.SafeCreate(sk4d_surface_make_render_target(AContext.Handle, AIsBudgeted, @LImageInfo, ASampleCount, gr_surfaceorigin_t(AOrigin), @LProperties, AShouldCreateWithMips)); end; function TSkSurface.PeekPixels: ISkPixmap; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_surface_peek_pixels(GetHandle)); + Result := TSkBindings.SafeCreate(sk4d_surface_peek_pixels(Handle)); end; class procedure TSkSurface.raster_release_proc(pixels, context: Pointer); @@ -10669,15 +11189,7 @@ function TSkSurface.ReadPixels(const ADest: ISkPixmap; const ASrcX, begin if not Assigned(ADest) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ADest']); - Result := TSkiaAPI.sk4d_surface_read_pixels(GetHandle, ADest.Handle, ASrcX, ASrcY); -end; - -{ TSkSVGCanvas } - -class function TSkSVGCanvas.Make(const ABounds: TRectF; const AStream: TStream; - const AFlags: TSkSVGCanvasFlags): ISkCanvas; -begin - Result := TSkManagedSVGCanvas.Make(ABounds, AStream, AFlags); + Result := sk4d_surface_read_pixels(Handle, ADest.Handle, ASrcX, ASrcY); end; { TSkTextBlob } @@ -10690,11 +11202,11 @@ function TSkTextBlob.GetIntercepts(const AUpperBounds, ALowerBounds: Single; begin LBounds[0] := AUpperBounds; LBounds[1] := ALowerBounds; - LCount := TSkiaAPI.sk4d_textblob_get_intercepts(GetHandle, @LBounds[0], nil, TSkBindings.SafeGetHandle(APaint)); + LCount := sk4d_textblob_get_intercepts(Handle, @LBounds[0], nil, TSkBindings.SafeHandle(APaint)); if LCount = 0 then Exit(nil); SetLength(Result, LCount); - TSkiaAPI.sk4d_textblob_get_intercepts(GetHandle, @LBounds[0], @Result[0], TSkBindings.SafeGetHandle(APaint)); + sk4d_textblob_get_intercepts(Handle, @LBounds[0], @Result[0], TSkBindings.SafeHandle(APaint)); end; class function TSkTextBlob.MakeFromText(const AText: string; @@ -10704,7 +11216,7 @@ class function TSkTextBlob.MakeFromText(const AText: string; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); if AText.IsEmpty then Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_textblob_make_from_text(@AText[Low(AText)], Length(AText) * 2, AFont.Handle, sk_textencoding_t.UTF16_SK_TEXTENCODING)); + Result := TSkBindings.SafeCreate(sk4d_textblob_make_from_text(@AText[Low(AText)], Length(AText) * 2, AFont.Handle, sk_textencoding_t.UTF16_SK_TEXTENCODING)); end; class function TSkTextBlob.MakeFromTextHorizontallyPositioned( @@ -10717,7 +11229,7 @@ class function TSkTextBlob.MakeFromTextHorizontallyPositioned( raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); if AText.IsEmpty then Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_textblob_make_from_text_horizontally_positioned(@AText[Low(AText)], Length(AText) * 2, @AXPositions[0], AY, AFont.Handle, sk_textencoding_t.UTF16_SK_TEXTENCODING)); + Result := TSkBindings.SafeCreate(sk4d_textblob_make_from_text_horizontally_positioned(@AText[Low(AText)], Length(AText) * 2, @AXPositions[0], AY, AFont.Handle, sk_textencoding_t.UTF16_SK_TEXTENCODING)); end; class function TSkTextBlob.MakeFromTextPositioned(const AText: string; @@ -10729,7 +11241,7 @@ class function TSkTextBlob.MakeFromTextPositioned(const AText: string; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); if AText.IsEmpty then Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_textblob_make_from_text_positioned(@AText[Low(AText)], Length(AText) * 2, @sk_point_t(APositions[0]), AFont.Handle, sk_textencoding_t.UTF16_SK_TEXTENCODING)); + Result := TSkBindings.SafeCreate(sk4d_textblob_make_from_text_positioned(@AText[Low(AText)], Length(AText) * 2, @sk_point_t(APositions[0]), AFont.Handle, sk_textencoding_t.UTF16_SK_TEXTENCODING)); end; class function TSkTextBlob.MakeFromTextTransform(const AText: string; @@ -10742,17 +11254,17 @@ class function TSkTextBlob.MakeFromTextTransform(const AText: string; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); if AText.IsEmpty then Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_textblob_make_from_text_transform(@AText[Low(AText)], Length(AText) * 2, @sk_rotationscalematrix_t(AMatrices[0]), AFont.Handle, sk_textencoding_t.UTF16_SK_TEXTENCODING)); + Result := TSkBindings.SafeCreate(sk4d_textblob_make_from_text_transform(@AText[Low(AText)], Length(AText) * 2, @sk_rotationscalematrix_t(AMatrices[0]), AFont.Handle, sk_textencoding_t.UTF16_SK_TEXTENCODING)); end; -class procedure TSkTextBlob.RefHandle(const AHandle: THandle); +class procedure TSkTextBlob.__RefHandle(const AHandle: THandle); begin - TSkiaAPI.sk4d_textblob_ref(AHandle); + sk4d_textblob_ref(AHandle); end; -class procedure TSkTextBlob.UnrefHandle(const AHandle: THandle); +class procedure TSkTextBlob.__UnrefHandle(const AHandle: THandle); begin - TSkiaAPI.sk4d_textblob_unref(AHandle); + sk4d_textblob_unref(AHandle); end; { TSkTraceMemoryDumpBaseClass } @@ -10760,7 +11272,7 @@ class procedure TSkTextBlob.UnrefHandle(const AHandle: THandle); constructor TSkTraceMemoryDumpBaseClass.Create(const ADetailedDump, ADumpWrappedObjects: Boolean); begin - inherited Create(TSkiaAPI.sk4d_tracememorydumpbaseclass_create(ADetailedDump, ADumpWrappedObjects, Self)); + inherited Create(sk4d_tracememorydumpbaseclass_create(ADetailedDump, ADumpWrappedObjects, Self)); end; class constructor TSkTraceMemoryDumpBaseClass.Create; @@ -10769,13 +11281,7 @@ constructor TSkTraceMemoryDumpBaseClass.Create(const ADetailedDump, begin LProcs.dump_numeric_value := dump_numeric_value_proc; LProcs.dump_string_value := dump_string_value_proc; - TSkiaAPI.sk4d_tracememorydumpbaseclass_set_procs(@LProcs); -end; - -class procedure TSkTraceMemoryDumpBaseClass.DestroyHandle( - const AHandle: THandle); -begin - TSkiaAPI.sk4d_tracememorydumpbaseclass_destroy(AHandle); + sk4d_tracememorydumpbaseclass_set_procs(@LProcs); end; class procedure TSkTraceMemoryDumpBaseClass.dump_numeric_value_proc( @@ -10791,56 +11297,10 @@ class procedure TSkTraceMemoryDumpBaseClass.dump_string_value_proc( TSkTraceMemoryDumpBaseClass(context).DumpStringValue(string(dump_name), string(value_name), string(value)); end; -{ TSkFontStyle } - -class function TSkFontStyle.Bold: TSkFontStyle; -begin - Result := TSkFontStyle.Create(TSkFontWeight.Bold, TSkFontWidth.Normal, TSkFontSlant.Upright); -end; - -class function TSkFontStyle.BoldItalic: TSkFontStyle; -begin - Result := TSkFontStyle.Create(TSkFontWeight.Bold, TSkFontWidth.Normal, TSkFontSlant.Italic); -end; - -constructor TSkFontStyle.Create(const AWeight, AWidth: Integer; - const ASlant: TSkFontSlant); -begin - Weight := AWeight; - Width := AWidth; - Slant := ASlant; -end; - -constructor TSkFontStyle.Create(const AWeight: TSkFontWeight; - const AWidth: TSkFontWidth; const ASlant: TSkFontSlant); -begin - Weight := Ord(AWeight); - Width := Ord(AWidth); - Slant := ASlant; -end; - -class operator TSkFontStyle.Equal(const AFontStyle1, - AFontStyle2: TSkFontStyle): Boolean; -begin - Result := (AFontStyle1.Weight = AFontStyle2.Weight) and - (AFontStyle1.Width = AFontStyle2.Width ) and - (AFontStyle1.Slant = AFontStyle2.Slant ); -end; - -class function TSkFontStyle.Italic: TSkFontStyle; -begin - Result := TSkFontStyle.Create(TSkFontWeight.Normal, TSkFontWidth.Normal, TSkFontSlant.Italic); -end; - -class function TSkFontStyle.Normal: TSkFontStyle; -begin - Result := TSkFontStyle.Create(TSkFontWeight.Normal, TSkFontWidth.Normal, TSkFontSlant.Upright); -end; - -class operator TSkFontStyle.NotEqual(const AFontStyle1, - AFontStyle2: TSkFontStyle): Boolean; +class procedure TSkTraceMemoryDumpBaseClass.__DestroyHandle( + const AHandle: THandle); begin - Result := not (AFontStyle1 = AFontStyle2); + sk4d_tracememorydumpbaseclass_destroy(AHandle); end; { TSkTypeface } @@ -10849,28 +11309,28 @@ function TSkTypeface.GetFamilyName: string; var LResult: ISkString; begin - LResult := TSkString.Wrap(TSkiaAPI.sk4d_typeface_get_family_name(GetHandle)); + LResult := TSkString.Wrap(sk4d_typeface_get_family_name(Handle)); Result := LResult.Text; end; function TSkTypeface.GetSlant: TSkFontSlant; begin - Result := TSkFontSlant(TSkiaAPI.sk4d_typeface_get_slant(GetHandle)); + Result := TSkFontSlant(sk4d_typeface_get_slant(Handle)); end; function TSkTypeface.GetStyle: TSkFontStyle; begin - TSkiaAPI.sk4d_typeface_get_style(GetHandle, sk_fontstyle_t(Result)); + sk4d_typeface_get_style(Handle, sk_fontstyle_t(Result)); end; function TSkTypeface.GetWeight: Integer; begin - Result := TSkiaAPI.sk4d_typeface_get_weight(GetHandle); + Result := sk4d_typeface_get_weight(Handle); end; function TSkTypeface.GetWidth: Integer; begin - Result := TSkiaAPI.sk4d_typeface_get_width(GetHandle); + Result := sk4d_typeface_get_width(Handle); end; function TSkTypeface.IsBold: Boolean; @@ -10885,24 +11345,28 @@ function TSkTypeface.IsItalic: Boolean; class function TSkTypeface.MakeDefault: ISkTypeface; begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_typeface_make_default()); + Result := TSkBindings.SafeCreate(sk4d_typeface_make_default()); end; class function TSkTypeface.MakeFromFile(const AFileName: string; const ATTCIndex: Integer): ISkTypeface; +var + LMarshaller: TMarshaller; begin if AFileName.IsEmpty then raise ESkException.Create(SFileNameIsEmpty); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_typeface_make_from_file(MarshaledAString(UTF8String(AFileName)), ATTCIndex)); + Result := TSkBindings.SafeCreate(sk4d_typeface_make_from_file(LMarshaller.AsUtf8(AFileName).ToPointer, ATTCIndex)); end; class function TSkTypeface.MakeFromName(const AFamilyName: string; const AStyle: TSkFontStyle): ISkTypeface; +var + LMarshaller: TMarshaller; begin if AFamilyName.IsEmpty then - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_typeface_make_from_name(nil, @sk_fontstyle_t(AStyle))) + Result := TSkBindings.SafeCreate(sk4d_typeface_make_from_name(nil, @sk_fontstyle_t(AStyle))) else - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_typeface_make_from_name(MarshaledAString(UTF8String(AFamilyName)), @sk_fontstyle_t(AStyle))); + Result := TSkBindings.SafeCreate(sk4d_typeface_make_from_name(LMarshaller.AsUtf8(AFamilyName).ToPointer, @sk_fontstyle_t(AStyle))); end; class function TSkTypeface.MakeFromStream(const AStream: TStream; @@ -10911,7 +11375,7 @@ class function TSkTypeface.MakeFromStream(const AStream: TStream; LStream: ISkStream; begin LStream := TSkStreamAdapter.Create(AStream); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_typeface_make_from_stream(LStream.Handle, ATTCIndex)); + Result := TSkBindings.SafeCreate(sk4d_typeface_make_from_stream(LStream.Handle, ATTCIndex)); end; { TSkVertices } @@ -10947,62 +11411,62 @@ class function TSkVertices.MakeCopy(const AVertexMode: TSkVertexMode; LIndices := @AIndices[0] else LIndices := nil; - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_vertices_make_copy(sk_vertexmode_t(AVerTexMode), Length(APositions), @sk_point_t(APositions[0]), LTextures, LColors, Length(AIndices), LIndices)); + Result := TSkBindings.SafeCreate(sk4d_vertices_make_copy(sk_vertexmode_t(AVerTexMode), Length(APositions), @sk_point_t(APositions[0]), LTextures, LColors, Length(AIndices), LIndices)); end; -class procedure TSkVertices.RefHandle(const AHandle: THandle); +class procedure TSkVertices.__RefHandle(const AHandle: THandle); begin - TSkiaAPI.sk4d_vertices_ref(AHandle); + sk4d_vertices_ref(AHandle); end; -class procedure TSkVertices.UnrefHandle(const AHandle: THandle); +class procedure TSkVertices.__UnrefHandle(const AHandle: THandle); begin - TSkiaAPI.sk4d_vertices_unref(AHandle); + sk4d_vertices_unref(AHandle); end; { TSkParticleEffect } class constructor TSkParticleEffect.Create; begin - TSkiaAPI.sk4d_particleeffect_init(); + sk4d_particleeffect_init(); end; function TSkParticleEffect.GetPosition: TPointF; begin - TSkiaAPI.sk4d_particleeffect_get_position(GetHandle, sk_point_t(Result)); + sk4d_particleeffect_get_position(Handle, sk_point_t(Result)); end; function TSkParticleEffect.GetRate: Single; begin - Result := TSkiaAPI.sk4d_particleeffect_get_rate(GetHandle); + Result := sk4d_particleeffect_get_rate(Handle); end; function TSkParticleEffect.GetUniform( const AIndex: NativeUInt): TSkParticleUniform; begin - TSkiaAPI.sk4d_particleeffect_get_uniform(GetHandle, AIndex, sk_particleuniform_t(Result)); + sk4d_particleeffect_get_uniform(Handle, AIndex, sk_particleuniform_t(Result)); end; function TSkParticleEffect.GetUniformCount: NativeUInt; begin - Result := TSkiaAPI.sk4d_particleeffect_get_uniform_count(GetHandle); + Result := sk4d_particleeffect_get_uniform_count(Handle); end; -function TSkParticleEffect.GetUniformData: PSkParticleUniformData; +function TSkParticleEffect.GetUniformData: PSingleArray; begin - Result := PSkParticleUniformData(TSkiaAPI.sk4d_particleeffect_get_uniform_data(GetHandle)); + Result := PSingleArray(sk4d_particleeffect_get_uniform_data(Handle)); end; function TSkParticleEffect.GetUniformDataCount: Integer; begin - Result := TSkiaAPI.sk4d_particleeffect_get_uniform_data_count(GetHandle); + Result := sk4d_particleeffect_get_uniform_data_count(Handle); end; function TSkParticleEffect.GetUniformName(const AIndex: NativeUInt): string; var LResult: ISkString; begin - LResult := TSkString.Wrap(TSkiaAPI.sk4d_particleeffect_get_uniform_name(GetHandle, AIndex)); + LResult := TSkString.Wrap(sk4d_particleeffect_get_uniform_name(Handle, AIndex)); Result := LResult.Text; end; @@ -11021,10 +11485,12 @@ class function TSkParticleEffect.Make(const AData: string; class function TSkParticleEffect.MakeFromFile( const AFileName: string): ISkParticleEffect; +var + LMarshaller: TMarshaller; begin if AFileName.IsEmpty then raise ESkException.Create(SFileNameIsEmpty); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_particleeffect_make_from_file(MarshaledAString(UTF8String(AFileName)))); + Result := TSkBindings.SafeCreate(sk4d_particleeffect_make_from_file(LMarshaller.AsUtf8(AFileName).ToPointer)); end; class function TSkParticleEffect.MakeFromStream(const AStream: TStream; @@ -11033,74 +11499,76 @@ class function TSkParticleEffect.MakeFromStream(const AStream: TStream; LStream: ISkStream; begin LStream := TSkStreamAdapter.Create(AStream); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_particleeffect_make_from_stream(LStream.Handle, TSkBindings.SafeGetHandle(AResourceProvider))); + Result := TSkBindings.SafeCreate(sk4d_particleeffect_make_from_stream(LStream.Handle, TSkBindings.SafeHandle(AResourceProvider))); end; procedure TSkParticleEffect.Render(const ACanvas: ISkCanvas); begin if not Assigned(ACanvas) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); - TSkiaAPI.sk4d_particleeffect_render(GetHandle, ACanvas.Handle); + sk4d_particleeffect_render(Handle, ACanvas.Handle); end; procedure TSkParticleEffect.SetPosition(const AValue: TPointF); begin - TSkiaAPI.sk4d_particleeffect_set_position(GetHandle, @sk_point_t(AValue)); + sk4d_particleeffect_set_position(Handle, @sk_point_t(AValue)); end; procedure TSkParticleEffect.SetRate(const AValue: Single); begin - TSkiaAPI.sk4d_particleeffect_set_rate(GetHandle, AValue); + sk4d_particleeffect_set_rate(Handle, AValue); end; function TSkParticleEffect.SetUniform(const AName: string; const AData: TArray): Boolean; +var + LMarshaller: TMarshaller; begin if Length(AData) < 1 then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AData']); - Result := TSkiaAPI.sk4d_particleeffect_set_uniform(GetHandle, MarshaledAString(UTF8String(AName)), @AData[0], Length(AData)); + Result := sk4d_particleeffect_set_uniform(Handle, LMarshaller.AsUtf8(AName).ToPointer, @AData[0], Length(AData)); end; procedure TSkParticleEffect.Start(const ANow: Double; const ALooping: Boolean); begin - TSkiaAPI.sk4d_particleeffect_start(GetHandle, ANow, ALooping); + sk4d_particleeffect_start(Handle, ANow, ALooping); end; procedure TSkParticleEffect.Update(const ANow: Double); begin - TSkiaAPI.sk4d_particleeffect_update(GetHandle, ANow); + sk4d_particleeffect_update(Handle, ANow); end; { TSkottieAnimation } function TSkottieAnimation.GetDuration: Double; begin - Result := TSkiaAPI.sk4d_skottieanimation_get_duration(GetHandle); + Result := sk4d_skottieanimation_get_duration(Handle); end; function TSkottieAnimation.GetFPS: Double; begin - Result := TSkiaAPI.sk4d_skottieanimation_get_fps(GetHandle); + Result := sk4d_skottieanimation_get_fps(Handle); end; function TSkottieAnimation.GetInPoint: Double; begin - Result := TSkiaAPI.sk4d_skottieanimation_get_in_point(GetHandle); + Result := sk4d_skottieanimation_get_in_point(Handle); end; function TSkottieAnimation.GetOutPoint: Double; begin - Result := TSkiaAPI.sk4d_skottieanimation_get_out_point(GetHandle); + Result := sk4d_skottieanimation_get_out_point(Handle); end; function TSkottieAnimation.GetSize: TSizeF; begin - TSkiaAPI.sk4d_skottieanimation_get_size(GetHandle, sk_size_t(Result)); + sk4d_skottieanimation_get_size(Handle, sk_size_t(Result)); end; function TSkottieAnimation.GetVersion: string; begin - Result := string(TSkiaAPI.sk4d_skottieanimation_get_version(GetHandle)); + Result := string(sk4d_skottieanimation_get_version(Handle)); end; class function TSkottieAnimation.Make(const AData: string; @@ -11118,185 +11586,132 @@ class function TSkottieAnimation.Make(const AData: string; class function TSkottieAnimation.MakeFromFile( const AFileName: string): ISkottieAnimation; +var + LMarshaller: TMarshaller; begin if AFileName.IsEmpty then raise ESkException.Create(SFileNameIsEmpty); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_skottieanimation_make_from_file(MarshaledAString(UTF8String(AFileName)))); + Result := TSkBindings.SafeCreate(sk4d_skottieanimation_make_from_file(LMarshaller.AsUtf8(AFileName).ToPointer)); end; class function TSkottieAnimation.MakeFromStream(const AStream: TStream; const AResourceProvider: ISkResourceProvider): ISkottieAnimation; -var - LStream: ISkStream; -begin - LStream := TSkStreamAdapter.Create(AStream); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_skottieanimation_make_from_stream(LStream.Handle, TSkBindings.SafeGetHandle(AResourceProvider))); -end; - -class procedure TSkottieAnimation.RefHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_skottieanimation_ref(AHandle); -end; - -procedure TSkottieAnimation.Render(const ACanvas: ISkCanvas; - const ARenderFlags: TSkottieAnimationRenderFlags); -begin - if not Assigned(ACanvas) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); - TSkiaAPI.sk4d_skottieanimation_render(GetHandle, ACanvas.Handle, nil, Byte(ARenderFlags)); -end; - -procedure TSkottieAnimation.Render(const ACanvas: ISkCanvas; - const ADest: TRectF; const ARenderFlags: TSkottieAnimationRenderFlags); -begin - if not Assigned(ACanvas) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); - TSkiaAPI.sk4d_skottieanimation_render(GetHandle, ACanvas.Handle, @sk_rect_t(ADest), Byte(ARenderFlags)); -end; - -procedure TSkottieAnimation.SeekFrame(const ATick: Double); -begin - TSkiaAPI.sk4d_skottieanimation_seek_frame(GetHandle, ATick); -end; - -procedure TSkottieAnimation.SeekFrameTime(const ATick: Double); -begin - TSkiaAPI.sk4d_skottieanimation_seek_frame_time(GetHandle, ATick); -end; - -class procedure TSkottieAnimation.UnrefHandle(const AHandle: THandle); +var + LStream: ISkStream; begin - TSkiaAPI.sk4d_skottieanimation_unref(AHandle); + LStream := TSkStreamAdapter.Create(AStream); + Result := TSkBindings.SafeCreate(sk4d_skottieanimation_make_from_stream(LStream.Handle, TSkBindings.SafeHandle(AResourceProvider))); end; -{ TSkPositionAffinity } - -class operator TSkPositionAffinity.Equal(const APositionAffinity1, - APositionAffinity2: TSkPositionAffinity): Boolean; +procedure TSkottieAnimation.Render(const ACanvas: ISkCanvas; + const ARenderFlags: TSkottieAnimationRenderFlags); begin - Result := (APositionAffinity1.Position = APositionAffinity2.Position) and - (APositionAffinity1.Affinity = APositionAffinity2.Affinity); + if not Assigned(ACanvas) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); + sk4d_skottieanimation_render(Handle, ACanvas.Handle, nil, Byte(ARenderFlags)); end; -class operator TSkPositionAffinity.NotEqual(const APositionAffinity1, - APositionAffinity2: TSkPositionAffinity): Boolean; +procedure TSkottieAnimation.Render(const ACanvas: ISkCanvas; + const ADest: TRectF; const ARenderFlags: TSkottieAnimationRenderFlags); begin - Result := not (APositionAffinity1 = APositionAffinity2); + if not Assigned(ACanvas) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); + sk4d_skottieanimation_render(Handle, ACanvas.Handle, @sk_rect_t(ADest), Byte(ARenderFlags)); end; -{ TSkMetrics } - -class operator TSkMetrics.Equal(const AMetrics1, - AMetrics2: TSkMetrics): Boolean; +procedure TSkottieAnimation.SeekFrame(const ATick: Double); begin - Result := (AMetrics1.StartIndex = AMetrics2.StartIndex ) and - (AMetrics1.EndIndex = AMetrics2.EndIndex ) and - (AMetrics1.EndExcludingWhitespaces = AMetrics2.EndExcludingWhitespaces) and - (AMetrics1.EndIncludingNewline = AMetrics2.EndIncludingNewline ) and - (AMetrics1.IsHardBreak = AMetrics2.IsHardBreak ) and - (AMetrics1.LineNumber = AMetrics2.LineNumber ) and - (SameValue(AMetrics1.Ascent, AMetrics2.Ascent, Epsilon)) and - (SameValue(AMetrics1.Descent, AMetrics2.Descent, Epsilon)) and - (SameValue(AMetrics1.Height, AMetrics2.Height, Epsilon)) and - (SameValue(AMetrics1.Width, AMetrics2.Width, Epsilon)) and - (SameValue(AMetrics1.Left, AMetrics2.Left, Epsilon)) and - (SameValue(AMetrics1.Baseline, AMetrics2.Baseline, Epsilon)); + sk4d_skottieanimation_seek_frame(Handle, ATick); end; -class operator TSkMetrics.NotEqual(const AMetrics1, - AMetrics2: TSkMetrics): Boolean; +procedure TSkottieAnimation.SeekFrameTime(const ATick: Double); begin - Result := not (AMetrics1 = AMetrics2); + sk4d_skottieanimation_seek_frame_time(Handle, ATick); end; -{ TSkTextBox } - -class operator TSkTextBox.Equal(const ATextBox1, - ATextBox2: TSkTextBox): Boolean; +class procedure TSkottieAnimation.__RefHandle(const AHandle: THandle); begin - Result := (ATextBox1.Rect = ATextBox2.Rect ) and - (ATextBox1.Direction = ATextBox2.Direction); + sk4d_skottieanimation_ref(AHandle); end; -class operator TSkTextBox.NotEqual(const ATextBox1, - ATextBox2: TSkTextBox): Boolean; +class procedure TSkottieAnimation.__UnrefHandle(const AHandle: THandle); begin - Result := not (ATextBox1 = ATextBox2) + sk4d_skottieanimation_unref(AHandle); end; { TSkParagraph } -class procedure TSkParagraph.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_paragraph_destroy(AHandle); -end; - function TSkParagraph.DidExceedMaxLines: Boolean; begin - Result := TSkiaAPI.sk4d_paragraph_did_exceed_max_lines(GetHandle); + Result := sk4d_paragraph_did_exceed_max_lines(Handle); end; function TSkParagraph.GetAlphabeticBaseline: Single; begin - Result := TSkiaAPI.sk4d_paragraph_get_alphabetic_baseline(GetHandle); + Result := sk4d_paragraph_get_alphabetic_baseline(Handle); end; function TSkParagraph.GetGlyphPositionAtCoordinate(const ADeltaX, ADeltaY: Single): TSkPositionAffinity; begin - TSkiaAPI.sk4d_paragraph_get_glyph_position_at_coordinate(GetHandle, ADeltaX, ADeltaY, sk_positionaffinity_t(Result)); + sk4d_paragraph_get_glyph_position_at_coordinate(Handle, ADeltaX, ADeltaY, sk_positionaffinity_t(Result)); end; function TSkParagraph.GetHeight: Single; begin - Result := TSkiaAPI.sk4d_paragraph_get_height(GetHandle); + Result := sk4d_paragraph_get_height(Handle); end; function TSkParagraph.GetIdeographicBaseline: Single; begin - Result := TSkiaAPI.sk4d_paragraph_get_ideographic_baseline(GetHandle); + Result := sk4d_paragraph_get_ideographic_baseline(Handle); end; function TSkParagraph.GetLineMetrics: TArray; var + I: Integer; LCount: NativeUInt; + LResult: TArray; begin - LCount := TSkiaAPI.sk4d_paragraph_get_line_metrics(GetHandle, nil); + LCount := sk4d_paragraph_get_line_metrics(Handle, nil); if LCount = 0 then Exit(nil); - SetLength(Result, LCount); - TSkiaAPI.sk4d_paragraph_get_line_metrics(GetHandle, @sk_metrics_t(Result[0])); + SetLength(LResult, LCount); + sk4d_paragraph_get_line_metrics(Handle, @sk_metrics_t(LResult[0])); + SetLength(Result, Length(LResult)); + for I := 0 to Length(LResult) - 1 do + Result[I] := TSkMetrics(LResult[I]); end; function TSkParagraph.GetLongestLine: Single; begin - Result := TSkiaAPI.sk4d_paragraph_get_longest_line(GetHandle); + Result := sk4d_paragraph_get_longest_line(Handle); end; function TSkParagraph.GetMaxIntrinsicWidth: Single; begin - Result := TSkiaAPI.sk4d_paragraph_get_max_intrinsic_width(GetHandle); + Result := sk4d_paragraph_get_max_intrinsic_width(Handle); end; function TSkParagraph.GetMaxWidth: Single; begin - Result := TSkiaAPI.sk4d_paragraph_get_max_width(GetHandle); + Result := sk4d_paragraph_get_max_width(Handle); end; function TSkParagraph.GetMinIntrinsicWidth: Single; begin - Result := TSkiaAPI.sk4d_paragraph_get_min_intrinsic_width(GetHandle); + Result := sk4d_paragraph_get_min_intrinsic_width(Handle); end; function TSkParagraph.GetRectsForPlaceholders: TArray; var LCount: NativeUInt; begin - LCount := TSkiaAPI.sk4d_paragraph_get_rects_for_placeholders(GetHandle, nil); + LCount := sk4d_paragraph_get_rects_for_placeholders(Handle, nil); if LCount = 0 then Exit(nil); SetLength(Result, LCount); - TSkiaAPI.sk4d_paragraph_get_rects_for_placeholders(GetHandle, @sk_textbox_t(Result[0])); + sk4d_paragraph_get_rects_for_placeholders(Handle, @sk_textbox_t(Result[0])); end; function TSkParagraph.GetRectsForRange(const AStart, AEnd: Cardinal; @@ -11305,63 +11720,51 @@ function TSkParagraph.GetRectsForRange(const AStart, AEnd: Cardinal; var LCount: NativeUInt; begin - LCount := TSkiaAPI.sk4d_paragraph_get_rects_for_range(GetHandle, AStart, AEnd, sk_rectheightstyle_t(ARectHeightStyle), sk_rectwidthstyle_t(ARectWidthStyle), nil); + LCount := sk4d_paragraph_get_rects_for_range(Handle, AStart, AEnd, sk_rectheightstyle_t(ARectHeightStyle), sk_rectwidthstyle_t(ARectWidthStyle), nil); if LCount = 0 then Exit(nil); SetLength(Result, LCount); - TSkiaAPI.sk4d_paragraph_get_rects_for_range(GetHandle, AStart, AEnd, sk_rectheightstyle_t(ARectHeightStyle), sk_rectwidthstyle_t(ARectWidthStyle), @sk_textbox_t(Result[0])); + sk4d_paragraph_get_rects_for_range(Handle, AStart, AEnd, sk_rectheightstyle_t(ARectHeightStyle), sk_rectwidthstyle_t(ARectWidthStyle), @sk_textbox_t(Result[0])); end; procedure TSkParagraph.GetWordBoundary(const AOffset: Cardinal; out AStart, AEnd: Cardinal); begin - TSkiaAPI.sk4d_paragraph_get_word_boundary(GetHandle, AOffset, AStart, AEnd); + sk4d_paragraph_get_word_boundary(Handle, AOffset, AStart, AEnd); end; procedure TSkParagraph.Layout(const AWidth: Single); begin - TSkiaAPI.sk4d_paragraph_layout(GetHandle, AWidth); + sk4d_paragraph_layout(Handle, AWidth); end; procedure TSkParagraph.Paint(const ACanvas: ISkCanvas; const AX, AY: Single); begin if not Assigned(ACanvas) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); - TSkiaAPI.sk4d_paragraph_paint(GetHandle, ACanvas.Handle, AX, AY); + sk4d_paragraph_paint(Handle, ACanvas.Handle, AX, AY); end; function TSkParagraph.ToPath: ISkPath; begin - Result := TSkPath.Wrap(TSkiaAPI.sk4d_paragraph_to_path(GetHandle)); + Result := TSkPath.Wrap(sk4d_paragraph_to_path(Handle)); end; -{ TSkPlaceholderStyle } - -constructor TSkPlaceholderStyle.Create(const AWidth, AHeight: Single; - const AAlignment: TSkPlaceholderAlignment; const ABaseline: TSkTextBaseline; - const ABaselineOffset: Single); +procedure TSkParagraph.Visit(const AProc: TSkParagraphVisitProc); begin - Width := AWidth; - Height := AHeight; - Alignment := AAlignment; - Baseline := ABaseline; - BaselineOffset := ABaselineOffset; + sk4d_paragraph_visit(Handle, visit_proc, @AProc); end; -class operator TSkPlaceholderStyle.Equal(const APlaceholderStyle1, - APlaceholderStyle2: TSkPlaceholderStyle): Boolean; +class procedure TSkParagraph.visit_proc(line_number: int32_t; + const info: psk_paragraphvisitorinfo_t; context: Pointer); begin - Result := (APlaceholderStyle1.Alignment = APlaceholderStyle2.Alignment) and - (APlaceholderStyle1.Baseline = APlaceholderStyle2.Baseline ) and - (SameValue(APlaceholderStyle1.Width, APlaceholderStyle2.Width, Epsilon)) and - (SameValue(APlaceholderStyle1.Height, APlaceholderStyle2.Height, Epsilon)) and - ((APlaceholderStyle1.Alignment <> TSkPlaceholderAlignment.Baseline) or (SameValue(APlaceholderStyle1.BaselineOffset, APlaceholderStyle2.BaselineOffset, Epsilon))); + if info <> nil then + TSkParagraphVisitProc(context^)(line_number, TSkBindings.ToParagraphVisitorInfo(info^)); end; -class operator TSkPlaceholderStyle.NotEqual(const APlaceholderStyle1, - APlaceholderStyle2: TSkPlaceholderStyle): Boolean; +class procedure TSkParagraph.__DestroyHandle(const AHandle: THandle); begin - Result := not (APlaceholderStyle1 = APlaceholderStyle2); + sk4d_paragraph_destroy(AHandle); end; { TSkParagraphBuilder } @@ -11369,22 +11772,19 @@ constructor TSkPlaceholderStyle.Create(const AWidth, AHeight: Single; procedure TSkParagraphBuilder.AddPlaceholder( const APlaceholder: TSkPlaceholderStyle); begin - TSkiaAPI.sk4d_paragraphbuilder_add_placeholder(GetHandle, @sk_placeholderstyle_t(APlaceholder)); + sk4d_paragraphbuilder_add_placeholder(Handle, @sk_placeholderstyle_t(APlaceholder)); end; procedure TSkParagraphBuilder.AddText(const AText: string); var - LText: UTF8String; + LMarshaller: TMarshaller; begin - if AText.IsEmpty then - Exit; - LText := UTF8String(AText); - TSkiaAPI.sk4d_paragraphbuilder_add_text(GetHandle, @LText[Low(LText)], Length(LText)); + sk4d_paragraphbuilder_add_text(Handle, LMarshaller.AsUtf8(AText).ToPointer); end; function TSkParagraphBuilder.Build: ISkParagraph; begin - Result := TSkParagraph.Wrap(TSkiaAPI.sk4d_paragraphbuilder_build(GetHandle)); + Result := TSkParagraph.Wrap(sk4d_paragraphbuilder_build(Handle)); end; constructor TSkParagraphBuilder.Create(const AParagraphStyle: ISkParagraphStyle; @@ -11395,7 +11795,7 @@ constructor TSkParagraphBuilder.Create(const AParagraphStyle: ISkParagraphStyle; raise ESkArgumentException.CreateFmt(SParamIsNil, ['AParagraphStyle']); if not Assigned(AFontProvider) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFontProvider']); - inherited Create(TSkiaAPI.sk4d_paragraphbuilder_create2(AParagraphStyle.Handle, AFontProvider.Handle, AEnableFontFallback)); + inherited Create(sk4d_paragraphbuilder_create2(AParagraphStyle.Handle, AFontProvider.Handle, AEnableFontFallback)); end; constructor TSkParagraphBuilder.Create( @@ -11403,331 +11803,307 @@ constructor TSkParagraphBuilder.Create( begin if not Assigned(AParagraphStyle) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AParagraphStyle']); - inherited Create(TSkiaAPI.sk4d_paragraphbuilder_create(AParagraphStyle.Handle)); -end; - -class procedure TSkParagraphBuilder.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_paragraphbuilder_destroy(AHandle); + inherited Create(sk4d_paragraphbuilder_create(AParagraphStyle.Handle)); end; procedure TSkParagraphBuilder.Pop; begin - TSkiaAPI.sk4d_paragraphbuilder_pop(GetHandle); + sk4d_paragraphbuilder_pop(Handle); end; procedure TSkParagraphBuilder.PushStyle(const ATextStyle: ISkTextStyle); begin if not Assigned(ATextStyle) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATextStyle']); - TSkiaAPI.sk4d_paragraphbuilder_push_style(GetHandle, ATextStyle.Handle); + sk4d_paragraphbuilder_push_style(Handle, ATextStyle.Handle); end; -{ TSkStrutStyle } - -constructor TSkStrutStyle.Create; +class procedure TSkParagraphBuilder.__DestroyHandle(const AHandle: THandle); begin - inherited Create(TSkiaAPI.sk4d_strutstyle_create()); + sk4d_paragraphbuilder_destroy(AHandle); end; -class procedure TSkStrutStyle.DestroyHandle(const AHandle: THandle); +{ TSkStrutStyle } + +constructor TSkStrutStyle.Create; begin - TSkiaAPI.sk4d_strutstyle_destroy(AHandle); + inherited Create(sk4d_strutstyle_create()); end; function TSkStrutStyle.GetEnabled: Boolean; begin - Result := TSkiaAPI.sk4d_strutstyle_get_enabled(GetHandle); + Result := sk4d_strutstyle_get_enabled(Handle); end; function TSkStrutStyle.GetFontFamilies: TArray; begin - Result := TSkBindings.GetStrings(GetHandle, + Result := TSkBindings.GetStrings(Handle, function (const AHandle: THandle; const AStrings: PMarshaledAString): Integer begin - Result := TSkiaAPI.sk4d_strutstyle_get_font_families(AHandle, AStrings); + Result := sk4d_strutstyle_get_font_families(AHandle, AStrings); end); end; function TSkStrutStyle.GetFontSize: Single; begin - Result := TSkiaAPI.sk4d_strutstyle_get_font_size(GetHandle); + Result := sk4d_strutstyle_get_font_size(Handle); end; function TSkStrutStyle.GetFontStyle: TSkFontStyle; begin - TSkiaAPI.sk4d_strutstyle_get_font_style(GetHandle, sk_fontstyle_t(Result)); + sk4d_strutstyle_get_font_style(Handle, sk_fontstyle_t(Result)); end; function TSkStrutStyle.GetForceHeight: Boolean; begin - Result := TSkiaAPI.sk4d_strutstyle_get_force_height(GetHandle); + Result := sk4d_strutstyle_get_force_height(Handle); end; function TSkStrutStyle.GetHalfLeading: Boolean; begin - Result := TSkiaAPI.sk4d_strutstyle_get_half_leading(GetHandle); + Result := sk4d_strutstyle_get_half_leading(Handle); end; function TSkStrutStyle.GetHeightMultiplier: Single; begin - Result := TSkiaAPI.sk4d_strutstyle_get_height_multiplier(GetHandle); + Result := sk4d_strutstyle_get_height_multiplier(Handle); end; function TSkStrutStyle.GetLeading: Single; begin - Result := TSkiaAPI.sk4d_strutstyle_get_leading(GetHandle); + Result := sk4d_strutstyle_get_leading(Handle); end; function TSkStrutStyle.IsEqual(const AStrutStyle: ISkStrutStyle): Boolean; begin if not Assigned(AStrutStyle) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AStrutStyle']); - Result := TSkiaAPI.sk4d_strutstyle_is_equal(GetHandle, AStrutStyle.Handle); + Result := sk4d_strutstyle_is_equal(Handle, AStrutStyle.Handle); end; procedure TSkStrutStyle.SetEnabled(const AValue: Boolean); begin - TSkiaAPI.sk4d_strutstyle_set_enabled(GetHandle, AValue); + sk4d_strutstyle_set_enabled(Handle, AValue); end; procedure TSkStrutStyle.SetFontFamilies(const AValue: TArray); begin - TSkBindings.SetStrings(GetHandle, AValue, - procedure (const AHandle: THandle; const AStrings: PMarshaledAString; const ALength: Integer) + TSkBindings.SetStrings(Handle, AValue, + procedure (const AHandle: THandle; const AStrings: PMarshaledAString) begin - TSkiaAPI.sk4d_strutstyle_set_font_families(AHandle, AStrings, ALength); + sk4d_strutstyle_set_font_families(AHandle, AStrings, Length(AValue)); end); end; procedure TSkStrutStyle.SetFontSize(const AValue: Single); begin - TSkiaAPI.sk4d_strutstyle_set_font_size(GetHandle, AValue); + sk4d_strutstyle_set_font_size(Handle, AValue); end; procedure TSkStrutStyle.SetFontStyle(const AValue: TSkFontStyle); begin - TSkiaAPI.sk4d_strutstyle_set_font_style(GetHandle, @sk_fontstyle_t(AValue)); + sk4d_strutstyle_set_font_style(Handle, @sk_fontstyle_t(AValue)); end; procedure TSkStrutStyle.SetForceHeight(const AValue: Boolean); begin - TSkiaAPI.sk4d_strutstyle_set_force_height(GetHandle, AValue); + sk4d_strutstyle_set_force_height(Handle, AValue); end; procedure TSkStrutStyle.SetHalfLeading(const AValue: Boolean); begin - TSkiaAPI.sk4d_strutstyle_set_half_leading(GetHandle, AValue); + sk4d_strutstyle_set_half_leading(Handle, AValue); end; procedure TSkStrutStyle.SetHeightMultiplier(const AValue: Single); begin - TSkiaAPI.sk4d_strutstyle_set_height_multiplier(GetHandle, AValue); + sk4d_strutstyle_set_height_multiplier(Handle, AValue); end; procedure TSkStrutStyle.SetLeading(const AValue: Single); begin - TSkiaAPI.sk4d_strutstyle_set_leading(GetHandle, AValue); + sk4d_strutstyle_set_leading(Handle, AValue); end; -{ TSkParagraphStyle } - -constructor TSkParagraphStyle.Create; +class procedure TSkStrutStyle.__DestroyHandle(const AHandle: THandle); begin - inherited Create(TSkiaAPI.sk4d_paragraphstyle_create()); + sk4d_strutstyle_destroy(AHandle); end; -class procedure TSkParagraphStyle.DestroyHandle(const AHandle: THandle); +{ TSkParagraphStyle } + +constructor TSkParagraphStyle.Create; begin - TSkiaAPI.sk4d_paragraphstyle_destroy(AHandle); + inherited Create(sk4d_paragraphstyle_create()); end; procedure TSkParagraphStyle.DisableHinting; begin - TSkiaAPI.sk4d_paragraphstyle_disable_hinting(GetHandle); + sk4d_paragraphstyle_disable_hinting(Handle); end; function TSkParagraphStyle.GetEllipsis: string; var LResult: ISkString; begin - LResult := TSkString.Wrap(TSkiaAPI.sk4d_paragraphstyle_get_ellipsis(GetHandle)); + LResult := TSkString.Wrap(sk4d_paragraphstyle_get_ellipsis(Handle)); Result := LResult.Text; end; function TSkParagraphStyle.GetHeight: Single; begin - Result := TSkiaAPI.sk4d_paragraphstyle_get_height(GetHandle); + Result := sk4d_paragraphstyle_get_height(Handle); end; function TSkParagraphStyle.GetMaxLines: NativeUInt; begin - Result := TSkiaAPI.sk4d_paragraphstyle_get_max_lines(GetHandle); + Result := sk4d_paragraphstyle_get_max_lines(Handle); end; function TSkParagraphStyle.GetStrutStyle: ISkStrutStyle; begin - Result := TSkStrutStyle.Wrap(TSkiaAPI.sk4d_paragraphstyle_get_strut_style(GetHandle), False); + Result := TSkStrutStyle.Wrap(sk4d_paragraphstyle_get_strut_style(Handle), False); end; function TSkParagraphStyle.GetTextAlign: TSkTextAlign; begin - Result := TSkTextAlign(TSkiaAPI.sk4d_paragraphstyle_get_text_align(GetHandle)); + Result := TSkTextAlign(sk4d_paragraphstyle_get_text_align(Handle)); end; function TSkParagraphStyle.GetTextDirection: TSkTextDirection; begin - Result := TSkTextDirection(TSkiaAPI.sk4d_paragraphstyle_get_text_direction(GetHandle)); + Result := TSkTextDirection(sk4d_paragraphstyle_get_text_direction(Handle)); end; function TSkParagraphStyle.GetTextHeightBehaviors: TSkTextHeightBehaviors; begin - Result := TSkTextHeightBehaviors(Byte(TSkiaAPI.sk4d_paragraphstyle_get_text_height_behaviors(GetHandle))); + Result := TSkTextHeightBehaviors(Byte(sk4d_paragraphstyle_get_text_height_behaviors(Handle))); end; function TSkParagraphStyle.GetTextStyle: ISkTextStyle; begin - Result := TSkTextStyle.Wrap(TSkiaAPI.sk4d_paragraphstyle_get_text_style(GetHandle), False); + Result := TSkTextStyle.Wrap(sk4d_paragraphstyle_get_text_style(Handle), False); end; procedure TSkParagraphStyle.SetEllipsis(const AValue: string); +var + LMarshaller: TMarshaller; begin if AValue.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AValue']); - TSkiaAPI.sk4d_paragraphstyle_set_ellipsis(GetHandle, MarshaledAString(UTF8String(AValue))); + sk4d_paragraphstyle_set_ellipsis(Handle, LMarshaller.AsUtf8(AValue).ToPointer); end; procedure TSkParagraphStyle.SetHeight(const AValue: Single); begin - TSkiaAPI.sk4d_paragraphstyle_set_height(GetHandle, AValue); + sk4d_paragraphstyle_set_height(Handle, AValue); end; procedure TSkParagraphStyle.SetMaxLines(const AValue: NativeUInt); begin - TSkiaAPI.sk4d_paragraphstyle_set_max_lines(GetHandle, AValue); + sk4d_paragraphstyle_set_max_lines(Handle, AValue); end; procedure TSkParagraphStyle.SetStrutStyle(AValue: ISkStrutStyle); begin - TSkiaAPI.sk4d_paragraphstyle_set_strut_style(GetHandle, TSkBindings.SafeGetHandle(AValue)); + sk4d_paragraphstyle_set_strut_style(Handle, TSkBindings.SafeHandle(AValue)); end; procedure TSkParagraphStyle.SetTextAlign(const AValue: TSkTextAlign); begin - TSkiaAPI.sk4d_paragraphstyle_set_text_align(GetHandle, sk_textalign_t(AValue)); + sk4d_paragraphstyle_set_text_align(Handle, sk_textalign_t(AValue)); end; procedure TSkParagraphStyle.SetTextDirection(const AValue: TSkTextDirection); begin - TSkiaAPI.sk4d_paragraphstyle_set_text_direction(GetHandle, sk_textdirection_t(AValue)); + sk4d_paragraphstyle_set_text_direction(Handle, sk_textdirection_t(AValue)); end; procedure TSkParagraphStyle.SetTextHeightBehaviors( const AValue: TSkTextHeightBehaviors); begin - TSkiaAPI.sk4d_paragraphstyle_set_text_height_behaviors(GetHandle, Byte(AValue)); + sk4d_paragraphstyle_set_text_height_behaviors(Handle, Byte(AValue)); end; procedure TSkParagraphStyle.SetTextStyle(AValue: ISkTextStyle); begin - TSkiaAPI.sk4d_paragraphstyle_set_text_style(GetHandle, TSkBindings.SafeGetHandle(AValue)); -end; - -{ TSkTextShadow } - -constructor TSkTextShadow.Create(const AColor: TAlphaColor; - const AOffset: TPointF; const ABlurRadius: Double); -begin - Color := AColor; - Offset := AOffset; - BlurRadius := ABlurRadius; -end; - -class operator TSkTextShadow.Equal(const ATextShadow1, - ATextShadow2: TSkTextShadow): Boolean; -begin - Result := (ATextShadow1.Color = ATextShadow2.Color ) and - (ATextShadow1.Offset = ATextShadow2.Offset) and - (SameValue(ATextShadow1.BlurRadius, ATextShadow2.BlurRadius, Epsilon)); + sk4d_paragraphstyle_set_text_style(Handle, TSkBindings.SafeHandle(AValue)); end; -class operator TSkTextShadow.NotEqual(const ATextShadow1, - ATextShadow2: TSkTextShadow): Boolean; +class procedure TSkParagraphStyle.__DestroyHandle(const AHandle: THandle); begin - Result := not (ATextShadow1 = ATextShadow2); + sk4d_paragraphstyle_destroy(AHandle); end; { TSkTextStyle } procedure TSkTextStyle.AddFontFeature(const AFeature: string; const AValue: Integer); +var + LMarshaller: TMarshaller; begin if AFeature.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AFeature']); - TSkiaAPI.sk4d_textstyle_add_font_feature(GetHandle, MarshaledAString(UTF8String(AFeature)), AValue); + sk4d_textstyle_add_font_feature(Handle, LMarshaller.AsUtf8(AFeature).ToPointer, AValue); end; procedure TSkTextStyle.AddShadow(const AShadow: TSkTextShadow); begin - TSkiaAPI.sk4d_textstyle_add_shadow(GetHandle, @sk_textshadow_t(AShadow)); + sk4d_textstyle_add_shadow(Handle, @sk_textshadow_t(AShadow)); end; procedure TSkTextStyle.ClearBackgroundColor; begin - TSkiaAPI.sk4d_textstyle_clear_background_color(GetHandle); + sk4d_textstyle_clear_background_color(Handle); end; procedure TSkTextStyle.ClearForegroundColor; begin - TSkiaAPI.sk4d_textstyle_clear_foreground_color(GetHandle); + sk4d_textstyle_clear_foreground_color(Handle); end; -constructor TSkTextStyle.Create; -begin - inherited Create(TSkiaAPI.sk4d_textstyle_create()); -end; -class procedure TSkTextStyle.DestroyHandle(const AHandle: THandle); +constructor TSkTextStyle.Create; begin - TSkiaAPI.sk4d_textstyle_destroy(AHandle); + inherited Create(sk4d_textstyle_create()); end; function TSkTextStyle.GetBackground: ISkPaint; begin - Result := TSkPaint.Wrap(TSkiaAPI.sk4d_textstyle_get_background(GetHandle)); + Result := TSkPaint.Wrap(sk4d_textstyle_get_background(Handle)); end; function TSkTextStyle.GetColor: TAlphaColor; begin - Result := TSkiaAPI.sk4d_textstyle_get_color(GetHandle); + Result := sk4d_textstyle_get_color(Handle); end; function TSkTextStyle.GetDecorationColor: TAlphaColor; begin - Result := TSkiaAPI.sk4d_textstyle_get_decoration_color(GetHandle); + Result := sk4d_textstyle_get_decoration_color(Handle); end; function TSkTextStyle.GetDecorations: TSkTextDecorations; begin - Result := TSkTextDecorations(Byte(TSkiaAPI.sk4d_textstyle_get_decorations(GetHandle))); + Result := TSkTextDecorations(Byte(sk4d_textstyle_get_decorations(Handle))); end; function TSkTextStyle.GetDecorationStyle: TSkTextDecorationStyle; begin - Result := TSkTextDecorationStyle(TSkiaAPI.sk4d_textstyle_get_decoration_style(GetHandle)); + Result := TSkTextDecorationStyle(sk4d_textstyle_get_decoration_style(Handle)); end; function TSkTextStyle.GetDecorationThickness: Single; begin - Result := TSkiaAPI.sk4d_textstyle_get_decoration_thickness(GetHandle); + Result := sk4d_textstyle_get_decoration_thickness(Handle); end; function TSkTextStyle.GetFontFamilies: TArray; begin - Result := TSkBindings.GetStrings(GetHandle, + Result := TSkBindings.GetStrings(Handle, function (const AHandle: THandle; const AStrings: PMarshaledAString): Integer begin - Result := TSkiaAPI.sk4d_textstyle_get_font_families(AHandle, AStrings); + Result := sk4d_textstyle_get_font_families(AHandle, AStrings); end); end; @@ -11735,160 +12111,167 @@ function TSkTextStyle.GetFontMetrics: TSkFontMetrics; var LResult: sk_fontmetrics_t; begin - TSkiaAPI.sk4d_textstyle_get_font_metrics(GetHandle, LResult); - Result := TSkMapping.ToFontMetrics(LResult); + sk4d_textstyle_get_font_metrics(Handle, LResult); + Result := TSkBindings.ToFontMetrics(LResult); end; function TSkTextStyle.GetFontSize: Single; begin - Result := TSkiaAPI.sk4d_textstyle_get_font_size(GetHandle); + Result := sk4d_textstyle_get_font_size(Handle); end; function TSkTextStyle.GetFontStyle: TSkFontStyle; begin - TSkiaAPI.sk4d_textstyle_get_font_style(GetHandle, sk_fontstyle_t(Result)); + sk4d_textstyle_get_font_style(Handle, sk_fontstyle_t(Result)); end; function TSkTextStyle.GetForeground: ISkPaint; begin - Result := TSkPaint.Wrap(TSkiaAPI.sk4d_textstyle_get_foreground(GetHandle)); + Result := TSkPaint.Wrap(sk4d_textstyle_get_foreground(Handle)); end; function TSkTextStyle.GetHalfLeading: Boolean; begin - Result := TSkiaAPI.sk4d_textstyle_get_half_leading(GetHandle); + Result := sk4d_textstyle_get_half_leading(Handle); end; function TSkTextStyle.GetHeightMultiplier: Single; begin - Result := TSkiaAPI.sk4d_textstyle_get_height_multiplier(GetHandle); + Result := sk4d_textstyle_get_height_multiplier(Handle); end; function TSkTextStyle.GetLetterSpacing: Single; begin - Result := TSkiaAPI.sk4d_textstyle_get_letter_spacing(GetHandle); + Result := sk4d_textstyle_get_letter_spacing(Handle); end; function TSkTextStyle.GetLocale: string; var LResult: ISkString; begin - LResult := TSkString.Wrap(TSkiaAPI.sk4d_textstyle_get_locale(GetHandle)); + LResult := TSkString.Wrap(sk4d_textstyle_get_locale(Handle)); Result := LResult.Text; end; function TSkTextStyle.GetWordSpacing: Single; begin - Result := TSkiaAPI.sk4d_textstyle_get_word_spacing(GetHandle); + Result := sk4d_textstyle_get_word_spacing(Handle); end; function TSkTextStyle.IsEqual(const ATextStyle: ISkTextStyle): Boolean; begin if not Assigned(ATextStyle) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATextStyle']); - Result := TSkiaAPI.sk4d_textstyle_is_equal(GetHandle, ATextStyle.Handle); + Result := sk4d_textstyle_is_equal(Handle, ATextStyle.Handle); end; procedure TSkTextStyle.ResetFontFeatures; begin - TSkiaAPI.sk4d_textstyle_reset_font_features(GetHandle); + sk4d_textstyle_reset_font_features(Handle); end; procedure TSkTextStyle.ResetShadows; begin - TSkiaAPI.sk4d_textstyle_reset_shadows(GetHandle); + sk4d_textstyle_reset_shadows(Handle); end; procedure TSkTextStyle.SetBackgroundColor(const APaint: ISkPaint); begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_textstyle_set_background_color(GetHandle, APaint.Handle); + sk4d_textstyle_set_background_color(Handle, APaint.Handle); end; procedure TSkTextStyle.SetColor(const AValue: TAlphaColor); begin - TSkiaAPI.sk4d_textstyle_set_color(GetHandle, AValue); + sk4d_textstyle_set_color(Handle, AValue); end; procedure TSkTextStyle.SetDecorationColor(const AValue: TAlphaColor); begin - TSkiaAPI.sk4d_textstyle_set_decoration_color(GetHandle, AValue); + sk4d_textstyle_set_decoration_color(Handle, AValue); end; procedure TSkTextStyle.SetDecorations(const AValue: TSkTextDecorations); begin - TSkiaAPI.sk4d_textstyle_set_decorations(GetHandle, Byte(AValue)); + sk4d_textstyle_set_decorations(Handle, Byte(AValue)); end; procedure TSkTextStyle.SetDecorationStyle(const AValue: TSkTextDecorationStyle); begin - TSkiaAPI.sk4d_textstyle_set_decoration_style(GetHandle, sk_textdecorationstyle_t(AValue)); + sk4d_textstyle_set_decoration_style(Handle, sk_textdecorationstyle_t(AValue)); end; procedure TSkTextStyle.SetDecorationThickness(const AValue: Single); begin - TSkiaAPI.sk4d_textstyle_set_decoration_thickness(GetHandle, AValue); + sk4d_textstyle_set_decoration_thickness(Handle, AValue); end; procedure TSkTextStyle.SetFontFamilies(const AValue: TArray); begin - TSkBindings.SetStrings(GetHandle, AValue, - procedure (const AHandle: THandle; const AStrings: PMarshaledAString; const ALength: Integer) + TSkBindings.SetStrings(Handle, AValue, + procedure (const AHandle: THandle; const AStrings: PMarshaledAString) begin - TSkiaAPI.sk4d_textstyle_set_font_families(AHandle, AStrings, ALength); + sk4d_textstyle_set_font_families(AHandle, AStrings, Length(AValue)); end); end; procedure TSkTextStyle.SetFontSize(const AValue: Single); begin - TSkiaAPI.sk4d_textstyle_set_font_size(GetHandle, AValue); + sk4d_textstyle_set_font_size(Handle, AValue); end; procedure TSkTextStyle.SetFontStyle(const AValue: TSkFontStyle); begin - TSkiaAPI.sk4d_textstyle_set_font_style(GetHandle, @sk_fontstyle_t(AValue)); + sk4d_textstyle_set_font_style(Handle, @sk_fontstyle_t(AValue)); end; procedure TSkTextStyle.SetForegroundColor(const APaint: ISkPaint); begin if not Assigned(APaint) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['APaint']); - TSkiaAPI.sk4d_textstyle_set_foreground_color(GetHandle, APaint.Handle); + sk4d_textstyle_set_foreground_color(Handle, APaint.Handle); end; procedure TSkTextStyle.SetHalfLeading(const AValue: Boolean); begin - TSkiaAPI.sk4d_textstyle_set_half_leading(GetHandle, AValue); + sk4d_textstyle_set_half_leading(Handle, AValue); end; procedure TSkTextStyle.SetHeightMultiplier(const AValue: Single); begin - TSkiaAPI.sk4d_textstyle_set_height_multiplier(GetHandle, AValue); + sk4d_textstyle_set_height_multiplier(Handle, AValue); end; procedure TSkTextStyle.SetLetterSpacing(const AValue: Single); begin - TSkiaAPI.sk4d_textstyle_set_letter_spacing(GetHandle, AValue); + sk4d_textstyle_set_letter_spacing(Handle, AValue); end; procedure TSkTextStyle.SetLocale(const AValue: string); +var + LMarshaller: TMarshaller; begin if AValue.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AValue']); - TSkiaAPI.sk4d_textstyle_set_locale(GetHandle, MarshaledAString(UTF8String(AValue))); + sk4d_textstyle_set_locale(Handle, LMarshaller.AsUtf8(AValue).ToPointer); end; procedure TSkTextStyle.SetWordSpacing(const AValue: Single); begin - TSkiaAPI.sk4d_textstyle_set_word_spacing(GetHandle, AValue); + sk4d_textstyle_set_word_spacing(Handle, AValue); +end; + +class procedure TSkTextStyle.__DestroyHandle(const AHandle: THandle); +begin + sk4d_textstyle_destroy(AHandle); end; { TSkTypefaceFontProvider } constructor TSkTypefaceFontProvider.Create; begin - inherited Create(TSkiaAPI.sk4d_typefacefontprovider_create()); + inherited Create(sk4d_typefacefontprovider_create()); end; procedure TSkTypefaceFontProvider.RegisterTypeface( @@ -11896,17 +12279,19 @@ procedure TSkTypefaceFontProvider.RegisterTypeface( begin if not Assigned(ATypeface) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATypeface']); - TSkiaAPI.sk4d_typefacefontprovider_register_typeface(GetHandle, ATypeface.Handle); + sk4d_typefacefontprovider_register_typeface(Handle, ATypeface.Handle); end; procedure TSkTypefaceFontProvider.RegisterTypeface(const ATypeface: ISkTypeface; const AFamilyName: string); +var + LMarshaller: TMarshaller; begin if not Assigned(ATypeface) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['ATypeface']); if AFamilyName.IsEmpty then raise ESkArgumentException.CreateFmt(SParamIsEmpty, ['AFamilyName']); - TSkiaAPI.sk4d_typefacefontprovider_register_typeface2(GetHandle, ATypeface.Handle, MarshaledAString(UTF8String(AFamilyName))); + sk4d_typefacefontprovider_register_typeface2(Handle, ATypeface.Handle, LMarshaller.AsUtf8(AFamilyName).ToPointer); end; { TSkResourceProviderBaseClass } @@ -11916,24 +12301,18 @@ procedure TSkTypefaceFontProvider.RegisterTypeface(const ATypeface: ISkTypeface; LProcs: sk_resourceproviderbaseclass_procs_t; begin LProcs.load := load_proc; - TSkiaAPI.sk4d_resourceproviderbaseclass_set_procs(@LProcs); + sk4d_resourceproviderbaseclass_set_procs(@LProcs); end; constructor TSkResourceProviderBaseClass.Create(const APredecode: Boolean); begin - inherited Create(TSkiaAPI.sk4d_resourceproviderbaseclass_create(APredecode, Self)); + inherited Create(sk4d_resourceproviderbaseclass_create(APredecode, Self)); end; class function TSkResourceProviderBaseClass.load_proc(context: Pointer; const path, name: MarshaledAString): sk_data_t; -var - LResult: TBytes; begin - LResult := TSkResourceProviderBaseClass(context).Load(string(path), string(name)); - if Length(LResult) = 0 then - Result := TSkiaAPI.sk4d_data_make_empty() - else - Result := TSkiaAPI.sk4d_data_make_with_copy(@LResult[0], Length(LResult)); + Result := TSkObject.__ReleaseHandle(TSkData.MakeFromBytes(TSkResourceProviderBaseClass(context).Load(string(path), string(name)))); end; { TSkFileResourceProvider } @@ -11965,39 +12344,188 @@ function TSkFileResourceProvider.Load(const APath, AName: string): TBytes; constructor TSkShaper.Create; begin - inherited Create(TSkiaAPI.sk4d_shaper_create()); -end; - -class procedure TSkShaper.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_shaper_destroy(AHandle); + inherited Create(sk4d_shaper_create()); end; function TSkShaper.Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single): ISkTextBlob; var - LText: UTF8String; + LMarshaller: TMarshaller; begin if not Assigned(AFont) then raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); - LText := UTF8String(AText); - if Length(LText) = 0 then - Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shaper_shape(GetHandle, @LText[Low(LText)], Length(LText), AFont.Handle, ALeftToRight, AWidth, nil, nil)); + Result := TSkBindings.SafeCreate(sk4d_shaper_shape(Handle, LMarshaller.AsUtf8(AText).ToPointer, AFont.Handle, ALeftToRight, AWidth, nil, nil)); end; function TSkShaper.Shape(const AText: string; const AFont: ISkFont; const ALeftToRight: Boolean; const AWidth: Single; const AOffset: TPointF; out AEndPoint: TPointF): ISkTextBlob; var - LText: UTF8String; + LMarshaller: TMarshaller; +begin + if not Assigned(AFont) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); + Result := TSkBindings.SafeCreate(sk4d_shaper_shape(Handle, LMarshaller.AsUtf8(AText).ToPointer, AFont.Handle, ALeftToRight, AWidth, @sk_point_t(AOffset), @sk_point_t(AEndPoint))); +end; + +class procedure TSkShaper.__DestroyHandle(const AHandle: THandle); +begin + sk4d_shaper_destroy(AHandle); +end; + +{ TSkSVGCanvas } + +class function TSkSVGCanvas.Make(const ABounds: TRectF; const AStream: TStream; + const AFlags: TSkSVGCanvasFlags): ISkCanvas; +var + LCanvas: TSkSVGCanvas; + LHandle: THandle; + LWStream: ISkWStream; +begin + LWStream := TSkWStreamAdapter.Create(AStream); + LHandle := sk4d_svgcanvas_make(@sk_rect_t(ABounds), LWStream.Handle, Byte(AFlags)); + if LHandle = 0 then + Exit(nil); + LCanvas := TSkSVGCanvas.Wrap(LHandle); + LCanvas.FHolder := LWStream; + Result := LCanvas; +end; + +{ TSkSVGDOM } + +function TSkSVGDOM.FindNodeById(const AId: string): ISkSVGNode; +var + LMarshaller: TMarshaller; +begin + Result := TSkBindings.SafeCreate(sk4d_svgdom_find_node_by_id(Handle, LMarshaller.AsUtf8(AId).ToPointer), False); +end; + +function TSkSVGDOM.GetRoot: ISkSVGSVG; +begin + if not Assigned(FRoot) then + FRoot := TSkBindings.SafeCreate(sk4d_svgdom_get_root(Handle), False); + Result := FRoot; +end; + +class function TSkSVGDOM.Make(const AData: string; + const AResourceProvider: ISkResourceProvider): ISkSVGDOM; +var + LStream: TStream; +begin + LStream := TStringStream.Create(AData, TEncoding.UTF8); + try + Result := MakeFromStream(LStream, AResourceProvider); + finally + LStream.Free; + end; +end; + +class function TSkSVGDOM.MakeFromFile(const AFileName: string): ISkSVGDOM; +var + LMarshaller: TMarshaller; +begin + if AFileName.IsEmpty then + raise ESkException.Create(SFileNameIsEmpty); + Result := TSkBindings.SafeCreate(sk4d_svgdom_make_from_file(LMarshaller.AsUtf8(AFileName).ToPointer)); +end; + +class function TSkSVGDOM.MakeFromStream(const AStream: TStream; + const AResourceProvider: ISkResourceProvider): ISkSVGDOM; +var + LStream: ISkStream; +begin + LStream := TSkStreamAdapter.Create(AStream); + Result := TSkBindings.SafeCreate(sk4d_svgdom_make_from_stream(LStream.Handle, TSkBindings.SafeHandle(AResourceProvider))); +end; + +procedure TSkSVGDOM.Render(const ACanvas: ISkCanvas); +begin + if not Assigned(ACanvas) then + raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); + sk4d_svgdom_render(Handle, ACanvas.Handle); +end; + +procedure TSkSVGDOM.SetContainerSize(const ASize: TSizeF); +begin + sk4d_svgdom_set_container_size(Handle, @sk_size_t(ASize)); +end; + +{ TSkSVGNode } + +function TSkSVGNode.TrySetAttribute(const AName, AValue: string): Boolean; +var + LMarshaller: TMarshaller; +begin + Result := sk4d_svgnode_set_attribute(Handle, LMarshaller.AsUtf8(AName).ToPointer, LMarshaller.AsUtf8(AValue).ToPointer); +end; + +{ TSkSVGSVG } + +function TSkSVGSVG.GetHeight: TSkSVGLength; +begin + sk4d_svgsvg_get_height(Handle, sk_svglength_t(Result)); +end; + +function TSkSVGSVG.GetIntrinsicSize(const AViewPort: TSizeF; + const ADPI: Single): TSizeF; +begin + sk4d_svgsvg_get_intrinsic_size(Handle, @sk_size_t(AViewPort), ADPI, sk_size_t(Result)); +end; + +function TSkSVGSVG.GetPreserveAspectRatio: TSkSVGPreserveAspectRatio; +begin + sk4d_svgsvg_get_preserve_aspect_ratio(Handle, sk_svgpreserveaspectratio_t(Result)); +end; + +function TSkSVGSVG.GetWidth: TSkSVGLength; +begin + sk4d_svgsvg_get_width(Handle, sk_svglength_t(Result)); +end; + +function TSkSVGSVG.GetX: TSkSVGLength; +begin + sk4d_svgsvg_get_x(Handle, sk_svglength_t(Result)); +end; + +function TSkSVGSVG.GetY: TSkSVGLength; +begin + sk4d_svgsvg_get_y(Handle, sk_svglength_t(Result)); +end; + +procedure TSkSVGSVG.SetHeight(const AValue: TSkSVGLength); +begin + sk4d_svgsvg_set_height(Handle, @sk_svglength_t(AValue)); +end; + +procedure TSkSVGSVG.SetPreserveAspectRatio( + const AValue: TSkSVGPreserveAspectRatio); +begin + sk4d_svgsvg_set_preserve_aspect_ratio(Handle, @sk_svgpreserveaspectratio_t(AValue)); +end; + +procedure TSkSVGSVG.SetViewBox(const AViewBox: TRectF); +begin + sk4d_svgsvg_set_view_box(Handle, @sk_rect_t(AViewBox)); +end; + +procedure TSkSVGSVG.SetWidth(const AValue: TSkSVGLength); +begin + sk4d_svgsvg_set_width(Handle, @sk_svglength_t(AValue)); +end; + +procedure TSkSVGSVG.SetX(const AValue: TSkSVGLength); +begin + sk4d_svgsvg_set_x(Handle, @sk_svglength_t(AValue)); +end; + +procedure TSkSVGSVG.SetY(const AValue: TSkSVGLength); begin - if not Assigned(AFont) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['AFont']); - LText := UTF8String(AText); - if Length(LText) = 0 then - Exit(nil); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_shaper_shape(GetHandle, @LText[Low(LText)], Length(LText), AFont.Handle, ALeftToRight, AWidth, @sk_point_t(AOffset), @sk_point_t(AEndPoint))); + sk4d_svgsvg_set_y(Handle, @sk_svglength_t(AValue)); +end; + +function TSkSVGSVG.TryGetViewBox(out AViewBox: TRectF): Boolean; +begin + Result := sk4d_svgsvg_get_view_box(Handle, sk_rect_t(AViewBox)); end; { TSkUnicode } @@ -12022,33 +12550,40 @@ class procedure TSkUnicode.codepoint_proc(unichar: sk_unichar_t; start, constructor TSkUnicode.Create; begin - inherited Create(TSkiaAPI.sk4d_unicode_create()); -end; - -class procedure TSkUnicode.DestroyHandle(const AHandle: THandle); -begin - TSkiaAPI.sk4d_unicode_destroy(AHandle); + inherited Create(sk4d_unicode_create()); end; procedure TSkUnicode.ForEachBidiRegion(const AText: string; const ADirection: TSkDirection; const AProc: TSkUnicodeBidiRegionProc); begin if (not AText.IsEmpty) and (Assigned(AProc)) then - TSkiaAPI.sk4d_unicode_for_each_bidi_region(GetHandle, @AText[Low(AText)], Length(AText), sk_direction_t(ADirection), bidi_region_proc, @AProc); + sk4d_unicode_for_each_bidi_region(Handle, @AText[Low(AText)], Length(AText), sk_direction_t(ADirection), bidi_region_proc, @AProc); end; procedure TSkUnicode.ForEachBreak(const AText: string; const AType: TSkBreakType; const AProc: TSkUnicodeBreakProc); begin if (not AText.IsEmpty) and (Assigned(AProc)) then - TSkiaAPI.sk4d_unicode_for_each_break(GetHandle, @AText[Low(AText)], Length(AText), sk_breaktype_t(AType), break_proc, @AProc); + sk4d_unicode_for_each_break(Handle, @AText[Low(AText)], Length(AText), sk_breaktype_t(AType), break_proc, @AProc); end; procedure TSkUnicode.ForEachCodepoint(const AText: string; const AProc: TSkUnicodeCodepointProc); begin if (not AText.IsEmpty) and (Assigned(AProc)) then - TSkiaAPI.sk4d_unicode_for_each_codepoint(GetHandle, @AText[Low(AText)], Length(AText), codepoint_proc, @AProc); + sk4d_unicode_for_each_codepoint(Handle, @AText[Low(AText)], Length(AText), codepoint_proc, @AProc); +end; + +function TSkUnicode.GetBreakIterator(const AType: TSkBreakType; + const AText: string): ISkUnicodeBreakIterator; +begin + Result := TUnicodeBreakIterator.Create(Self, AType, AText); +end; + +function TSkUnicode.GetBreakIteratorUTF8(const AType: TSkBreakType; + const AText: UTF8String): ISkUnicodeBreakIterator; +begin + Result := TUnicodeBreakIterator.Create(Self, AType, AText); end; function TSkUnicode.GetBreaks(const AText: string; @@ -12058,7 +12593,7 @@ function TSkUnicode.GetBreaks(const AText: string; LResult: TList; LStartIndex: Integer; begin - LStartIndex := 0; + LStartIndex := 0; LPStartIndex := @LStartIndex; LResult := TList.Create; try @@ -12076,221 +12611,884 @@ function TSkUnicode.GetBreaks(const AText: string; end; end; -{ TSkSVGDOM } - -function TSkSVGDOM.FindNodeById(const AId: string): ISkSVGNode; +class procedure TSkUnicode.__DestroyHandle(const AHandle: THandle); begin - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_svgdom_find_node_by_id(GetHandle, MarshaledAString(UTF8String(AId))), False); + sk4d_unicode_destroy(AHandle); end; -function TSkSVGDOM.GetRoot: ISkSVGSVG; +function ExtensionToEncodedImageFormat(const AExtension: string): TSkEncodedImageFormat; begin - if not Assigned(FRootHolder) then - FRootHolder := TSkBindings.SafeCreate(TSkiaAPI.sk4d_svgdom_get_root(GetHandle), False); - Result := FRootHolder; + if (string.Compare('.jpg', AExtension, [TCompareOption.coIgnoreCase]) = 0) or (string.Compare('.jpeg', AExtension, [TCompareOption.coIgnoreCase]) = 0) then + Result := TSkEncodedImageFormat.JPEG + else if string.Compare('.webp', AExtension, [TCompareOption.coIgnoreCase]) = 0 then + Result := TSkEncodedImageFormat.WEBP + else if string.Compare('.png', AExtension, [TCompareOption.coIgnoreCase]) = 0 then + Result := TSkEncodedImageFormat.PNG + else + raise ESkArgumentException.Create('Invalid extension'); end; -class function TSkSVGDOM.Make(const AData: string; - const AResourceProvider: ISkResourceProvider): ISkSVGDOM; +{ TSkUnicode.TUnicodeBreakIterator } + +constructor TSkUnicode.TUnicodeBreakIterator.Create(const AUnicode: ISkUnicode; + const AType: TSkBreakType; const AText: string); var - LStream: TStream; + LText: pchar16_t; begin - LStream := TStringStream.Create(AData, TEncoding.UTF8); - try - Result := MakeFromStream(LStream, AResourceProvider); - finally - LStream.Free; - end; + if Length(AText) = 0 then + LText := nil + else + LText := @AText[Low(AText)]; + inherited Create(sk4d_unicodebreakiterator_create2(AUnicode.Handle, sk_breaktype_t(AType), LText, Length(AText))); end; -class function TSkSVGDOM.MakeFromFile(const AFileName: string): ISkSVGDOM; +constructor TSkUnicode.TUnicodeBreakIterator.Create(const AUnicode: ISkUnicode; + const AType: TSkBreakType; const AText: UTF8String); +var + LText: _pchar; begin - if AFileName.IsEmpty then - raise ESkException.Create(SFileNameIsEmpty); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_svgdom_make_from_file(MarshaledAString(UTF8String(AFileName)))); + if Length(AText) = 0 then + LText := nil + else + LText := @AText[Low(AText)]; + inherited Create(sk4d_unicodebreakiterator_create(AUnicode.Handle, sk_breaktype_t(AType), LText, Length(AText))); end; -class function TSkSVGDOM.MakeFromStream(const AStream: TStream; - const AResourceProvider: ISkResourceProvider): ISkSVGDOM; -var - LStream: ISkStream; +function TSkUnicode.TUnicodeBreakIterator.GetCurrent: TSkUnicodeBreakIteratorElem; begin - LStream := TSkStreamAdapter.Create(AStream); - Result := TSkBindings.SafeCreate(TSkiaAPI.sk4d_svgdom_make_from_stream(LStream.Handle, TSkBindings.SafeGetHandle(AResourceProvider))); + Result := FCurrent; end; -procedure TSkSVGDOM.Render(const ACanvas: ISkCanvas); +function TSkUnicode.TUnicodeBreakIterator.MoveNext: Boolean; begin - if not Assigned(ACanvas) then - raise ESkArgumentException.CreateFmt(SParamIsNil, ['ACanvas']); - TSkiaAPI.sk4d_svgdom_render(GetHandle, ACanvas.Handle); + Result := sk4d_unicodebreakiterator_next(Handle, sk_unicodebreakiteratorelem_t(FCurrent)); end; -procedure TSkSVGDOM.SetContainerSize(const ASize: TSizeF); +class procedure TSkUnicode.TUnicodeBreakIterator.__DestroyHandle( + const AHandle: THandle); begin - TSkiaAPI.sk4d_svgdom_set_container_size(GetHandle, @sk_size_t(ASize)); + sk4d_unicodebreakiterator_destroy(AHandle); end; -{ TSkSVGNode } +{ TSkBindings } -function TSkSVGNode.TrySetAttribute(const AName, AValue: string): Boolean; +class function TSkBindings.AsDateTime(const AValue: TDateTime): sk_datetime_t; +var + LDay: Word; + LHour: Word; + LMilliSecond: Word; + LMinute: Word; + LMonth: Word; + LSecond: Word; + LYear: Word; begin - Result := TSkiaAPI.sk4d_svgnode_set_attribute(GetHandle, MarshaledAString(UTF8String(AName)), MarshaledAString(UTF8String(AValue))); + DecodeDateTime(AValue, LYear, LMonth, LDay, LHour, LMinute, LSecond, LMilliSecond); + Result.time_zone_minutes := Round(TTimeZone.Local.UtcOffset.TotalMinutes); + Result.year := LYear; + Result.month := LMonth; + Result.day_of_week := DayOfWeek(AValue) - 1; + Result.day := LDay; + Result.hour := LHour; + Result.minute := LMinute; + Result.second := LSecond; end; -{ TSkSVGLength } +class function TSkBindings.AsGrContextOptions( + const AValue: TGrContextOptions): gr_contextoptions_t; +begin + Result.buffer_map_threshold := AValue.BufferMapThreshold; + Result.do_manual_mipmapping := AValue.DoManualMipmapping; + Result.allow_path_mask_caching := AValue.AllowPathMaskCaching; + Result.glyph_cache_texture_maximum_bytes := AValue.GlyphCacheTextureMaximumBytes; + Result.avoid_stencil_buffers := AValue.AvoidStencilBuffers; + Result.runtime_program_cache_size := AValue.RuntimeProgramCacheSize; + Result.persistent_cache := TSkBindings.SafeHandle(AValue.PersistentCache); + Result.shader_cache_strategy := gr_shadercachestrategy_t(AValue.ShaderCacheStrategy); + Result.shader_error_handler := TSkBindings.SafeHandle(AValue.ShaderErrorHandler); +end; + +class function TSkBindings.AsGrVkAlloc(const AValue: TGrVkAlloc): gr_vk_alloc_t; +begin + Result.device_memory := AValue.DeviceMemory; + Result.offset := AValue.Offset; + Result.size := AValue.Size; + Result.flags := Byte(AValue.Flags); + Result.memory := AValue.Memory; +end; + +class function TSkBindings.AsGrVkBackendContext( + const AValue: TGrVkBackendContext): gr_vk_backendcontext_t; +begin + Result.instance := AValue.Instance; + Result.physical_device := AValue.PhysicalDevice; + Result.device := AValue.Device; + Result.queue := AValue.Queue; + Result.graphics_queue_index := AValue.GraphicsQueueIndex; + Result.max_version := AValue.MaxVersion; + Result.extensions := TSkBindings.SafeHandle(AValue.Extensions); + Result.physical_device_features := THandle(AValue.PhysicalDeviceFeatures); + Result.physical_device_features2 := THandle(AValue.PhysicalDeviceFeatures2); + Result.get_proc := __gr_vk_get_proc; + Result.protected_context := AValue.ProtectedContext; + if Assigned(AValue.GetProc) then + Result.get_context := @AValue.GetProc + else + Result.get_context := nil; +end; -constructor TSkSVGLength.Create(const AValue: Single; - const AUnit: TSkSVGLengthUnit); +class function TSkBindings.AsGrVkImageInfo( + const AValue: TGrVkImageInfo): gr_vk_imageinfo_t; begin - Value := AValue; - &Unit := AUnit; + Result.image := AValue.Image; + Result.alloc := AsGrVkAlloc(AValue.Alloc); + Result.image_tiling := AValue.ImageTiling; + Result.image_layout := AValue.ImageLayout; + Result.format := AValue.Format; + Result.image_usage_flags := AValue.ImageUsageFlags; + Result.sample_count := AValue.SampleCount; + Result.level_count := AValue.LevelCount; + Result.current_queue_family := AValue.CurrentQueueFamily; + Result.protected_image := AValue.ProtectedImage; + Result.ycbcr_conversion_info := gr_vk_ycbcrconversioninfo_t(AValue.YcbcrConversionInfo); + Result.sharing_mode := AValue.SharingMode; end; -class operator TSkSVGLength.Equal(const ASVGLength1, - ASVGLength2: TSkSVGLength): Boolean; +class function TSkBindings.AsImageInfo( + const AValue: TSkImageInfo): sk_imageinfo_t; begin - Result := (ASVGLength1.&Unit = ASVGLength2.&Unit) and - (SameValue(ASVGLength1.Value, ASVGLength2.Value, Epsilon)); + Result.width := AValue.Width; + Result.height := AValue.Height; + Result.color_type := sk_colortype_t(AValue.ColorType); + Result.alpha_type := sk_alphatype_t(AValue.AlphaType); + Result.color_space := TSkBindings.SafeHandle(AValue.ColorSpace); end; -class operator TSkSVGLength.NotEqual(const ASVGLength1, - ASVGLength2: TSkSVGLength): Boolean; +class function TSkBindings.AsLattice(const AValue: TSkLattice): sk_lattice_t; begin - Result := not (ASVGLength1 = ASVGLength2); + Result.x_divs := @AValue.FXDivs[0]; + Result.y_divs := @AValue.FYDivs[0]; + Result.x_count := Length(AValue.FXDivs); + Result.y_count := Length(AValue.FYDivs); + if Length(AValue.FRectTypes) > 0 then + begin + Result.rect_types := @AValue.FRectTypes[0]; + Result.colors := @AValue.FColors[0]; + end + else + begin + Result.rect_types := nil; + Result.colors := nil; + end; + if AValue.FUseBounds then + Result.bounds := @sk_irect_t(AValue.FBounds) + else + Result.bounds := nil; end; -{ TSkSVGPreserveAspectRatio } +class function TSkBindings.AsPDFMetadata( + const AValue: TSkPDFMetadata): sk_pdfmetadata_t; +var + LMarshaller: TMarshaller; +begin + Result.title := LMarshaller.AsUtf8(AValue.Title).ToPointer; + Result.author := LMarshaller.AsUtf8(AValue.Author).ToPointer; + Result.subject := LMarshaller.AsUtf8(AValue.Subject).ToPointer; + Result.keywords := LMarshaller.AsUtf8(AValue.Keywords).ToPointer; + Result.creator := LMarshaller.AsUtf8(AValue.Creator).ToPointer; + Result.producer := LMarshaller.AsUtf8(AValue.Producer).ToPointer; + Result.creation := TSkBindings.AsDateTime(AValue.Creation); + Result.modified := TSkBindings.AsDateTime(AValue.Modified); + Result.raster_dpi := AValue.RasterDPI; + Result.pdfa := AValue.PDFA; + Result.encoding_quality := AValue.EncodingQuality; +end; -constructor TSkSVGPreserveAspectRatio.Create(const AAlign: TSkSVGAspectAlign; - const AScale: TSkSVGAspectScale); +class function TSkBindings.AsSurfaceProperties( + const AValue: TSkSurfaceProperties): sk_surfaceprops_t; begin - Align := AAlign; - Scale := AScale; + Result.flags := Byte(AValue.Flags); + Result.pixel_geometry := sk_pixelgeometry_t(AValue.PixelGeometry); end; -class operator TSkSVGPreserveAspectRatio.Equal(const ASVGPreserveAspectRatio1, - ASVGPreserveAspectRatio2: TSkSVGPreserveAspectRatio): Boolean; +class function TSkBindings.GetStrings(const AHandle: THandle; + const AFunc: TSkGetStringsFunc): TArray; +var + I: Integer; + LMarshaledAStrings: TArray; begin - Result := (ASVGPreserveAspectRatio1.Align = ASVGPreserveAspectRatio2.Align) and - (ASVGPreserveAspectRatio1.Scale = ASVGPreserveAspectRatio2.Scale); + SetLength(LMarshaledAStrings, AFunc(AHandle, nil)); + if Length(LMarshaledAStrings) = 0 then + Result := nil + else + begin + AFunc(AHandle, @LMarshaledAStrings[0]); + SetLength(Result, Length(LMarshaledAStrings)); + for I := 0 to Length(LMarshaledAStrings) - 1 do + Result[I] := string(LMarshaledAStrings[I]); + end; end; -class operator TSkSVGPreserveAspectRatio.NotEqual( - const ASVGPreserveAspectRatio1, - ASVGPreserveAspectRatio2: TSkSVGPreserveAspectRatio): Boolean; +class function TSkBindings.SafeCreate(const AHandle: THandle; + const AOwnsHandle: Boolean): T; begin - Result := not (ASVGPreserveAspectRatio1 = ASVGPreserveAspectRatio2); + if AHandle = 0 then + Exit(nil); + Result := T.Wrap(AHandle, AOwnsHandle); end; -{ TSkSVGSVG } +class function TSkBindings.SafeHandle(const AObject: ISkObject): THandle; +begin + if not Assigned(AObject) then + Exit(0); + Result := AObject.Handle; +end; -function TSkSVGSVG.GetHeight: TSkSVGLength; +class procedure TSkBindings.SetStrings(const AHandle: THandle; const AStrings1, + AStrings2: TArray; const AProc: TSkSetTwoStringsProc); +var + I: Integer; + LMarshaller: TMarshaller; + LPStrings1: PMarshaledAString; + LPStrings2: PMarshaledAString; + LStrings1: TArray; + LStrings2: TArray; +begin + if Length(AStrings1) = 0 then + LPStrings1 := nil + else + begin + SetLength(LStrings1, Length(AStrings1)); + for I := 0 to Length(AStrings1) - 1 do + LStrings1[I] := LMarshaller.AsUtf8(AStrings1[I]).ToPointer; + LPStrings1 := @LStrings1[0]; + end; + if Length(AStrings2) = 0 then + LPStrings2 := nil + else + begin + SetLength(LStrings2, Length(AStrings2)); + for I := 0 to Length(AStrings2) - 1 do + LStrings2[I] := LMarshaller.AsUtf8(AStrings2[I]).ToPointer; + LPStrings2 := @LStrings2[0]; + end; + AProc(AHandle, LPStrings1, LPStrings2); +end; + +class procedure TSkBindings.SetStrings(const AHandle: THandle; + const AStrings: TArray; const AProc: TSkSetStringsProc); +var + I: Integer; + LMarshaller: TMarshaller; + LStrings: TArray; begin - TSkiaAPI.sk4d_svgsvg_get_height(GetHandle, sk_svglength_t(Result)); + if Length(AStrings) = 0 then + AProc(AHandle, nil) + else + begin + SetLength(LStrings, Length(AStrings)); + for I := 0 to Length(AStrings) - 1 do + LStrings[I] := LMarshaller.AsUtf8(AStrings[I]).ToPointer; + AProc(AHandle, @LStrings[0]); + end; end; -function TSkSVGSVG.GetIntrinsicSize(const AViewPort: TSizeF; - const ADPI: Single): TSizeF; +class function TSkBindings.ToFontMetrics( + const AValue: sk_fontmetrics_t): TSkFontMetrics; begin - TSkiaAPI.sk4d_svgsvg_get_intrinsic_size(GetHandle, @sk_size_t(AViewPort), ADPI, sk_size_t(Result)); + Result.Flags := TSkFontMetricsFlags(Byte(AValue.flags)); + Result.Top := AValue.top; + Result.Ascent := AValue.ascent; + Result.Descent := AValue.descent; + Result.Bottom := AValue.bottom; + Result.Leading := AValue.leading; + Result.AvgCharWidth := AValue.avg_char_width; + Result.MaxCharWidth := AValue.max_char_width; + Result.XMin := AValue.x_min; + Result.XMax := AValue.x_max; + Result.XHeight := AValue.x_height; + Result.CapHeight := AValue.cap_height; + Result.UnderlineThickness := AValue.underline_thickness; + Result.UnderlinePosition := AValue.underline_position; + Result.StrikeoutThickness := AValue.strikeout_thickness; + Result.StrikeoutPosition := AValue.strikeout_position; end; -function TSkSVGSVG.GetPreserveAspectRatio: TSkSVGPreserveAspectRatio; +class function TSkBindings.ToImageInfo( + const AValue: sk_imageinfo_t): TSkImageInfo; begin - TSkiaAPI.sk4d_svgsvg_get_preserve_aspect_ratio(GetHandle, sk_svgpreserveaspectratio_t(Result)); + Result.Width := AValue.width; + Result.Height := AValue.height; + Result.ColorType := TSkColorType(AValue.color_type); + Result.AlphaType := TSkAlphaType(AValue.alpha_type); + Result.ColorSpace := TSkBindings.SafeCreate(AValue.color_space); end; -function TSkSVGSVG.GetWidth: TSkSVGLength; +class function TSkBindings.ToParagraphVisitorInfo( + const AValue: sk_paragraphvisitorinfo_t): TSkParagraphVisitorInfo; begin - TSkiaAPI.sk4d_svgsvg_get_width(GetHandle, sk_svglength_t(Result)); + Result.Font := TSkFont.Wrap(AValue.font, False); + Result.Origin := TPointF(AValue.origin); + Result.AdvanceX := AValue.advance_x; + Result.Count := AValue.count; + Result.Glyphs := PWordArray(AValue.glyphs); + Result.Positions := PPointFArray(AValue.positions); + Result.Utf8Starts := PCardinalArray(AValue.utf8_starts); + Result.Flags := TSkParagraphVisitorFlags(Byte(AValue.flags)); end; -function TSkSVGSVG.GetX: TSkSVGLength; +class function TSkBindings.ToSurfaceProperties( + const AValue: sk_surfaceprops_t): TSkSurfaceProperties; begin - TSkiaAPI.sk4d_svgsvg_get_x(GetHandle, sk_svglength_t(Result)); + Result.Flags := TSkSurfacePropertiesFlags(Byte(AValue.flags)); + Result.PixelGeometry := TSkPixelGeometry(AValue.pixel_geometry); end; -function TSkSVGSVG.GetY: TSkSVGLength; +class function TSkBindings.__gr_gl_get_proc(context: Pointer; + const name: MarshaledAString): Pointer; begin - TSkiaAPI.sk4d_svgsvg_get_y(GetHandle, sk_svglength_t(Result)); + Result := TGrGlGetProc(context^)(string(name)); end; -procedure TSkSVGSVG.SetHeight(const AValue: TSkSVGLength); +class function TSkBindings.__gr_vk_get_proc(context: Pointer; + const name: MarshaledAString; instance: gr_vk_instance_t; + device: gr_vk_device_t): Pointer; begin - TSkiaAPI.sk4d_svgsvg_set_height(GetHandle, @sk_svglength_t(AValue)); + Result := TGrVkGetProc(context^)(string(name), instance, device); end; -procedure TSkSVGSVG.SetPreserveAspectRatio( - const AValue: TSkSVGPreserveAspectRatio); +{ TSkDelegate } + +class procedure TSkDelegate.Finalize(const AContextProc: Pointer); begin - TSkiaAPI.sk4d_svgsvg_set_preserve_aspect_ratio(GetHandle, @sk_svgpreserveaspectratio_t(AValue)); + Dispose(PProcWrapper(AContextProc)); end; -procedure TSkSVGSVG.SetViewBox(const AViewBox: TRectF); +class function TSkDelegate.Initialize(const AProc: T; + const AInitializeFunc: TSkDelegateInitializeFunc): I; +var + LProcWrapper: PProcWrapper; begin - TSkiaAPI.sk4d_svgsvg_set_view_box(GetHandle, @sk_rect_t(AViewBox)); + New(LProcWrapper); + try + LProcWrapper.Proc := AProc; + Result := AInitializeFunc(LProcWrapper); + if not Assigned(Result) then + Dispose(LProcWrapper); + except + Dispose(LProcWrapper); + raise; + end; end; -procedure TSkSVGSVG.SetWidth(const AValue: TSkSVGLength); +class procedure TSkDelegate.Invoke(const AContextProc: Pointer; + const AInvokeProc: TSkDelegateInvokeProc); begin - TSkiaAPI.sk4d_svgsvg_set_width(GetHandle, @sk_svglength_t(AValue)); + AInvokeProc(PProcWrapper(AContextProc).Proc) end; -procedure TSkSVGSVG.SetX(const AValue: TSkSVGLength); +{ TSkData } + +class function TSkData.MakeFromBytes(const ABytes: TBytes): ISkData; begin - TSkiaAPI.sk4d_svgsvg_set_x(GetHandle, @sk_svglength_t(AValue)); + if Length(ABytes) = 0 then + Result := TSkBindings.SafeCreate(sk4d_data_make_empty()) + else + Result := TSkBindings.SafeCreate(sk4d_data_make_with_copy(@ABytes[0], Length(ABytes))); end; -procedure TSkSVGSVG.SetY(const AValue: TSkSVGLength); +class procedure TSkData.__RefHandle(const AHandle: THandle); begin - TSkiaAPI.sk4d_svgsvg_set_y(GetHandle, @sk_svglength_t(AValue)); + sk4d_data_ref(AHandle); end; -function TSkSVGSVG.TryGetViewBox(out AViewBox: TRectF): Boolean; +class procedure TSkData.__UnrefHandle(const AHandle: THandle); begin - Result := TSkiaAPI.sk4d_svgsvg_get_view_box(GetHandle, sk_rect_t(AViewBox)); + sk4d_data_unref(AHandle); end; -{ TSkVersion } +{ TSkStreamAdapter } -class function TSkVersion.GetBuild: Integer; +class constructor TSkStreamAdapter.Create; var - LVersion: TArray; + LProcs: sk_streamadapter_procs_t; +begin + LProcs.get_length := get_length_proc; + LProcs.get_position := get_position_proc; + LProcs.read := read_proc; + LProcs.seek := seek_proc; + sk4d_streamadapter_set_procs(@LProcs); +end; + +constructor TSkStreamAdapter.Create(const AStream: TStream); begin - LVersion := SkVersion.Split(['.']); - Result := LVersion[2].ToInteger; + inherited Create(sk4d_streamadapter_create(AStream)); end; -class function TSkVersion.GetLibraryBuild: Integer; +class function TSkStreamAdapter.get_length_proc(context: Pointer): size_t; begin - Result := TSkiaAPI.sk4d_library_version_get_build(); + Result := TStream(context).Size; end; -class function TSkVersion.GetLibraryMajor: Integer; +class function TSkStreamAdapter.get_position_proc(context: Pointer): size_t; begin - Result := TSkiaAPI.sk4d_library_version_get_major(); + Result := TStream(context).Position; end; -class function TSkVersion.GetLibraryMinor: Integer; +class function TSkStreamAdapter.read_proc(context, buffer: Pointer; + size: size_t): size_t; begin - Result := TSkiaAPI.sk4d_library_version_get_minor(); + Result := TStream(context).Read(buffer^, size); end; -class function TSkVersion.GetMajor: Integer; -var - LVersion: TArray; +class function TSkStreamAdapter.seek_proc(context: Pointer; + position: size_t): _bool; +begin + TStream(context).Position := position; + Result := True; +end; + +class procedure TSkStreamAdapter.__DestroyHandle(const AHandle: THandle); begin - LVersion := SkVersion.Split(['.']); - Result := LVersion[0].ToInteger; + sk4d_streamadapter_destroy(AHandle); end; -class function TSkVersion.GetMinor: Integer; +{ TSkWStreamAdapter } + +class constructor TSkWStreamAdapter.Create; var - LVersion: TArray; + LProcs: sk_wstreamadapter_procs_t; +begin + LProcs.write := write_proc; + sk4d_wstreamadapter_set_procs(@LProcs); +end; + +constructor TSkWStreamAdapter.Create(const AStream: TStream); +begin + inherited Create(sk4d_wstreamadapter_create(AStream)); +end; + +class function TSkWStreamAdapter.write_proc(context: Pointer; + const buffer: Pointer; size: size_t): _bool; +begin + TStream(context).Write(buffer^, size); + Result := True; +end; + +class procedure TSkWStreamAdapter.__DestroyHandle(const AHandle: THandle); begin - LVersion := SkVersion.Split(['.']); - Result := LVersion[1].ToInteger; + sk4d_wstreamadapter_destroy(AHandle); end; +{ TSkString } + +constructor TSkString.Create; +begin + inherited Create(sk4d_string_create()); +end; + +function TSkString.GetText: string; +begin + Result := string(sk4d_string_get_text(Handle)); +end; + +class procedure TSkString.__DestroyHandle(const AHandle: THandle); +begin + sk4d_string_destroy(AHandle); +end; + +{$HPPEMIT NOUSINGNAMESPACE} +{$HPPEMIT END '#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_SKIA)'} +{$HPPEMIT END ' using ::Skia::_di_IGrBackendRenderTarget;'} +{$HPPEMIT END ' using ::Skia::_di_IGrBackendTexture;'} +{$HPPEMIT END ' using ::Skia::_di_IGrDirectContext;'} +{$HPPEMIT END ' using ::Skia::_di_IGrGlInterface;'} +{$HPPEMIT END ' using ::Skia::_di_IGrPersistentCache;'} +{$HPPEMIT END ' using ::Skia::_di_IGrShaderErrorHandler;'} +{$HPPEMIT END ' using ::Skia::_di_IGrVkExtensions;'} +{$HPPEMIT END ' using ::Skia::_di_ISkAnimationCodecPlayer;'} +{$HPPEMIT END ' using ::Skia::_di_ISkBlender;'} +{$HPPEMIT END ' using ::Skia::_di_ISkCanvas;'} +{$HPPEMIT END ' using ::Skia::_di_ISkCodec;'} +{$HPPEMIT END ' using ::Skia::_di_ISkColorFilter;'} +{$HPPEMIT END ' using ::Skia::_di_ISkColorSpace;'} +{$HPPEMIT END ' using ::Skia::_di_ISkColorSpaceICCProfile;'} +{$HPPEMIT END ' using ::Skia::_di_ISkDocument;'} +{$HPPEMIT END ' using ::Skia::_di_ISkEnumerable;'} +{$HPPEMIT END ' using ::Skia::_di_ISkFileResourceProvider;'} +{$HPPEMIT END ' using ::Skia::_di_ISkFont;'} +{$HPPEMIT END ' using ::Skia::_di_ISkImage;'} +{$HPPEMIT END ' using ::Skia::_di_ISkImageFilter;'} +{$HPPEMIT END ' using ::Skia::_di_ISkMaskFilter;'} +{$HPPEMIT END ' using ::Skia::_di_ISkNonVirtualReferenceCounted;'} +{$HPPEMIT END ' using ::Skia::_di_ISkObject;'} +{$HPPEMIT END ' using ::Skia::_di_ISkOpBuilder;'} +{$HPPEMIT END ' using ::Skia::_di_ISkottieAnimation;'} +{$HPPEMIT END ' using ::Skia::_di_ISkPaint;'} +{$HPPEMIT END ' using ::Skia::_di_ISkParagraph;'} +{$HPPEMIT END ' using ::Skia::_di_ISkParagraphBuilder;'} +{$HPPEMIT END ' using ::Skia::_di_ISkParagraphStyle;'} +{$HPPEMIT END ' using ::Skia::_di_ISkParticleEffect;'} +{$HPPEMIT END ' using ::Skia::_di_ISkPath;'} +{$HPPEMIT END ' using ::Skia::_di_ISkPathBuilder;'} +{$HPPEMIT END ' using ::Skia::_di_ISkPathEffect;'} +{$HPPEMIT END ' using ::Skia::_di_ISkPathIterator;'} +{$HPPEMIT END ' using ::Skia::_di_ISkPathMeasure;'} +{$HPPEMIT END ' using ::Skia::_di_ISkPicture;'} +{$HPPEMIT END ' using ::Skia::_di_ISkPictureRecorder;'} +{$HPPEMIT END ' using ::Skia::_di_ISkPixmap;'} +{$HPPEMIT END ' using ::Skia::_di_ISkReferenceCounted;'} +{$HPPEMIT END ' using ::Skia::_di_ISkRegion;'} +{$HPPEMIT END ' using ::Skia::_di_ISkRegionCliperator;'} +{$HPPEMIT END ' using ::Skia::_di_ISkRegionIterator;'} +{$HPPEMIT END ' using ::Skia::_di_ISkRegionSpanerator;'} +{$HPPEMIT END ' using ::Skia::_di_ISkResourceProvider;'} +{$HPPEMIT END ' using ::Skia::_di_ISkRoundRect;'} +{$HPPEMIT END ' using ::Skia::_di_ISkRuntimeEffect;'} +{$HPPEMIT END ' using ::Skia::_di_ISkShader;'} +{$HPPEMIT END ' using ::Skia::_di_ISkShaper;'} +{$HPPEMIT END ' using ::Skia::_di_ISkStrutStyle;'} +{$HPPEMIT END ' using ::Skia::_di_ISkSurface;'} +{$HPPEMIT END ' using ::Skia::_di_ISkSVGDOM;'} +{$HPPEMIT END ' using ::Skia::_di_ISkSVGNode;'} +{$HPPEMIT END ' using ::Skia::_di_ISkSVGSVG;'} +{$HPPEMIT END ' using ::Skia::_di_ISkTextBlob;'} +{$HPPEMIT END ' using ::Skia::_di_ISkTextStyle;'} +{$HPPEMIT END ' using ::Skia::_di_ISkTraceMemoryDump;'} +{$HPPEMIT END ' using ::Skia::_di_ISkTypeface;'} +{$HPPEMIT END ' using ::Skia::_di_ISkTypefaceFontProvider;'} +{$HPPEMIT END ' using ::Skia::_di_ISkUnicode;'} +{$HPPEMIT END ' using ::Skia::_di_ISkUnicodeBreakIterator;'} +{$HPPEMIT END ' using ::Skia::_di_ISkVertices;'} +{$HPPEMIT END ' using ::Skia::_di_TGrGlGetProc;'} +{$HPPEMIT END ' using ::Skia::_di_TGrVkGetProc;'} +{$HPPEMIT END ' using ::Skia::_di_TSkFontPathProc;'} +{$HPPEMIT END ' using ::Skia::_di_TSkImageRasterReleaseProc;'} +{$HPPEMIT END ' using ::Skia::_di_TSkImageTextureReleaseProc;'} +{$HPPEMIT END ' using ::Skia::_di_TSkParagraphVisitProc;'} +{$HPPEMIT END ' using ::Skia::_di_TSkSurfaceRasterReleaseProc;'} +{$HPPEMIT END ' using ::Skia::_di_TSkUnicodeBidiRegionProc;'} +{$HPPEMIT END ' using ::Skia::_di_TSkUnicodeBreakProc;'} +{$HPPEMIT END ' using ::Skia::_di_TSkUnicodeCodepointProc;'} +{$HPPEMIT END ' using ::Skia::ESkArgumentException;'} +{$HPPEMIT END ' using ::Skia::ESkException;'} +{$HPPEMIT END ' using ::Skia::GrGlenum;'} +{$HPPEMIT END ' using ::Skia::GrGluint;'} +{$HPPEMIT END ' using ::Skia::GrMtlHandle;'} +{$HPPEMIT END ' using ::Skia::GrVkBool32;'} +{$HPPEMIT END ' using ::Skia::GrVkChromaLocation;'} +{$HPPEMIT END ' using ::Skia::GrVkDevice;'} +{$HPPEMIT END ' using ::Skia::GrVkDeviceMemory;'} +{$HPPEMIT END ' using ::Skia::GrVkDeviceSize;'} +{$HPPEMIT END ' using ::Skia::GrVkFilter;'} +{$HPPEMIT END ' using ::Skia::GrVkFormat;'} +{$HPPEMIT END ' using ::Skia::GrVkFormatFeatureFlags;'} +{$HPPEMIT END ' using ::Skia::GrVkImage;'} +{$HPPEMIT END ' using ::Skia::GrVkImageLayout;'} +{$HPPEMIT END ' using ::Skia::GrVkImageUsageFlags;'} +{$HPPEMIT END ' using ::Skia::GrVkInstance;'} +{$HPPEMIT END ' using ::Skia::GrVkPhysicalDevice;'} +{$HPPEMIT END ' using ::Skia::GrVkPhysicalDeviceFeatures;'} +{$HPPEMIT END ' using ::Skia::GrVkPhysicalDeviceFeatures2;'} +{$HPPEMIT END ' using ::Skia::GrVkQueue;'} +{$HPPEMIT END ' using ::Skia::GrVkSamplerYcbcrModelConversion;'} +{$HPPEMIT END ' using ::Skia::GrVkSharingMode;'} +{$HPPEMIT END ' using ::Skia::GrVkVkImageTiling;'} +{$HPPEMIT END ' using ::Skia::GrVkVkSamplerYcbcrRange;'} +{$HPPEMIT END ' using ::Skia::IGrBackendRenderTarget;'} +{$HPPEMIT END ' using ::Skia::IGrBackendTexture;'} +{$HPPEMIT END ' using ::Skia::IGrDirectContext;'} +{$HPPEMIT END ' using ::Skia::IGrGlInterface;'} +{$HPPEMIT END ' using ::Skia::IGrPersistentCache;'} +{$HPPEMIT END ' using ::Skia::IGrShaderErrorHandler;'} +{$HPPEMIT END ' using ::Skia::IGrVkExtensions;'} +{$HPPEMIT END ' using ::Skia::ISkAnimationCodecPlayer;'} +{$HPPEMIT END ' using ::Skia::ISkBlender;'} +{$HPPEMIT END ' using ::Skia::ISkCanvas;'} +{$HPPEMIT END ' using ::Skia::ISkCodec;'} +{$HPPEMIT END ' using ::Skia::ISkColorFilter;'} +{$HPPEMIT END ' using ::Skia::ISkColorSpace;'} +{$HPPEMIT END ' using ::Skia::ISkColorSpaceICCProfile;'} +{$HPPEMIT END ' using ::Skia::ISkDocument;'} +{$HPPEMIT END ' using ::Skia::ISkEnumerable;'} +{$HPPEMIT END ' using ::Skia::ISkFileResourceProvider;'} +{$HPPEMIT END ' using ::Skia::ISkFont;'} +{$HPPEMIT END ' using ::Skia::ISkImage;'} +{$HPPEMIT END ' using ::Skia::ISkImageFilter;'} +{$HPPEMIT END ' using ::Skia::ISkMaskFilter;'} +{$HPPEMIT END ' using ::Skia::ISkNonVirtualReferenceCounted;'} +{$HPPEMIT END ' using ::Skia::ISkObject;'} +{$HPPEMIT END ' using ::Skia::ISkOpBuilder;'} +{$HPPEMIT END ' using ::Skia::ISkottieAnimation;'} +{$HPPEMIT END ' using ::Skia::ISkPaint;'} +{$HPPEMIT END ' using ::Skia::ISkParagraph;'} +{$HPPEMIT END ' using ::Skia::ISkParagraphBuilder;'} +{$HPPEMIT END ' using ::Skia::ISkParagraphStyle;'} +{$HPPEMIT END ' using ::Skia::ISkParticleEffect;'} +{$HPPEMIT END ' using ::Skia::ISkPath;'} +{$HPPEMIT END ' using ::Skia::ISkPathBuilder;'} +{$HPPEMIT END ' using ::Skia::ISkPathEffect;'} +{$HPPEMIT END ' using ::Skia::ISkPathIterator;'} +{$HPPEMIT END ' using ::Skia::ISkPathMeasure;'} +{$HPPEMIT END ' using ::Skia::ISkPicture;'} +{$HPPEMIT END ' using ::Skia::ISkPictureRecorder;'} +{$HPPEMIT END ' using ::Skia::ISkPixmap;'} +{$HPPEMIT END ' using ::Skia::ISkReferenceCounted;'} +{$HPPEMIT END ' using ::Skia::ISkRegion;'} +{$HPPEMIT END ' using ::Skia::ISkRegionCliperator;'} +{$HPPEMIT END ' using ::Skia::ISkRegionIterator;'} +{$HPPEMIT END ' using ::Skia::ISkRegionSpanerator;'} +{$HPPEMIT END ' using ::Skia::ISkResourceProvider;'} +{$HPPEMIT END ' using ::Skia::ISkRoundRect;'} +{$HPPEMIT END ' using ::Skia::ISkRuntimeEffect;'} +{$HPPEMIT END ' using ::Skia::ISkShader;'} +{$HPPEMIT END ' using ::Skia::ISkShaper;'} +{$HPPEMIT END ' using ::Skia::ISkStrutStyle;'} +{$HPPEMIT END ' using ::Skia::ISkSurface;'} +{$HPPEMIT END ' using ::Skia::ISkSVGDOM;'} +{$HPPEMIT END ' using ::Skia::ISkSVGNode;'} +{$HPPEMIT END ' using ::Skia::ISkSVGSVG;'} +{$HPPEMIT END ' using ::Skia::ISkTextBlob;'} +{$HPPEMIT END ' using ::Skia::ISkTextStyle;'} +{$HPPEMIT END ' using ::Skia::ISkTraceMemoryDump;'} +{$HPPEMIT END ' using ::Skia::ISkTypeface;'} +{$HPPEMIT END ' using ::Skia::ISkTypefaceFontProvider;'} +{$HPPEMIT END ' using ::Skia::ISkUnicode;'} +{$HPPEMIT END ' using ::Skia::ISkUnicodeBreakIterator;'} +{$HPPEMIT END ' using ::Skia::ISkVertices;'} +{$HPPEMIT END ' using ::Skia::PCardinalArray;'} +{$HPPEMIT END ' using ::Skia::PPointFArray;'} +{$HPPEMIT END ' using ::Skia::PSingleArray;'} +{$HPPEMIT END ' using ::Skia::PWordArray;'} +{$HPPEMIT END ' using ::Skia::TGrBackendAPI;'} +{$HPPEMIT END ' using ::Skia::TGrBackendRenderTarget;'} +{$HPPEMIT END ' using ::Skia::TGrBackendTexture;'} +{$HPPEMIT END ' using ::Skia::TGrContextOptions;'} +{$HPPEMIT END ' using ::Skia::TGrDirectContext;'} +{$HPPEMIT END ' using ::Skia::TGrGlFramebufferInfo;'} +{$HPPEMIT END ' using ::Skia::TGrGlGetProc;'} +{$HPPEMIT END ' using ::Skia::TGrGlInterface;'} +{$HPPEMIT END ' using ::Skia::TGrGlTextureInfo;'} +{$HPPEMIT END ' using ::Skia::TGrMtlBackendContext;'} +{$HPPEMIT END ' using ::Skia::TGrMtlTextureInfo;'} +{$HPPEMIT END ' using ::Skia::TGrPersistentCacheBaseClass;'} +{$HPPEMIT END ' using ::Skia::TGrShaderCacheStrategy;'} +{$HPPEMIT END ' using ::Skia::TGrShaderErrorHandlerBaseClass;'} +{$HPPEMIT END ' using ::Skia::TGrSurfaceOrigin;'} +{$HPPEMIT END ' using ::Skia::TGrVkAlloc;'} +{$HPPEMIT END ' using ::Skia::TGrVkAllocFlag;'} +{$HPPEMIT END ' using ::Skia::TGrVkAllocFlags;'} +{$HPPEMIT END ' using ::Skia::TGrVkBackendContext;'} +{$HPPEMIT END ' using ::Skia::TGrVkExtensions;'} +{$HPPEMIT END ' using ::Skia::TGrVkGetProc;'} +{$HPPEMIT END ' using ::Skia::TGrVkImageInfo;'} +{$HPPEMIT END ' using ::Skia::TGrVkYcbcrConversionInfo;'} +{$HPPEMIT END ' using ::Skia::TSkAffinity;'} +{$HPPEMIT END ' using ::Skia::TSkAlphaType;'} +{$HPPEMIT END ' using ::Skia::TSkAnimationCodecPlayer;'} +{$HPPEMIT END ' using ::Skia::TSkBlender;'} +{$HPPEMIT END ' using ::Skia::TSkBlendMode;'} +{$HPPEMIT END ' using ::Skia::TSkBlurStyle;'} +{$HPPEMIT END ' using ::Skia::TSkBreakType;'} +{$HPPEMIT END ' using ::Skia::TSkCanvas;'} +{$HPPEMIT END ' using ::Skia::TSkClipOp;'} +{$HPPEMIT END ' using ::Skia::TSkCodec;'} +{$HPPEMIT END ' using ::Skia::TSkColorChannel;'} +{$HPPEMIT END ' using ::Skia::TSkColorFilter;'} +{$HPPEMIT END ' using ::Skia::TSkColorMatrix;'} +{$HPPEMIT END ' using ::Skia::TSkColorSpace;'} +{$HPPEMIT END ' using ::Skia::TSkColorSpaceICCProfile;'} +{$HPPEMIT END ' using ::Skia::TSkColorSpacePrimaries;'} +{$HPPEMIT END ' using ::Skia::TSkColorSpaceTransferFunction;'} +{$HPPEMIT END ' using ::Skia::TSkColorSpaceXyz;'} +{$HPPEMIT END ' using ::Skia::TSkColorType;'} +{$HPPEMIT END ' using ::Skia::TSkContrastInvertStyle;'} +{$HPPEMIT END ' using ::Skia::TSkCubicResampler;'} +{$HPPEMIT END ' using ::Skia::TSkDirection;'} +{$HPPEMIT END ' using ::Skia::TSkDocument;'} +{$HPPEMIT END ' using ::Skia::TSkDrawPointsMode;'} +{$HPPEMIT END ' using ::Skia::TSkEncodedImageFormat;'} +{$HPPEMIT END ' using ::Skia::TSkFileResourceProvider;'} +{$HPPEMIT END ' using ::Skia::TSkFilterMode;'} +{$HPPEMIT END ' using ::Skia::TSkFont;'} +{$HPPEMIT END ' using ::Skia::TSkFontEdging;'} +{$HPPEMIT END ' using ::Skia::TSkFontHinting;'} +{$HPPEMIT END ' using ::Skia::TSkFontMetrics;'} +{$HPPEMIT END ' using ::Skia::TSkFontMetricsFlag;'} +{$HPPEMIT END ' using ::Skia::TSkFontMetricsFlags;'} +{$HPPEMIT END ' using ::Skia::TSkFontPathProc;'} +{$HPPEMIT END ' using ::Skia::TSkFontSlant;'} +{$HPPEMIT END ' using ::Skia::TSkFontStyle;'} +{$HPPEMIT END ' using ::Skia::TSkFontWeight;'} +{$HPPEMIT END ' using ::Skia::TSkFontWidth;'} +{$HPPEMIT END ' using ::Skia::TSkGraphics;'} +{$HPPEMIT END ' using ::Skia::TSkHighContrastConfig;'} +{$HPPEMIT END ' using ::Skia::TSkImage;'} +{$HPPEMIT END ' using ::Skia::TSkImageCachingHint;'} +{$HPPEMIT END ' using ::Skia::TSkImageEncoder;'} +{$HPPEMIT END ' using ::Skia::TSkImageFilter;'} +{$HPPEMIT END ' using ::Skia::TSkImageInfo;'} +{$HPPEMIT END ' using ::Skia::TSkImageRasterReleaseProc;'} +{$HPPEMIT END ' using ::Skia::TSkImageTextureReleaseProc;'} +{$HPPEMIT END ' using ::Skia::TSkLattice;'} +{$HPPEMIT END ' using ::Skia::TSkLatticeRectType;'} +{$HPPEMIT END ' using ::Skia::TSkMaskFilter;'} +{$HPPEMIT END ' using ::Skia::TSkMetrics;'} +{$HPPEMIT END ' using ::Skia::TSkMipmapMode;'} +{$HPPEMIT END ' using ::Skia::TSkNonVirtualReferenceCounted;'} +{$HPPEMIT END ' using ::Skia::TSkObject;'} +{$HPPEMIT END ' using ::Skia::TSkOpBuilder;'} +{$HPPEMIT END ' using ::Skia::TSkottieAnimation;'} +{$HPPEMIT END ' using ::Skia::TSkottieAnimationRenderFlag;'} +{$HPPEMIT END ' using ::Skia::TSkottieAnimationRenderFlags;'} +{$HPPEMIT END ' using ::Skia::TSkOverdrawColor;'} +{$HPPEMIT END ' using ::Skia::TSkPaint;'} +{$HPPEMIT END ' using ::Skia::TSkPaintStyle;'} +{$HPPEMIT END ' using ::Skia::TSkParagraph;'} +{$HPPEMIT END ' using ::Skia::TSkParagraphBuilder;'} +{$HPPEMIT END ' using ::Skia::TSkParagraphStyle;'} +{$HPPEMIT END ' using ::Skia::TSkParagraphVisitorFlag;'} +{$HPPEMIT END ' using ::Skia::TSkParagraphVisitorFlags;'} +{$HPPEMIT END ' using ::Skia::TSkParagraphVisitorInfo;'} +{$HPPEMIT END ' using ::Skia::TSkParagraphVisitProc;'} +{$HPPEMIT END ' using ::Skia::TSkParticleEffect;'} +{$HPPEMIT END ' using ::Skia::TSkParticleUniform;'} +{$HPPEMIT END ' using ::Skia::TSkParticleUniformData;'} +{$HPPEMIT END ' using ::Skia::TSkPatchColors;'} +{$HPPEMIT END ' using ::Skia::TSkPatchCubics;'} +{$HPPEMIT END ' using ::Skia::TSkPatchTexCoords;'} +{$HPPEMIT END ' using ::Skia::TSkPath;'} +{$HPPEMIT END ' using ::Skia::TSkPathArcSize;'} +{$HPPEMIT END ' using ::Skia::TSkPathBuilder;'} +{$HPPEMIT END ' using ::Skia::TSkPathDirection;'} +{$HPPEMIT END ' using ::Skia::TSkPathEffect;'} +{$HPPEMIT END ' using ::Skia::TSkPathEffect1DStyle;'} +{$HPPEMIT END ' using ::Skia::TSkPathEffectTrimMode;'} +{$HPPEMIT END ' using ::Skia::TSkPathFillType;'} +{$HPPEMIT END ' using ::Skia::TSkPathIteratorElem;'} +{$HPPEMIT END ' using ::Skia::TSkPathMeasure;'} +{$HPPEMIT END ' using ::Skia::TSkPathMeasureMatrixFlag;'} +{$HPPEMIT END ' using ::Skia::TSkPathMeasureMatrixFlags;'} +{$HPPEMIT END ' using ::Skia::TSkPathOp;'} +{$HPPEMIT END ' using ::Skia::TSkPathPoints;'} +{$HPPEMIT END ' using ::Skia::TSkPathVerb;'} +{$HPPEMIT END ' using ::Skia::TSkPDFMetadata;'} +{$HPPEMIT END ' using ::Skia::TSkPicture;'} +{$HPPEMIT END ' using ::Skia::TSkPictureRecorder;'} +{$HPPEMIT END ' using ::Skia::TSkPixelGeometry;'} +{$HPPEMIT END ' using ::Skia::TSkPixmap;'} +{$HPPEMIT END ' using ::Skia::TSkPlaceholderAlignment;'} +{$HPPEMIT END ' using ::Skia::TSkPlaceholderStyle;'} +{$HPPEMIT END ' using ::Skia::TSkPositionAffinity;'} +{$HPPEMIT END ' using ::Skia::TSkRectHeightStyle;'} +{$HPPEMIT END ' using ::Skia::TSkRectWidthStyle;'} +{$HPPEMIT END ' using ::Skia::TSkReferenceCounted;'} +{$HPPEMIT END ' using ::Skia::TSkRegion;'} +{$HPPEMIT END ' using ::Skia::TSkRegionOp;'} +{$HPPEMIT END ' using ::Skia::TSkResourceProviderBaseClass;'} +{$HPPEMIT END ' using ::Skia::TSkRotationScaleMatrix;'} +{$HPPEMIT END ' using ::Skia::TSkRoundRect;'} +{$HPPEMIT END ' using ::Skia::TSkRoundRectCorner;'} +{$HPPEMIT END ' using ::Skia::TSkRoundRectRadii;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffect;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectChildType;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectFloat2;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectFloat2x2;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectFloat3;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectFloat3x3;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectFloat4;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectFloat4x4;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectInt2;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectInt3;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectInt4;'} +{$HPPEMIT END ' using ::Skia::TSkRuntimeEffectUniformType;'} +{$HPPEMIT END ' using ::Skia::TSkSamplingOptions;'} +{$HPPEMIT END ' using ::Skia::TSkSegmentMask;'} +{$HPPEMIT END ' using ::Skia::TSkSegmentMasks;'} +{$HPPEMIT END ' using ::Skia::TSkShader;'} +{$HPPEMIT END ' using ::Skia::TSkShaper;'} +{$HPPEMIT END ' using ::Skia::TSkSrcRectConstraint;'} +{$HPPEMIT END ' using ::Skia::TSkStrokeCap;'} +{$HPPEMIT END ' using ::Skia::TSkStrokeJoin;'} +{$HPPEMIT END ' using ::Skia::TSkStrutStyle;'} +{$HPPEMIT END ' using ::Skia::TSkSurface;'} +{$HPPEMIT END ' using ::Skia::TSkSurfaceProperties;'} +{$HPPEMIT END ' using ::Skia::TSkSurfacePropertiesFlag;'} +{$HPPEMIT END ' using ::Skia::TSkSurfacePropertiesFlags;'} +{$HPPEMIT END ' using ::Skia::TSkSurfaceRasterReleaseProc;'} +{$HPPEMIT END ' using ::Skia::TSkSVGAspectAlign;'} +{$HPPEMIT END ' using ::Skia::TSkSVGAspectScale;'} +{$HPPEMIT END ' using ::Skia::TSkSVGCanvas;'} +{$HPPEMIT END ' using ::Skia::TSkSVGCanvasFlag;'} +{$HPPEMIT END ' using ::Skia::TSkSVGCanvasFlags;'} +{$HPPEMIT END ' using ::Skia::TSkSVGDOM;'} +{$HPPEMIT END ' using ::Skia::TSkSVGLength;'} +{$HPPEMIT END ' using ::Skia::TSkSVGLengthUnit;'} +{$HPPEMIT END ' using ::Skia::TSkSVGNode;'} +{$HPPEMIT END ' using ::Skia::TSkSVGPreserveAspectRatio;'} +{$HPPEMIT END ' using ::Skia::TSkSVGSVG;'} +{$HPPEMIT END ' using ::Skia::TSkTableFilter;'} +{$HPPEMIT END ' using ::Skia::TSkTextAlign;'} +{$HPPEMIT END ' using ::Skia::TSkTextBaseline;'} +{$HPPEMIT END ' using ::Skia::TSkTextBlob;'} +{$HPPEMIT END ' using ::Skia::TSkTextBox;'} +{$HPPEMIT END ' using ::Skia::TSkTextDecoration;'} +{$HPPEMIT END ' using ::Skia::TSkTextDecorations;'} +{$HPPEMIT END ' using ::Skia::TSkTextDecorationStyle;'} +{$HPPEMIT END ' using ::Skia::TSkTextDirection;'} +{$HPPEMIT END ' using ::Skia::TSkTextHeightBehavior;'} +{$HPPEMIT END ' using ::Skia::TSkTextHeightBehaviors;'} +{$HPPEMIT END ' using ::Skia::TSkTextShadow;'} +{$HPPEMIT END ' using ::Skia::TSkTextStyle;'} +{$HPPEMIT END ' using ::Skia::TSkTileMode;'} +{$HPPEMIT END ' using ::Skia::TSkTraceMemoryDumpBaseClass;'} +{$HPPEMIT END ' using ::Skia::TSkTypeface;'} +{$HPPEMIT END ' using ::Skia::TSkTypefaceFontProvider;'} +{$HPPEMIT END ' using ::Skia::TSkUnicode;'} +{$HPPEMIT END ' using ::Skia::TSkUnicodeBidiRegionProc;'} +{$HPPEMIT END ' using ::Skia::TSkUnicodeBreakIteratorElem;'} +{$HPPEMIT END ' using ::Skia::TSkUnicodeBreakProc;'} +{$HPPEMIT END ' using ::Skia::TSkUnicodeCodepointProc;'} +{$HPPEMIT END ' using ::Skia::TSkVertexMode;'} +{$HPPEMIT END ' using ::Skia::TSkVertices;'} +{$HPPEMIT END ' typedef TSkEncodedImageFormat (__fastcall *TExtensionToEncodedImageFormatFunc)(const ::System::UnicodeString AExtension);'} +{$HPPEMIT END ' static const ::System::Word GrGlTexture2D = ::Skia::GrGlTexture2D;'} +{$HPPEMIT END ' static const ::System::Word GrGlTextureExternal = ::Skia::GrGlTextureExternal;'} +{$HPPEMIT END ' static const ::System::Word GrGlTextureRectangle = ::Skia::GrGlTextureRectangle;'} +{$HPPEMIT END ' static const TSkFontSlant SkFontSlantRegular = ::Skia::SkFontSlantRegular;'} +{$HPPEMIT END ' static const TSkFontWeight SkFontWeightDemiBold = ::Skia::SkFontWeightDemiBold;'} +{$HPPEMIT END ' static const TSkFontWeight SkFontWeightHairline = ::Skia::SkFontWeightHairline;'} +{$HPPEMIT END ' static const TSkFontWeight SkFontWeightHeavy = ::Skia::SkFontWeightHeavy;'} +{$HPPEMIT END ' static const TSkFontWeight SkFontWeightRegular = ::Skia::SkFontWeightRegular;'} +{$HPPEMIT END ' static const TSkFontWeight SkFontWeightUltraBlack = ::Skia::SkFontWeightUltraBlack;'} +{$HPPEMIT END ' static const TSkFontWeight SkFontWeightUltraBold = ::Skia::SkFontWeightUltraBold;'} +{$HPPEMIT END ' static const TSkFontWeight SkFontWeightUltraLight = ::Skia::SkFontWeightUltraLight;'} +{$HPPEMIT END ' static const TSkFontWidth SkFontWidthRegular = ::Skia::SkFontWidthRegular;'} +{$HPPEMIT END ' static ::System::StaticArray& GrGlSizedFormat = ::Skia::GrGlSizedFormat;'} +{$HPPEMIT END ' static ::System::StaticArray& SkBytesPerPixel = ::Skia::SkBytesPerPixel;'} +{$HPPEMIT END ' static TSkColorMatrix& SkColorMatrixIdentity = ::Skia::SkColorMatrixIdentity;'} +{$HPPEMIT END ' static TSkColorSpaceTransferFunction& SkColorSpaceTransferFunctionHLG = ::Skia::SkColorSpaceTransferFunctionHLG;'} +{$HPPEMIT END ' static TSkColorSpaceTransferFunction& SkColorSpaceTransferFunctionLinear = ::Skia::SkColorSpaceTransferFunctionLinear;'} +{$HPPEMIT END ' static TSkColorSpaceTransferFunction& SkColorSpaceTransferFunctionPQ = ::Skia::SkColorSpaceTransferFunctionPQ;'} +{$HPPEMIT END ' static TSkColorSpaceTransferFunction& SkColorSpaceTransferFunctionRec2020 = ::Skia::SkColorSpaceTransferFunctionRec2020;'} +{$HPPEMIT END ' static TSkColorSpaceTransferFunction& SkColorSpaceTransferFunctionSRGB = ::Skia::SkColorSpaceTransferFunctionSRGB;'} +{$HPPEMIT END ' static TSkColorSpaceTransferFunction& SkColorSpaceTransferFunctionTwoDotTwo = ::Skia::SkColorSpaceTransferFunctionTwoDotTwo;'} +{$HPPEMIT END ' static TSkColorSpaceXyz& SkColorSpaceXyzAdobeRGB = ::Skia::SkColorSpaceXyzAdobeRGB;'} +{$HPPEMIT END ' static TSkColorSpaceXyz& SkColorSpaceXyzDisplayP3 = ::Skia::SkColorSpaceXyzDisplayP3;'} +{$HPPEMIT END ' static TSkColorSpaceXyz& SkColorSpaceXyzIdentity = ::Skia::SkColorSpaceXyzIdentity;'} +{$HPPEMIT END ' static TSkColorSpaceXyz& SkColorSpaceXyzRec2020 = ::Skia::SkColorSpaceXyzRec2020;'} +{$HPPEMIT END ' static TSkColorSpaceXyz& SkColorSpaceXyzSRGB = ::Skia::SkColorSpaceXyzSRGB;'} +{$HPPEMIT END ' static TSkCubicResampler& SkCubicResamplerCatmullRom = ::Skia::SkCubicResamplerCatmullRom;'} +{$HPPEMIT END ' static TSkCubicResampler& SkCubicResamplerMitchell = ::Skia::SkCubicResamplerMitchell;'} +{$HPPEMIT END ' static TSkFontStyle& SkFontStyleBold = ::Skia::SkFontStyleBold;'} +{$HPPEMIT END ' static TSkFontStyle& SkFontStyleBoldItalic = ::Skia::SkFontStyleBoldItalic;'} +{$HPPEMIT END ' static TSkFontStyle& SkFontStyleItalic = ::Skia::SkFontStyleItalic;'} +{$HPPEMIT END ' static TSkFontStyle& SkFontStyleNormal = ::Skia::SkFontStyleNormal;'} +{$HPPEMIT END ' static TSkColorType& SkNative32ColorType = ::Skia::SkNative32ColorType;'} +{$HPPEMIT END ' static TSkRotationScaleMatrix& SkRotationScaleMatrixIdentity = ::Skia::SkRotationScaleMatrixIdentity;'} +{$HPPEMIT END ' static TSkSamplingOptions& SkSamplingOptionsHigh = ::Skia::SkSamplingOptionsHigh;'} +{$HPPEMIT END ' static TSkSamplingOptions& SkSamplingOptionsLow = ::Skia::SkSamplingOptionsLow;'} +{$HPPEMIT END ' static TSkSamplingOptions& SkSamplingOptionsMedium = ::Skia::SkSamplingOptionsMedium;'} +{$HPPEMIT END ' static ::System::StaticArray& SkShiftPerPixel = ::Skia::SkShiftPerPixel;'} +{$HPPEMIT END ' static const TExtensionToEncodedImageFormatFunc ExtensionToEncodedImageFormat = ::Skia::ExtensionToEncodedImageFormat;'} +{$HPPEMIT END '#endif'} end. diff --git a/skia4delphi/Source/VCL/Skia.Vcl.pas b/skia4delphi/Source/VCL/Skia.Vcl.pas index bf74f5b..43ba285 100644 --- a/skia4delphi/Source/VCL/Skia.Vcl.pas +++ b/skia4delphi/Source/VCL/Skia.Vcl.pas @@ -23,7 +23,9 @@ interface System.Types, System.UITypes, System.Classes, + System.Math, System.Messaging, + System.Generics.Collections, Vcl.Graphics, Vcl.Controls, Vcl.ExtCtrls, @@ -46,11 +48,53 @@ TSkBitmapHelper = class helper for TBitmap strict private procedure FlipPixels(const AWidth, AHeight: Integer; const ASrcPixels: PByte; const ASrcStride: Integer; const ADestPixels: PByte; const ADestStride: Integer); inline; public + constructor CreateFromSkImage(const AImage: ISkImage); procedure SkiaDraw(const AProc: TSkDrawProc; const AStartClean: Boolean = True); function ToSkImage: ISkImage; end; + { TSkPersistent } + + TSkPersistent = class(TPersistent) + strict private + FChanged: Boolean; + FCreated: Boolean; + FIgnoringAllChanges: Boolean; + FOnChange: TNotifyEvent; + FUpdatingCount: Integer; + function GetUpdating: Boolean; + protected + procedure DoAssign(ASource: TPersistent); virtual; + procedure DoChanged; virtual; + function GetHasChanged: Boolean; virtual; + function SetValue(var AField: Byte; const AValue: Byte): Boolean; overload; + function SetValue(var AField: Word; const AValue: Word): Boolean; overload; + function SetValue(var AField: Cardinal; const AValue: Cardinal): Boolean; overload; + function SetValue(var AField: Boolean; const AValue: Boolean): Boolean; overload; + function SetValue(var AField: Integer; const AValue: Integer): Boolean; overload; + function SetValue(var AField: Int64; const AValue: Int64): Boolean; overload; + function SetValue(var AField: Single; const AValue: Single; const AEpsilon: Single = 0.0): Boolean; overload; + function SetValue(var AField: Double; const AValue: Double; const AEpsilon: Double = 0.0): Boolean; overload; + function SetValue(var AField: TBytes; const AValue: TBytes): Boolean; overload; + function SetValue(var AField: string; const AValue: string): Boolean; overload; + function SetValue(var AField: T; const AValue: T): Boolean; overload; + property Created: Boolean read FCreated; + property UpdatingCount: Integer read FUpdatingCount; + public + procedure AfterConstruction; override; + procedure Assign(ASource: TPersistent); override; final; + procedure BeginUpdate; overload; + procedure BeginUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; + procedure Change; virtual; + procedure EndUpdate; overload; + procedure EndUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; + property HasChanged: Boolean read GetHasChanged; + property Updating: Boolean read GetUpdating; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + TSkDrawEvent = procedure(ASender: TObject; const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single) of object; + TSkDrawCacheKind = (Never, Raster, Always); { TSkCustomControl } @@ -60,12 +104,12 @@ TSkCustomControl = class abstract(TGraphicControl) FDrawBufferData: Pointer; FDrawBufferStride: Integer; FDrawCached: Boolean; - FDrawCacheEnabled: Boolean; + FDrawCacheKind: TSkDrawCacheKind; FOnDraw: TSkDrawEvent; FOpacity: Byte; procedure CreateBuffer(const AMemDC: HDC; out ABuffer: HBITMAP; out AData: Pointer; out AStride: Integer); procedure DeleteBuffers; - procedure SetDrawCacheEnabled(const AValue: Boolean); + procedure SetDrawCacheKind(const AValue: TSkDrawCacheKind); procedure SetOnDraw(const AValue: TSkDrawEvent); procedure SetOpacity(const AValue: Byte); {$IF CompilerVersion < 33} @@ -79,7 +123,7 @@ TSkCustomControl = class abstract(TGraphicControl) function NeedsRedraw: Boolean; virtual; procedure Paint; override; final; procedure Resize; override; - property DrawCacheEnabled: Boolean read FDrawCacheEnabled write SetDrawCacheEnabled default True; + property DrawCacheKind: TSkDrawCacheKind read FDrawCacheKind write SetDrawCacheKind default TSkDrawCacheKind.Raster; property OnDraw: TSkDrawEvent read FOnDraw write SetOnDraw; public constructor Create(AOwner: TComponent); override; @@ -202,7 +246,7 @@ TSkCustomWinControl = class abstract(TCustomControl) FDrawBufferData: Pointer; FDrawBufferStride: Integer; FDrawCached: Boolean; - FDrawCacheEnabled: Boolean; + FDrawCacheKind: TSkDrawCacheKind; FDrawParentInBackground: Boolean; FOnDraw: TSkDrawEvent; FOpacity: Byte; @@ -210,7 +254,7 @@ TSkCustomWinControl = class abstract(TCustomControl) procedure DeleteBuffers; procedure DrawParentImage(ADC: HDC; AInvalidateParent: Boolean = False); function GetOpaqueParent: TWinControl; - procedure SetDrawCacheEnabled(const AValue: Boolean); + procedure SetDrawCacheKind(const AValue: TSkDrawCacheKind); procedure SetDrawParentInBackground(const AValue: Boolean); procedure SetOnDraw(const AValue: TSkDrawEvent); procedure SetOpacity(const AValue: Byte); @@ -226,7 +270,7 @@ TSkCustomWinControl = class abstract(TCustomControl) function NeedsRedraw: Boolean; virtual; procedure Paint; override; final; procedure Resize; override; - property DrawCacheEnabled: Boolean read FDrawCacheEnabled write SetDrawCacheEnabled default True; + property DrawCacheKind: TSkDrawCacheKind read FDrawCacheKind write SetDrawCacheKind default TSkDrawCacheKind.Raster; property DrawParentInBackground: Boolean read FDrawParentInBackground write SetDrawParentInBackground; property OnDraw: TSkDrawEvent read FOnDraw write SetOnDraw; public @@ -269,93 +313,255 @@ TSkCustomWinControl = class abstract(TCustomControl) property OnStartDrag; end; + { TSkCustomAnimation } + TSkCustomAnimation = class(TSkPersistent) + public const + DefaultFrameRate = 60; + public class var + FrameRate: Integer; + protected const + DefaultAutoReverse = False; + DefaultDelay = 0; + DefaultEnabled = True; + DefaultInverse = False; + DefaultLoop = True; + DefaultPause = False; + DefaultSpeed = 1; + DefaultStartFromCurrent = False; + DefaultStartProgress = 0; + DefaultStopProgress = 1; + ProgressEpsilon = 0; + SpeedEpsilon = 1E-3; + SpeedRoundTo = -3; + TimeEpsilon = 1E-3; + TimeRoundTo = -3; + strict private type + TProcess = class + strict private + // Unsafe referece for TSkAnimation in list + FAniList: TList; + FAniProcessingList: TList; + FAnimation: TTimer; + FPerformanceFrequency: Int64; + FTime: Double; + procedure DoAdd(const AAnimation: TSkCustomAnimation); + procedure DoRemove(const AAnimation: TSkCustomAnimation); + function GetTick: Double; + procedure OnProcess(ASender: TObject); + strict private + class var FProcess: TProcess; + class destructor Destroy; + public + constructor Create; + destructor Destroy; override; + class procedure Add(const AAnimation: TSkCustomAnimation); static; + class procedure Remove(const AAnimation: TSkCustomAnimation); static; + end; + strict private + FAllowAnimation: Boolean; + FAutoReverse: Boolean; + FCurrentTime: Double; + FCurrentTimeChanged: Boolean; + FDelay: Double; + FDelayTime: Double; + FDuration: Double; + FEnabled: Boolean; + FEnabledChanged: Boolean; + FInverse: Boolean; + FLoop: Boolean; + FNeedStart: Boolean; + FNeedStartRepaint: Boolean; + [unsafe] FOwner: TComponent; + FPause: Boolean; + FProcessDuration: Double; + FProcessing: Boolean; + FProcessTime: Double; + FProgress: Double; + FRunning: Boolean; + FSavedInverse: Boolean; + FSavedProgress: Double; + FSpeed: Double; + FStartFromCurrent: Boolean; + FStartProgress: Double; + FStopProgress: Double; + FTickCount: Integer; + function CanProcessing: Boolean; + function DoSetCurrentTime(const AValue: Double): Boolean; + procedure InternalStart(const ACanProcess: Boolean); + function IsDelayStored: Boolean; + function IsProgressStored: Boolean; + function IsSpeedStored: Boolean; + function IsStartProgressStored: Boolean; + function IsStopProgressStored: Boolean; + procedure ProcessTick(ADeltaTime: Double); + procedure SetAllowAnimation(const AValue: Boolean); + procedure SetCurrentTime(const AValue: Double); + procedure SetDelay(const AValue: Double); + procedure SetEnabled(const AValue: Boolean); + procedure SetLoop(const AValue: Boolean); + procedure SetPause(const AValue: Boolean); + procedure SetProcessing(const AValue: Boolean); + procedure SetProgress(const AValue: Double); + procedure SetRunning(const AValue: Boolean); + procedure SetSpeed(const AValue: Double); + procedure SetStartProgress(const AValue: Double); + procedure SetStartValues(const ADelayTime: Double; const AStartAtEnd: Boolean); + procedure SetStopProgress(const AValue: Double); + procedure UpdateCurrentTime(const AIsRunning, ARecalcProcessDuration: Boolean); inline; + private + property SavedProgress: Double read FSavedProgress write FSavedProgress; + protected + procedure BeforePaint; + procedure DoAssign(ASource: TPersistent); override; + procedure DoChanged; override; + procedure DoFinish; virtual; abstract; + procedure DoProcess; virtual; abstract; + procedure DoStart; virtual; abstract; + function GetDuration: Double; + procedure SetDuration(const AValue: Double); + property AllowAnimation: Boolean read FAllowAnimation write SetAllowAnimation; + property Owner: TComponent read FOwner; + property Processing: Boolean read FProcessing; + public + constructor Create(const AOwner: TComponent); + destructor Destroy; override; + function Equals(AObject: TObject): Boolean; override; + procedure Start; virtual; + procedure Stop; virtual; + procedure StopAtCurrent; virtual; + property AutoReverse: Boolean read FAutoReverse write FAutoReverse default DefaultAutoReverse; + /// Current time of the animation in seconds + property CurrentTime: Double read FCurrentTime write SetCurrentTime stored False nodefault; + /// Delay in seconds to start the animation + property Delay: Double read FDelay write SetDelay stored IsDelayStored; + /// Duration in seconds + property Duration: Double read GetDuration; + /// Enables the animation to run automatically (in the next control's paint). + property Enabled: Boolean read FEnabled write SetEnabled default DefaultEnabled; + property Inverse: Boolean read FInverse write FInverse default DefaultInverse; + property Loop: Boolean read FLoop write SetLoop default DefaultLoop; + property Pause: Boolean read FPause write SetPause default DefaultPause; + /// Normalized CurrentTime (value between 0..1) + property Progress: Double read FProgress write SetProgress stored IsProgressStored; + property Running: Boolean read FRunning; + property Speed: Double read FSpeed write SetSpeed stored IsSpeedStored; + property StartFromCurrent: Boolean read FStartFromCurrent write FStartFromCurrent default DefaultStartFromCurrent; + property StartProgress: Double read FStartProgress write SetStartProgress stored IsStartProgressStored; + property StopProgress: Double read FStopProgress write SetStopProgress stored IsStopProgressStored; + end; + TSkAnimationDrawEvent = procedure(ASender: TObject; const ACanvas: ISkCanvas; const ADest: TRectF; const AProgress: Double; const AOpacity: Single) of object; TSkAnimationDrawProc = reference to procedure(const ACanvas: ISkCanvas; const ADest: TRectF; const AProgress: Double; const AOpacity: Single); { TSkCustomAnimatedControl } TSkCustomAnimatedControl = class abstract(TSkCustomWinControl) - public - const - DefaultFPS = 60; - MinFPS = 60; + protected type + TAnimationBase = class(TSkCustomAnimation) + strict private + FInsideDoProcess: Boolean; + protected + procedure DoChanged; override; + procedure DoFinish; override; + procedure DoProcess; override; + procedure DoStart; override; + end; strict private - FAbsoluteShowing: Boolean; - FAbsoluteShowingCached: Boolean; - FAnimation: TTimer; - FAnimationStartTickCount: Cardinal; - FFixedProgress: Boolean; - FFPS: Double; - FIsStaticImage: Boolean; - FLoop: Boolean; + FAbsoluteVisible: Boolean; + FAbsoluteVisibleCached: Boolean; FOnAnimationDraw: TSkAnimationDrawEvent; - FOnAnimationFinished: TNotifyEvent; - FOnAnimationProgress: TNotifyEvent; + FOnAnimationFinish: TNotifyEvent; + FOnAnimationProcess: TNotifyEvent; FOnAnimationStart: TNotifyEvent; - FProgress: Double; - FProgressChangedManually: Boolean; - FSuccessRepaint: Boolean; - procedure AnimationTimer(ASender: TObject); - procedure CMEnabledChanged(var AMessage: TMessage); message CM_ENABLEDCHANGED; + procedure CheckAbsoluteVisible; + procedure CheckDuration; + {$IF CompilerVersion >= 34} + procedure CMParentVisibleChanged(var AMessage: TMessage); message CM_PARENTVISIBLECHANGED; + {$ELSE} procedure CMShowingChanged(var AMessage: TMessage); message CM_SHOWINGCHANGED; + {$ENDIF} procedure CMVisibleChanged(var AMessage: TMessage); message CM_VISIBLECHANGED; - function GetAbsoluteShowing: Boolean; - function GetRunningAnimation: Boolean; - procedure SetFixedProgress(const AValue: Boolean); - procedure SetFPS(const AValue: Double); - procedure SetIsStaticImage(const AValue: Boolean); - procedure SetLoop(const AValue: Boolean); + function GetAbsoluteVisible: Boolean; procedure SetOnAnimationDraw(const AValue: TSkAnimationDrawEvent); - procedure SetProgress(AValue: Double); strict protected + FAnimation: TAnimationBase; function CanRunAnimation: Boolean; virtual; procedure CheckAnimation; - procedure DoAnimationFinished; virtual; - procedure DoAnimationProgress; virtual; + function CreateAnimation: TAnimationBase; virtual; abstract; + procedure DoAnimationChanged; virtual; + procedure DoAnimationFinish; virtual; + procedure DoAnimationProcess; virtual; procedure DoAnimationStart; virtual; procedure Draw(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); override; - function GetDuration: Double; virtual; abstract; + procedure ReadState(AReader: TReader); override; procedure RenderFrame(const ACanvas: ISkCanvas; const ADest: TRectF; const AProgress: Double; const AOpacity: Single); virtual; - property AbsoluteShowing: Boolean read GetAbsoluteShowing; - property Duration: Double read GetDuration; - property FixedProgress: Boolean read FFixedProgress write SetFixedProgress; - property FPS: Double read FFPS write SetFPS; - property IsStaticImage: Boolean read FIsStaticImage write SetIsStaticImage; - property Progress: Double read FProgress write SetProgress; - property Loop: Boolean read FLoop write SetLoop; + property AbsoluteVisible: Boolean read GetAbsoluteVisible; property OnAnimationDraw: TSkAnimationDrawEvent read FOnAnimationDraw write SetOnAnimationDraw; - property OnAnimationFinished: TNotifyEvent read FOnAnimationFinished write FOnAnimationFinished; - property OnAnimationProgress: TNotifyEvent read FOnAnimationProgress write FOnAnimationProgress; + property OnAnimationFinish: TNotifyEvent read FOnAnimationFinish write FOnAnimationFinish; + property OnAnimationProcess: TNotifyEvent read FOnAnimationProcess write FOnAnimationProcess; property OnAnimationStart: TNotifyEvent read FOnAnimationStart write FOnAnimationStart; - property RunningAnimation: Boolean read GetRunningAnimation; public constructor Create(AOwner: TComponent); override; + destructor Destroy; override; end; { TSkAnimatedPaintBox } TSkAnimatedPaintBox = class(TSkCustomAnimatedControl) - strict private - const + public type + { TAnimation } + + TAnimation = class(TAnimationBase) + protected const DefaultDuration = 1; + strict private + function IsDurationStored: Boolean; + strict protected + procedure DoAssign(ASource: TPersistent); override; + public + constructor Create(const AOwner: TComponent); + function Equals(AObject: TObject): Boolean; override; + published + property AutoReverse; + property Delay; + property Duration: Double read GetDuration write SetDuration stored IsDurationStored; + property Enabled; + property Inverse; + property Loop; + property Progress; + property Speed; + property StartFromCurrent; + property StartProgress; + property StopProgress; + end; strict private - FAnimate: Boolean; - FDuration: Double; - function IsDurationStored: Boolean; - procedure SetAnimate(const AValue: Boolean); - procedure SetDuration(const AValue: Double); + function GetAnimation: TAnimation; + procedure ReadAnimate(AReader: TReader); + procedure ReadDuration(AReader: TReader); + procedure ReadLoop(AReader: TReader); + procedure SetAnimation(const AValue: TAnimation); strict protected - function CanRunAnimation: Boolean; override; - function GetDuration: Double; override; - public - constructor Create(AOwner: TComponent); override; - property FixedProgress; - property Progress; + function CreateAnimation: TSkCustomAnimatedControl.TAnimationBase; override; + procedure DefineProperties(AFiler: TFiler); override; published - property Animate: Boolean read FAnimate write SetAnimate default True; - property Duration: Double read FDuration write SetDuration stored IsDurationStored; - property Loop default True; + property Animation: TAnimation read GetAnimation write SetAnimation; property OnAnimationDraw; + property OnAnimationFinish; + property OnAnimationProcess; + property OnAnimationStart; + end; + + { TSkAnimatedPaintBoxHelper } + + TSkAnimatedPaintBoxHelper = class helper for TSkAnimatedPaintBox + strict protected + function RunningAnimation: Boolean; deprecated 'Use Animation.Running instead'; + public + function Animate: Boolean; deprecated 'Use Animation.Enabled instead'; + function Duration: Double; deprecated 'Use Animation.Duration instead'; + function FixedProgress: Boolean; deprecated 'Use Animation.Enabled instead'; + function Loop: Boolean; deprecated 'Use Animation.Loop instead'; + function Progress: Double; deprecated 'Use Animation.Progress instead'; end; TSkAnimatedImageWrapMode = (Fit, FitCrop, Original, OriginalCenter, Place, Stretch); @@ -363,71 +569,93 @@ TSkAnimatedPaintBox = class(TSkCustomAnimatedControl) { TSkAnimatedImage } TSkAnimatedImage = class(TSkCustomAnimatedControl) - public - type - { TSource } - - TSource = class(TPersistent) - strict private - FData: TBytes; - FOnChange: TNotifyEvent; - procedure SetData(const AValue: TBytes); - public - constructor Create(const AOnChange: TNotifyEvent); - procedure Assign(ASource: TPersistent); override; - function Equals(AObject: TObject): Boolean; override; - property Data: TBytes read FData write SetData; - end; + public type + { TAnimation } + + TAnimation = class(TAnimationBase) + published + property AutoReverse; + property Delay; + property Duration; + property Enabled; + property Inverse; + property Loop; + property Progress; + property Speed; + property StartFromCurrent; + property StartProgress; + property StopProgress; + end; - { TFormatInfo } + { TSource } + + TSource = class(TPersistent) + public type + TChangeProc = procedure of object; + strict private + FData: TBytes; + FOnChange: TChangeProc; + procedure SetData(const AValue: TBytes); + public + constructor Create(const AOnChange: TChangeProc); + procedure Assign(ASource: TPersistent); override; + function Equals(AObject: TObject): Boolean; override; + property Data: TBytes read FData write SetData; + end; - TFormatInfo = record - Description: string; - Extensions: TArray; - Name: string; - constructor Create(const AName, ADescription: string; const AExtensions: TArray); - end; + { TFormatInfo } - { TAnimationCodec } - - TAnimationCodec = class - strict protected - function GetDuration: Double; virtual; abstract; - function GetFPS: Double; virtual; abstract; - function GetIsStatic: Boolean; virtual; abstract; - function GetSize: TSizeF; virtual; abstract; - public - procedure Render(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); virtual; abstract; - procedure SeekFrameTime(const ATime: Double); virtual; abstract; - class function SupportedFormats: TArray; virtual; abstract; - class function TryDetectFormat(const ABytes: TBytes; out AFormat: TFormatInfo): Boolean; virtual; abstract; - class function TryMakeFromStream(const AStream: TStream; out ACodec: TAnimationCodec): Boolean; virtual; abstract; - property Duration: Double read GetDuration; - property FPS: Double read GetFPS; - property IsStatic: Boolean read GetIsStatic; - property Size: TSizeF read GetSize; - end; + TFormatInfo = record + Description: string; + Extensions: TArray; + Name: string; + constructor Create(const AName, ADescription: string; const AExtensions: TArray); + end; - TAnimationCodecClass = class of TAnimationCodec; - strict private - class var - FRegisteredCodecs: TArray; + { TAnimationCodec } + + TAnimationCodec = class + strict protected + function GetDuration: Double; virtual; abstract; + function GetFPS: Double; virtual; abstract; + function GetIsStatic: Boolean; virtual; abstract; + function GetSize: TSizeF; virtual; abstract; + public + procedure Render(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); virtual; abstract; + procedure SeekFrameTime(const ATime: Double); virtual; abstract; + class function SupportedFormats: TArray; virtual; abstract; + class function TryDetectFormat(const ABytes: TBytes; out AFormat: TFormatInfo): Boolean; virtual; abstract; + class function TryMakeFromStream(const AStream: TStream; out ACodec: TAnimationCodec): Boolean; virtual; abstract; + property Duration: Double read GetDuration; + property FPS: Double read GetFPS; + property IsStatic: Boolean read GetIsStatic; + property Size: TSizeF read GetSize; + end; + + TAnimationCodecClass = class of TAnimationCodec; + strict private class var + FRegisteredCodecs: TArray; strict private FCodec: TAnimationCodec; FSource: TSource; FWrapMode: TSkAnimatedImageWrapMode; + function GetAnimation: TAnimation; function GetOriginalSize: TSizeF; procedure ReadData(AStream: TStream); + procedure ReadLoop(AReader: TReader); + procedure ReadOnAnimationFinished(AReader: TReader); + procedure ReadOnAnimationProgress(AReader: TReader); + procedure SetAnimation(const AValue: TAnimation); procedure SetSource(const AValue: TSource); procedure SetWrapMode(const AValue: TSkAnimatedImageWrapMode); - procedure SourceChange(ASender: TObject); procedure WriteData(AStream: TStream); strict protected - function CanRunAnimation: Boolean; override; + function CreateAnimation: TSkCustomAnimatedControl.TAnimationBase; override; procedure DefineProperties(AFiler: TFiler); override; procedure Draw(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); override; - function GetDuration: Double; override; procedure RenderFrame(const ACanvas: ISkCanvas; const ADest: TRectF; const AProgress: Double; const AOpacity: Single); override; + procedure SourceChange; virtual; + property Codec: TAnimationCodec read FCodec; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -435,75 +663,42 @@ TAnimationCodecClass = class of TAnimationCodec; procedure LoadFromStream(const AStream: TStream); class procedure RegisterCodec(const ACodecClass: TAnimationCodecClass); static; class property RegisteredCodecs: TArray read FRegisteredCodecs; - property FixedProgress; property OriginalSize: TSizeF read GetOriginalSize; - property Progress; - property RunningAnimation; published - property Loop default True; + property Animation: TAnimation read GetAnimation write SetAnimation; property Source: TSource read FSource write SetSource; property WrapMode: TSkAnimatedImageWrapMode read FWrapMode write SetWrapMode default TSkAnimatedImageWrapMode.Fit; property OnAnimationDraw; - property OnAnimationFinished; - property OnAnimationProgress; + property OnAnimationFinish; + property OnAnimationProcess; property OnAnimationStart; end; - { TSkPersistentData } + { TSkAnimatedImageHelper } - TSkPersistentData = class(TPersistent) - strict private - FChanged: Boolean; - FCreated: Boolean; - FIgnoringAllChanges: Boolean; - FOnChange: TNotifyEvent; - FUpdatingCount: Integer; - function GetUpdating: Boolean; - protected - procedure DoAssign(ASource: TPersistent); virtual; - procedure DoChanged; virtual; - function GetHasChanged: Boolean; virtual; - procedure SetValue(var AField: Byte; const AValue: Byte); overload; - procedure SetValue(var AField: Word; const AValue: Word); overload; - procedure SetValue(var AField: Cardinal; const AValue: Cardinal); overload; - procedure SetValue(var AField: Boolean; const AValue: Boolean); overload; - procedure SetValue(var AField: Integer; const AValue: Integer); overload; - procedure SetValue(var AField: Int64; const AValue: Int64); overload; - procedure SetValue(var AField: Single; const AValue: Single; const AEpsilon: Single = 0.0); overload; - procedure SetValue(var AField: Double; const AValue: Double; const AEpsilon: Double = 0.0); overload; - procedure SetValue(var AField: TBytes; const AValue: TBytes); overload; - procedure SetValue(var AField: string; const AValue: string); overload; - procedure SetValue(var AField: T; const AValue: T); overload; - property Created: Boolean read FCreated; - property UpdatingCount: Integer read FUpdatingCount; + TSkAnimatedImageHelper = class helper for TSkAnimatedImage + strict protected + function Duration: Double; deprecated 'Use Animation.Duration instead'; public - procedure AfterConstruction; override; - procedure Assign(ASource: TPersistent); override; final; - procedure BeginUpdate; overload; - procedure BeginUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; - procedure Change; virtual; - procedure EndUpdate; overload; - procedure EndUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; - property HasChanged: Boolean read GetHasChanged; - property Updating: Boolean read GetUpdating; - property OnChange: TNotifyEvent read FOnChange write FOnChange; + function FixedProgress: Boolean; deprecated 'Use Animation.Enabled instead'; + function Loop: Boolean; deprecated 'Use Animation.Loop instead'; + function Progress: Double; deprecated 'Use Animation.Progress instead'; + function RunningAnimation: Boolean; deprecated 'Use Animation.Running instead'; end; { TSkFontComponent } - TSkFontComponent = class(TSkPersistentData) - public - type - TSkFontSlant = (Regular, Italic, Oblique); - TSkFontStretch = (UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, Regular, SemiExpanded, Expanded, ExtraExpanded, UltraExpanded); - TSkFontWeight = (Thin, UltraLight, Light, SemiLight, Regular, Medium, Semibold, Bold, UltraBold, Black, UltraBlack); - strict protected - const - DefaultFamilies = ''; - DefaultSize = 14; - DefaultSlant = TSkFontSlant.Regular; - DefaultStretch = TSkFontStretch.Regular; - DefaultWeight = TSkFontWeight.Regular; + TSkFontComponent = class(TSkPersistent) + public type + TSkFontSlant = (Regular, Italic, Oblique); + TSkFontStretch = (UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, Regular, SemiExpanded, Expanded, ExtraExpanded, UltraExpanded); + TSkFontWeight = (Thin, UltraLight, Light, SemiLight, Regular, Medium, Semibold, Bold, UltraBold, Black, UltraBlack); + strict protected const + DefaultFamilies = ''; + DefaultSize = 14; + DefaultSlant = TSkFontSlant.Regular; + DefaultStretch = TSkFontStretch.Regular; + DefaultWeight = TSkFontWeight.Regular; strict private FFamilies: string; FSize: Single; @@ -539,52 +734,50 @@ TSkFontComponent = class(TSkPersistentData) { TSkTextSettings } - TSkTextSettings = class(TSkPersistentData) - public - type - { TDecorations } - - TDecorations = class(TSkPersistentData) - strict protected - const - DefaultColor = TAlphaColors.Null; - DefaultDecorations = []; - DefaultStrokeColor = TAlphaColors.Null; - DefaultStyle = TSkTextDecorationStyle.Solid; - DefaultThickness = 1; - strict private - FColor: TAlphaColor; - FDecorations: TSkTextDecorations; - FStrokeColor: TAlphaColor; - FStyle: TSkTextDecorationStyle; - FThickness: Single; - procedure SetColor(const AValue: TAlphaColor); - procedure SetDecorations(const AValue: TSkTextDecorations); - procedure SetStrokeColor(const AValue: TAlphaColor); - procedure SetStyle(const AValue: TSkTextDecorationStyle); - procedure SetThickness(const AValue: Single); - strict protected - procedure DoAssign(ASource: TPersistent); override; - function IsThicknessStored: Boolean; virtual; - public - constructor Create; - function Equals(AObject: TObject): Boolean; override; - published - property Color: TAlphaColor read FColor write SetColor default DefaultColor; - property Decorations: TSkTextDecorations read FDecorations write SetDecorations default DefaultDecorations; - property StrokeColor: TAlphaColor read FStrokeColor write SetStrokeColor default DefaultStrokeColor; - property Style: TSkTextDecorationStyle read FStyle write SetStyle default DefaultStyle; - property Thickness: Single read FThickness write SetThickness stored IsThicknessStored; - end; - strict protected - const - DefaultFontColor = TAlphaColors.Black; - DefaultHeightMultiplier = 0; - DefaultHorzAlign = TSkTextHorzAlign.Leading; - DefaultLetterSpacing = 0; - DefaultMaxLines = 1; - DefaultTrimming = TSkTextTrimming.Word; - DefaultVertAlign = TSkTextVertAlign.Center; + TSkTextSettings = class(TSkPersistent) + public type + { TDecorations } + + TDecorations = class(TSkPersistent) + strict protected + const + DefaultColor = TAlphaColors.Null; + DefaultDecorations = []; + DefaultStrokeColor = TAlphaColors.Null; + DefaultStyle = TSkTextDecorationStyle.Solid; + DefaultThickness = 1; + strict private + FColor: TAlphaColor; + FDecorations: TSkTextDecorations; + FStrokeColor: TAlphaColor; + FStyle: TSkTextDecorationStyle; + FThickness: Single; + procedure SetColor(const AValue: TAlphaColor); + procedure SetDecorations(const AValue: TSkTextDecorations); + procedure SetStrokeColor(const AValue: TAlphaColor); + procedure SetStyle(const AValue: TSkTextDecorationStyle); + procedure SetThickness(const AValue: Single); + strict protected + procedure DoAssign(ASource: TPersistent); override; + function IsThicknessStored: Boolean; virtual; + public + constructor Create; + function Equals(AObject: TObject): Boolean; override; + published + property Color: TAlphaColor read FColor write SetColor default DefaultColor; + property Decorations: TSkTextDecorations read FDecorations write SetDecorations default DefaultDecorations; + property StrokeColor: TAlphaColor read FStrokeColor write SetStrokeColor default DefaultStrokeColor; + property Style: TSkTextDecorationStyle read FStyle write SetStyle default DefaultStyle; + property Thickness: Single read FThickness write SetThickness stored IsThicknessStored; + end; + strict protected const + DefaultFontColor = TAlphaColors.Black; + DefaultHeightMultiplier = 0; + DefaultHorzAlign = TSkTextHorzAlign.Leading; + DefaultLetterSpacing = 0; + DefaultMaxLines = 1; + DefaultTrimming = TSkTextTrimming.Word; + DefaultVertAlign = TSkTextVertAlign.Center; strict private FDecorations: TDecorations; FFont: TSkFontComponent; @@ -650,26 +843,25 @@ TSkTextSettingsClass = class of TSkTextSettings; { TSkTextSettingsInfo } TSkTextSettingsInfo = class(TPersistent) - public - type - TBaseTextSettings = class(TSkTextSettings) - strict private - [unsafe] FControl: TControl; - [unsafe] FInfo: TSkTextSettingsInfo; - public - constructor Create(const AOwner: TPersistent); override; - property Control: TControl read FControl; - property Info: TSkTextSettingsInfo read FInfo; - end; + public type + TBaseTextSettings = class(TSkTextSettings) + strict private + [unsafe] FControl: TControl; + [unsafe] FInfo: TSkTextSettingsInfo; + public + constructor Create(const AOwner: TPersistent); override; + property Control: TControl read FControl; + property Info: TSkTextSettingsInfo read FInfo; + end; - TCustomTextSettings = class(TBaseTextSettings) - public - constructor Create(const AOwner: TPersistent); override; - published - property MaxLines default 0; - end; + TCustomTextSettings = class(TBaseTextSettings) + public + constructor Create(const AOwner: TPersistent); override; + published + property MaxLines default 0; + end; - TCustomTextSettingsClass = class of TCustomTextSettings; + TCustomTextSettingsClass = class of TCustomTextSettings; strict private FDefaultTextSettings: TSkTextSettings; FDesign: Boolean; @@ -706,151 +898,150 @@ TCustomTextSettingsClass = class of TCustomTextSettings; { TSkLabel } TSkLabel = class(TSkCustomControl, ISkTextSettings) - public - type - TWordsCollection = class; - TCustomWordsItemClass = class of TCustomWordsItem; - - TCustomWordsItem = class(TCollectionItem) - strict protected - const - DefaultBackgroundColor = TAlphaColors.Null; - DefaultCaption = ''; - DefaultCursor = crDefault; - DefaultFontColor = TAlphaColors.Black; - DefaultHeightMultiplier = 0; - DefaultLetterSpacing = 0; - DefaultName = 'Item 0'; - strict private - FBackgroundColor: TAlphaColor; - FCaption: string; - FChanged: Boolean; - FCursor: TCursor; - FIgnoringAllChanges: Boolean; - FName: string; - FOnClick: TNotifyEvent; - FTag: NativeInt; - FTagFloat: Single; - [Weak] FTagObject: TObject; - FTagString: string; - FTextSettingsInfo: TSkTextSettingsInfo; - FUpdatingCount: Integer; - [unsafe] FWords: TWordsCollection; - procedure CheckName(const AName: string; AWordsCollection: TWordsCollection); - function GetDecorations: TSkTextSettings.TDecorations; - function GetFont: TSkFontComponent; - function GetFontColor: TAlphaColor; - function GetHeightMultiplier: Single; - function GetLetterSpacing: Single; - function GetStyledSettings: TSkStyledSettings; - function IsCaptionStored: Boolean; - function IsFontColorStored: Boolean; - function IsHeightMultiplierStored: Boolean; - function IsLetterSpacingStored: Boolean; - function IsNameStored: Boolean; - function IsStyledSettingsStored: Boolean; - procedure TextSettingsChange(ASender: TObject); - procedure SetBackgroundColor(const AValue: TAlphaColor); - procedure SetCaption(const AValue: string); - procedure SetCursor(const AValue: TCursor); - procedure SetDecorations(const AValue: TSkTextSettings.TDecorations); - procedure SetFont(const AValue: TSkFontComponent); - procedure SetFontColor(const AValue: TAlphaColor); - procedure SetHeightMultiplier(const AValue: Single); - procedure SetLetterSpacing(const AValue: Single); - procedure SetName(const AValue: string); - procedure SetStyledSettings(const AValue: TSkStyledSettings); - function UniqueName(const AName: string; const ACollection: TCollection): string; - strict protected - procedure DoAssign(ASource: TPersistent); virtual; - procedure DoChanged; virtual; - function GetDisplayName: string; override; - procedure SetCollection(AValue: TCollection); override; - public - constructor Create(ACollection: TCollection); override; - destructor Destroy; override; - procedure Assign(ASource: TPersistent); override; final; - procedure BeginUpdate; overload; - procedure Change; virtual; - procedure EndUpdate; overload; - procedure EndUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; - property BackgroundColor: TAlphaColor read FBackgroundColor write SetBackgroundColor default DefaultBackgroundColor; - property Caption: string read FCaption write SetCaption stored IsCaptionStored; - property Cursor: TCursor read FCursor write SetCursor default crDefault; - property Decorations: TSkTextSettings.TDecorations read GetDecorations write SetDecorations; - property Font: TSkFontComponent read GetFont write SetFont; - property FontColor: TAlphaColor read GetFontColor write SetFontColor stored IsFontColorStored; - property HeightMultiplier: Single read GetHeightMultiplier write SetHeightMultiplier stored IsHeightMultiplierStored; - property LetterSpacing: Single read GetLetterSpacing write SetLetterSpacing stored IsLetterSpacingStored; - /// The case-insensitive name of the item in the collection. This field cannot be empty and must be unique for his collection - property Name: string read FName write SetName stored IsNameStored; - property StyledSettings: TSkStyledSettings read GetStyledSettings write SetStyledSettings stored IsStyledSettingsStored; - property Tag: NativeInt read FTag write FTag default 0; - property TagFloat: Single read FTagFloat write FTagFloat; - property TagObject: TObject read FTagObject write FTagObject; - property TagString: string read FTagString write FTagString; - property Words: TWordsCollection read FWords; - property OnClick: TNotifyEvent read FOnClick write FOnClick; - end; + public type + TWordsCollection = class; + TCustomWordsItemClass = class of TCustomWordsItem; + + TCustomWordsItem = class(TCollectionItem) + strict protected + const + DefaultBackgroundColor = TAlphaColors.Null; + DefaultCaption = ''; + DefaultCursor = crDefault; + DefaultFontColor = TAlphaColors.Black; + DefaultHeightMultiplier = 0; + DefaultLetterSpacing = 0; + DefaultName = 'Item 0'; + strict private + FBackgroundColor: TAlphaColor; + FCaption: string; + FChanged: Boolean; + FCursor: TCursor; + FIgnoringAllChanges: Boolean; + FName: string; + FOnClick: TNotifyEvent; + FTag: NativeInt; + FTagFloat: Single; + [Weak] FTagObject: TObject; + FTagString: string; + FTextSettingsInfo: TSkTextSettingsInfo; + FUpdatingCount: Integer; + [unsafe] FWords: TWordsCollection; + procedure CheckName(const AName: string; AWordsCollection: TWordsCollection); + function GetDecorations: TSkTextSettings.TDecorations; + function GetFont: TSkFontComponent; + function GetFontColor: TAlphaColor; + function GetHeightMultiplier: Single; + function GetLetterSpacing: Single; + function GetStyledSettings: TSkStyledSettings; + function IsCaptionStored: Boolean; + function IsFontColorStored: Boolean; + function IsHeightMultiplierStored: Boolean; + function IsLetterSpacingStored: Boolean; + function IsNameStored: Boolean; + function IsStyledSettingsStored: Boolean; + procedure TextSettingsChange(ASender: TObject); + procedure SetBackgroundColor(const AValue: TAlphaColor); + procedure SetCaption(const AValue: string); + procedure SetCursor(const AValue: TCursor); + procedure SetDecorations(const AValue: TSkTextSettings.TDecorations); + procedure SetFont(const AValue: TSkFontComponent); + procedure SetFontColor(const AValue: TAlphaColor); + procedure SetHeightMultiplier(const AValue: Single); + procedure SetLetterSpacing(const AValue: Single); + procedure SetName(const AValue: string); + procedure SetStyledSettings(const AValue: TSkStyledSettings); + function UniqueName(const AName: string; const ACollection: TCollection): string; + strict protected + procedure DoAssign(ASource: TPersistent); virtual; + procedure DoChanged; virtual; + function GetDisplayName: string; override; + procedure SetCollection(AValue: TCollection); override; + public + constructor Create(ACollection: TCollection); override; + destructor Destroy; override; + procedure Assign(ASource: TPersistent); override; final; + procedure BeginUpdate; overload; + procedure Change; virtual; + procedure EndUpdate; overload; + procedure EndUpdate(const AIgnoreAllChanges: Boolean); overload; virtual; + property BackgroundColor: TAlphaColor read FBackgroundColor write SetBackgroundColor default DefaultBackgroundColor; + property Caption: string read FCaption write SetCaption stored IsCaptionStored; + property Cursor: TCursor read FCursor write SetCursor default crDefault; + property Decorations: TSkTextSettings.TDecorations read GetDecorations write SetDecorations; + property Font: TSkFontComponent read GetFont write SetFont; + property FontColor: TAlphaColor read GetFontColor write SetFontColor stored IsFontColorStored; + property HeightMultiplier: Single read GetHeightMultiplier write SetHeightMultiplier stored IsHeightMultiplierStored; + property LetterSpacing: Single read GetLetterSpacing write SetLetterSpacing stored IsLetterSpacingStored; + /// The case-insensitive name of the item in the collection. This field cannot be empty and must be unique for his collection + property Name: string read FName write SetName stored IsNameStored; + property StyledSettings: TSkStyledSettings read GetStyledSettings write SetStyledSettings stored IsStyledSettingsStored; + property Tag: NativeInt read FTag write FTag default 0; + property TagFloat: Single read FTagFloat write FTagFloat; + property TagObject: TObject read FTagObject write FTagObject; + property TagString: string read FTagString write FTagString; + property Words: TWordsCollection read FWords; + property OnClick: TNotifyEvent read FOnClick write FOnClick; + end; - { TWordsCollection } - - TWordsCollection = class(TOwnedCollection) - strict protected - const - DefaultColor = TAlphaColors.Black; - DefaultFontSize = 14; - DefaultFontSlant = TSkFontComponent.TSkFontSlant.Regular; - DefaultFontWeight = TSkFontComponent.TSkFontWeight.Regular; - strict private - [unsafe] FLabel: TSkLabel; - FOnChange: TNotifyEvent; - function GetItem(AIndex: Integer): TCustomWordsItem; - function GetItemByName(const AName: string): TCustomWordsItem; - procedure SetItem(AIndex: Integer; const AValue: TCustomWordsItem); - strict protected - procedure Update(AItem: TCollectionItem); override; - public - constructor Create(AOwner: TPersistent; AItemClass: TCustomWordsItemClass); - function Add: TCustomWordsItem; overload; - function Add(const ACaption: string; const AColor: TAlphaColor = DefaultColor; - const AFontSize: Single = DefaultFontSize; - const AFontWeight: TSkFontComponent.TSkFontWeight = DefaultFontWeight; - const AFontSlant: TSkFontComponent.TSkFontSlant = DefaultFontSlant): TCustomWordsItem; overload; - function AddOrSet(const AName, ACaption: string; const AFontColor: TAlphaColor = DefaultColor; - const AFont: TSkFontComponent = nil; const AOnClick: TNotifyEvent = nil; - const ACursor: TCursor = crDefault): TCustomWordsItem; - function Insert(AIndex: Integer): TCustomWordsItem; - /// Case-insensitive search of item by name - function IndexOf(const AName: string): Integer; - /// Case-insensitive search of item by name - property ItemByName[const AName: string]: TCustomWordsItem read GetItemByName; - property Items[AIndex: Integer]: TCustomWordsItem read GetItem write SetItem; default; - property &Label: TSkLabel read FLabel; - property OnChange: TNotifyEvent read FOnChange write FOnChange; - end; + { TWordsCollection } + + TWordsCollection = class(TOwnedCollection) + strict protected + const + DefaultColor = TAlphaColors.Black; + DefaultFontSize = 14; + DefaultFontSlant = TSkFontComponent.TSkFontSlant.Regular; + DefaultFontWeight = TSkFontComponent.TSkFontWeight.Regular; + strict private + [unsafe] FLabel: TSkLabel; + FOnChange: TNotifyEvent; + function GetItem(AIndex: Integer): TCustomWordsItem; + function GetItemByName(const AName: string): TCustomWordsItem; + procedure SetItem(AIndex: Integer; const AValue: TCustomWordsItem); + strict protected + procedure Update(AItem: TCollectionItem); override; + public + constructor Create(AOwner: TPersistent; AItemClass: TCustomWordsItemClass); + function Add: TCustomWordsItem; overload; + function Add(const ACaption: string; const AColor: TAlphaColor = DefaultColor; + const AFontSize: Single = DefaultFontSize; + const AFontWeight: TSkFontComponent.TSkFontWeight = DefaultFontWeight; + const AFontSlant: TSkFontComponent.TSkFontSlant = DefaultFontSlant): TCustomWordsItem; overload; + function AddOrSet(const AName, ACaption: string; const AFontColor: TAlphaColor = DefaultColor; + const AFont: TSkFontComponent = nil; const AOnClick: TNotifyEvent = nil; + const ACursor: TCursor = crDefault): TCustomWordsItem; + function Insert(AIndex: Integer): TCustomWordsItem; + /// Case-insensitive search of item by name + function IndexOf(const AName: string): Integer; + /// Case-insensitive search of item by name + property ItemByName[const AName: string]: TCustomWordsItem read GetItemByName; + property Items[AIndex: Integer]: TCustomWordsItem read GetItem write SetItem; default; + property &Label: TSkLabel read FLabel; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; - { TWordsItem } - - TWordsItem = class(TCustomWordsItem) - published - property BackgroundColor; - property Caption; - property Cursor; - property Decorations; - property Font; - property FontColor; - property HeightMultiplier; - property LetterSpacing; - property Name; - property StyledSettings; - property TagString; - property OnClick; - end; + { TWordsItem } + + TWordsItem = class(TCustomWordsItem) + published + property BackgroundColor; + property Caption; + property Cursor; + property Decorations; + property Font; + property FontColor; + property HeightMultiplier; + property LetterSpacing; + property Name; + property StyledSettings; + property TagString; + property OnClick; + end; - { TItemClickedMessage } + { TItemClickedMessage } - TItemClickedMessage = class(TMessage); + TItemClickedMessage = class(TMessage); strict private FBackgroundPicture: ISkPicture; FClickedPosition: TPoint; @@ -873,6 +1064,7 @@ TItemClickedMessage = class(TMessage); procedure DeleteParagraph; function GetCaption: string; procedure GetFitSize(var AWidth, AHeight: Single); + function GetLinesCount: Integer; function GetParagraph: ISkParagraph; function GetParagraphBounds: TRectF; function HasFitSizeChanged: Boolean; @@ -905,8 +1097,10 @@ TItemClickedMessage = class(TMessage); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; + function DidExceedMaxLines: Boolean; function UseRightToLeftAlignment: Boolean; override; property DefaultTextSettings: TSkTextSettings read GetDefaultTextSettings; + property LinesCount: Integer read GetLinesCount; property ResultingTextSettings: TSkTextSettings read GetResultingTextSettings; published property AutoSize default True; @@ -917,18 +1111,33 @@ TItemClickedMessage = class(TMessage); property Words: TWordsCollection read FWords write SetWords; end; - { TSkTypefaceManager } + { TSkDefaultProviders } - TSkTypefaceManager = class sealed - strict private - class var FProvider: ISkTypefaceFontProvider; + TSkDefaultProviders = class sealed + strict private class var + FResource: ISkResourceProvider; + FTypefaceFont: ISkTypefaceFontProvider; class constructor Create; public class procedure RegisterTypeface(const AFileName: string); overload; static; class procedure RegisterTypeface(const AStream: TStream); overload; static; - class property Provider: ISkTypefaceFontProvider read FProvider; + class property Resource: ISkResourceProvider read FResource write FResource; + class property TypefaceFont: ISkTypefaceFontProvider read FTypefaceFont; + end; + + { TSkTypefaceManager } + + TSkTypefaceManager = class sealed + public + class function Provider: ISkTypefaceFontProvider; static; deprecated 'Use TSkDefaultProviders.TypefaceFont instead'; + class procedure RegisterTypeface(const AFileName: string); overload; static; deprecated 'Use TSkDefaultProviders.RegisterTypeface instead'; + class procedure RegisterTypeface(const AStream: TStream); overload; static; deprecated 'Use TSkDefaultProviders.RegisterTypeface instead'; end; +function BitmapToSkImage(const ABitmap: TBitmap): ISkImage; +procedure SkiaDraw(const ABitmap: TBitmap; const AProc: TSkDrawProc; const AStartClean: Boolean = True); +function SkImageToBitmap(const AImage: ISkImage): TBitmap; + const AllStyledSettings: TSkStyledSettings = [TSkStyledSetting.Family, TSkStyledSetting.Size, TSkStyledSetting.Style, TSkStyledSetting.FontColor, TSkStyledSetting.Other]; @@ -941,7 +1150,7 @@ implementation uses { Delphi } - System.Math, + Winapi.MMSystem, System.Math.Vectors, System.ZLib, System.IOUtils, @@ -1082,6 +1291,11 @@ TSkRectFHelper = record helper for TRectF function RectCenter(var R: TRectF; const Bounds: TRectF): TRectF; forward; {$ENDIF} +function BitmapToSkImage(const ABitmap: TBitmap): ISkImage; +begin + Result := ABitmap.ToSkImage; +end; + function IsSameBytes(const ALeft, ARight: TBytes): Boolean; begin Result := (ALeft = ARight) or @@ -1097,6 +1311,16 @@ function PlaceIntoTopLeft(const ASourceRect, ADesignatedArea: TRectF): TRectF; Result.SetLocation(ADesignatedArea.TopLeft); end; +procedure SkiaDraw(const ABitmap: TBitmap; const AProc: TSkDrawProc; const AStartClean: Boolean); +begin + ABitmap.SkiaDraw(AProc, AStartClean); +end; + +function SkImageToBitmap(const AImage: ISkImage): TBitmap; +begin + Result := TBitmap.CreateFromSkImage(AImage); +end; + {$IF CompilerVersion < 32} { TSkRectFHelper } @@ -1138,8 +1362,34 @@ function RectCenter(var R: TRectF; const Bounds: TRectF): TRectF; end; {$ENDIF} +type + TBitmapImageAccess = class(TBitmapImage); + { TSkBitmapHelper } +constructor TSkBitmapHelper.CreateFromSkImage(const AImage: ISkImage); +var + LPixels: Pointer; + LStride: Integer; +begin + Assert(Assigned(AImage)); + Create; + PixelFormat := TPixelFormat.pf32bit; + AlphaFormat := TAlphaFormat.afPremultiplied; + SetSize(AImage.Width, AImage.Height); + if not Empty then + begin + LStride := BytesPerScanLine(Width, 32, 32); + GetMem(LPixels, LStride * Height); + try + AImage.ReadPixels(TSkImageInfo.Create(Width, Height), LPixels, LStride); + FlipPixels(Width, Height, LPixels, LStride, ScanLine[Height - 1], LStride); + finally + FreeMem(LPixels); + end; + end; +end; + procedure TSkBitmapHelper.FlipPixels(const AWidth, AHeight: Integer; const ASrcPixels: PByte; const ASrcStride: Integer; const ADestPixels: PByte; const ADestStride: Integer); @@ -1151,7 +1401,23 @@ procedure TSkBitmapHelper.FlipPixels(const AWidth, AHeight: Integer; end; procedure TSkBitmapHelper.SkiaDraw(const AProc: TSkDrawProc; const AStartClean: Boolean); + + procedure ChangePixelFormat; + var + LOriginalSize: TSize; + begin + // Optimization to avoid unnecessary internal conversions of TBitmap as the + // image content will already be discarded. + + LOriginalSize := TSize.Create(Width, Height); + Assign(nil); + PixelFormat := TPixelFormat.pf32bit; + AlphaFormat := TAlphaFormat.afPremultiplied; + SetSize(LOriginalSize.Width, LOriginalSize.Height); + end; + var + LOriginalImage: ISkImage; LPixmap: ISkPixmap; LSurface: ISkSurface; LStride: Integer; @@ -1159,16 +1425,23 @@ procedure TSkBitmapHelper.SkiaDraw(const AProc: TSkDrawProc; const AStartClean: Assert(Assigned(AProc)); if Empty then raise ESkBitmapHelper.Create('Invalid bitmap'); - if not SupportsPartialTransparency then + LOriginalImage := nil; + if (PixelFormat <> TPixelFormat.pf32bit) or (AlphaFormat <> TAlphaFormat.afPremultiplied) then begin - PixelFormat := TPixelFormat.pf32bit; - AlphaFormat := TAlphaFormat.afPremultiplied; + if not AStartClean then + LOriginalImage := ToSkImage; + ChangePixelFormat; end; LStride := BytesPerScanLine(Width, 32, 32); LSurface := TSkSurface.MakeRaster(Width, Height); LPixmap := LSurface.PeekPixels; if AStartClean then LSurface.Canvas.Clear(TAlphaColors.Null) + else if LOriginalImage <> nil then + begin + LSurface.Canvas.Clear(TAlphaColors.Null); + LSurface.Canvas.DrawImage(LOriginalImage, 0, 0); + end else FlipPixels(Width, Height, ScanLine[Height - 1], LStride, LPixmap.Pixels, LPixmap.RowBytes); AProc(LSurface.Canvas); @@ -1176,94 +1449,327 @@ procedure TSkBitmapHelper.SkiaDraw(const AProc: TSkDrawProc; const AStartClean: end; function TSkBitmapHelper.ToSkImage: ISkImage; + + function CodecConvert: ISkImage; + var + LStream: TMemoryStream; + begin + LStream := TMemoryStream.Create; + try + SaveToStream(LStream); + LStream.Position := 0; + Result := TSkImage.MakeFromEncodedStream(LStream); + finally + LStream.Free; + end; + end; + var + LAlphaType: TSkAlphaType; LPixels: Pointer; LStride: Integer; begin if Empty then raise ESkBitmapHelper.Create('Invalid bitmap'); - if not SupportsPartialTransparency then + if PixelFormat = TPixelFormat.pf32bit then begin - PixelFormat := TPixelFormat.pf32bit; - AlphaFormat := TAlphaFormat.afPremultiplied; - end; - LStride := BytesPerScanLine(Width, 32, 32); - GetMem(LPixels, LStride * Height); - try - FlipPixels(Width, Height, ScanLine[Height - 1], LStride, LPixels, LStride); - Result := TSkImage.MakeFromRaster(TSkImageInfo.Create(Width, Height), LPixels, LStride, - procedure (const APixels: Pointer) - begin - FreeMem(APixels); - end); - except - FreeMem(LPixels); - raise; - end; + case AlphaFormat of + TAlphaFormat.afIgnored: LAlphaType := TSkAlphaType.Opaque; + TAlphaFormat.afDefined: LAlphaType := TSkAlphaType.Unpremul; + TAlphaFormat.afPremultiplied: LAlphaType := TSkAlphaType.Premul; + else + LAlphaType := TSkAlphaType.Unknown; + end; + LStride := BytesPerScanLine(Width, 32, 32); + GetMem(LPixels, LStride * Height); + try + FlipPixels(Width, Height, ScanLine[Height - 1], LStride, LPixels, LStride); + Result := TSkImage.MakeFromRaster(TSkImageInfo.Create(Width, Height, SkNative32ColorType, LAlphaType), LPixels, LStride, + procedure (const APixels: Pointer) + begin + FreeMem(APixels); + end); + except + FreeMem(LPixels); + raise; + end; + end + else + Result := CodecConvert; end; -{ TSkCustomControl } +{ TSkPersistent } -{$IF CompilerVersion < 33} -procedure TSkCustomControl.ChangeScale(M, D: Integer); +procedure TSkPersistent.AfterConstruction; begin - if M <> D then - FScaleFactor := FScaleFactor * M / D; inherited; + FCreated := True; end; -{$ENDIF} -constructor TSkCustomControl.Create(AOwner: TComponent); +procedure TSkPersistent.Assign(ASource: TPersistent); begin - inherited; - ControlStyle := ControlStyle + [csReplicatable] - [csOpaque]; - FDrawCacheEnabled := True; - FOpacity := 255; - {$IF CompilerVersion < 33} - FScaleFactor := 1; - {$ENDIF} - Height := 50; - Width := 50; + if ASource <> Self then + begin + BeginUpdate; + try + DoAssign(ASource); + finally + EndUpdate; + end; + end; end; -procedure TSkCustomControl.CreateBuffer(const AMemDC: HDC; out ABuffer: HBITMAP; - out AData: Pointer; out AStride: Integer); -const - ColorMasks: array[0..2] of DWORD = ($00FF0000, $0000FF00, $000000FF); -var - LBitmapInfo: PBitmapInfo; +procedure TSkPersistent.BeginUpdate; begin - AStride := BytesPerScanline(Width, 32, 32); - GetMem(LBitmapInfo, SizeOf(TBitmapInfoHeader) + SizeOf(ColorMasks)); - try - LBitmapInfo.bmiHeader := Default(TBitmapInfoHeader); - LBitmapInfo.bmiHeader.biSize := SizeOf(TBitmapInfoHeader); - LBitmapInfo.bmiHeader.biWidth := Width; - LBitmapInfo.bmiHeader.biHeight := -Height; - LBitmapInfo.bmiHeader.biPlanes := 1; - LBitmapInfo.bmiHeader.biBitCount := 32; - LBitmapInfo.bmiHeader.biCompression := BI_BITFIELDS; - LBitmapInfo.bmiHeader.biSizeImage := AStride * Height; - Move(ColorMasks[0], LBitmapInfo.bmiColors[0], SizeOf(ColorMasks)); - ABuffer := CreateDIBSection(AMemDC, LBitmapInfo^, DIB_RGB_COLORS, AData, 0, 0); - if ABuffer <> 0 then - GdiFlush; - finally - FreeMem(LBitmapInfo); - end; + BeginUpdate(False); end; -procedure TSkCustomControl.DeleteBuffers; +procedure TSkPersistent.BeginUpdate(const AIgnoreAllChanges: Boolean); begin - if FDrawBuffer <> 0 then + Inc(FUpdatingCount); + FIgnoringAllChanges := FIgnoringAllChanges or AIgnoreAllChanges; +end; + +procedure TSkPersistent.Change; +begin + if FUpdatingCount > 0 then + FChanged := True + else begin - FDrawCached := False; - DeleteObject(FDrawBuffer); - FDrawBuffer := 0; + FChanged := False; + DoChanged; end; end; -destructor TSkCustomControl.Destroy; +procedure TSkPersistent.DoAssign(ASource: TPersistent); +begin + inherited Assign(ASource); +end; + +procedure TSkPersistent.DoChanged; +begin + if FCreated and Assigned(FOnChange) then + FOnChange(Self); +end; + +procedure TSkPersistent.EndUpdate; +begin + EndUpdate(False); +end; + +procedure TSkPersistent.EndUpdate(const AIgnoreAllChanges: Boolean); +var + LCallChange: Boolean; + LIgnoreChanges: Boolean; +begin + LIgnoreChanges := AIgnoreAllChanges or FIgnoringAllChanges; + LCallChange := False; + if FUpdatingCount <= 0 then + raise ESkPersistentData.Create('The object is not in update state'); + Dec(FUpdatingCount); + if (not LIgnoreChanges) and HasChanged then + LCallChange := True + else + FChanged := False; + if FUpdatingCount <= 0 then + FIgnoringAllChanges := False; + if LCallChange and (FUpdatingCount = 0) then + begin + FChanged := False; + DoChanged; + end; +end; + +function TSkPersistent.GetHasChanged: Boolean; +begin + Result := FChanged; +end; + +function TSkPersistent.GetUpdating: Boolean; +begin + Result := FUpdatingCount > 0; +end; + +function TSkPersistent.SetValue(var AField: Byte; const AValue: Byte): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Word; const AValue: Word): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Double; const AValue, + AEpsilon: Double): Boolean; +begin + Result := not SameValue(AField, AValue, AEpsilon); + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: TBytes; const AValue: TBytes): Boolean; +begin + Result := not IsSameBytes(AField, AValue); + if Result then + begin + AField := Copy(AValue); + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: string; const AValue: string): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Single; const AValue, + AEpsilon: Single): Boolean; +begin + Result := not SameValue(AField, AValue, AEpsilon); + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Boolean; + const AValue: Boolean): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Cardinal; + const AValue: Cardinal): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Integer; + const AValue: Integer): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: Int64; const AValue: Int64): Boolean; +begin + Result := AField <> AValue; + if Result then + begin + AField := AValue; + Change; + end; +end; + +function TSkPersistent.SetValue(var AField: T; const AValue: T): Boolean; +begin + if Assigned(TypeInfo(T)) and (PTypeInfo(TypeInfo(T)).Kind in [TTypeKind.tkSet, TTypeKind.tkEnumeration, TTypeKind.tkRecord{$IF CompilerVersion >= 33}, TTypeKind.tkMRecord{$ENDIF}]) then + Result := not CompareMem(@AField, @AValue, SizeOf(T)) + else + Result := TComparer.Default.Compare(AField, AValue) <> 0; + if Result then + begin + AField := AValue; + Change; + end; +end; + +{ TSkCustomControl } + +{$IF CompilerVersion < 33} +procedure TSkCustomControl.ChangeScale(M, D: Integer); +begin + if M <> D then + FScaleFactor := FScaleFactor * M / D; + inherited; +end; +{$ENDIF} + +constructor TSkCustomControl.Create(AOwner: TComponent); +begin + inherited; + ControlStyle := ControlStyle + [csReplicatable] - [csOpaque]; + FDrawCacheKind := TSkDrawCacheKind.Raster; + FOpacity := 255; + {$IF CompilerVersion < 33} + FScaleFactor := 1; + {$ENDIF} + Height := 50; + Width := 50; +end; + +procedure TSkCustomControl.CreateBuffer(const AMemDC: HDC; out ABuffer: HBITMAP; + out AData: Pointer; out AStride: Integer); +const + ColorMasks: array[0..2] of DWORD = ($00FF0000, $0000FF00, $000000FF); +var + LBitmapInfo: PBitmapInfo; +begin + AStride := BytesPerScanline(Width, 32, 32); + GetMem(LBitmapInfo, SizeOf(TBitmapInfoHeader) + SizeOf(ColorMasks)); + try + LBitmapInfo.bmiHeader := Default(TBitmapInfoHeader); + LBitmapInfo.bmiHeader.biSize := SizeOf(TBitmapInfoHeader); + LBitmapInfo.bmiHeader.biWidth := Width; + LBitmapInfo.bmiHeader.biHeight := -Height; + LBitmapInfo.bmiHeader.biPlanes := 1; + LBitmapInfo.bmiHeader.biBitCount := 32; + LBitmapInfo.bmiHeader.biCompression := BI_BITFIELDS; + LBitmapInfo.bmiHeader.biSizeImage := AStride * Height; + Move(ColorMasks[0], LBitmapInfo.bmiColors[0], SizeOf(ColorMasks)); + ABuffer := CreateDIBSection(AMemDC, LBitmapInfo^, DIB_RGB_COLORS, AData, 0, 0); + if ABuffer <> 0 then + GdiFlush; + finally + FreeMem(LBitmapInfo); + end; +end; + +procedure TSkCustomControl.DeleteBuffers; +begin + if FDrawBuffer <> 0 then + begin + FDrawCached := False; + DeleteObject(FDrawBuffer); + FDrawBuffer := 0; + end; +end; + +destructor TSkCustomControl.Destroy; begin DeleteBuffers; inherited; @@ -1301,7 +1807,7 @@ procedure TSkCustomControl.DrawDesignBorder(const ACanvas: ISkCanvas; function TSkCustomControl.NeedsRedraw: Boolean; begin - Result := (not FDrawCacheEnabled) or (not FDrawCached); + Result := (not FDrawCached) or (FDrawCacheKind = TSkDrawCacheKind.Never) or (FDrawBuffer = 0); end; procedure TSkCustomControl.Paint; @@ -1367,12 +1873,12 @@ procedure TSkCustomControl.Resize; inherited; end; -procedure TSkCustomControl.SetDrawCacheEnabled(const AValue: Boolean); +procedure TSkCustomControl.SetDrawCacheKind(const AValue: TSkDrawCacheKind); begin - if FDrawCacheEnabled <> AValue then + if FDrawCacheKind <> AValue then begin - FDrawCacheEnabled := AValue; - if not AValue then + FDrawCacheKind := AValue; + if FDrawCacheKind <> TSkDrawCacheKind.Always then Repaint; end; end; @@ -1494,7 +2000,7 @@ function TSkSvgBrush.IsWrapModeStored: Boolean; function TSkSvgBrush.MakeDOM: ISkSVGDOM; begin - Result := TSkSVGDOM.Make(FSource); + Result := TSkSVGDOM.Make(FSource, TSkDefaultProviders.Resource); end; procedure TSkSvgBrush.RecreateDOM; @@ -1566,8 +2072,8 @@ procedure TSkSvgBrush.Render(const ACanvas: ISkCanvas; const ADestRect: TRectF; begin if AWrapMode <> TSkSvgWrapMode.Default then begin - ADOM.Root.Width := TSkSVGLength.Create(AWrappedDest.Width, TSkSVGLengthUnit.PX); - ADOM.Root.Height := TSkSVGLength.Create(AWrappedDest.Height, TSkSVGLengthUnit.PX); + ADOM.Root.Width := TSkSVGLength.Create(AWrappedDest.Width, TSkSVGLengthUnit.Pixel); + ADOM.Root.Height := TSkSVGLength.Create(AWrappedDest.Height, TSkSVGLengthUnit.Pixel); end; end else @@ -1623,8 +2129,8 @@ procedure TSkSvgBrush.Render(const ACanvas: ISkCanvas; const ADestRect: TRectF; begin if FWrapMode <> TSkSvgWrapMode.Default then begin - LDOM.Root.Width := TSkSVGLength.Create(LWrappedDest.Width, TSkSVGLengthUnit.PX); - LDOM.Root.Height := TSkSVGLength.Create(LWrappedDest.Height, TSkSVGLengthUnit.PX); + LDOM.Root.Width := TSkSVGLength.Create(LWrappedDest.Width, TSkSVGLengthUnit.Pixel); + LDOM.Root.Height := TSkSVGLength.Create(LWrappedDest.Height, TSkSVGLengthUnit.Pixel); end; end else @@ -1686,6 +2192,7 @@ constructor TSkSvg.Create(AOwner: TComponent); inherited; FSvg := CreateSvgBrush; FSvg.OnChanged := SvgChanged; + DrawCacheKind := TSkDrawCacheKind.Always; end; function TSkSvg.CreateSvgBrush: TSkSvgBrush; @@ -1732,8 +2239,8 @@ procedure TSkCustomWinControl.ChangeScale(M, D: Integer); constructor TSkCustomWinControl.Create(AOwner: TComponent); begin inherited; - ControlStyle := ControlStyle - [csOpaque]; - FDrawCacheEnabled := True; + ControlStyle := ControlStyle - [csOpaque] + [csAcceptsControls]; + FDrawCacheKind := TSkDrawCacheKind.Raster; FOpacity := 255; {$IF CompilerVersion < 33} FScaleFactor := 1; @@ -1831,23 +2338,60 @@ procedure TSkCustomWinControl.DrawParentImage(ADC: HDC; until (LControl = AParent); end; + procedure DrawControl(const AControl: TControl; const AOffset: TPoint); + var + LSaveIndex: Integer; + LPoint: TPoint; + begin + LSaveIndex := SaveDC(ADC); + try + GetViewportOrgEx(ADC, LPoint); + SetViewportOrgEx(ADC, LPoint.X - AOffset.X, LPoint.Y - AOffset.Y, nil); + IntersectClipRect(ADC, 0, 0, AControl.ClientWidth, AControl.ClientHeight); + if AControl is TWinControl then + begin + AControl.Perform(WM_ERASEBKGND, ADC, 0); + AControl.Perform(WM_PRINTCLIENT, ADC, prf_Client); + end + else + AControl.Perform(WM_PAINT, ADC, 0); + finally + RestoreDC(ADC, LSaveIndex); + end; + end; + + procedure DrawParentChildControls; + var + I: Integer; + LControl: TControl; + LBoundsRect: TRect; + begin + if not Assigned(Parent) then + Exit; + LBoundsRect := BoundsRect; + for I := 0 to Parent.ControlCount - 1 do + begin + LControl := Parent.Controls[I]; + if LControl = Self then + Break; + if (LControl.BoundsRect * LBoundsRect <> TRect.Empty) and + (LControl.Visible and (not (csDesigning in LControl.ComponentState) or not (csDesignerHide in LControl.ControlState)) or + ((csDesigning in LControl.ComponentState) and not (csDesignerHide in LControl.ControlState)) and + not (csNoDesignVisible in LControl.ControlStyle)) then + begin + DrawControl(LControl, LBoundsRect.TopLeft - LControl.BoundsRect.TopLeft); + end; + end; + end; + var - LSaveIndex: Integer; - LPoint: TPoint; - LParentOffset: TPoint; LOpaqueParent: TWinControl; begin LOpaqueParent := GetOpaqueParent; if LOpaqueParent = nil then Exit; - LSaveIndex := SaveDC(ADC); - GetViewportOrgEx(ADC, LPoint); - LParentOffset := LocalToParent(LOpaqueParent); - SetViewportOrgEx(ADC, LPoint.X - LParentOffset.X, LPoint.Y - LParentOffset.Y, nil); - IntersectClipRect(ADC, 0, 0, LOpaqueParent.ClientWidth, LOpaqueParent.ClientHeight); - LOpaqueParent.Perform(WM_ERASEBKGND, ADC, 0); - LOpaqueParent.Perform(WM_PRINTCLIENT, ADC, prf_Client); - RestoreDC(ADC, LSaveIndex); + DrawControl(LOpaqueParent, LocalToParent(LOpaqueParent)); + DrawParentChildControls; if AInvalidateParent and not (LOpaqueParent is TCustomControl) and not (LOpaqueParent is TCustomForm) and not (csDesigning in ComponentState) then begin @@ -1870,7 +2414,7 @@ function TSkCustomWinControl.GetOpaqueParent: TWinControl; function TSkCustomWinControl.NeedsRedraw: Boolean; begin - Result := (not FDrawCacheEnabled) or (not FDrawCached); + Result := (not FDrawCached) or (FDrawCacheKind = TSkDrawCacheKind.Never) or (FDrawBuffer = 0); end; procedure TSkCustomWinControl.Paint; @@ -1954,12 +2498,12 @@ procedure TSkCustomWinControl.Resize; inherited; end; -procedure TSkCustomWinControl.SetDrawCacheEnabled(const AValue: Boolean); +procedure TSkCustomWinControl.SetDrawCacheKind(const AValue: TSkDrawCacheKind); begin - if FDrawCacheEnabled <> AValue then + if FDrawCacheKind <> AValue then begin - FDrawCacheEnabled := AValue; - if not AValue then + FDrawCacheKind := AValue; + if FDrawCacheKind <> TSkDrawCacheKind.Always then Repaint; end; end; @@ -2007,223 +2551,709 @@ procedure TSkCustomWinControl.WMEraseBkgnd(var AMessage: TWMEraseBkgnd); inherited; end; -{ TSkCustomAnimatedControl } +{ TSkCustomAnimation.TProcess } -procedure TSkCustomAnimatedControl.AnimationTimer(ASender: TObject); +class procedure TSkCustomAnimation.TProcess.Add(const AAnimation: TSkCustomAnimation); begin - FSuccessRepaint := False; - Paint; - if not FSuccessRepaint then - begin - FAbsoluteShowingCached := False; - CheckAnimation; - end; + if FProcess = nil then + FProcess := TProcess.Create; + FProcess.DoAdd(AAnimation); end; -function TSkCustomAnimatedControl.CanRunAnimation: Boolean; +constructor TSkCustomAnimation.TProcess.Create; begin - Result := (not FIsStaticImage) and Assigned(Parent) and (not FFixedProgress) and - ([csDestroying, csDesigning] * ComponentState = []) and - AbsoluteShowing and (Width > 0) and (Height > 0) and - (FLoop or not SameValue(FProgress, 1, TEpsilon.Matrix)); + inherited Create; + FAniList := TList.Create; + FAniProcessingList := TList.Create; + FrameRate := EnsureRange(FrameRate, 5, 120); + FAnimation := TTimer.Create(nil); + FAnimation.Enabled := False; + FAnimation.Interval := Trunc(1000 / FrameRate); + FAnimation.OnTimer := OnProcess; + if not QueryPerformanceFrequency(FPerformanceFrequency) then + FPerformanceFrequency := 0; end; -procedure TSkCustomAnimatedControl.CheckAnimation; +destructor TSkCustomAnimation.TProcess.Destroy; +begin + FreeAndNil(FAniList); + FAniProcessingList.Free; + FAnimation.Free; + inherited; +end; - procedure FixStartTickCount; - var - LNewTickCount: Int64; +class destructor TSkCustomAnimation.TProcess.Destroy; +begin + FProcess.Free; + inherited; +end; + +procedure TSkCustomAnimation.TProcess.DoAdd(const AAnimation: TSkCustomAnimation); +begin + if FAniList.IndexOf(AAnimation) < 0 then + FAniList.Add(AAnimation); + if not FAnimation.Enabled and (FAniList.Count > 0) then + FTime := GetTick; + FAnimation.Enabled := FAniList.Count > 0; +end; + +procedure TSkCustomAnimation.TProcess.DoRemove(const AAnimation: TSkCustomAnimation); +begin + if FAniList <> nil then begin - LNewTickCount := TThread.GetTickCount - Round(FProgress * Duration * 1000); - if LNewTickCount < 0 then - LNewTickCount := High(Cardinal) + LNewTickCount; - FAnimationStartTickCount := Cardinal(LNewTickCount); + FAniList.Remove(AAnimation); + FAniProcessingList.Remove(AAnimation); + FAnimation.Enabled := FAniList.Count > 0; end; +end; +function TSkCustomAnimation.TProcess.GetTick: Double; var - LCanRunAnimation: Boolean; + LPerformanceCounter: Int64; begin - if Assigned(FAnimation) then + if FPerformanceFrequency = 0 then + Result := timeGetTime / MSecsPerSec + else + begin + QueryPerformanceCounter(LPerformanceCounter); + Result := LPerformanceCounter / FPerformanceFrequency; + end; +end; + +procedure TSkCustomAnimation.TProcess.OnProcess(ASender: TObject); +var + I: Integer; + LNewTime: Double; + LDeltaTime: Double; + [unsafe] LAnimation: TSkCustomAnimation; +begin + FrameRate := EnsureRange(FrameRate, 5, 120); + FAnimation.Interval := Trunc(1000 / FrameRate); + LNewTime := GetTick; + LDeltaTime := LNewTime - FTime; + if LDeltaTime < TimeEpsilon then + Exit; + FTime := LNewTime; + if FAniList.Count > 0 then begin - LCanRunAnimation := CanRunAnimation; - if FAnimation.Enabled <> LCanRunAnimation then + FAniProcessingList.AddRange(FAniList); + I := FAniProcessingList.Count - 1; + while I >= 0 do begin - FAnimation.Enabled := LCanRunAnimation; - if LCanRunAnimation then + if I < FAniProcessingList.Count then begin - FixStartTickCount; - DoAnimationStart; + LAnimation := FAniProcessingList[I]; + FAniProcessingList.Delete(I); + if LAnimation.Running then + LAnimation.ProcessTick(LDeltaTime); + Dec(I); end else - DoAnimationFinished; + I := FAniProcessingList.Count - 1; end; end; end; -procedure TSkCustomAnimatedControl.CMEnabledChanged(var AMessage: TMessage); +class procedure TSkCustomAnimation.TProcess.Remove( + const AAnimation: TSkCustomAnimation); begin - CheckAnimation; - inherited; + if FProcess <> nil then + FProcess.DoRemove(AAnimation); end; -procedure TSkCustomAnimatedControl.CMShowingChanged(var AMessage: TMessage); +{ TSkCustomAnimation } + +procedure TSkCustomAnimation.BeforePaint; begin - FAbsoluteShowingCached := False; - if (not FFixedProgress) and (not FProgressChangedManually) and (not FAbsoluteShowing) and AbsoluteShowing then + if FNeedStart then begin - FProgress := 0; - FAnimationStartTickCount := TThread.GetTickCount; + if FAllowAnimation then + InternalStart(False) + else + FNeedStartRepaint := True; end; - CheckAnimation; - inherited; end; -procedure TSkCustomAnimatedControl.CMVisibleChanged(var AMessage: TMessage); +function TSkCustomAnimation.CanProcessing: Boolean; begin - FAbsoluteShowingCached := False; - if (not FFixedProgress) and (not FProgressChangedManually) and (not FAbsoluteShowing) and AbsoluteShowing then - begin - FProgress := 0; - FAnimationStartTickCount := TThread.GetTickCount; - end; - CheckAnimation; + Result := FRunning and (not FPause) and (FSpeed >= SpeedEpsilon) and (FProcessDuration >= TimeEpsilon) and (FAllowAnimation or not FLoop); +end; + +constructor TSkCustomAnimation.Create(const AOwner: TComponent); +begin + inherited Create; + FOwner := AOwner; + Assign(nil); +end; + +destructor TSkCustomAnimation.Destroy; +begin + SetProcessing(False); inherited; end; -constructor TSkCustomAnimatedControl.Create(AOwner: TComponent); +procedure TSkCustomAnimation.DoAssign(ASource: TPersistent); +var + LSourceAnimation: TSkCustomAnimation absolute ASource; +begin + if ASource = nil then + begin + AutoReverse := DefaultAutoReverse; + Delay := DefaultDelay; + Enabled := DefaultEnabled; + Inverse := DefaultInverse; + Loop := DefaultLoop; + Pause := DefaultPause; + Speed := DefaultSpeed; + StartFromCurrent := DefaultStartFromCurrent; + StartProgress := DefaultStartProgress; + StopProgress := DefaultStopProgress; + DoSetCurrentTime(0); + SetRunning(False); + end + else if ASource is TSkCustomAnimation then + begin + AutoReverse := LSourceAnimation.AutoReverse; + Delay := LSourceAnimation.Delay; + Enabled := LSourceAnimation.Enabled; + Inverse := LSourceAnimation.Inverse; + Loop := LSourceAnimation.Loop; + Pause := LSourceAnimation.Pause; + Speed := LSourceAnimation.Speed; + StartFromCurrent := LSourceAnimation.StartFromCurrent; + StartProgress := LSourceAnimation.StartProgress; + StopProgress := LSourceAnimation.StopProgress; + DoSetCurrentTime(LSourceAnimation.CurrentTime); + SetRunning(LSourceAnimation.Running); + end + else + inherited; +end; + +procedure TSkCustomAnimation.DoChanged; +var + LCanProcess: Boolean; begin + UpdateCurrentTime(FRunning, True); + LCanProcess := FAllowAnimation; + + if FEnabledChanged then + begin + FEnabledChanged := False; + if not FEnabled then + Stop + else if (not Assigned(FOwner)) or (not (csDesigning in FOwner.ComponentState)) then + begin + FNeedStart := True; + FNeedStartRepaint := False; + end; + end; + if FNeedStart and FNeedStartRepaint and FAllowAnimation then + begin + Start; + LCanProcess := False; + end; + SetProcessing(CanProcessing); inherited; - if csDesigning in ComponentState then + if LCanProcess then + DoProcess; +end; + +function TSkCustomAnimation.DoSetCurrentTime(const AValue: Double): Boolean; +begin + Result := SetValue(FDelayTime, 0, TimeEpsilon); + Result := SetValue(FCurrentTime, EnsureRange(AValue, 0, FDuration), TimeEpsilon) or Result; +end; + +function TSkCustomAnimation.Equals(AObject: TObject): Boolean; +var + LSourceAnimation: TSkCustomAnimation absolute AObject; +begin + Result := (AObject is TSkCustomAnimation) and + (FAutoReverse = LSourceAnimation.AutoReverse) and + (FEnabled = LSourceAnimation.Enabled) and + (FInverse = LSourceAnimation.Inverse) and + (FLoop = LSourceAnimation.Loop) and + (FPause = LSourceAnimation.Pause) and + (FStartFromCurrent = LSourceAnimation.StartFromCurrent) and + (FRunning = LSourceAnimation.Running) and + SameValue(FCurrentTime, LSourceAnimation.CurrentTime, TimeEpsilon) and + SameValue(FDelay, LSourceAnimation.Delay, TimeEpsilon) and + SameValue(FSpeed, LSourceAnimation.Speed, SpeedEpsilon) and + SameValue(FStartProgress, LSourceAnimation.StartProgress, ProgressEpsilon) and + SameValue(FStopProgress, LSourceAnimation.StopProgress, ProgressEpsilon); +end; + +function TSkCustomAnimation.GetDuration: Double; +begin + Result := FDuration; +end; + +procedure TSkCustomAnimation.InternalStart(const ACanProcess: Boolean); +begin + FNeedStart := False; + if not FLoop then + FTickCount := 0; + if FAutoReverse then begin - FProgress := 0.5; - FFixedProgress := True; + if FRunning then + FInverse := FSavedInverse + else + FSavedInverse := FInverse; + end; + if FProcessDuration < TimeEpsilon then + begin + SetStartValues(0, True); + FRunning := True; + DoStart; + if ACanProcess and FAllowAnimation then + DoProcess; + FRunning := False; + FProcessTime := 0; + DoFinish; + end + else + begin + SetStartValues(FDelay, False); + FRunning := True; + FEnabled := True; + SetProcessing(CanProcessing); + + if FDelay < TimeEpsilon then + begin + DoStart; + if ACanProcess and FAllowAnimation then + DoProcess; + end + else + DoStart; end; - FIsStaticImage := True; - FLoop := True; - FFPS := DefaultFPS; - FAnimation := TTimer.Create(Self); - FAnimation.Enabled := False; - FAnimation.Interval := Round(1000 / FFPS); - FAnimation.OnTimer := AnimationTimer; - FAbsoluteShowing := Visible; - DrawCacheEnabled := FIsStaticImage; - DrawParentInBackground := True; end; -procedure TSkCustomAnimatedControl.DoAnimationFinished; +function TSkCustomAnimation.IsDelayStored: Boolean; begin - if Assigned(FOnAnimationFinished) then - FOnAnimationFinished(Self); - FProgressChangedManually := False; + Result := not SameValue(FDelay, DefaultDelay, TimeEpsilon); end; -procedure TSkCustomAnimatedControl.DoAnimationProgress; +function TSkCustomAnimation.IsProgressStored: Boolean; begin - if Assigned(FOnAnimationProgress) then - FOnAnimationProgress(Self); + Result := not SameValue(FProgress, DefaultStartProgress, ProgressEpsilon); end; -procedure TSkCustomAnimatedControl.DoAnimationStart; +function TSkCustomAnimation.IsSpeedStored: Boolean; begin - if Assigned(FOnAnimationStart) then - FOnAnimationStart(Self); + Result := not SameValue(FSpeed, DefaultSpeed, SpeedEpsilon); end; -procedure TSkCustomAnimatedControl.Draw(const ACanvas: ISkCanvas; - const ADest: TRectF; const AOpacity: Single); +function TSkCustomAnimation.IsStartProgressStored: Boolean; +begin + Result := not SameValue(FStartProgress, DefaultStartProgress, ProgressEpsilon); +end; - procedure FixElapsedSeconds(const ACurrentTickCount: Cardinal; - var AStartTickCount: Cardinal; var AElapsedSeconds: Double); - var - LMillisecondsElapsed: Int64; +function TSkCustomAnimation.IsStopProgressStored: Boolean; +begin + Result := not SameValue(FStopProgress, DefaultStopProgress, ProgressEpsilon); +end; + +procedure TSkCustomAnimation.ProcessTick(ADeltaTime: Double); +begin + if Assigned(FOwner) and (csDestroying in FOwner.ComponentState) then + Exit; + SetProcessing(CanProcessing); + if (not FRunning) or FPause or (FSpeed < SpeedEpsilon) or (not FProcessing) then + Exit; + + if FDelayTime >= TimeEpsilon then begin - Assert(ACurrentTickCount < AStartTickCount); - if ACurrentTickCount >= Cardinal(Ceil(Duration * 1000)) then + FDelayTime := FDelayTime - ADeltaTime; + if FDelayTime < TimeEpsilon then begin - if FLoop then - begin - LMillisecondsElapsed := ACurrentTickCount + High(Cardinal) - AStartTickCount; - LMillisecondsElapsed := LMillisecondsElapsed mod Round(Duration * 1000); - Assert(ACurrentTickCount > LMillisecondsElapsed); - FAnimationStartTickCount := Cardinal(ACurrentTickCount - LMillisecondsElapsed); - end - else - AStartTickCount := ACurrentTickCount - Cardinal(Ceil(Duration * 1000)); - AElapsedSeconds := (ACurrentTickCount - AStartTickCount) / 1000; + ADeltaTime := Max(-FDelayTime, 0); + SetStartValues(0, False); + if ADeltaTime < TimeEpsilon then + Exit; end else - begin - LMillisecondsElapsed := ACurrentTickCount + High(Cardinal) - AStartTickCount; - AElapsedSeconds := LMillisecondsElapsed / 1000; - end; - Assert(AElapsedSeconds >= 0); + Exit; end; - function CalcProgress: Double; - var - LElapsedSeconds: Double; - LDuration: Double; - LCurrentTickCount: Cardinal; + if FInverse then + FProcessTime := FProcessTime - ADeltaTime * FSpeed + else + FProcessTime := FProcessTime + ADeltaTime * FSpeed; + if FProcessTime >= FProcessDuration then begin - if Enabled then + FProcessTime := FProcessDuration; + if FLoop then begin - LCurrentTickCount := TThread.GetTickCount; - LElapsedSeconds := (LCurrentTickCount - FAnimationStartTickCount) / 1000; - if LElapsedSeconds < 0 then - FixElapsedSeconds(LCurrentTickCount, FAnimationStartTickCount, LElapsedSeconds); - LDuration := Duration; - if SameValue(LDuration, 0, TEpsilon.Matrix) then - Result := 1 + if FAutoReverse then + begin + FInverse := True; + FProcessTime := FProcessDuration; + end else + FProcessTime := 0; + end + else + if FAutoReverse and (FTickCount = 0) then begin - if FLoop then - begin - {$IF CompilerVersion >= 29} - LElapsedSeconds := FMod(LElapsedSeconds, LDuration); - {$ELSE} - LElapsedSeconds := (Round(LElapsedSeconds * 1000) mod Round(LDuration * 1000)) / 1000; - {$ENDIF} - end - else - LElapsedSeconds := Min(LElapsedSeconds, LDuration); - Result := LElapsedSeconds / LDuration; - end; + Inc(FTickCount); + FInverse := True; + FProcessTime := FProcessDuration; + end + else + FRunning := False; + end + else if FProcessTime <= 0 then + begin + FProcessTime := 0; + if FLoop then + begin + if FAutoReverse then + begin + FInverse := False; + FProcessTime := 0; + end + else + FProcessTime := FProcessDuration; end else - Result := FProgress; + if FAutoReverse and (FTickCount = 0) then + begin + Inc(FTickCount); + FInverse := False; + FProcessTime := 0; + end + else + FRunning := False; end; + UpdateCurrentTime(True, Updating); -var - LProgress: Double; + if not FRunning then + begin + if FAutoReverse then + FInverse := FSavedInverse; + FEnabled := False; + SetProcessing(False); + end; + + if FAllowAnimation then + DoProcess; + if not FRunning then + DoFinish; +end; + +procedure TSkCustomAnimation.SetAllowAnimation(const AValue: Boolean); begin - inherited; - if Assigned(FAnimation) and not FAnimation.Enabled then + SetValue(FAllowAnimation, AValue); +end; + +procedure TSkCustomAnimation.SetCurrentTime(const AValue: Double); +begin + BeginUpdate; + try + FCurrentTimeChanged := DoSetCurrentTime(RoundTo(AValue, TimeRoundTo)) or FCurrentTimeChanged; + finally + EndUpdate; + end; +end; + +procedure TSkCustomAnimation.SetDelay(const AValue: Double); +begin + FDelay := Max(0, RoundTo(AValue, TimeRoundTo)); + FDelayTime := Min(FDelayTime, FDelay); +end; + +procedure TSkCustomAnimation.SetDuration(const AValue: Double); +begin + SetValue(FDuration, Max(RoundTo(AValue, TimeRoundTo), 0), TimeEpsilon); +end; + +procedure TSkCustomAnimation.SetEnabled(const AValue: Boolean); +begin + BeginUpdate; + try + FEnabledChanged := SetValue(FEnabled, AValue) or FEnabledChanged; + finally + EndUpdate; + end; +end; + +procedure TSkCustomAnimation.SetLoop(const AValue: Boolean); +begin + SetValue(FLoop, AValue); +end; + +procedure TSkCustomAnimation.SetPause(const AValue: Boolean); +begin + SetValue(FPause, AValue); +end; + +procedure TSkCustomAnimation.SetProcessing(const AValue: Boolean); +begin + if FProcessing <> AValue then begin - if not FAbsoluteShowing then - FAbsoluteShowingCached := False; - CheckAnimation; + FProcessing := AValue; + if FProcessing then + TProcess.Add(Self) + else + TProcess.Remove(Self); end; - if FFixedProgress then - LProgress := FProgress +end; + +procedure TSkCustomAnimation.SetProgress(const AValue: Double); +begin + FSavedProgress := AValue; + CurrentTime := FDuration * EnsureRange(AValue, 0, 1); +end; + +procedure TSkCustomAnimation.SetRunning(const AValue: Boolean); +begin + SetValue(FRunning, AValue); +end; + +procedure TSkCustomAnimation.SetSpeed(const AValue: Double); +begin + SetValue(FSpeed, Max(RoundTo(AValue, SpeedRoundTo), 0), SpeedEpsilon); +end; + +procedure TSkCustomAnimation.SetStartProgress(const AValue: Double); +begin + SetValue(FStartProgress, EnsureRange(AValue, 0, 1), ProgressEpsilon); +end; + +procedure TSkCustomAnimation.SetStartValues(const ADelayTime: Double; const AStartAtEnd: Boolean); +begin + FDelayTime := ADelayTime; + if FStartFromCurrent and not AStartAtEnd then + FProcessTime := EnsureRange(FCurrentTime - Min(FStartProgress, FStopProgress) * FDuration, 0, FProcessDuration) else - LProgress := CalcProgress; - RenderFrame(ACanvas, ADest, LProgress, AOpacity); - if not SameValue(LProgress, FProgress, TEpsilon.Matrix) then + FProcessTime := IfThen(FInverse = AStartAtEnd, 0, FProcessDuration); + UpdateCurrentTime(True, Updating); +end; + +procedure TSkCustomAnimation.SetStopProgress(const AValue: Double); +begin + SetValue(FStopProgress, EnsureRange(AValue, 0, 1), ProgressEpsilon); +end; + +procedure TSkCustomAnimation.Start; +begin + InternalStart(True); +end; + +procedure TSkCustomAnimation.Stop; +begin + FNeedStart := False; + if not FRunning then + Exit; + if FAutoReverse then + FInverse := FSavedInverse; + if FInverse then begin - FProgress := LProgress; - DoAnimationProgress; - end; - if (not FLoop) and SameValue(LProgress, 1, TEpsilon.Matrix) then + FCurrentTime := 0; + FProgress := 0; + end + else begin + FCurrentTime := FProcessDuration; FProgress := 1; - CheckAnimation; end; - FSuccessRepaint := True; + if FAllowAnimation then + DoProcess; + FRunning := False; + FEnabled := False; + SetProcessing(False); + DoFinish; +end; + +procedure TSkCustomAnimation.StopAtCurrent; +begin + FNeedStart := False; + if not FRunning then + Exit; + if FAutoReverse then + FInverse := FSavedInverse; + FRunning := False; + FEnabled := False; + SetProcessing(False); + DoFinish; +end; + +procedure TSkCustomAnimation.UpdateCurrentTime(const AIsRunning, ARecalcProcessDuration: Boolean); +begin + if ARecalcProcessDuration then + begin + FProcessDuration := Abs(FStopProgress - FStartProgress) * FDuration; + if FProcessDuration < TimeEpsilon then + FProcessDuration := 0; + end; + if FCurrentTimeChanged and AIsRunning then + FProcessTime := EnsureRange(FCurrentTime - Min(FStartProgress, FStopProgress) * FDuration, 0, FProcessDuration); + if AIsRunning then + FCurrentTime := Min(FStartProgress, FStopProgress) * FDuration + FProcessTime + else + FCurrentTime := EnsureRange(FCurrentTime, 0, FDuration); + FCurrentTimeChanged := False; + if FDuration < TimeEpsilon then + begin + if FInverse then + FProgress := FStopProgress + else + FProgress := FStartProgress; + end + else + FProgress := FCurrentTime / FDuration; +end; + +{ TSkCustomAnimatedControl.TAnimationBase } + +procedure TSkCustomAnimatedControl.TAnimationBase.DoChanged; +begin + inherited; + if Created then + TSkCustomAnimatedControl(Owner).DoAnimationChanged; +end; + +procedure TSkCustomAnimatedControl.TAnimationBase.DoFinish; +begin + TSkCustomAnimatedControl(Owner).DoAnimationFinish; +end; + +procedure TSkCustomAnimatedControl.TAnimationBase.DoProcess; +begin + if FInsideDoProcess then + Exit; + FInsideDoProcess := True; + try + TSkCustomAnimatedControl(Owner).DoAnimationProcess; + finally + FInsideDoProcess := False; + end; +end; + +procedure TSkCustomAnimatedControl.TAnimationBase.DoStart; +begin + TSkCustomAnimatedControl(Owner).DoAnimationStart; +end; + +{ TSkCustomAnimatedControl } + +function TSkCustomAnimatedControl.CanRunAnimation: Boolean; +begin + Result := Assigned(Parent) and ([csDestroying, csLoading] * ComponentState = []) and + AbsoluteVisible and (Width > 0) and (Height > 0) and (WindowHandle <> 0); +end; + +procedure TSkCustomAnimatedControl.CheckAbsoluteVisible; +begin + FAbsoluteVisibleCached := False; + if Assigned(FAnimation) and FAnimation.Loop and FAnimation.Running and (not FAbsoluteVisible) and AbsoluteVisible then + FAnimation.Start; + CheckAnimation; +end; + +procedure TSkCustomAnimatedControl.CheckAnimation; +begin + if Assigned(FAnimation) then + FAnimation.AllowAnimation := CanRunAnimation; +end; + +procedure TSkCustomAnimatedControl.CheckDuration; +begin + if Assigned(FAnimation) then + begin + if SameValue(FAnimation.Duration, 0, TAnimationBase.TimeEpsilon) then + DrawCacheKind := TSkDrawCacheKind.Raster + else + DrawCacheKind := TSkDrawCacheKind.Never; + end; +end; + +{$IF CompilerVersion >= 34} + +procedure TSkCustomAnimatedControl.CMParentVisibleChanged( + var AMessage: TMessage); +begin + CheckAbsoluteVisible; + inherited; +end; + +{$ELSE} + +procedure TSkCustomAnimatedControl.CMShowingChanged(var AMessage: TMessage); +begin + CheckAbsoluteVisible; + inherited; end; -function TSkCustomAnimatedControl.GetAbsoluteShowing: Boolean; +{$ENDIF} + +procedure TSkCustomAnimatedControl.CMVisibleChanged(var AMessage: TMessage); +begin + CheckAbsoluteVisible; + inherited; +end; - function GetParentedShowing: Boolean; +constructor TSkCustomAnimatedControl.Create(AOwner: TComponent); +begin + inherited; + FAnimation := CreateAnimation; + FAbsoluteVisible := Visible; + FAbsoluteVisibleCached := True; + CheckDuration; + DrawParentInBackground := True; +end; + +destructor TSkCustomAnimatedControl.Destroy; +begin + FAnimation.Free; + inherited; +end; + +procedure TSkCustomAnimatedControl.DoAnimationChanged; +begin + CheckDuration; + if csDesigning in ComponentState then + Repaint; +end; + +procedure TSkCustomAnimatedControl.DoAnimationFinish; +begin + if WindowHandle <> 0 then + Paint; + if Assigned(FOnAnimationFinish) then + FOnAnimationFinish(Self); +end; + +procedure TSkCustomAnimatedControl.DoAnimationProcess; +begin + CheckAnimation; + if WindowHandle <> 0 then + Paint; + if Assigned(FOnAnimationProcess) then + FOnAnimationProcess(Self); +end; + +procedure TSkCustomAnimatedControl.DoAnimationStart; +begin + if Assigned(FOnAnimationStart) then + FOnAnimationStart(Self); +end; + +procedure TSkCustomAnimatedControl.Draw(const ACanvas: ISkCanvas; + const ADest: TRectF; const AOpacity: Single); +begin + inherited; + if not FAnimation.AllowAnimation then + CheckAnimation; + FAnimation.BeforePaint; + RenderFrame(ACanvas, ADest, FAnimation.Progress, AOpacity); +end; + +function TSkCustomAnimatedControl.GetAbsoluteVisible: Boolean; + + function GetParentedVisible: Boolean; var LControl: TWinControl; begin @@ -2232,7 +3262,7 @@ function TSkCustomAnimatedControl.GetAbsoluteShowing: Boolean; LControl := Parent; while LControl <> nil do begin - if not LControl.Showing then + if not LControl.Visible then Exit(False); LControl := LControl.Parent; end; @@ -2240,17 +3270,24 @@ function TSkCustomAnimatedControl.GetAbsoluteShowing: Boolean; end; begin - if not FAbsoluteShowingCached then + if not FAbsoluteVisibleCached then begin - FAbsoluteShowing := GetParentedShowing; - FAbsoluteShowingCached := True; + FAbsoluteVisible := GetParentedVisible; + FAbsoluteVisibleCached := True; end; - Result := FAbsoluteShowing; + Result := FAbsoluteVisible; end; -function TSkCustomAnimatedControl.GetRunningAnimation: Boolean; +procedure TSkCustomAnimatedControl.ReadState(AReader: TReader); begin - Result := Assigned(FAnimation) and FAnimation.Enabled; + FAnimation.BeginUpdate; + try + FAnimation.SavedProgress := FAnimation.Progress; + inherited; + FAnimation.Progress := FAnimation.SavedProgress; + finally + FAnimation.EndUpdate; + end; end; procedure TSkCustomAnimatedControl.RenderFrame(const ACanvas: ISkCanvas; @@ -2260,112 +3297,117 @@ procedure TSkCustomAnimatedControl.RenderFrame(const ACanvas: ISkCanvas; FOnAnimationDraw(Self, ACanvas, ADest, AProgress, AOpacity); end; -procedure TSkCustomAnimatedControl.SetFixedProgress(const AValue: Boolean); +procedure TSkCustomAnimatedControl.SetOnAnimationDraw(const AValue: TSkAnimationDrawEvent); begin - if FFixedProgress <> AValue then + if TMethod(FOnAnimationDraw) <> TMethod(AValue) then begin - FFixedProgress := AValue; - CheckAnimation; + FOnAnimationDraw := AValue; + Redraw; end; end; -procedure TSkCustomAnimatedControl.SetFPS(const AValue: Double); +{ TSkAnimatedPaintBox.TAnimation } + +constructor TSkAnimatedPaintBox.TAnimation.Create(const AOwner: TComponent); begin - if not SameValue(FFPS, AValue, TEpsilon.Vector) then - begin - FFPS := AValue; - if Assigned(FAnimation) then - FAnimation.Interval := Round(1000 / FFPS); - end; + inherited Create(AOwner); + Duration := DefaultDuration; end; -procedure TSkCustomAnimatedControl.SetIsStaticImage(const AValue: Boolean); +procedure TSkAnimatedPaintBox.TAnimation.DoAssign(ASource: TPersistent); +var + LSourceAnimation: TSkCustomAnimation absolute ASource; begin - if FIsStaticImage <> AValue then - begin - FIsStaticImage := AValue; - DrawCacheEnabled := FIsStaticImage; - CheckAnimation; - end; + if ASource = nil then + Duration := DefaultDuration + else if ASource is TSkCustomAnimation then + Duration := LSourceAnimation.Duration; + inherited; end; -procedure TSkCustomAnimatedControl.SetLoop(const AValue: Boolean); +function TSkAnimatedPaintBox.TAnimation.Equals(AObject: TObject): Boolean; +var + LSourceAnimation: TSkCustomAnimation absolute AObject; begin - if FLoop <> AValue then - begin - FLoop := AValue; - CheckAnimation; - end; + Result := inherited and SameValue(Duration, LSourceAnimation.Duration, TimeEpsilon); end; -procedure TSkCustomAnimatedControl.SetOnAnimationDraw(const AValue: TSkAnimationDrawEvent); +function TSkAnimatedPaintBox.TAnimation.IsDurationStored: Boolean; begin - if TMethod(FOnAnimationDraw) <> TMethod(AValue) then - begin - FOnAnimationDraw := AValue; - Redraw; - end; + Result := not SameValue(Duration, DefaultDuration, TimeEpsilon); +end; + +{ TSkAnimatedPaintBox } + +function TSkAnimatedPaintBox.CreateAnimation: TSkCustomAnimatedControl.TAnimationBase; +begin + Result := TAnimation.Create(Self); +end; + +procedure TSkAnimatedPaintBox.DefineProperties(AFiler: TFiler); +begin + inherited; + // Backward compatibility with version 3 + AFiler.DefineProperty('Animate', ReadAnimate, nil, False); + AFiler.DefineProperty('Duration', ReadDuration, nil, False); + AFiler.DefineProperty('Loop', ReadLoop, nil, False); +end; + +function TSkAnimatedPaintBox.GetAnimation: TSkAnimatedPaintBox.TAnimation; +begin + Result := TSkAnimatedPaintBox.TAnimation(FAnimation); +end; + +procedure TSkAnimatedPaintBox.ReadAnimate(AReader: TReader); +begin + Animation.Enabled := AReader.ReadBoolean; +end; + +procedure TSkAnimatedPaintBox.ReadDuration(AReader: TReader); +begin + Animation.Duration := AReader.ReadFloat; +end; + +procedure TSkAnimatedPaintBox.ReadLoop(AReader: TReader); +begin + Animation.Loop := AReader.ReadBoolean; end; -procedure TSkCustomAnimatedControl.SetProgress(AValue: Double); +procedure TSkAnimatedPaintBox.SetAnimation(const AValue: TSkAnimatedPaintBox.TAnimation); begin - FProgressChangedManually := True; - AValue := EnsureRange(AValue, 0, 1); - if not SameValue(FProgress, AValue, TEpsilon.Matrix) then - begin - FProgress := AValue; - if SameValue(FProgress, 0, TEpsilon.Matrix) then - FAnimationStartTickCount := TThread.GetTickCount; - CheckAnimation; - DoAnimationProgress; - Repaint; - end; + FAnimation.Assign(AValue); end; -{ TSkAnimatedPaintBox } +{ TSkAnimatedPaintBoxHelper } -function TSkAnimatedPaintBox.CanRunAnimation: Boolean; +function TSkAnimatedPaintBoxHelper.Animate: Boolean; begin - Result := FAnimate and inherited; + Result := Animation.Enabled; end; -constructor TSkAnimatedPaintBox.Create(AOwner: TComponent); +function TSkAnimatedPaintBoxHelper.Duration: Double; begin - inherited; - FAnimate := True; - FDuration := DefaultDuration; - IsStaticImage := not FAnimate; + Result := Animation.Duration; end; -function TSkAnimatedPaintBox.GetDuration: Double; +function TSkAnimatedPaintBoxHelper.FixedProgress: Boolean; begin - Result := FDuration; + Result := not Animation.Enabled; end; -function TSkAnimatedPaintBox.IsDurationStored: Boolean; +function TSkAnimatedPaintBoxHelper.Loop: Boolean; begin - Result := not SameValue(FDuration, DefaultDuration, TEpsilon.Vector); + Result := Animation.Loop; end; -procedure TSkAnimatedPaintBox.SetAnimate(const AValue: Boolean); +function TSkAnimatedPaintBoxHelper.Progress: Double; begin - if FAnimate <> AValue then - begin - FAnimate := AValue; - if FAnimate then - Progress := 0; - IsStaticImage := not FAnimate; - Redraw; - end; + Result := Animation.Progress; end; -procedure TSkAnimatedPaintBox.SetDuration(const AValue: Double); +function TSkAnimatedPaintBoxHelper.RunningAnimation: Boolean; begin - if not SameValue(FDuration, AValue, TEpsilon.Vector) then - begin - FDuration := AValue; - CheckAnimation; - end; + Result := Animation.Running; end; { TSkAnimatedImage.TSource } @@ -2374,11 +3416,13 @@ procedure TSkAnimatedImage.TSource.Assign(ASource: TPersistent); begin if ASource is TSource then Data := TSource(ASource).Data + else if ASource = nil then + Data := nil else inherited; end; -constructor TSkAnimatedImage.TSource.Create(const AOnChange: TNotifyEvent); +constructor TSkAnimatedImage.TSource.Create(const AOnChange: TChangeProc); begin inherited Create; FOnChange := AOnChange; @@ -2395,7 +3439,7 @@ procedure TSkAnimatedImage.TSource.SetData(const AValue: TBytes); begin FData := Copy(AValue); if Assigned(FOnChange) then - FOnChange(Self); + FOnChange(); end; end; @@ -2411,17 +3455,17 @@ constructor TSkAnimatedImage.TFormatInfo.Create(const AName, { TSkAnimatedImage } -function TSkAnimatedImage.CanRunAnimation: Boolean; -begin - Result := Assigned(FCodec) and inherited; -end; - constructor TSkAnimatedImage.Create(AOwner: TComponent); begin inherited; FSource := TSource.Create(SourceChange); end; +function TSkAnimatedImage.CreateAnimation: TSkCustomAnimatedControl.TAnimationBase; +begin + Result := TAnimation.Create(Self); +end; + procedure TSkAnimatedImage.DefineProperties(AFiler: TFiler); function DoWrite: Boolean; @@ -2435,6 +3479,10 @@ procedure TSkAnimatedImage.DefineProperties(AFiler: TFiler); begin inherited; AFiler.DefineBinaryProperty('Data', ReadData, WriteData, DoWrite); + // Backward compatibility with version 3 + AFiler.DefineProperty('Loop', ReadLoop, nil, False); + AFiler.DefineProperty('OnAnimationFinished', ReadOnAnimationFinished, nil, False); + AFiler.DefineProperty('OnAnimationProgress', ReadOnAnimationProgress, nil, False); end; destructor TSkAnimatedImage.Destroy; @@ -2453,12 +3501,9 @@ procedure TSkAnimatedImage.Draw(const ACanvas: ISkCanvas; const ADest: TRectF; DrawDesignBorder(ACanvas, ADest, AOpacity); end; -function TSkAnimatedImage.GetDuration: Double; +function TSkAnimatedImage.GetAnimation: TAnimation; begin - if Assigned(FCodec) then - Result := FCodec.Duration - else - Result := 0; + Result := TSkAnimatedImage.TAnimation(FAnimation); end; function TSkAnimatedImage.GetOriginalSize: TSizeF; @@ -2492,6 +3537,32 @@ procedure TSkAnimatedImage.ReadData(AStream: TStream); LoadFromStream(AStream); end; +procedure TSkAnimatedImage.ReadLoop(AReader: TReader); +begin + Animation.Loop := AReader.ReadBoolean; +end; + +type + TReaderAccess = class(TReader) end; + +procedure TSkAnimatedImage.ReadOnAnimationFinished(AReader: TReader); +var + LMethod: TMethod; +begin + LMethod := TReaderAccess(AReader).FindMethodInstance(AReader.Root, AReader.ReadIdent); + if LMethod.Code <> nil then + OnAnimationFinish := TNotifyEvent(LMethod); +end; + +procedure TSkAnimatedImage.ReadOnAnimationProgress(AReader: TReader); +var + LMethod: TMethod; +begin + LMethod := TReaderAccess(AReader).FindMethodInstance(AReader.Root, AReader.ReadIdent); + if LMethod.Code <> nil then + OnAnimationProcess := TNotifyEvent(LMethod); +end; + class procedure TSkAnimatedImage.RegisterCodec( const ACodecClass: TAnimationCodecClass); begin @@ -2539,11 +3610,28 @@ procedure TSkAnimatedImage.RenderFrame(const ACanvas: ISkCanvas; end; begin - FCodec.SeekFrameTime(AProgress * Duration); - FCodec.Render(ACanvas, GetWrappedRect(ADest), AOpacity); + if Assigned(FCodec) then + begin + if (csDesigning in ComponentState) and (not Animation.Running) and (AProgress = 0) then + FCodec.SeekFrameTime(Animation.Duration / 8) + else + FCodec.SeekFrameTime(Animation.CurrentTime); + ACanvas.Save; + try + ACanvas.ClipRect(ADest); + FCodec.Render(ACanvas, GetWrappedRect(ADest), AOpacity); + finally + ACanvas.Restore; + end; + end; inherited; end; +procedure TSkAnimatedImage.SetAnimation(const AValue: TAnimation); +begin + FAnimation.Assign(AValue); +end; + procedure TSkAnimatedImage.SetSource(const AValue: TSource); begin FSource.Assign(AValue); @@ -2558,7 +3646,7 @@ procedure TSkAnimatedImage.SetWrapMode(const AValue: TSkAnimatedImageWrapMode); end; end; -procedure TSkAnimatedImage.SourceChange(ASender: TObject); +procedure TSkAnimatedImage.SourceChange; var LCodecClass: TAnimationCodecClass; LStream: TStream; @@ -2576,10 +3664,13 @@ procedure TSkAnimatedImage.SourceChange(ASender: TObject); LStream.Free; end; if Assigned(FCodec) then - FPS := Max(FCodec.FPS, MinFPS); - if not FixedProgress then - Progress := 0; - IsStaticImage := (FCodec = nil) or FCodec.IsStatic; + begin + Animation.SetDuration(FCodec.Duration); + if Animation.Running then + Animation.Start; + end + else + Animation.SetDuration(0); Redraw; end; @@ -2589,6 +3680,33 @@ procedure TSkAnimatedImage.WriteData(AStream: TStream); AStream.WriteBuffer(FSource.Data, Length(FSource.Data)); end; +{ TSkAnimatedImageHelper } + +function TSkAnimatedImageHelper.Duration: Double; +begin + Result := Animation.Duration; +end; + +function TSkAnimatedImageHelper.FixedProgress: Boolean; +begin + Result := not Animation.Enabled; +end; + +function TSkAnimatedImageHelper.Loop: Boolean; +begin + Result := Animation.Loop; +end; + +function TSkAnimatedImageHelper.Progress: Double; +begin + Result := Animation.Progress; +end; + +function TSkAnimatedImageHelper.RunningAnimation: Boolean; +begin + Result := Animation.Running; +end; + { TSkDefaultAnimationCodec } constructor TSkDefaultAnimationCodec.Create( @@ -2612,7 +3730,7 @@ function TSkDefaultAnimationCodec.GetDuration: Double; function TSkDefaultAnimationCodec.GetFPS: Double; begin - Result := TSkCustomAnimatedControl.DefaultFPS; + Result := TSkCustomAnimation.DefaultFrameRate; end; function TSkDefaultAnimationCodec.GetIsStatic: Boolean; @@ -2825,7 +3943,7 @@ class function TSkLottieAnimationCodec.TryMakeFromStream(const AStream: TStream; begin LDecompressionStream := TDecompressionStream.Create(AStream, 31); try - Result := TSkottieAnimation.MakeFromStream(LDecompressionStream); + Result := TSkottieAnimation.MakeFromStream(LDecompressionStream, TSkDefaultProviders.Resource); finally LDecompressionStream.Free; end; @@ -2837,7 +3955,7 @@ class function TSkLottieAnimationCodec.TryMakeFromStream(const AStream: TStream; if IsTgs then LSkottie := MakeFromTgsStream(AStream) else - LSkottie := TSkottieAnimation.MakeFromStream(AStream); + LSkottie := TSkottieAnimation.MakeFromStream(AStream, TSkDefaultProviders.Resource); Result := Assigned(LSkottie); if Result then @@ -2846,208 +3964,6 @@ class function TSkLottieAnimationCodec.TryMakeFromStream(const AStream: TStream; ACodec := nil; end; -{ TSkPersistentData } - -procedure TSkPersistentData.AfterConstruction; -begin - inherited; - FCreated := True; -end; - -procedure TSkPersistentData.Assign(ASource: TPersistent); -begin - if ASource <> Self then - begin - BeginUpdate; - try - DoAssign(ASource); - finally - EndUpdate; - end; - end; -end; - -procedure TSkPersistentData.BeginUpdate; -begin - BeginUpdate(False); -end; - -procedure TSkPersistentData.BeginUpdate(const AIgnoreAllChanges: Boolean); -begin - Inc(FUpdatingCount); - FIgnoringAllChanges := FIgnoringAllChanges or AIgnoreAllChanges; -end; - -procedure TSkPersistentData.Change; -begin - if FUpdatingCount > 0 then - FChanged := True - else - begin - FChanged := False; - DoChanged; - end; -end; - -procedure TSkPersistentData.DoAssign(ASource: TPersistent); -begin - inherited Assign(ASource); -end; - -procedure TSkPersistentData.DoChanged; -begin - if FCreated and Assigned(FOnChange) then - FOnChange(Self); -end; - -procedure TSkPersistentData.EndUpdate; -begin - EndUpdate(False); -end; - -procedure TSkPersistentData.EndUpdate(const AIgnoreAllChanges: Boolean); -var - LCallChange: Boolean; - LIgnoreChanges: Boolean; -begin - LIgnoreChanges := AIgnoreAllChanges or FIgnoringAllChanges; - LCallChange := False; - if FUpdatingCount <= 0 then - raise ESkPersistentData.Create('The object is not in update state'); - Dec(FUpdatingCount); - if (not LIgnoreChanges) and HasChanged then - LCallChange := True - else - FChanged := False; - if FUpdatingCount <= 0 then - FIgnoringAllChanges := False; - if LCallChange and (FUpdatingCount = 0) then - begin - FChanged := False; - DoChanged; - end; -end; - -function TSkPersistentData.GetHasChanged: Boolean; -begin - Result := FChanged; -end; - -function TSkPersistentData.GetUpdating: Boolean; -begin - Result := FUpdatingCount > 0; -end; - -procedure TSkPersistentData.SetValue(var AField: Byte; const AValue: Byte); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Word; const AValue: Word); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Double; const AValue, - AEpsilon: Double); -begin - if not SameValue(AField, AValue, AEpsilon) then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: TBytes; const AValue: TBytes); -begin - if not IsSameBytes(AField, AValue) then - begin - AField := Copy(AValue); - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: string; const AValue: string); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Single; const AValue, - AEpsilon: Single); -begin - if not SameValue(AField, AValue, AEpsilon) then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Boolean; - const AValue: Boolean); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Cardinal; - const AValue: Cardinal); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Integer; - const AValue: Integer); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: Int64; const AValue: Int64); -begin - if AField <> AValue then - begin - AField := AValue; - Change; - end; -end; - -procedure TSkPersistentData.SetValue(var AField: T; const AValue: T); -var - LDifferent: Boolean; -begin - if Assigned(TypeInfo(T)) and (PTypeInfo(TypeInfo(T)).Kind in [TTypeKind.tkSet, TTypeKind.tkEnumeration, TTypeKind.tkRecord{$IF CompilerVersion >= 33}, TTypeKind.tkMRecord{$ENDIF}]) then - LDifferent := not CompareMem(@AField, @AValue, SizeOf(T)) - else - LDifferent := TComparer.Default.Compare(AField, AValue) <> 0; - if LDifferent then - begin - AField := AValue; - Change; - end; -end; - { TSkFontComponent } procedure TSkFontComponent.AssignTo(ADest: TPersistent); @@ -4197,6 +5113,14 @@ destructor TSkLabel.Destroy; inherited; end; +function TSkLabel.DidExceedMaxLines: Boolean; +var + LParagraph: ISkParagraph; +begin + LParagraph := Paragraph; + Result := Assigned(LParagraph) and (LParagraph.DidExceedMaxLines); +end; + procedure TSkLabel.Draw(const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); @@ -4335,7 +5259,7 @@ procedure TSkLabel.GetFitSize(var AWidth, AHeight: Single); if Assigned(LParagraph) then begin if (akLeft in Anchors) and (akRight in Anchors) then - ParagraphLayout(AWidth) + ParagraphLayout(AWidth / ScaleFactor) else ParagraphLayout(High(Integer)); end; @@ -4344,10 +5268,21 @@ procedure TSkLabel.GetFitSize(var AWidth, AHeight: Single); AHeight := GetFitHeight; finally if Assigned(LParagraph) then - ParagraphLayout(AWidth); + ParagraphLayout(AWidth / ScaleFactor); end; end; +function TSkLabel.GetLinesCount: Integer; +var + LParagraph: ISkParagraph; +begin + LParagraph := Paragraph; + if Assigned(LParagraph) then + Result := Length(LParagraph.LineMetrics) + else + Result := 0; +end; + function TSkLabel.GetParagraph: ISkParagraph; type TDrawKind = (Fill, Stroke); @@ -4473,7 +5408,7 @@ function TSkLabel.GetParagraph: ISkParagraph; I: Integer; begin LDefaultTextStyle := CreateDefaultTextStyle(ADrawKind); - LBuilder := TSkParagraphBuilder.Create(CreateParagraphStyle(LDefaultTextStyle), TSkTypefaceManager.Provider); + LBuilder := TSkParagraphBuilder.Create(CreateParagraphStyle(LDefaultTextStyle), TSkDefaultProviders.TypefaceFont); for I := 0 to FWords.Count- 1 do begin @@ -4505,7 +5440,7 @@ function TSkLabel.GetParagraph: ISkParagraph; FParagraph := CreateParagraph(TDrawKind.Fill); if LHasTextStroked then FParagraphStroked := CreateParagraph(TDrawKind.Stroke); - ParagraphLayout(Width); + ParagraphLayout(Width / ScaleFactor); end; Result := FParagraph; end; @@ -4579,11 +5514,12 @@ function TSkLabel.GetWordsItemAtPosition(const AX, if Assigned(LParagraph) then begin case ResultingTextSettings.VertAlign of - TSkTextVertAlign.Center: LParagraphPoint := PointF(AX, AY - (Height - ParagraphBounds.Height) / 2); - TSkTextVertAlign.Trailing: LParagraphPoint := PointF(AX, AY - Height - ParagraphBounds.Height); + TSkTextVertAlign.Center: LParagraphPoint := PointF(AX, AY - (Height - ParagraphBounds.Height * ScaleFactor) / 2); + TSkTextVertAlign.Trailing: LParagraphPoint := PointF(AX, AY - Height - ParagraphBounds.Height * ScaleFactor); else LParagraphPoint := PointF(AX, AY); end; + LParagraphPoint := LParagraphPoint / ScaleFactor; LTextIndex := 0; for I := 0 to FWords.Count - 1 do begin @@ -4776,21 +5712,38 @@ procedure TSkLabel.WordsChange(ASender: TObject); TextSettingsChanged(nil); end; +{ TSkDefaultProviders } + +class constructor TSkDefaultProviders.Create; +begin + FTypefaceFont := TSkTypefaceFontProvider.Create; +end; + +class procedure TSkDefaultProviders.RegisterTypeface(const AFileName: string); +begin + FTypefaceFont.RegisterTypeface(TSkTypeFace.MakeFromFile(AFileName)); +end; + +class procedure TSkDefaultProviders.RegisterTypeface(const AStream: TStream); +begin + FTypefaceFont.RegisterTypeface(TSkTypeFace.MakeFromStream(AStream)); +end; + { TSkTypefaceManager } -class constructor TSkTypefaceManager.Create; +class function TSkTypefaceManager.Provider: ISkTypefaceFontProvider; begin - FProvider := TSkTypefaceFontProvider.Create; + Result := TSkDefaultProviders.TypefaceFont; end; class procedure TSkTypefaceManager.RegisterTypeface(const AFileName: string); begin - FProvider.RegisterTypeface(TSkTypeFace.MakeFromFile(AFileName)); + TSkDefaultProviders.RegisterTypeface(AFileName); end; class procedure TSkTypefaceManager.RegisterTypeface(const AStream: TStream); begin - FProvider.RegisterTypeface(TSkTypeFace.MakeFromStream(AStream)); + TSkDefaultProviders.RegisterTypeface(AStream); end; { TSkGraphic } @@ -5161,22 +6114,82 @@ procedure Register; RegisterComponents('Skia', [TSkAnimatedImage, TSkAnimatedPaintBox, TSkLabel, TSkPaintBox, TSkSvg]); end; +{$IFDEF MSWINDOWS} + {$HPPEMIT '#ifdef USEPACKAGES'} + {$HPPEMIT ' #pragma link "Skia.Package.VCL.bpi"'} + {$HPPEMIT '#elif defined(__WIN32__)'} + {$HPPEMIT ' #pragma link "Skia.Package.VCL.lib"'} + {$HPPEMIT '#elif defined(_WIN64)'} + {$HPPEMIT ' #pragma link "Skia.Package.VCL.a"'} + {$HPPEMIT '#endif'} +{$ENDIF} + +(*$HPPEMIT 'namespace Skia {'*) +(*$HPPEMIT ' namespace Vcl {'*) +(*$HPPEMIT ' namespace Graphics { using namespace ::Vcl::Graphics; }'*) +(*$HPPEMIT ' namespace Controls { using namespace ::Vcl::Controls; }'*) +(*$HPPEMIT ' namespace Extctrls { using namespace ::Vcl::Extctrls; }'*) +(*$HPPEMIT ' }'*) +(*$HPPEMIT '}'*) + +{$HPPEMIT NOUSINGNAMESPACE} +{$HPPEMIT END '#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_SKIA)'} +{$HPPEMIT END ' using ::Skia::Vcl::_di_ISkTextSettings;'} +{$HPPEMIT END ' using ::Skia::Vcl::_di_TSkAnimationDrawProc;'} +{$HPPEMIT END ' using ::Skia::Vcl::_di_TSkDrawProc;'} +{$HPPEMIT END ' using ::Skia::Vcl::ESkBitmapHelper;'} +{$HPPEMIT END ' using ::Skia::Vcl::ESkLabel;'} +{$HPPEMIT END ' using ::Skia::Vcl::ESkPersistentData;'} +{$HPPEMIT END ' using ::Skia::Vcl::ESkTextSettingsInfo;'} +{$HPPEMIT END ' using ::Skia::Vcl::ESkVcl;'} +{$HPPEMIT END ' using ::Skia::Vcl::ISkTextSettings;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkAnimatedImage;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkAnimatedImageWrapMode;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkAnimatedPaintBox;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkAnimationDrawEvent;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkAnimationDrawProc;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkCustomAnimatedControl;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkCustomAnimation;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkCustomControl;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkCustomWinControl;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkDefaultProviders;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkDrawCacheKind;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkDrawEvent;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkDrawProc;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkFontComponent;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkLabel;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkPaintBox;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkPersistent;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkStyledSetting;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkStyledSettings;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkSvg;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkSvgBrush;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkSvgSource;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkSvgWrapMode;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkTextHorzAlign;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkTextSettings;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkTextSettingsClass;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkTextSettingsInfo;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkTextTrimming;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkTextVertAlign;'} +{$HPPEMIT END ' using ::Skia::Vcl::TSkTypefaceManager;'} +{$HPPEMIT END ' typedef ::Skia::_di_ISkImage (__fastcall *TBitmapToSkImageFunc)(::Vcl::Graphics::TBitmap* const ABitmap);'} +{$HPPEMIT END ' typedef void (__fastcall *TSkiaDrawProc)(::Vcl::Graphics::TBitmap* const ABitmap, const ::Skia::Vcl::_di_TSkDrawProc AProc, const bool AStartClean);'} +{$HPPEMIT END ' typedef ::Vcl::Graphics::TBitmap* (__fastcall *TSkImageToBitmapFunc)(const ::Skia::_di_ISkImage AImage);'} +{$HPPEMIT END ' static TSkStyledSettings& AllStyledSettings = ::Skia::Vcl::AllStyledSettings;'} +{$HPPEMIT END ' static TSkStyledSettings& DefaultStyledSettings = ::Skia::Vcl::DefaultStyledSettings;'} +{$HPPEMIT END ' static const TBitmapToSkImageFunc BitmapToSkImage = ::Skia::Vcl::BitmapToSkImage;'} +{$HPPEMIT END ' static const TSkiaDrawProc SkiaDraw = ::Skia::Vcl::SkiaDraw;'} +{$HPPEMIT END ' static const TSkImageToBitmapFunc SkImageToBitmap = ::Skia::Vcl::SkImageToBitmap;'} +{$HPPEMIT END '#endif'} + initialization TSkAnimatedImage.RegisterCodec(TSkLottieAnimationCodec); TSkAnimatedImage.RegisterCodec(TSkDefaultAnimationCodec); TPicture.RegisterFileFormat('svg', 'Scalable Vector Graphics', TSkSvgGraphic); TPicture.RegisterFileFormat('webp', 'WebP Images', TSkGraphic); TPicture.RegisterFileFormat('wbmp', 'WBMP Images', TSkGraphic); - TPicture.RegisterFileFormat('arw', 'Raw Sony', TSkGraphic); - TPicture.RegisterFileFormat('cr2', 'Raw Canon', TSkGraphic); - TPicture.RegisterFileFormat('dng', 'Raw Adobe DNG Digital Negative', TSkGraphic); - TPicture.RegisterFileFormat('nef', 'Raw Nikon', TSkGraphic); - TPicture.RegisterFileFormat('nrw', 'Raw Nikon', TSkGraphic); - TPicture.RegisterFileFormat('orf', 'Raw Olympus ORF', TSkGraphic); - TPicture.RegisterFileFormat('raf', 'Raw Fujifilm RAF', TSkGraphic); - TPicture.RegisterFileFormat('rw2', 'Raw Panasonic', TSkGraphic); - TPicture.RegisterFileFormat('pef', 'Raw Pentax PEF', TSkGraphic); - TPicture.RegisterFileFormat('srw', 'Raw Samsung SRW', TSkGraphic); + TSkCustomAnimation.FrameRate := TSkCustomAnimation.DefaultFrameRate; finalization TPicture.UnregisterGraphicClass(TSkGraphic); TPicture.UnregisterGraphicClass(TSkSvgGraphic);