|
@@ -133,7 +133,7 @@ function FlamegraphZoomView({
|
|
|
return null;
|
|
|
}
|
|
|
return new SelectedFrameRenderer(flamegraphOverlayCanvasRef);
|
|
|
- }, [flamegraphOverlayCanvasRef, flamegraph, flamegraphTheme]);
|
|
|
+ }, [flamegraphOverlayCanvasRef]);
|
|
|
|
|
|
const hoveredNode = useMemo(() => {
|
|
|
if (!configSpaceCursor || !flamegraphRenderer) {
|
|
@@ -142,10 +142,6 @@ function FlamegraphZoomView({
|
|
|
return flamegraphRenderer.getHoveredNode(configSpaceCursor);
|
|
|
}, [configSpaceCursor, flamegraphRenderer]);
|
|
|
|
|
|
- useEffect(() => {
|
|
|
- scheduler.draw();
|
|
|
- }, [flamegraphState.search.results]);
|
|
|
-
|
|
|
useEffect(() => {
|
|
|
const onKeyDown = (evt: KeyboardEvent) => {
|
|
|
if (!flamegraphRenderer) {
|
|
@@ -198,7 +194,14 @@ function FlamegraphZoomView({
|
|
|
return () => {
|
|
|
document.removeEventListener('keydown', onKeyDown);
|
|
|
};
|
|
|
- }, [flamegraphRenderer, previousState, nextState, scheduler]);
|
|
|
+ }, [
|
|
|
+ flamegraphRenderer,
|
|
|
+ canvasPoolManager,
|
|
|
+ dispatchFlamegraphState,
|
|
|
+ previousState,
|
|
|
+ nextState,
|
|
|
+ scheduler,
|
|
|
+ ]);
|
|
|
|
|
|
const previousInteraction = usePrevious(lastInteraction);
|
|
|
const beforeInteractionConfigView = useRef<Rect | null>(null);
|
|
@@ -219,7 +222,7 @@ function FlamegraphZoomView({
|
|
|
) {
|
|
|
dispatch({type: 'checkpoint', payload: flamegraphRenderer.configView.clone()});
|
|
|
}
|
|
|
- }, [lastInteraction, flamegraphRenderer]);
|
|
|
+ }, [lastInteraction, flamegraphRenderer, dispatch, previousInteraction]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (!flamegraphRenderer) {
|
|
@@ -231,6 +234,7 @@ function FlamegraphZoomView({
|
|
|
};
|
|
|
|
|
|
scheduler.registerBeforeFrameCallback(drawRectangles);
|
|
|
+ scheduler.draw();
|
|
|
|
|
|
return () => {
|
|
|
scheduler.unregisterBeforeFrameCallback(drawRectangles);
|
|
@@ -328,6 +332,7 @@ function FlamegraphZoomView({
|
|
|
gridRenderer,
|
|
|
selectedNode,
|
|
|
hoveredNode,
|
|
|
+ selectedFrameRenderer,
|
|
|
]);
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -355,7 +360,7 @@ function FlamegraphZoomView({
|
|
|
flamegraphRenderer.setConfigView(
|
|
|
new Rect(
|
|
|
frame.start,
|
|
|
- flamegraph.inverted
|
|
|
+ flamegraphRenderer.flamegraph.inverted
|
|
|
? flamegraphRenderer.configSpace.height -
|
|
|
flamegraphRenderer.configView.height -
|
|
|
frame.depth +
|
|
@@ -402,7 +407,13 @@ function FlamegraphZoomView({
|
|
|
}
|
|
|
);
|
|
|
return () => observer.disconnect();
|
|
|
- }, [scheduler, flamegraphCanvasRef, flamegraphOverlayCanvasRef, flamegraphRenderer]);
|
|
|
+ }, [
|
|
|
+ canvasPoolManager,
|
|
|
+ scheduler,
|
|
|
+ flamegraphCanvasRef,
|
|
|
+ flamegraphOverlayCanvasRef,
|
|
|
+ flamegraphRenderer,
|
|
|
+ ]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
canvasPoolManager.registerScheduler(scheduler);
|
|
@@ -462,7 +473,6 @@ function FlamegraphZoomView({
|
|
|
selectedNode,
|
|
|
hoveredNode,
|
|
|
canvasPoolManager,
|
|
|
- startPanVector,
|
|
|
lastInteraction,
|
|
|
]
|
|
|
);
|
|
@@ -518,7 +528,7 @@ function FlamegraphZoomView({
|
|
|
|
|
|
setStartPanVector(physicalMousePos);
|
|
|
},
|
|
|
- [flamegraphRenderer, startPanVector]
|
|
|
+ [flamegraphRenderer, startPanVector, canvasPoolManager]
|
|
|
);
|
|
|
|
|
|
const onCanvasMouseMove = useCallback(
|
|
@@ -540,13 +550,7 @@ function FlamegraphZoomView({
|
|
|
setLastInteraction(null);
|
|
|
}
|
|
|
},
|
|
|
- [
|
|
|
- flamegraphRenderer,
|
|
|
- setConfigSpaceCursor,
|
|
|
- onMouseDrag,
|
|
|
- lastInteraction,
|
|
|
- startPanVector,
|
|
|
- ]
|
|
|
+ [flamegraphRenderer, setConfigSpaceCursor, onMouseDrag, startPanVector]
|
|
|
);
|
|
|
|
|
|
const onCanvasMouseLeave = useCallback(() => {
|