Skip to content

[Impeller] Fix positioning of text shadow masks#187460

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
flar:fix-impeller-text-shadow-position
Jun 3, 2026
Merged

[Impeller] Fix positioning of text shadow masks#187460
auto-submit[bot] merged 1 commit into
flutter:masterfrom
flar:fix-impeller-text-shadow-position

Conversation

@flar

@flar flar commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

While fixing #182886 the positioning of text shadows was disrupted with all of the shadows being positioned at 0, 0 coordinates despite the positional arguments to the text call.

Fixes: #187341

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on [Discord].

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 2, 2026
@github-actions github-actions Bot added a: text input Entering text in a text field or keyboard related problems engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Jun 2, 2026
@flar

flar commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

The new test case renders the following without the fix:

Screenshot 2026-06-02 at 12 24 55 PM

And with the fix:

Screenshot 2026-06-02 at 12 49 44 PM

which matches the behavior (and desired results) observed in the linked issue.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates Impeller's text rendering pipeline to bake the text position directly into the entity's transform in Canvas::DrawTextFrame. Consequently, TextContents::GetCoverage and TextContents::ComputeVertexData are simplified to use the entity's transform directly instead of manually applying a translation offset. A new unit test TextWithShadowAndPosition is added to verify text rendering with shadows and position offsets. The reviewer suggests removing the unused position parameter from TextContents::ComputeVertexData's signature and checking if the position_ member variable of TextContents can be safely removed.

Comment thread engine/src/flutter/impeller/entity/contents/text_contents.cc
@flar
flar requested review from b-luk and gaaclarke June 2, 2026 22:22
@flutter-dashboard

Copy link
Copy Markdown

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.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #187460 at sha d223d05

@flutter-dashboard flutter-dashboard Bot added the will affect goldens Changes to golden files label Jun 3, 2026
@flar flar added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 3, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jun 3, 2026
Merged via the queue into flutter:master with commit 308ba65 Jun 3, 2026
211 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 3, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 3, 2026
…11832)

Manual roll requested by [email protected]

flutter/flutter@701665b...2ba5420

2026-06-03 [email protected] Roll Packages from 818b310 to b11504f (8 revisions) (flutter/flutter#187511)
2026-06-03 [email protected] Add new file patterns for team-web labeler (flutter/flutter#187397)
2026-06-03 [email protected] Roll Skia from 279b17fe9fc1 to d625048c853a (12 revisions) (flutter/flutter#187483)
2026-06-03 [email protected] [SwiftPM] Fix prefer_initializing_formals lint (flutter/flutter#187502)
2026-06-03 [email protected] Roll Fuchsia Linux SDK from q27k7_um1GvVrySZS... to ap7MhLX4TdpWRrLS_... (flutter/flutter#187478)
2026-06-03 [email protected] [SwiftPM] Fix concurrent directory/file/symlink creation crashes (flutter/flutter#186953)
2026-06-03 [email protected] [Impeller] Fix positioning of text shadow masks (flutter/flutter#187460)
2026-06-02 [email protected] Remove Material imports from painting tests (flutter/flutter#186937)
2026-06-02 [email protected] Add android_hardware_smoke_test integration tests (flutter/flutter#187130)
2026-06-02 [email protected] Roll pub packages (flutter/flutter#187471)
2026-06-02 [email protected] [flutter tool] propagate analytics env to sub-tools (flutter/flutter#186780)
2026-06-02 [email protected] Adds macro for fragment shaders to support flutter <= 3.44 (flutter/flutter#187316)
2026-06-02 [email protected] Small clean-up in different java files under `engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/` (flutter/flutter#186631)
2026-06-02 [email protected] refactor(web): Unify ui.Path code for CanvasKit and Skwasm (flutter/flutter#187331)
2026-06-02 [email protected] Roll Packages from f5d50ca to 818b310 (2 revisions) (flutter/flutter#187441)
2026-06-02 [email protected] Allow selecting multi-digit device options (flutter/flutter#186184)
2026-06-02 [email protected] Improve error message for type mismatch in Navigator.pop and maybePop. (flutter/flutter#186571)
2026-06-02 [email protected] Remove semantics_tester import from material_button_test.dart (flutter/flutter#184807)
2026-06-02 [email protected] [flutter_tools] Refactor hostPlatform to use Abi.current() (flutter/flutter#185369)
2026-06-02 [email protected] Clean up avoid_type_to_string suppressions (flutter/flutter#186869)
2026-06-02 [email protected] Update Flutter documentation links in flutter_console.bat (flutter/flutter#187354)
2026-06-02 [email protected] Revert "[Impeller] Allow attaching specific texture mip levels and slices" (flutter/flutter#187445)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…lutter#11832)

Manual roll requested by [email protected]

flutter/flutter@701665b...2ba5420

2026-06-03 [email protected] Roll Packages from 818b310 to b11504f (8 revisions) (flutter/flutter#187511)
2026-06-03 [email protected] Add new file patterns for team-web labeler (flutter/flutter#187397)
2026-06-03 [email protected] Roll Skia from 279b17fe9fc1 to d625048c853a (12 revisions) (flutter/flutter#187483)
2026-06-03 [email protected] [SwiftPM] Fix prefer_initializing_formals lint (flutter/flutter#187502)
2026-06-03 [email protected] Roll Fuchsia Linux SDK from q27k7_um1GvVrySZS... to ap7MhLX4TdpWRrLS_... (flutter/flutter#187478)
2026-06-03 [email protected] [SwiftPM] Fix concurrent directory/file/symlink creation crashes (flutter/flutter#186953)
2026-06-03 [email protected] [Impeller] Fix positioning of text shadow masks (flutter/flutter#187460)
2026-06-02 [email protected] Remove Material imports from painting tests (flutter/flutter#186937)
2026-06-02 [email protected] Add android_hardware_smoke_test integration tests (flutter/flutter#187130)
2026-06-02 [email protected] Roll pub packages (flutter/flutter#187471)
2026-06-02 [email protected] [flutter tool] propagate analytics env to sub-tools (flutter/flutter#186780)
2026-06-02 [email protected] Adds macro for fragment shaders to support flutter <= 3.44 (flutter/flutter#187316)
2026-06-02 [email protected] Small clean-up in different java files under `engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/` (flutter/flutter#186631)
2026-06-02 [email protected] refactor(web): Unify ui.Path code for CanvasKit and Skwasm (flutter/flutter#187331)
2026-06-02 [email protected] Roll Packages from f5d50ca to 818b310 (2 revisions) (flutter/flutter#187441)
2026-06-02 [email protected] Allow selecting multi-digit device options (flutter/flutter#186184)
2026-06-02 [email protected] Improve error message for type mismatch in Navigator.pop and maybePop. (flutter/flutter#186571)
2026-06-02 [email protected] Remove semantics_tester import from material_button_test.dart (flutter/flutter#184807)
2026-06-02 [email protected] [flutter_tools] Refactor hostPlatform to use Abi.current() (flutter/flutter#185369)
2026-06-02 [email protected] Clean up avoid_type_to_string suppressions (flutter/flutter#186869)
2026-06-02 [email protected] Update Flutter documentation links in flutter_console.bat (flutter/flutter#187354)
2026-06-02 [email protected] Revert "[Impeller] Allow attaching specific texture mip levels and slices" (flutter/flutter#187445)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
via-guy pushed a commit to via-guy/flutter that referenced this pull request Jun 26, 2026
While fixing flutter#182886 the
positioning of text shadows was disrupted with all of the shadows being
positioned at `0, 0` coordinates despite the positional arguments to the
text call.

Fixes: flutter#187341

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
@flar flar added cp:stable cp: stable cherry pick this pull request to stable release candidate branch and removed cp:stable labels Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems CICD Run CI/CD cp: stable cherry pick this pull request to stable release candidate branch e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Icon shadow is not rendering properly in ios/android.

2 participants