Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public void doReplayInner(String visibleScene, long startNs, long endNs, int dro

private class FrameCollectItem {
String visibleScene;
long sumFrameCost;
float sumFrameCost;
int sumFrame = 0;
int sumDroppedFrames;
// record the level of frames dropped each time
Expand Down Expand Up @@ -306,7 +306,7 @@ void collect(int droppedFrames) {
}

void report() {
float fps = Math.min(refreshRate, 1000.f * sumFrame / sumFrameCost);
float fps = 1000.f * sumFrame / sumFrameCost;
MatrixLog.i(TAG, "[report] FPS:%s %s", fps, toString());
try {
TracePlugin plugin = Matrix.with().getPluginByClass(TracePlugin.class);
Expand Down Expand Up @@ -398,12 +398,11 @@ public void onActivityStarted(Activity activity) {
@Override
public void onActivityResumed(Activity activity) {
lastResumeTimeMap.put(activity.getClass().getName(), System.currentTimeMillis());

this.refreshRate = (int) activity.getWindowManager().getDefaultDisplay().getRefreshRate();
if (useFrameMetrics) {
if (frameListenerMap.containsKey(activity.hashCode())) {
return;
}
this.refreshRate = (int) activity.getWindowManager().getDefaultDisplay().getRefreshRate();
this.frameIntervalNs = Constants.TIME_SECOND_TO_NANO / (long) refreshRate;
Window.OnFrameMetricsAvailableListener onFrameMetricsAvailableListener = new Window.OnFrameMetricsAvailableListener() {
@RequiresApi(api = Build.VERSION_CODES.O)
Expand Down