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

Moves pointer event sanitizing to engine.#13697

Merged
chunhtai merged 7 commits intoflutter:masterfrom
chunhtai:issues/20517
Nov 19, 2019
Merged

Moves pointer event sanitizing to engine.#13697
chunhtai merged 7 commits intoflutter:masterfrom
chunhtai:issues/20517

Conversation

@chunhtai
Copy link
Contributor

@chunhtai chunhtai commented Nov 5, 2019

flutter/flutter#44217
flutter/flutter#20517
This pr reimplemeting the sanitizing in engine side.

@chunhtai chunhtai added the Work in progress (WIP) Not ready (yet) for review! label Nov 5, 2019
@chunhtai chunhtai removed the Work in progress (WIP) Not ready (yet) for review! label Nov 8, 2019
@chunhtai chunhtai requested a review from chinmaygarde November 8, 2019 20:43
@chunhtai
Copy link
Contributor Author

chunhtai commented Nov 8, 2019

cc @goderbauer @HansMuller

physicalX: packet.getFloat64(kStride * offset++, _kFakeHostEndian),
physicalY: packet.getFloat64(kStride * offset++, _kFakeHostEndian),
physicalDeltaX: packet.getFloat64(kStride * offset++, _kFakeHostEndian),
physicalDeltaY: packet.getFloat64(kStride * offset++, _kFakeHostEndian),
Copy link
Contributor Author

@chunhtai chunhtai Nov 8, 2019

Choose a reason for hiding this comment

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

Framework move and hover event need delta value. We have to calculate it in the engine, otherwise framework will still need to keep the state which defeat the purpose of this migration

physicalDeltaY: packet.getFloat64(kStride * offset++, _kFakeHostEndian),
buttons: packet.getInt64(kStride * offset++, _kFakeHostEndian),
obscured: packet.getInt64(kStride * offset++, _kFakeHostEndian) != 0,
synthesized: packet.getInt64(kStride * offset++, _kFakeHostEndian) != 0,
Copy link
Contributor Author

@chunhtai chunhtai Nov 8, 2019

Choose a reason for hiding this comment

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

framework need to know if the pointer event is synthesized to be able to correctly calculate the drag velocity.

// converted_pointers.
for (size_t i = 0; i < buffer_length / kBytesPerPointerData; i++) {
PointerData pointer_data =
*(reinterpret_cast<PointerData*>(&buffer[i * kBytesPerPointerData]));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chinmaygarde Is this the right way to go? I am not sure what is the standard way to use copy constructor here

Copy link
Contributor

Choose a reason for hiding this comment

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

I apologize for my previous comment. I didn't see that the data structure was packed and you were reading from an offset that may not be properly aligned. Your first attempt was better. Please use the memcpy. Sorry for the confusion.

@chunhtai
Copy link
Contributor Author

@chinmaygarde this is ready for re review

@chunhtai chunhtai merged commit 132d38c into flutter:master Nov 19, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 19, 2019
tvolkert added a commit to flutter/flutter that referenced this pull request Nov 20, 2019
[email protected]:flutter/engine.git/compare/f4fba66c2fad...c812a62

git log f4fba66..c812a62 --no-merges --oneline
2019-11-19 [email protected] allow ignoring toString, hashCode, and == in api_conform_test (flutter/engine#13907)
2019-11-19 [email protected] Roll src/third_party/dart d9d5fbc109..eeca3fb1cb (5 commits)
2019-11-19 [email protected] Add virtual destructor to GPUSurfaceSoftwareDelegate. (flutter/engine#13918)
2019-11-19 [email protected] Moves pointer event sanitizing to engine. (flutter/engine#13697)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants