Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | Properties | List of all members
AppViewDelegate Class Reference
Inheritance diagram for AppViewDelegate:

Instance Methods

(void) - drawInMTKView: [implementation]
 
(void) - mtkView:drawableSizeWillChange: [implementation]
 

Properties

GrDirectContextgrContext
 
id< MTLCommandQueue > metalQueue
 

Detailed Description

Definition at line 47 of file main.mm.

Method Documentation

◆ drawInMTKView:

- (void) drawInMTKView: (nonnull MTKView *)  view
implementation

Definition at line 49 of file main.mm.

56 :(nonnull MTKView *)view {
57 if (![self grContext] || !view) {
58 return;
59 }
60 // Do as much as possible before creating surface.
61 config_paint(&fPaint);
62 float rotation = (float)(180 * 1e-9 * SkTime::GetNSecs());
63
64 // Create surface:
66 if (!surface) {
67 NSLog(@"error: no sksurface");
68 return;
69 }
70
71 draw_example(surface.get(), fPaint, rotation);
72
73 // Must flush *and* present for this to work!
75 surface = nullptr;
76
77 id<MTLCommandBuffer> commandBuffer = [[self metalQueue] commandBuffer];
78 [commandBuffer presentDrawable:[view currentDrawable]];
79 [commandBuffer commit];
80}
sk_sp< SkSurface > SkMtkViewToSurface(MTKView *, GrRecordingContext *)
VkSurfaceKHR surface
Definition main.cc:49
GrDirectContext * grContext
Definition main.mm:48
double GetNSecs()
Definition SkTime.cpp:17
SK_API GrSemaphoresSubmitted Flush(sk_sp< SkSurface >)
static void config_paint(SkPaint *paint)
Definition main.mm:29
static void draw_example(SkSurface *surface, const SkPaint &paint, double rotation)
Definition main.mm:38

◆ mtkView:drawableSizeWillChange:

- (void) mtkView: (nonnull MTKView *)  view
drawableSizeWillChange: (CGSize)  size 
implementation

Definition at line 49 of file main.mm.

82 :(nonnull MTKView *)view drawableSizeWillChange:(CGSize)size {
83 // change anything on size change?
84}
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
Definition switches.h:259

Property Documentation

◆ grContext

- (GrDirectContext*) grContext
readwritenonatomicassign

Definition at line 48 of file main.mm.

◆ metalQueue

- (id<MTLCommandQueue>) metalQueue
readwritenonatomicassign

Definition at line 49 of file main.mm.


The documentation for this class was generated from the following file: