Skip to content

Conversation

@xster
Copy link
Member

@xster xster commented May 8, 2018

Matched with screenshots of native apps

@xster xster requested a review from cbracken May 8, 2018 00:09
xster added a commit to flutter/goldens that referenced this pull request May 8, 2018
@cbracken
Copy link
Member

cbracken commented May 8, 2018

lgtm

@xster
Copy link
Member Author

xster commented May 8, 2018

cc @tvolkert @jason-simmons , I tried to repro the tests on Linux.

Different visible here in pink:
download

It seems like there's a minute difference in font rendering here to cause an error from the golden.

@tvolkert
Copy link
Contributor

tvolkert commented May 8, 2018

@xster it looks like we should enable the --skia-deterministic-rendering flag when running via flutter test

@tvolkert
Copy link
Contributor

tvolkert commented May 8, 2018

@xster I tried again after having picked up 30abc54, but it still fails on Linux. It's one of the following reasons:

  1. Implement better logic in golden file comparators #17258 needs to be implemented because on Linux we're getting a different PNG encoding of the same pixel values.
  2. flutter_tester isn't respecting the --skia-deterministic-rendering flag.
  3. Skia isn't deterministic even when --skia-deterministic-rendering is respected.

I'm trying to find out which of these is the case.

@tvolkert
Copy link
Contributor

tvolkert commented May 8, 2018

I've ruled out #1 and #2 from above (the pixel values are indeed different, and flutter_tester is respecting the --skia-deterministic-rendering flag). But there are some additional possibilities that occurred to me:

  1. shadows will always be slightly different across platforms, and once Disable shadows when taking goldens #17363 lands, the tests will pass.
  2. The host embedder (flutter_tester) doesn't respect --enable-software-rendering, thus making the --skia-deterministic-rendering flag a no-op.

@tvolkert
Copy link
Contributor

tvolkert commented May 8, 2018

Looking at the images, it doesn't appear as if shadows are even in play here, so #4 can be safely ruled out...

@tvolkert
Copy link
Contributor

tvolkert commented May 8, 2018

Zoomed up on the upper right corner of one of those boxes, here's what the diff looks like:

nav_bar_test large_title 1

That's a noticeable rendering difference, so although it's unclear where the bug is, it looks like this did catch a potentially real issue...

@xster
Copy link
Member Author

xster commented May 8, 2018

I wonder if we could make the issue clearer if we used another proper font that's available on both platforms.

@tvolkert
Copy link
Contributor

tvolkert commented May 8, 2018

@chinmaygarde says that the screenshotter always uses software rendering, so I'm fresh out of ideas beyond #3 (Skia isn't deterministic even when --skia-deterministic-rendering is specified)

Copy link
Contributor

Choose a reason for hiding this comment

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

Was discussing this with @Hixie. For now at least, we'll skip the golden file tests on non-Linux platforms (and require that developers update their goldens while running on Linux).

So tldr: add a skip: !Platform.isLinux to these new testWidgets() methods

Copy link
Member Author

Choose a reason for hiding this comment

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

cool, thanks for following up. I'll update the goldens

@xster xster merged commit e42c50c into flutter:master May 11, 2018
@xster xster deleted the ios-font branch May 11, 2018 00:35
srawlins added a commit to srawlins/flutter that referenced this pull request May 11, 2018
* master:
  Add a golden image test for centered text (flutter#17517)
  Gallery a11y fix: give the categories and demos pages "route" scope (flutter#17516)
  Stop Gallery the logo to back-button cross fade shaking (flutter#17513)
  Correct a typo in InputDecorator, affects computeMinIntrinsicHeight() (flutter#17512)
  don't fail a test when there are issues deleting a temp dir (flutter#17498)
  Roll engine to 9ae10ef (flutter#17503)
  Roll engine to b856303 (flutter#17499)
  Rebase after package:isolate fixes. (flutter#17289)
  Add more unit tests for AOT snapshotting (flutter#17493)
  Update a TODO with issue number (flutter#17494)
  Fix backdrop demo margin for iPhone X (flutter#17480)
  Post libtxt/post iOS 11 fidelity fine tuning (flutter#17366)
  Add onChangeStart and onChangeEnd to slider. (flutter#17298)
  Use deprecated I/O constants (flutter#17491)
  Augment `flutter screenshot` with all supported screenshot types (flutter#17478)
  Roll engine to fade83c (flutter#17488)
  Fix handling of null body2 text style for chip and slider (flutter#17311)
  Roll engine to 37e20af (flutter#17481)
  Mark test as flaky (flutter#17486)
DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this pull request May 14, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 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.

4 participants