Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Metal APIs from main branch #1598

Merged
merged 28 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f3f0d44
Add Metal
mattleibow Jul 10, 2020
2115f62
Update externals
mattleibow Jul 10, 2020
c5eb1c6
Changes
mattleibow Jul 11, 2020
a0e2c59
undos
mattleibow Jul 11, 2020
ded3586
dsfgdsf 
mattleibow Jul 11, 2020
488cbde
Merge branch 'master' into dev/metal
mattleibow Jul 19, 2020
e14b92b
Merge branch 'master' into dev/metal
mattleibow Jul 19, 2020
cba19ad
Merge branch 'master' into dev/metal
mattleibow Jul 21, 2020
a1a7b18
regen
mattleibow Jul 21, 2020
96f4a26
sdfasdf
mattleibow Jul 21, 2020
6d7d0d9
SKMetalView
mattleibow Jul 21, 2020
719368a
Merge master into dev/metal
mattleibow Oct 10, 2020
1fd0a1d
Update PR
mattleibow Feb 1, 2021
951333d
Merge branch 'master' into dev/metal
mattleibow Feb 1, 2021
753d395
Merge branch 'dev/skia-update' into dev/metal-update
mattleibow Feb 1, 2021
6b6213f
Some fixes
mattleibow Feb 1, 2021
daf2657
Fixing things up
mattleibow Feb 1, 2021
fc244e3
Fix changed enums
mattleibow Feb 1, 2021
7d087c9
Remove the externals/harfbuzz submodule (#1599)
mattleibow Feb 1, 2021
2a87a0d
Add Metal APIs for macOS and iOS (#1394)
mattleibow Feb 2, 2021
112025b
Revert "Add Metal APIs for macOS and iOS (#1394)"
mattleibow Feb 2, 2021
29e8f26
Add Metal APIs for macOS and iOS (#1394)
mattleibow Feb 2, 2021
d966ef2
docs: Add unoplatform references (#1602)
jeromelaban Feb 2, 2021
97efda8
Merge branch 'dev/skia-update' into dev/metal-update
mattleibow Feb 2, 2021
fa6fbbe
Merge branch 'master' into dev/metal-update
mattleibow Feb 2, 2021
abc73fe
Merge branch 'master' into dev/metal-update
mattleibow Feb 2, 2021
e3a2414
Add a symlink for a "missing" file
mattleibow Feb 2, 2021
f66ea3b
Merge branch 'master' into dev/metal-update
mattleibow Feb 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Metal APIs for macOS and iOS (#1394)
  • Loading branch information
mattleibow committed Feb 2, 2021
commit 29e8f2675123f43e918e48393634d97e62453b4a
15 changes: 15 additions & 0 deletions binding/Binding/GRBackendRenderTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ public GRBackendRenderTarget (int width, int height, int sampleCount, GRVkImageI
CreateVulkan (width, height, sampleCount, vkImageInfo);
}

#if __IOS__ || __MACOS__

public GRBackendRenderTarget (int width, int height, int sampleCount, GRMetalTextureInfo mtlInfo)
: this (IntPtr.Zero, true)
{
var info = mtlInfo.ToNative ();
Handle = SkiaApi.gr_backendrendertarget_new_metal (width, height, sampleCount, &info);

if (Handle == IntPtr.Zero) {
throw new InvalidOperationException ("Unable to create a new GRBackendRenderTarget instance.");
}
}

#endif

private void CreateGl (int width, int height, int sampleCount, int stencilBits, GRGlFramebufferInfo glInfo)
{
Handle = SkiaApi.gr_backendrendertarget_new_gl (width, height, sampleCount, stencilBits, &glInfo);
Expand Down
15 changes: 15 additions & 0 deletions binding/Binding/GRBackendTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ public GRBackendTexture (int width, int height, GRVkImageInfo vkInfo)
CreateVulkan (width, height, vkInfo);
}

#if __IOS__ || __MACOS__

public GRBackendTexture (int width, int height, bool mipmapped, GRMetalTextureInfo mtlInfo)
: this (IntPtr.Zero, true)
{
var info = mtlInfo.ToNative ();
Handle = SkiaApi.gr_backendtexture_new_metal (width, height, mipmapped, &info);

if (Handle == IntPtr.Zero) {
throw new InvalidOperationException ("Unable to create a new GRBackendTexture instance.");
}
}

#endif

private void CreateGl (int width, int height, bool mipmapped, GRGlTextureInfo glInfo)
{
Handle = SkiaApi.gr_backendtexture_new_gl (width, height, mipmapped, &glInfo);
Expand Down
16 changes: 16 additions & 0 deletions binding/Binding/GRContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ public static GRContext CreateVulkan (GRVkBackendContext backendContext)
return GetObject (SkiaApi.gr_context_make_vulkan (backendContext.ToNative ()));
}

#if __IOS__ || __MACOS__

// CreateMetal

public static GRContext CreateMetal (Metal.IMTLDevice device, Metal.IMTLCommandQueue queue)
{
if (device == null)
throw new ArgumentNullException (nameof (device));
if (queue == null)
throw new ArgumentNullException (nameof (queue));

return GetObject (SkiaApi.gr_context_make_metal ((void*)device.Handle, (void*)queue.Handle));
}

#endif

//

public GRBackend Backend => SkiaApi.gr_context_get_backend (Handle).FromNative ();
Expand Down
38 changes: 38 additions & 0 deletions binding/Binding/GRDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,44 @@ public GRGlTextureInfo (uint target, uint id, uint format)
}
}

#if __IOS__ || __MACOS__

public unsafe partial struct GRMetalTextureInfo
{
public GRMetalTextureInfo (Metal.IMTLTexture texture)
{
Texture = texture;
}

public Metal.IMTLTexture Texture { get; set; }

internal GRMetalTextureInfoNative ToNative () =>
new GRMetalTextureInfoNative {
fTexture = (void*)Texture.Handle
};

public readonly bool Equals (GRMetalTextureInfo obj) =>
Texture == obj.Texture;

public readonly override bool Equals (object obj) =>
obj is GRMetalTextureInfo f && Equals (f);

public static bool operator == (GRMetalTextureInfo left, GRMetalTextureInfo right) =>
left.Equals (right);

public static bool operator != (GRMetalTextureInfo left, GRMetalTextureInfo right) =>
!left.Equals (right);

public readonly override int GetHashCode ()
{
var hash = new HashCode ();
hash.Add (Texture);
return hash.ToHashCode ();
}
}

#endif

[EditorBrowsable (EditorBrowsableState.Never)]
[Flags]
[Obsolete]
Expand Down
21 changes: 21 additions & 0 deletions binding/Binding/SKSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,24 @@ public static SKSurface Create (GRContext context, bool budgeted, SKImageInfo in
return GetObject (SkiaApi.sk_surface_new_render_target (context.Handle, budgeted, &cinfo, sampleCount, origin, props?.Handle ?? IntPtr.Zero, shouldCreateWithMips));
}

#if __MACOS__ || __IOS__

public static SKSurface Create (GRContext context, CoreAnimation.CAMetalLayer layer, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, out CoreAnimation.ICAMetalDrawable drawable) =>
Create (context, layer, origin, sampleCount, colorType, null, null, out drawable);

public static SKSurface Create (GRContext context, CoreAnimation.CAMetalLayer layer, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, out CoreAnimation.ICAMetalDrawable drawable) =>
Create (context, layer, origin, sampleCount, colorType, colorspace, null, out drawable);

public static SKSurface Create (GRContext context, CoreAnimation.CAMetalLayer layer, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props, out CoreAnimation.ICAMetalDrawable drawable)
{
void* drawablePtr;
var surface = GetObject (SkiaApi.sk_surface_new_metal_layer (context.Handle, (void*)layer.Handle, origin, sampleCount, colorType.ToNative (), colorspace?.Handle ?? IntPtr.Zero, props?.Handle ?? IntPtr.Zero, &drawablePtr));
drawable = ObjCRuntime.Runtime.GetINativeObject<CoreAnimation.ICAMetalDrawable> ((IntPtr)drawablePtr, true);
return surface;
}

#endif

// NULL surface

public static SKSurface CreateNull (int width, int height) =>
Expand Down Expand Up @@ -354,6 +372,9 @@ public bool ReadPixels (SKImageInfo dstInfo, IntPtr dstPixels, int dstRowBytes,
return result;
}

public void Flush () =>
SkiaApi.sk_surface_flush (Handle);

internal static SKSurface GetObject (IntPtr handle) =>
handle == IntPtr.Zero ? null : new SKSurface (handle, true);
}
Expand Down
97 changes: 97 additions & 0 deletions binding/Binding/SkiaApi.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,20 @@ private partial class Delegates {
(gr_backendrendertarget_new_gl_delegate ??= GetSymbol<Delegates.gr_backendrendertarget_new_gl> ("gr_backendrendertarget_new_gl")).Invoke (width, height, samples, stencils, glInfo);
#endif

// gr_backendrendertarget_t* gr_backendrendertarget_new_metal(int width, int height, int samples, const gr_mtl_textureinfo_t* mtlInfo)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
internal static extern gr_backendrendertarget_t gr_backendrendertarget_new_metal (Int32 width, Int32 height, Int32 samples, GRMetalTextureInfoNative* mtlInfo);
#else
private partial class Delegates {
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
internal delegate gr_backendrendertarget_t gr_backendrendertarget_new_metal (Int32 width, Int32 height, Int32 samples, GRMetalTextureInfoNative* mtlInfo);
}
private static Delegates.gr_backendrendertarget_new_metal gr_backendrendertarget_new_metal_delegate;
internal static gr_backendrendertarget_t gr_backendrendertarget_new_metal (Int32 width, Int32 height, Int32 samples, GRMetalTextureInfoNative* mtlInfo) =>
(gr_backendrendertarget_new_metal_delegate ??= GetSymbol<Delegates.gr_backendrendertarget_new_metal> ("gr_backendrendertarget_new_metal")).Invoke (width, height, samples, mtlInfo);
#endif

// gr_backendrendertarget_t* gr_backendrendertarget_new_vulkan(int width, int height, int samples, const gr_vk_imageinfo_t* vkImageInfo)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -353,6 +367,20 @@ private partial class Delegates {
(gr_backendtexture_new_gl_delegate ??= GetSymbol<Delegates.gr_backendtexture_new_gl> ("gr_backendtexture_new_gl")).Invoke (width, height, mipmapped, glInfo);
#endif

// gr_backendtexture_t* gr_backendtexture_new_metal(int width, int height, bool mipmapped, const gr_mtl_textureinfo_t* mtlInfo)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
internal static extern gr_backendtexture_t gr_backendtexture_new_metal (Int32 width, Int32 height, [MarshalAs (UnmanagedType.I1)] bool mipmapped, GRMetalTextureInfoNative* mtlInfo);
#else
private partial class Delegates {
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
internal delegate gr_backendtexture_t gr_backendtexture_new_metal (Int32 width, Int32 height, [MarshalAs (UnmanagedType.I1)] bool mipmapped, GRMetalTextureInfoNative* mtlInfo);
}
private static Delegates.gr_backendtexture_new_metal gr_backendtexture_new_metal_delegate;
internal static gr_backendtexture_t gr_backendtexture_new_metal (Int32 width, Int32 height, [MarshalAs (UnmanagedType.I1)] bool mipmapped, GRMetalTextureInfoNative* mtlInfo) =>
(gr_backendtexture_new_metal_delegate ??= GetSymbol<Delegates.gr_backendtexture_new_metal> ("gr_backendtexture_new_metal")).Invoke (width, height, mipmapped, mtlInfo);
#endif

// gr_backendtexture_t* gr_backendtexture_new_vulkan(int width, int height, const gr_vk_imageinfo_t* vkInfo)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -493,6 +521,20 @@ private partial class Delegates {
(gr_context_make_gl_delegate ??= GetSymbol<Delegates.gr_context_make_gl> ("gr_context_make_gl")).Invoke (glInterface);
#endif

// gr_context_t* gr_context_make_metal(void* device, void* queue)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
internal static extern gr_context_t gr_context_make_metal (void* device, void* queue);
#else
private partial class Delegates {
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
internal delegate gr_context_t gr_context_make_metal (void* device, void* queue);
}
private static Delegates.gr_context_make_metal gr_context_make_metal_delegate;
internal static gr_context_t gr_context_make_metal (void* device, void* queue) =>
(gr_context_make_metal_delegate ??= GetSymbol<Delegates.gr_context_make_metal> ("gr_context_make_metal")).Invoke (device, queue);
#endif

// gr_context_t* gr_context_make_vulkan(const gr_vk_backendcontext_t vkBackendContext)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -11429,6 +11471,20 @@ private partial class Delegates {
(sk_surface_draw_delegate ??= GetSymbol<Delegates.sk_surface_draw> ("sk_surface_draw")).Invoke (surface, canvas, x, y, paint);
#endif

// void sk_surface_flush(sk_surface_t* surface)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
internal static extern void sk_surface_flush (sk_surface_t surface);
#else
private partial class Delegates {
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
internal delegate void sk_surface_flush (sk_surface_t surface);
}
private static Delegates.sk_surface_flush sk_surface_flush_delegate;
internal static void sk_surface_flush (sk_surface_t surface) =>
(sk_surface_flush_delegate ??= GetSymbol<Delegates.sk_surface_flush> ("sk_surface_flush")).Invoke (surface);
#endif

// sk_canvas_t* sk_surface_get_canvas(sk_surface_t*)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -11527,6 +11583,20 @@ private partial class Delegates {
(sk_surface_new_image_snapshot_with_crop_delegate ??= GetSymbol<Delegates.sk_surface_new_image_snapshot_with_crop> ("sk_surface_new_image_snapshot_with_crop")).Invoke (surface, bounds);
#endif

// sk_surface_t* sk_surface_new_metal_layer(gr_context_t* context, const void* layer, gr_surfaceorigin_t origin, int sampleCount, sk_colortype_t colorType, sk_colorspace_t* colorspace, const sk_surfaceprops_t* props, const void** drawable)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
internal static extern sk_surface_t sk_surface_new_metal_layer (gr_context_t context, void* layer, GRSurfaceOrigin origin, Int32 sampleCount, SKColorTypeNative colorType, sk_colorspace_t colorspace, sk_surfaceprops_t props, void** drawable);
#else
private partial class Delegates {
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
internal delegate sk_surface_t sk_surface_new_metal_layer (gr_context_t context, void* layer, GRSurfaceOrigin origin, Int32 sampleCount, SKColorTypeNative colorType, sk_colorspace_t colorspace, sk_surfaceprops_t props, void** drawable);
}
private static Delegates.sk_surface_new_metal_layer sk_surface_new_metal_layer_delegate;
internal static sk_surface_t sk_surface_new_metal_layer (gr_context_t context, void* layer, GRSurfaceOrigin origin, Int32 sampleCount, SKColorTypeNative colorType, sk_colorspace_t colorspace, sk_surfaceprops_t props, void** drawable) =>
(sk_surface_new_metal_layer_delegate ??= GetSymbol<Delegates.sk_surface_new_metal_layer> ("sk_surface_new_metal_layer")).Invoke (context, layer, origin, sampleCount, colorType, colorspace, props, drawable);
#endif

// sk_surface_t* sk_surface_new_null(int width, int height)
#if !USE_DELEGATES
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -13262,6 +13332,33 @@ public unsafe partial struct GRGlTextureInfo : IEquatable<GRGlTextureInfo> {

}

// gr_mtl_textureinfo_t
[StructLayout (LayoutKind.Sequential)]
internal unsafe partial struct GRMetalTextureInfoNative : IEquatable<GRMetalTextureInfoNative> {
// public const void* fTexture
public void* fTexture;

public readonly bool Equals (GRMetalTextureInfoNative obj) =>
fTexture == obj.fTexture;

public readonly override bool Equals (object obj) =>
obj is GRMetalTextureInfoNative f && Equals (f);

public static bool operator == (GRMetalTextureInfoNative left, GRMetalTextureInfoNative right) =>
left.Equals (right);

public static bool operator != (GRMetalTextureInfoNative left, GRMetalTextureInfoNative right) =>
!left.Equals (right);

public readonly override int GetHashCode ()
{
var hash = new HashCode ();
hash.Add (fTexture);
return hash.ToHashCode ();
}

}

// gr_vk_alloc_t
[StructLayout (LayoutKind.Sequential)]
public unsafe partial struct GRVkAlloc : IEquatable<GRVkAlloc> {
Expand Down
4 changes: 4 additions & 0 deletions binding/libSkiaSharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
"cs": "GRVkBackendContextNative",
"internal": true
},
"gr_mtl_textureinfo_t": {
"cs": "GRMetalTextureInfoNative",
"internal": true
},
"sk_color4f_t": {
"cs": "SKColorF",
"readonly": true,
Expand Down
1 change: 1 addition & 0 deletions native/ios/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Task("libSkiaSharp")
$"target_cpu='{skiaArch}' " +
$"target_os='ios' " +
$"skia_use_icu=false " +
$"skia_use_metal=true " +
$"skia_use_piex=true " +
$"skia_use_sfntly=false " +
$"skia_use_system_expat=false " +
Expand Down
12 changes: 12 additions & 0 deletions native/ios/libSkiaSharp/libSkiaSharp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
345A7E581E7635B10046F543 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 345A7E571E7635B10046F543 /* CoreGraphics.framework */; };
345A7E5A1E7635B50046F543 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 345A7E591E7635B50046F543 /* CoreFoundation.framework */; };
345A7E5C1E7635B90046F543 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 345A7E5B1E7635B90046F543 /* CoreText.framework */; };
34AC596F24B80BAD009CDA1D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34AC596E24B80BAD009CDA1D /* Foundation.framework */; };
34AC597224B80BB4009CDA1D /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34AC597024B80BB4009CDA1D /* MetalKit.framework */; };
34AC597324B80BB4009CDA1D /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34AC597124B80BB4009CDA1D /* Metal.framework */; };
34B07C3A24EF0BE700FE3EC9 /* sk_managedtracememorydump.h in Headers */ = {isa = PBXBuildFile; fileRef = 34B07C3624EF0BE700FE3EC9 /* sk_managedtracememorydump.h */; };
34B07C3B24EF0BE700FE3EC9 /* SkManagedTraceMemoryDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 34B07C3724EF0BE700FE3EC9 /* SkManagedTraceMemoryDump.h */; };
34B07C3C24EF0BE700FE3EC9 /* SkManagedTraceMemoryDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34B07C3824EF0BE700FE3EC9 /* SkManagedTraceMemoryDump.cpp */; };
Expand Down Expand Up @@ -44,6 +47,9 @@
345A7E571E7635B10046F543 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
345A7E591E7635B50046F543 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
345A7E5B1E7635B90046F543 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
34AC596E24B80BAD009CDA1D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
34AC597024B80BB4009CDA1D /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/MetalKit.framework; sourceTree = DEVELOPER_DIR; };
34AC597124B80BB4009CDA1D /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Metal.framework; sourceTree = DEVELOPER_DIR; };
34B07C3624EF0BE700FE3EC9 /* sk_managedtracememorydump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sk_managedtracememorydump.h; path = ../../../../externals/skia/include/xamarin/sk_managedtracememorydump.h; sourceTree = "<group>"; };
34B07C3724EF0BE700FE3EC9 /* SkManagedTraceMemoryDump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkManagedTraceMemoryDump.h; path = ../../../../externals/skia/include/xamarin/SkManagedTraceMemoryDump.h; sourceTree = "<group>"; };
34B07C3824EF0BE700FE3EC9 /* SkManagedTraceMemoryDump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkManagedTraceMemoryDump.cpp; path = ../../../../externals/skia/src/xamarin/SkManagedTraceMemoryDump.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -72,6 +78,9 @@
345A7E5C1E7635B90046F543 /* CoreText.framework in Frameworks */,
345A7E5A1E7635B50046F543 /* CoreFoundation.framework in Frameworks */,
345A7E581E7635B10046F543 /* CoreGraphics.framework in Frameworks */,
34AC597224B80BB4009CDA1D /* MetalKit.framework in Frameworks */,
34AC597324B80BB4009CDA1D /* Metal.framework in Frameworks */,
34AC596F24B80BAD009CDA1D /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -129,6 +138,9 @@
345A7E561E7635B00046F543 /* Frameworks */ = {
isa = PBXGroup;
children = (
34AC597124B80BB4009CDA1D /* Metal.framework */,
34AC597024B80BB4009CDA1D /* MetalKit.framework */,
34AC596E24B80BAD009CDA1D /* Foundation.framework */,
345A7E5B1E7635B90046F543 /* CoreText.framework */,
345A7E591E7635B50046F543 /* CoreFoundation.framework */,
345A7E571E7635B10046F543 /* CoreGraphics.framework */,
Expand Down
5 changes: 3 additions & 2 deletions native/macos/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ Task("libSkiaSharp")
$"target_os='mac' " +
$"target_cpu='{skiaArch}' " +
$"skia_use_icu=false " +
$"skia_use_metal=true " +
$"skia_use_piex=true " +
$"skia_use_sfntly=false " +
$"skia_use_system_expat=false " +
$"skia_use_system_libjpeg_turbo=false " +
$"skia_use_system_libpng=false " +
$"skia_use_system_libwebp=false " +
$"skia_use_system_zlib=false " +
$"extra_cflags=[ '-DSKIA_C_DLL', '-DHAVE_ARC4RANDOM_BUF', '-mmacosx-version-min=10.7', '-stdlib=libc++' ] " +
$"extra_ldflags=[ '-Wl,macosx_version_min=10.7', '-stdlib=libc++' ]");
$"extra_cflags=[ '-DSKIA_C_DLL', '-DHAVE_ARC4RANDOM_BUF', '-mmacosx-version-min=10.8', '-stdlib=libc++' ] " +
$"extra_ldflags=[ '-Wl,macosx_version_min=10.8', '-stdlib=libc++' ]");

RunXCodeBuild("libSkiaSharp/libSkiaSharp.xcodeproj", "libSkiaSharp", "macosx", arch);

Expand Down
Loading