提交 b0220a3a 编写于 作者: C Chinmay Garde 提交者: GitHub

[iOS] Don’t perform a per frame platform to UI thread switch. (#3288)

上级 bd629a04
......@@ -32,8 +32,12 @@
displayLinkWithTarget:self
selector:@selector(onDisplayLink:)] retain];
_displayLink.paused = YES;
[_displayLink addToRunLoop:[NSRunLoop currentRunLoop]
forMode:NSRunLoopCommonModes];
blink::Threads::UI()->PostTask([client = [self retain]]() {
[client->_displayLink addToRunLoop:[NSRunLoop currentRunLoop]
forMode:NSRunLoopCommonModes];
[client release];
});
}
return self;
......@@ -52,8 +56,7 @@
_displayLink.paused = YES;
auto callback = std::move(_pendingCallback);
_pendingCallback = shell::VsyncWaiter::Callback();
blink::Threads::UI()->PostTask(
[callback, frame_time] { callback(frame_time); });
callback(frame_time);
}
- (void)dealloc {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册