Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merge skia into screenshot #6623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 2, 2016

Conversation

danrubel
Copy link
Contributor

@danrubel danrubel commented Nov 1, 2016

This merges flutter skia into flutter screenshot and

  • improves skia help text to indicate how to find the diagnostic port
  • improves the error message if failed to obtain skia pic
  • defaults the skia output file name to flutter_##.skp so that it need not be specified

More specifically,

flutter skia --diagnostic-port=12345 --output-file=myfile.skp

becomes

flutter screenshot --skia=12345
-- or --
flutter pic --skia=12345

@devoncarew @Hixie

printError('Must specify --$_kSkia or have a connected device');
return 1;
}
if (!device.supportsScreenshot) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to make this check specific to when they're taking a screenshot, and not when using --skia.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed.

File outputFile;
if (argResults.wasParsed(_kOut)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: braces not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@devoncarew
Copy link
Member

lgtm; /cc @jason-simmons, who wrote the skia command

We may want to look at exposing the skia info over service protocol extensions. This would make the information more widely available to development tools.

help: 'Retrieve the last frame rendered by a Flutter app as a Skia picture\n'
'using the specified diagnostic server port.\n'
'To find the diagnostic server port number, use "flutter run --verbose"\n'
'and look for "Diagnostic server listening on" in the output.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Not great to direct users to the verbose logs. One way to address this is to make the default diagnostic port have a default value rather than auto-selecting what appears to be a random port. Then, most of the time(?), users would not need to specify a skia port.


void printErrorHelpText() {
printError('');
printError('Be sure the --$_kSkia= option specifies the diagnostic server port, not the observatory port');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a period at the end here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


http.StreamedResponse postResponse = await postRequest.send();
if (postResponse.statusCode != HttpStatus.OK) {
printError('Failed to post Skia picture to skiaserve');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

period

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@Hixie
Copy link
Contributor

Hixie commented Nov 1, 2016

LGTM but I'm sad that we're sending people into the verbose logs. I wish there was a way we could discover the port for the currently running instance somehow. Not important for now though.

@danrubel danrubel merged commit 819ac27 into flutter:master Nov 2, 2016
@danrubel danrubel deleted the merge-skia-into-screenshot branch November 2, 2016 18:27
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants