Unverified Commit 511367aa authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] remove k toggle for canvaskit from web runner (#66273)

The k toggle allows switching between canvaskit and html backend at runtime. unfortunately this causes hot restart to break, since the dart_sdk modules stores state at runtime. The recommendation will be to use cavaskit via dart-defines.
parent 4c7f7463
...@@ -799,9 +799,6 @@ class _ResidentWebRunner extends ResidentWebRunner { ...@@ -799,9 +799,6 @@ class _ResidentWebRunner extends ResidentWebRunner {
return 0; return 0;
} }
@override
bool get supportsCanvasKit => supportsServiceProtocol;
@override @override
Future<bool> toggleCanvaskit() async { Future<bool> toggleCanvaskit() async {
final WebDevFS webDevFS = device.devFS as WebDevFS; final WebDevFS webDevFS = device.devFS as WebDevFS;
......
...@@ -795,7 +795,6 @@ abstract class ResidentRunner { ...@@ -795,7 +795,6 @@ abstract class ResidentRunner {
bool get isRunningProfile => debuggingOptions.buildInfo.isProfile; bool get isRunningProfile => debuggingOptions.buildInfo.isProfile;
bool get isRunningRelease => debuggingOptions.buildInfo.isRelease; bool get isRunningRelease => debuggingOptions.buildInfo.isRelease;
bool get supportsServiceProtocol => isRunningDebug || isRunningProfile; bool get supportsServiceProtocol => isRunningDebug || isRunningProfile;
bool get supportsCanvasKit => false;
bool get supportsWriteSkSL => supportsServiceProtocol; bool get supportsWriteSkSL => supportsServiceProtocol;
bool get trackWidgetCreation => debuggingOptions.buildInfo.trackWidgetCreation; bool get trackWidgetCreation => debuggingOptions.buildInfo.trackWidgetCreation;
...@@ -1319,9 +1318,6 @@ abstract class ResidentRunner { ...@@ -1319,9 +1318,6 @@ abstract class ResidentRunner {
commandHelp.S.print(); commandHelp.S.print();
commandHelp.U.print(); commandHelp.U.print();
} }
if (supportsCanvasKit){
commandHelp.k.print();
}
if (supportsWriteSkSL) { if (supportsWriteSkSL) {
commandHelp.M.print(); commandHelp.M.print();
} }
...@@ -1476,13 +1472,6 @@ class TerminalHandler { ...@@ -1476,13 +1472,6 @@ class TerminalHandler {
return true; return true;
} }
return false; return false;
case 'k':
if (residentRunner.supportsCanvasKit) {
final bool result = await residentRunner.toggleCanvaskit();
globals.printStatus('${result ? 'Enabled' : 'Disabled'} CanvasKit');
return true;
}
return false;
case 'L': case 'L':
if (residentRunner.supportsServiceProtocol) { if (residentRunner.supportsServiceProtocol) {
await residentRunner.debugDumpLayerTree(); await residentRunner.debugDumpLayerTree();
......
...@@ -1223,8 +1223,6 @@ void main() { ...@@ -1223,8 +1223,6 @@ void main() {
expect(residentRunner.supportsServiceProtocol, true); expect(residentRunner.supportsServiceProtocol, true);
// isRunningDebug // isRunningDebug
expect(residentRunner.isRunningDebug, true); expect(residentRunner.isRunningDebug, true);
// does not support CanvasKit
expect(residentRunner.supportsCanvasKit, false);
// does support SkSL // does support SkSL
expect(residentRunner.supportsWriteSkSL, true); expect(residentRunner.supportsWriteSkSL, true);
// commands // commands
...@@ -1278,8 +1276,6 @@ void main() { ...@@ -1278,8 +1276,6 @@ void main() {
expect(residentRunner.supportsServiceProtocol, false); expect(residentRunner.supportsServiceProtocol, false);
// isRunningDebug // isRunningDebug
expect(residentRunner.isRunningDebug, false); expect(residentRunner.isRunningDebug, false);
// does not support CanvasKit
expect(residentRunner.supportsCanvasKit, false);
// does support SkSL // does support SkSL
expect(residentRunner.supportsWriteSkSL, false); expect(residentRunner.supportsWriteSkSL, false);
// commands // commands
......
...@@ -759,7 +759,6 @@ void main() { ...@@ -759,7 +759,6 @@ void main() {
final WebAssetServer webAssetServer = WebAssetServer(null, null, null, null, null, null); final WebAssetServer webAssetServer = WebAssetServer(null, null, null, null, null, null);
when(mockWebDevFS.webAssetServer).thenReturn(webAssetServer); when(mockWebDevFS.webAssetServer).thenReturn(webAssetServer);
expect(residentWebRunner.supportsCanvasKit, true);
expect(webAssetServer.canvasKitRendering, false); expect(webAssetServer.canvasKitRendering, false);
final bool toggleResult = await residentWebRunner.toggleCanvaskit(); final bool toggleResult = await residentWebRunner.toggleCanvaskit();
......
...@@ -109,18 +109,6 @@ void main() { ...@@ -109,18 +109,6 @@ void main() {
verify(mockResidentRunner.printHelp(details: true)).called(3); verify(mockResidentRunner.printHelp(details: true)).called(3);
}); });
testUsingContext('k - toggles CanvasKit rendering and prints results', () async {
when(mockResidentRunner.supportsCanvasKit).thenReturn(true);
when(mockResidentRunner.toggleCanvaskit())
.thenAnswer((Invocation invocation) async {
return true;
});
await terminalHandler.processTerminalInput('k');
verify(mockResidentRunner.toggleCanvaskit()).called(1);
});
testUsingContext('i - debugToggleWidgetInspector with service protocol', () async { testUsingContext('i - debugToggleWidgetInspector with service protocol', () async {
await terminalHandler.processTerminalInput('i'); await terminalHandler.processTerminalInput('i');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment