#import <FlutterSurfaceManager.h>
Cache of back buffers to prevent unnecessary IOSurface allocations.
Definition at line 81 of file FlutterSurfaceManager.h.
◆ ageForSurface:
Definition at line 277 of file FlutterSurfaceManager.mm.
293 NSNumber* age = [_surfaceAge objectForKey:surface];
294 return age != nil ? age.intValue : 0;
295}
◆ count
Returns number of surfaces currently in cache. Used for tests.
Definition at line 277 of file FlutterSurfaceManager.mm.
352 {
353 @synchronized(self) {
355 }
356}
NSMutableArray< FlutterSurface * > * _surfaces
◆ dealloc
Definition at line 277 of file FlutterSurfaceManager.mm.
369 {
370 [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(onIdle) object:nil];
371}
◆ init
Definition at line 277 of file FlutterSurfaceManager.mm.
284 {
285 if (
self = [super
init]) {
286 self->_surfaces = [[NSMutableArray alloc] init];
287 self->_surfaceAge = [NSMapTable weakToStrongObjectsMapTable];
288 }
289 return self;
290}
◆ onIdle
◆ removeSurfaceForSize:
Removes surface with given size from cache (if available) and returns it.
Definition at line 277 of file FlutterSurfaceManager.mm.
302 @synchronized(self) {
303
305 [_surfaces removeAllObjects];
306 }
307
309
310
311
312
315 (res == nil || [
self ageForSurface:res] > [
self ageForSurface:
surface])) {
317 }
318 }
319 if (res != nil) {
320 [_surfaces removeObject:res];
321 }
322 return res;
323 }
324}
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
◆ reschedule
Definition at line 277 of file FlutterSurfaceManager.mm.
364 {
365 [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(onIdle) object:nil];
366 [self performSelector:@selector(onIdle) withObject:nil afterDelay:kIdleDelay];
367}
◆ returnSurfaces:
Removes all cached surfaces replacing them with new ones.
Definition at line 277 of file FlutterSurfaceManager.mm.
326 :(nonnull NSArray<FlutterSurface*>*)returnedSurfaces {
327 @synchronized(self) {
329 [self setAge:0 forSurface:surface];
330 }
332 [self setAge:[self ageForSurface:surface] + 1 forSurface:surface];
333 }
334
335 [_surfaces addObjectsFromArray:returnedSurfaces];
336
337
338
339
340
341
342 [_surfaces filterUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(FlutterSurface* surface,
343 NSDictionary* bindings) {
344 return [self ageForSurface:surface] < kSurfaceEvictionAge;
345 }]];
346 }
347
348
349 [self performSelectorOnMainThread:@selector(reschedule) withObject:nil waitUntilDone:NO];
350}
◆ setAge:forSurface:
◆ _surfaceAge
◆ _surfaces
The documentation for this class was generated from the following files: