|
10 | 10 |
|
11 | 11 | #include "flutter/fml/message_loop.h" |
12 | 12 | #include "flutter/fml/platform/darwin/platform_version.h" |
| 13 | +#include "flutter/fml/trace_event.h" |
13 | 14 | #include "flutter/shell/common/engine.h" |
14 | 15 | #include "flutter/shell/common/platform_view.h" |
15 | 16 | #include "flutter/shell/common/shell.h" |
@@ -61,6 +62,8 @@ @implementation FlutterEngine { |
61 | 62 |
|
62 | 63 | int64_t _nextTextureId; |
63 | 64 |
|
| 65 | + uint64_t _nextPointerFlowId; |
| 66 | + |
64 | 67 | BOOL _allowHeadlessExecution; |
65 | 68 | } |
66 | 69 |
|
@@ -117,12 +120,15 @@ - (void)updateViewportMetrics:(blink::ViewportMetrics)viewportMetrics { |
117 | 120 | } |
118 | 121 |
|
119 | 122 | - (void)dispatchPointerDataPacket:(std::unique_ptr<blink::PointerDataPacket>)packet { |
120 | | - self.shell.GetTaskRunners().GetUITaskRunner()->PostTask( |
121 | | - fml::MakeCopyable([engine = self.shell.GetEngine(), packet = std::move(packet)] { |
| 123 | + TRACE_EVENT0("flutter", "dispatchPointerDataPacket"); |
| 124 | + TRACE_FLOW_BEGIN("flutter", "PointerEvent", _nextPointerFlowId); |
| 125 | + self.shell.GetTaskRunners().GetUITaskRunner()->PostTask(fml::MakeCopyable( |
| 126 | + [engine = self.shell.GetEngine(), packet = std::move(packet), flow_id = _nextPointerFlowId] { |
122 | 127 | if (engine) { |
123 | | - engine->DispatchPointerDataPacket(*packet); |
| 128 | + engine->DispatchPointerDataPacket(*packet, flow_id); |
124 | 129 | } |
125 | 130 | })); |
| 131 | + _nextPointerFlowId++; |
126 | 132 | } |
127 | 133 |
|
128 | 134 | - (fml::WeakPtr<shell::PlatformView>)platformView { |
|
0 commit comments