Skip to content

Comments

Capture initial screenshot when starting frame timing trace#55720

Open
rubennorte wants to merge 1 commit intofacebook:mainfrom
rubennorte:export-D94223073
Open

Capture initial screenshot when starting frame timing trace#55720
rubennorte wants to merge 1 commit intofacebook:mainfrom
rubennorte:export-D94223073

Conversation

@rubennorte
Copy link
Contributor

Summary:
Changelog: [internal]

When tracing starts, the frame metrics listener only fires when new frames are rendered. This means if no UI changes occur during a trace, no screenshots are captured. This also causes the initial state of the UI to be missing from the trace.

This change captures an initial screenshot immediately when start() is called, ensuring there's always at least one frame recorded at the beginning of a trace regardless of whether UI changes occur.

The implementation also refactors the frame emission logic into a shared emitFrameTiming() method to eliminate code duplication between the frame metrics listener and the initial capture.

Differential Revision: D94223073

Summary:
Changelog: [internal]

When tracing starts, the frame metrics listener only fires when new frames are rendered. This means if no UI changes occur during a trace, no screenshots are captured. This also causes the initial state of the UI to be missing from the trace.

This change captures an initial screenshot immediately when `start()` is called, ensuring there's always at least one frame recorded at the beginning of a trace regardless of whether UI changes occur.

The implementation also refactors the frame emission logic into a shared `emitFrameTiming()` method to eliminate code duplication between the frame metrics listener and the initial capture.

Differential Revision: D94223073
@meta-codesync
Copy link

meta-codesync bot commented Feb 24, 2026

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94223073.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants