Repository navigation
iOS: Add stylus pointer tests - #191564
Merged
Merged
Conversation
Adds tests for the stylus and touch-geometry fields that currently lack testing on iOS. `dispatchTouches:` normalises iOS-specific UITouch objects into generic engine `PointerData` structs. These include `force`, `majorRadius`, `altitudeAngle` and `azimuthAngleInView:`, but those have no test coverage. Currently, the only testing we have of `PointerData` checks a timestamp. `tilt` and `orientation` need particular care as they're not just straight copies of the data. iOS measures from the surface plane such that an angle of 0 is parallel to the surface and pi/2 is vertical. `PointerData` measures from the surface normal such that 0 is vertical and pi/2 is parallel to the plane. When we migrate to the embedder API, we'll need to expose these details via `FlutterPointerEvent`. It currently has `pressure` but none of `tilt`, `orientation` or the radius fields, so all of this has to be added to the embedder API before iOS can adopt it. Issue: flutter#112232
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds unit tests to FlutterViewControllerTest.mm to verify the conversion and renormalization of stylus and touch-geometry fields (such as force, radius, altitude, and azimuth angles) from iOS UITouch events into Flutter's PointerData format. To support these tests, a helper class PointerDataCapturingEngine is introduced to capture dispatched pointer data packets. There are no review comments, and I have no feedback to provide.
hellohuanlin
approved these changes
Aug 24, 2026
This was referenced Aug 24, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Aug 24, 2026
flutter/flutter@65c9a8d...9a82789 2026-08-24 [email protected] Roll Packages from 252bb33 to df2ba94 (5 revisions) (flutter/flutter#191578) 2026-08-24 [email protected] Roll Dart SDK from cb056da580b6 to 78bbc37b6ff6 (13 revisions) (flutter/flutter#191574) 2026-08-24 [email protected] Roll Skia from 50452b13f05b to 57968d087d18 (1 revision) (flutter/flutter#191572) 2026-08-24 [email protected] Move more RSE rendering cases to complex_rse.frag (flutter/flutter#191235) 2026-08-24 [email protected] Roll Skia from 925e13559532 to 50452b13f05b (2 revisions) (flutter/flutter#191570) 2026-08-24 [email protected] iOS: Add stylus pointer tests (flutter/flutter#191564) 2026-08-24 [email protected] iOS: Improve FlutterEngineGroup tests (flutter/flutter#191563) 2026-08-24 [email protected] Roll Skia from c78782c7c1c2 to 925e13559532 (5 revisions) (flutter/flutter#191568) 2026-08-24 [email protected] Roll Skia from 886302c7c68e to c78782c7c1c2 (1 revision) (flutter/flutter#191566) 2026-08-24 [email protected] Revert "Improve initial size and placement logic for popups and toolt…ips on Linux (#189994) (flutter/flutter#191498) 2026-08-23 [email protected] Roll Fuchsia Linux SDK from Cqs-NyeELd60hqv1e... to 8Xu4ujBJniC0nQGx3... (flutter/flutter#191561) 2026-08-23 [email protected] Fixes MSAA on the linux embedder. (flutter/flutter#191379) 2026-08-23 [email protected] Remove Material/Cupertino references in error messages (flutter/flutter#191305) 2026-08-23 [email protected] Roll Skia from a1825062f832 to 886302c7c68e (1 revision) (flutter/flutter#191559) 2026-08-23 [email protected] Roll Skia from ad2106c0bb64 to a1825062f832 (1 revision) (flutter/flutter#191555) 2026-08-22 [email protected] Roll Fuchsia Linux SDK from ic6GjOSn-KN508XyK... to Cqs-NyeELd60hqv1e... (flutter/flutter#191547) 2026-08-22 [email protected] [WebParagraph] Fixing minor problem with getBoxesForRange (flutter/flutter#191419) 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
jagadeesh8682
pushed a commit
to jagadeesh8682/packages
that referenced
this pull request
Sep 2, 2026
…r#12578) flutter/flutter@65c9a8d...9a82789 2026-08-24 [email protected] Roll Packages from 252bb33 to df2ba94 (5 revisions) (flutter/flutter#191578) 2026-08-24 [email protected] Roll Dart SDK from cb056da580b6 to 78bbc37b6ff6 (13 revisions) (flutter/flutter#191574) 2026-08-24 [email protected] Roll Skia from 50452b13f05b to 57968d087d18 (1 revision) (flutter/flutter#191572) 2026-08-24 [email protected] Move more RSE rendering cases to complex_rse.frag (flutter/flutter#191235) 2026-08-24 [email protected] Roll Skia from 925e13559532 to 50452b13f05b (2 revisions) (flutter/flutter#191570) 2026-08-24 [email protected] iOS: Add stylus pointer tests (flutter/flutter#191564) 2026-08-24 [email protected] iOS: Improve FlutterEngineGroup tests (flutter/flutter#191563) 2026-08-24 [email protected] Roll Skia from c78782c7c1c2 to 925e13559532 (5 revisions) (flutter/flutter#191568) 2026-08-24 [email protected] Roll Skia from 886302c7c68e to c78782c7c1c2 (1 revision) (flutter/flutter#191566) 2026-08-24 [email protected] Revert "Improve initial size and placement logic for popups and toolt…ips on Linux (#189994) (flutter/flutter#191498) 2026-08-23 [email protected] Roll Fuchsia Linux SDK from Cqs-NyeELd60hqv1e... to 8Xu4ujBJniC0nQGx3... (flutter/flutter#191561) 2026-08-23 [email protected] Fixes MSAA on the linux embedder. (flutter/flutter#191379) 2026-08-23 [email protected] Remove Material/Cupertino references in error messages (flutter/flutter#191305) 2026-08-23 [email protected] Roll Skia from a1825062f832 to 886302c7c68e (1 revision) (flutter/flutter#191559) 2026-08-23 [email protected] Roll Skia from ad2106c0bb64 to a1825062f832 (1 revision) (flutter/flutter#191555) 2026-08-22 [email protected] Roll Fuchsia Linux SDK from ic6GjOSn-KN508XyK... to Cqs-NyeELd60hqv1e... (flutter/flutter#191547) 2026-08-22 [email protected] [WebParagraph] Fixing minor problem with getBoxesForRange (flutter/flutter#191419) 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds tests for the stylus and touch-geometry fields that currently lack testing on iOS.
dispatchTouches:normalises iOS-specific UITouch objects into generic enginePointerDatastructs. These includeforce,majorRadius,altitudeAngleandazimuthAngleInView:, but those have no test coverage. Currently, the only testing we have ofPointerDatachecks a timestamp.tiltandorientationneed particular care as they're not just straight copies of the data. iOS measures from the surface plane such that an angle of 0 is parallel to the surface and pi/2 is vertical.PointerDatameasures from the surface normal such that 0 is vertical and pi/2 is parallel to the plane.When we migrate to the embedder API, we'll need to expose these details via
FlutterPointerEvent. It currently haspressurebut none oftilt,orientationor the radius fields, so all of this has to be added to the embedder API before iOS can adopt it.Issue: #112232
Pre-launch Checklist
///).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-assistbot 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.