Unverified Commit 29fae06f authored by Jacob Richman's avatar Jacob Richman Committed by GitHub

Temporarily remove screenshot service extension that is causing code size issues (#21749)

* Revert "Avoid ever creating the WidgetInspectorService outside of debug mode. (#21648)"

This reverts commit eeebd833.

* Remove inspector screenshot service extension.
parent 0cc9ee5b
......@@ -293,23 +293,20 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture
}
);
assert(() {
// This service extension is deprecated and will be removed by 7/1/2018.
// Use ext.flutter.inspector.show instead.
registerBoolServiceExtension(
name: 'debugWidgetInspector',
getter: () async => WidgetsApp.debugShowWidgetInspectorOverride,
setter: (bool value) {
if (WidgetsApp.debugShowWidgetInspectorOverride == value)
return Future<Null>.value();
WidgetsApp.debugShowWidgetInspectorOverride = value;
return _forceRebuild();
}
);
// This service extension is deprecated and will be removed by 7/1/2018.
// Use ext.flutter.inspector.show instead.
registerBoolServiceExtension(
name: 'debugWidgetInspector',
getter: () async => WidgetsApp.debugShowWidgetInspectorOverride,
setter: (bool value) {
if (WidgetsApp.debugShowWidgetInspectorOverride == value)
return Future<Null>.value();
WidgetsApp.debugShowWidgetInspectorOverride = value;
return _forceRebuild();
}
);
WidgetInspectorService.instance.initServiceExtensions(registerServiceExtension);
return true;
}());
WidgetInspectorService.instance.initServiceExtensions(registerServiceExtension);
}
Future<Null> _forceRebuild() {
......
......@@ -13,7 +13,6 @@ import 'dart:ui' as ui
window,
ClipOp,
Image,
ImageByteFormat,
Paragraph,
Picture,
PictureRecorder,
......@@ -1027,33 +1026,6 @@ class WidgetInspectorService {
name: 'isWidgetCreationTracked',
callback: isWidgetCreationTracked,
);
registerServiceExtension(
name: 'screenshot',
callback: (Map<String, String> parameters) async {
assert(parameters.containsKey('id'));
assert(parameters.containsKey('width'));
assert(parameters.containsKey('height'));
final ui.Image image = await screenshot(
toObject(parameters['id']),
width: double.parse(parameters['width']),
height: double.parse(parameters['height']),
margin: parameters.containsKey('margin') ?
double.parse(parameters['margin']) : 0.0,
maxPixelRatio: parameters.containsKey('maxPixelRatio') ?
double.parse(parameters['maxPixelRatio']) : 1.0,
debugPaint: parameters['debugPaint'] == 'true',
);
if (image == null) {
return <String, Object>{'result': null};
}
final ByteData byteData = await image.toByteData(format:ui.ImageByteFormat.png);
return <String, Object>{
'result': base64.encoder.convert(Uint8List.view(byteData.buffer)),
};
},
);
}
/// Clear all InspectorService object references.
......
......@@ -512,7 +512,7 @@ void main() {
// If you add a service extension... TEST IT! :-)
// ...then increment this number.
expect(binding.extensions.length, 38);
expect(binding.extensions.length, 37);
expect(console, isEmpty);
debugPrint = debugPrintThrottled;
......
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