forked from firka/flutter
Add 'ext.ui.window.scheduleFrame' service protocol extension (flutter/engine#3030)
This commit is contained in:
@@ -13,10 +13,28 @@ class _Logger {
|
||||
static void _printString(String s) native "Logger_PrintString";
|
||||
}
|
||||
|
||||
// A service protocol extension to schedule a frame to be rendered into the
|
||||
// window.
|
||||
Future<developer.ServiceExtensionResponse> _scheduleFrame(
|
||||
String method,
|
||||
Map<String, String> parameters
|
||||
) async {
|
||||
// Schedule the frame.
|
||||
window.scheduleFrame();
|
||||
// Always succeed.
|
||||
return new developer.ServiceExtensionResponse.result(JSON.encode({
|
||||
'type': 'Success',
|
||||
}));
|
||||
}
|
||||
|
||||
void _setupHooks() {
|
||||
// Wire up timer implementation that is driven by MojoHandleWatcher.
|
||||
VMLibraryHooks.eventHandlerSendData = MojoHandleWatcher.timer;
|
||||
VMLibraryHooks.timerMillisecondClock = MojoCoreNatives.timerMillisecondClock;
|
||||
assert(() {
|
||||
// In debug mode, register the schedule frame extension.
|
||||
developer.registerExtension('ext.ui.window.scheduleFrame', _scheduleFrame);
|
||||
});
|
||||
}
|
||||
|
||||
void _scheduleMicrotask(void callback()) native "ScheduleMicrotask";
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
library dart_ui;
|
||||
|
||||
import 'dart:_internal';
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:developer' as developer;
|
||||
import 'dart:math' as math;
|
||||
import 'dart:mojo.internal';
|
||||
import 'dart:nativewrappers';
|
||||
|
||||
Reference in New Issue
Block a user