5#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurface.h"
29 return reinterpret_cast<int64_t
>(
_texture);
40- (void)setIsInUseOverride:(
BOOL)isInUseOverride {
44- (instancetype)initWithSize:(CGSize)size device:(
id<MTLDevice>)device {
78+ (IOSurfaceRef)createIOSurfaceWithSize:(CGSize)size {
79 unsigned pixelFormat =
'BGRA';
80 unsigned bytesPerElement = 4;
82 size_t bytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow,
size.width * bytesPerElement);
83 size_t totalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize,
size.height * bytesPerRow);
85 (
id)kIOSurfaceWidth : @(
size.width),
86 (
id)kIOSurfaceHeight : @(
size.height),
87 (
id)kIOSurfacePixelFormat : @(pixelFormat),
88 (
id)kIOSurfaceBytesPerElement : @(bytesPerElement),
89 (
id)kIOSurfaceBytesPerRow : @(bytesPerRow),
90 (
id)kIOSurfaceAllocSize : @(totalBytes),
93 IOSurfaceRef res = IOSurfaceCreate((CFDictionaryRef)
options);
94 IOSurfaceSetValue(res, CFSTR(
"IOSurfaceColorSpace"), kCGColorSpaceSRGB);
98+ (
id<MTLTexture>)createTextureForIOSurface:(IOSurfaceRef)surface
100 device:(
id<MTLDevice>)device {
101 MTLTextureDescriptor* textureDescriptor =
102 [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatBGRA8Unorm
106 textureDescriptor.usage =
107 MTLTextureUsageShaderRead | MTLTextureUsageRenderTarget | MTLTextureUsageShaderWrite;
109 return [device newTextureWithDescriptor:textureDescriptor iosurface:surface plane:0];
static void ReleaseSurface(void *surface)
FlutterMetalTexture asFlutterMetalTexture()
IOSurfaceRef createIOSurfaceWithSize:(CGSize size)
id< MTLTexture > _texture
id< MTLTexture > createTextureForIOSurface:size:device:(IOSurfaceRef surface, [size] CGSize size, [device] id< MTLDevice > device)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
FlutterMetalTextureHandle texture
size_t struct_size
The size of this struct. Must be sizeof(FlutterMetalTexture).
VoidCallback destruction_callback