Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves pointer event sanitizing to engine. #13697

Merged
merged 7 commits into from Nov 19, 2019

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
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

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.

lib/ui/pointer.dart Outdated Show resolved Hide resolved
lib/ui/window/pointer_data_packet_converter.h Show resolved Hide resolved
lib/ui/window/pointer_data_packet_converter.h Outdated Show resolved Hide resolved
lib/ui/window/pointer_data_packet_converter.cc Outdated Show resolved Hide resolved
lib/ui/window/pointer_data_packet_converter.cc Outdated Show resolved Hide resolved
lib/ui/window/pointer_data_packet_converter.h Outdated Show resolved Hide resolved
lib/ui/window/pointer_data_packet_converter.h Outdated Show resolved Hide resolved
lib/ui/window/pointer_data_packet_converter.h Outdated Show resolved Hide resolved
// 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
Member

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 tvolkert/flutter that referenced this pull request Nov 19, 2019
git@github.com:flutter/engine.git/compare/f4fba66c2fad...c812a62

git log f4fba66..c812a62 --no-merges --oneline
2019-11-19 jonahwilliams@google.com allow ignoring toString, hashCode, and == in api_conform_test (flutter/engine#13907)
2019-11-19 bkonyi@google.com Roll src/third_party/dart d9d5fbc109..eeca3fb1cb (5 commits)
2019-11-19 chinmaygarde@google.com Add virtual destructor to GPUSurfaceSoftwareDelegate. (flutter/engine#13918)
2019-11-19 47866232+chunhtai@users.noreply.github.com Moves pointer event sanitizing to engine. (flutter/engine#13697)
tvolkert added a commit to flutter/flutter that referenced this pull request Nov 20, 2019
git@github.com:flutter/engine.git/compare/f4fba66c2fad...c812a62

git log f4fba66..c812a62 --no-merges --oneline
2019-11-19 jonahwilliams@google.com allow ignoring toString, hashCode, and == in api_conform_test (flutter/engine#13907)
2019-11-19 bkonyi@google.com Roll src/third_party/dart d9d5fbc109..eeca3fb1cb (5 commits)
2019-11-19 chinmaygarde@google.com Add virtual destructor to GPUSurfaceSoftwareDelegate. (flutter/engine#13918)
2019-11-19 47866232+chunhtai@users.noreply.github.com Moves pointer event sanitizing to engine. (flutter/engine#13697)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants