Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
Remove log, fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dkwingsmt committed Jan 31, 2023
1 parent e249299 commit f5335ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions shell/platform/darwin/macos/framework/Source/FlutterEngine.mm
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ @implementation FlutterEngine {
std::unique_ptr<flutter::FlutterCompositor> _macOSCompositor;

// The information of all views attached to this engine mapped from IDs.
//
// It can't use NSDictionary, because the values need to be weak references.
NSMapTable* _viewControllers;

// FlutterCompositor is copied and used in embedder.cc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,9 @@ - (nonnull NSView*)createWithViewIdentifier:(int64_t)viewId arguments:(nullable
}

TEST_F(FlutterEngineTest, ManageControllersIfInitiatedByEngine) {
// Don't create the engine with `CreateMockFlutterEngine` because the latter
// introduces memory leakage.
// Don't create the engine with `CreateMockFlutterEngine`, because it adds
// additional references to FlutterViewControllers, which is crucial to this
// test case.
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"io.flutter"
project:nil
allowHeadlessExecution:NO];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,16 @@ - (FlutterMetalTexture)createTextureForView:(uint64_t)viewId size:(CGSize)size {
}

- (BOOL)present:(uint64_t)viewId texture:(const FlutterMetalTexture*)texture {
NSLog(@"Present %llu", viewId);
FlutterView* view = [_viewProvider getViewForId:viewId];
NSLog(@"Present View %@", view);
if (view == nil) {
return NO;
}
FlutterSurface* surface = [FlutterSurface fromFlutterMetalTexture:texture];
NSLog(@"Present surface %@", surface);
if (surface == nil) {
return NO;
}
FlutterSurfacePresentInfo* info = [[FlutterSurfacePresentInfo alloc] init];
info.surface = surface;
NSLog(@"Present surfaceMgr %@", view.surfaceManager);
[view.surfaceManager present:@[ info ] notify:nil];
return YES;
}
Expand Down

0 comments on commit f5335ea

Please sign in to comment.