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,7 +293,6 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture ...@@ -293,7 +293,6 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture
} }
); );
assert(() {
// This service extension is deprecated and will be removed by 7/1/2018. // This service extension is deprecated and will be removed by 7/1/2018.
// Use ext.flutter.inspector.show instead. // Use ext.flutter.inspector.show instead.
registerBoolServiceExtension( registerBoolServiceExtension(
...@@ -308,8 +307,6 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture ...@@ -308,8 +307,6 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture
); );
WidgetInspectorService.instance.initServiceExtensions(registerServiceExtension); WidgetInspectorService.instance.initServiceExtensions(registerServiceExtension);
return true;
}());
} }
Future<Null> _forceRebuild() { Future<Null> _forceRebuild() {
......
...@@ -13,7 +13,6 @@ import 'dart:ui' as ui ...@@ -13,7 +13,6 @@ import 'dart:ui' as ui
window, window,
ClipOp, ClipOp,
Image, Image,
ImageByteFormat,
Paragraph, Paragraph,
Picture, Picture,
PictureRecorder, PictureRecorder,
...@@ -1027,33 +1026,6 @@ class WidgetInspectorService { ...@@ -1027,33 +1026,6 @@ class WidgetInspectorService {
name: 'isWidgetCreationTracked', name: 'isWidgetCreationTracked',
callback: 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. /// Clear all InspectorService object references.
......
...@@ -512,7 +512,7 @@ void main() { ...@@ -512,7 +512,7 @@ void main() {
// If you add a service extension... TEST IT! :-) // If you add a service extension... TEST IT! :-)
// ...then increment this number. // ...then increment this number.
expect(binding.extensions.length, 38); expect(binding.extensions.length, 37);
expect(console, isEmpty); expect(console, isEmpty);
debugPrint = debugPrintThrottled; 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