Flutter Engine
The Flutter Engine
|
#include <pointer_data_packet_converter.h>
Classes | |
class | Delegate |
Public Member Functions | |
PointerDataPacketConverter (const Delegate &delegate) | |
Create a PointerDataPacketConverter. More... | |
~PointerDataPacketConverter () | |
std::unique_ptr< PointerDataPacket > | Convert (const PointerDataPacket &packet) |
Converts pointer data packet into a form that framework understands. The raw pointer data packet from embedding does not have sufficient information and may contain illegal pointer transitions. This method will fill out that information and attempt to correct pointer transitions. More... | |
Converter to convert the raw pointer data packet from the platforms.
Framework requires certain information to process pointer data. e.g. pointer identifier and the delta of pointer moment. The converter keeps track each pointer state and fill in those information appropriately.
The converter is also resposible for providing a clean pointer data stream. It will attempt to correct the stream if the it contains illegal pointer transitions.
Example 1 Missing Add:
Down(position x) -> Up(position x) ###After Conversion### Synthesized_Add(position x) -> Down(position x) -> Up(position x)
Example 2 Missing another move:
Add(position x) -> Down(position x) -> Move(position y) -> Up(position z) ###After Conversion### Add(position x) -> Down(position x) -> Move(position y) -> Synthesized_Move(position z) -> Up(position z)
Platform view is the only client that uses this class to convert all the incoming pointer packet and is responsible for the life cycle of its instance.
Definition at line 76 of file pointer_data_packet_converter.h.
|
explicit |
Create a PointerDataPacketConverter.
[in] | delegate | A delegate to fulfill the query to the app state. The delegate must exist throughout the lifetime of this class. Typically RuntimeController . |
Definition at line 14 of file pointer_data_packet_converter.cc.
|
default |
std::unique_ptr< PointerDataPacket > flutter::PointerDataPacketConverter::Convert | ( | const PointerDataPacket & | packet | ) |
Converts pointer data packet into a form that framework understands. The raw pointer data packet from embedding does not have sufficient information and may contain illegal pointer transitions. This method will fill out that information and attempt to correct pointer transitions.
Pointer data with invalid view IDs will be ignored.
[in] | packet | The raw pointer packet sent from embedding. |
Definition at line 19 of file pointer_data_packet_converter.cc.