Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@matanlurey
Copy link
Contributor

@matanlurey matanlurey commented Nov 16, 2023

Closes flutter/flutter#138501.


It would be nice to turn this into a test-fixture, and create a better local environment.

Here is how to run it locally:

# The test expects you to be PWD in the `src` directory or it crashes.
cd $ENGINE_SRC

out/host_debug_unopt_arm64/flutter_tester \
  --force-multithreading \
  --disable-observatory \
  --use-test-fonts \
  --icu-data-file-path=out/host_debug_unopt_arm64/icudtl.dat \
  --flutter-assets-dir=out/host_debug_unopt_arm64/gen/flutter/lib/ui/assets \
  --disable-asset-fonts \
  --enable-impeller \
  out/host_debug_unopt_arm64/gen/canvas_test.dart.dill

# "See" the output goldens.
open out/host_debug_unopt_arm64/gen/skia_gold_canvas_test.dart

image

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #48101 at sha 8076dda

@jonahwilliams
Copy link
Contributor

It looks like the text isn't showing up in the goldens ...

expect(canvas.getSaveCount(), equals(6));
});

test('TextDecoration renders non-solid lines', () async {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem that bad, you made it seem like this would be pretty hard

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Easy to write, hard to run :)

@matanlurey
Copy link
Contributor Author

It looks like the text isn't showing up in the goldens ...

Yeah I'm guessing this is a PWD issue similar to what I was seeing locally - test assets are expected to be in a specific place. Let's look at this together tomorrow, unless @dnfield notices I did something wrong.

@matanlurey matanlurey requested a review from dnfield November 16, 2023 20:48
@matanlurey
Copy link
Contributor Author

New code up, should work both locally and on CI :)

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM with nits

@matanlurey
Copy link
Contributor Author

@jonahwilliams I'm going to mark as auto-submit, but I'm happy to take additional comments post-submit.

@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 16, 2023
@jonahwilliams
Copy link
Contributor

LGTM!

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #48101 at sha 4cea312

@matanlurey
Copy link
Contributor Author

The fonts are still showing up blank on Skia-gold, let me take a look again.

// However, Flutter opts-in to a Skia feature to render tabs as a single space.
// See: https://github.com/flutter/flutter/issues/79153
final File file = File(path.join('flutter', 'testing', 'resources', 'RobotoSlab-VariableFont_wght.ttf'));
final File file = File(path.join(_flutterBuildPath, 'flutter', 'third_party', 'txt', 'assets', 'Roboto-Regular.ttf'));
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect this to be in a folder called fixtures.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you want "./gen/flutter/impeller/fixtures/assets/Roboto-Regular.ttf"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But my deps is:

deps = [ "//flutter/third_party/txt:txt_fixtures" ]

What does that have to do with the impeller folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

$ flutter % ls ../out/host_debug_unopt_arm64/gen/flutter/third_party/txt/assets                   
Roboto-Regular.ttf

Hmm....

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this is the right target specifically, but any test fixtures should be built to a target in the out directory that you can look up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also if the file didn't exist, we could get a FileNotFoundError AFAICT

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh yeah. Hmmm

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean, the decorations are showing up right 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, though that's also true if the font doesn't load (hey, I don't make the rules)

I'll take another look in a bit and add some FML_LOG statements and see if there is something obvious going wrong. Probably (?) using a font in a test that doesn't exist should be an error or at the very least an angry log statement.

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #48101 at sha 55b28db

@matanlurey
Copy link
Contributor Author

The fonts are still showing up blank on Skia-gold, let me take a look again.

@jonahwilliams @dnfield Turns out this is because the default font color is white on white on Skia gold, and had nothing to do with fonts. I'm now outputting blue and it looks good, PTAL.

@jonahwilliams
Copy link
Contributor

lol wonderful. Well now we know

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@auto-submit auto-submit bot merged commit 7a31543 into flutter:main Nov 20, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 20, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App will affect goldens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Impeller] Write a test for text-decoration using the new dart:ui-based support

3 participants