12#import <Metal/Metal.h>
13#import <MetalKit/MetalKit.h>
14#import <UIKit/UIKit.h>
21 - (void)drawRect:(CGRect)
rect;
31 id<MTLCommandQueue> fQueue;
36 device:(
id<MTLDevice>)mtlDevice
37 queue:(
id<MTLCommandQueue>)queue
39 self = [
super initWithFrame:frameRect device:mtlDevice];
46- (void)drawRect:(CGRect)rect {
47 [
super drawRect:rect];
53 CGSize
size = [
self drawableSize];
56 NSLog(
@"error: no sksurface");
63 id<MTLCommandBuffer> commandBuffer = [fQueue commandBuffer];
64 [commandBuffer presentDrawable:[
self currentDrawable]];
65 [commandBuffer commit];
67 bool paused = [viewController
isPaused];
68 [
self setEnableSetNeedsDisplay:paused];
69 [
self setPaused:paused];
76 - (instancetype)
init;
85- (instancetype)
init {
87 [
self setMetalDevice:MTLCreateSystemDefaultDevice()];
89 NSLog(
@"Metal is not supported on this device");
92 [
self setMetalQueue:[[
self metalDevice] newCommandQueue]];
99 NSLog(
@"GrDirectContexts::MakeMetal failed");
107 device:[
self metalDevice]
108 queue:[
self metalQueue]
109 grDevice:fDContext.get()];
110 [skiaView setPreferredFramesPerSecond:30];
111 [skiaView setController:vc];
GrDirectContext * fDContext
SkiaContext * MakeSkiaMetalContext()
void flushAndSubmit(GrSyncCpu sync=GrSyncCpu::kNo)
id< MTLCommandQueue > metalQueue
id< MTLDevice > metalDevice
SkiaViewController * controller
void draw:toCanvas:atSize:(CGRect rect,[toCanvas] SkCanvas *canvas,[atSize] CGSize size)
FlutterViewController * viewController
instancetype initWithFrame
SK_API sk_sp< GrDirectContext > MakeMetal(const GrMtlBackendContext &, const GrContextOptions &)
sk_sp< SkBlender > blender SkRect rect
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
sk_cfp< GrMTLHandle > fDevice
sk_cfp< GrMTLHandle > fQueue