|
20 | 20 | import static com.facebook.rendercore.debug.DebugEventAttribute.Description;
|
21 | 21 | import static com.facebook.rendercore.debug.DebugEventAttribute.HashCode;
|
22 | 22 | import static com.facebook.rendercore.debug.DebugEventAttribute.Key;
|
| 23 | +import static com.facebook.rendercore.debug.DebugEventAttribute.NumMountableOutputs; |
23 | 24 | import static com.facebook.rendercore.debug.DebugEventAttribute.RenderUnitId;
|
24 | 25 | import static com.facebook.rendercore.debug.DebugEventAttribute.RootHostHashCode;
|
25 | 26 | import static com.facebook.rendercore.debug.DebugEventDispatcher.beginTrace;
|
|
34 | 35 | import androidx.collection.LongSparseArray;
|
35 | 36 | import androidx.core.util.Preconditions;
|
36 | 37 | import com.facebook.rendercore.debug.DebugEvent;
|
| 38 | +import com.facebook.rendercore.debug.DebugEventDispatcher; |
37 | 39 | import com.facebook.rendercore.extensions.ExtensionState;
|
38 | 40 | import com.facebook.rendercore.extensions.MountExtension;
|
39 | 41 | import com.facebook.rendercore.extensions.RenderCoreExtension;
|
|
43 | 45 | import java.util.ArrayList;
|
44 | 46 | import java.util.HashMap;
|
45 | 47 | import java.util.List;
|
| 48 | +import kotlin.Unit; |
46 | 49 |
|
47 | 50 | public class MountState implements MountDelegateTarget {
|
48 | 51 |
|
@@ -127,13 +130,24 @@ public void mount(RenderTree renderTree) {
|
127 | 130 | if (traceIdentifier != null) {
|
128 | 131 | HashMap<String, Object> attributes = new HashMap<>();
|
129 | 132 | attributes.put(RootHostHashCode, mRootHost.hashCode());
|
| 133 | + attributes.put(NumMountableOutputs, renderTree.getMountableOutputCount()); |
130 | 134 |
|
131 | 135 | beginTrace(
|
132 | 136 | traceIdentifier,
|
133 | 137 | DebugEvent.RenderTreeMounted,
|
134 | 138 | String.valueOf(renderTree.getRenderStateId()),
|
135 | 139 | attributes);
|
136 | 140 | }
|
| 141 | + |
| 142 | + DebugEventDispatcher.dispatch( |
| 143 | + DebugEvent.RenderTreeMountStart, |
| 144 | + () -> String.valueOf(renderTree.getRenderStateId()), |
| 145 | + attrs -> { |
| 146 | + attrs.put(RootHostHashCode, mRootHost.hashCode()); |
| 147 | + attrs.put(NumMountableOutputs, renderTree.getMountableOutputCount()); |
| 148 | + return Unit.INSTANCE; |
| 149 | + }); |
| 150 | + |
137 | 151 | try {
|
138 | 152 |
|
139 | 153 | if (mIsMounting) {
|
@@ -229,6 +243,15 @@ public void mount(RenderTree renderTree) {
|
229 | 243 | endTrace(traceIdentifier);
|
230 | 244 | }
|
231 | 245 | mIsMounting = false;
|
| 246 | + |
| 247 | + DebugEventDispatcher.dispatch( |
| 248 | + DebugEvent.RenderTreeMountEnd, |
| 249 | + () -> String.valueOf(renderTree.getRenderStateId()), |
| 250 | + attrs -> { |
| 251 | + attrs.put(RootHostHashCode, mRootHost.hashCode()); |
| 252 | + attrs.put(NumMountableOutputs, renderTree.getMountableOutputCount()); |
| 253 | + return Unit.INSTANCE; |
| 254 | + }); |
232 | 255 | }
|
233 | 256 | }
|
234 | 257 |
|
|
0 commit comments