Revert^2 "Copy from DisplayEventReceiver.VsyncEventData"
912e1e49ed
Change-Id: I5c298d70c9d09fdea6ff2b981080d2e464252504
This commit is contained in:
@@ -195,7 +195,7 @@ public final class Choreographer {
|
||||
|
||||
private boolean mDebugPrintNextFrameTimeDelta;
|
||||
private int mFPSDivisor = 1;
|
||||
private DisplayEventReceiver.VsyncEventData mLastVsyncEventData =
|
||||
private final DisplayEventReceiver.VsyncEventData mLastVsyncEventData =
|
||||
new DisplayEventReceiver.VsyncEventData();
|
||||
private final FrameData mFrameData = new FrameData();
|
||||
|
||||
@@ -857,7 +857,7 @@ public final class Choreographer {
|
||||
mFrameScheduled = false;
|
||||
mLastFrameTimeNanos = frameTimeNanos;
|
||||
mLastFrameIntervalNanos = frameIntervalNanos;
|
||||
mLastVsyncEventData = vsyncEventData;
|
||||
mLastVsyncEventData.copyFrom(vsyncEventData);
|
||||
}
|
||||
|
||||
AnimationUtils.lockAnimationClock(frameTimeNanos / TimeUtils.NANOS_PER_MS);
|
||||
@@ -1247,7 +1247,7 @@ public final class Choreographer {
|
||||
private boolean mHavePendingVsync;
|
||||
private long mTimestampNanos;
|
||||
private int mFrame;
|
||||
private VsyncEventData mLastVsyncEventData = new VsyncEventData();
|
||||
private final VsyncEventData mLastVsyncEventData = new VsyncEventData();
|
||||
|
||||
FrameDisplayEventReceiver(Looper looper, int vsyncSource, long layerHandle) {
|
||||
super(looper, vsyncSource, /* eventRegistration */ 0, layerHandle);
|
||||
@@ -1287,7 +1287,7 @@ public final class Choreographer {
|
||||
|
||||
mTimestampNanos = timestampNanos;
|
||||
mFrame = frame;
|
||||
mLastVsyncEventData = vsyncEventData;
|
||||
mLastVsyncEventData.copyFrom(vsyncEventData);
|
||||
Message msg = Message.obtain(mHandler, this);
|
||||
msg.setAsynchronous(true);
|
||||
mHandler.sendMessageAtTime(msg, timestampNanos / TimeUtils.NANOS_PER_MS);
|
||||
|
||||
@@ -169,6 +169,12 @@ public abstract class DisplayEventReceiver {
|
||||
this.deadline = deadline;
|
||||
}
|
||||
|
||||
void copyFrom(FrameTimeline other) {
|
||||
vsyncId = other.vsyncId;
|
||||
expectedPresentationTime = other.expectedPresentationTime;
|
||||
deadline = other.deadline;
|
||||
}
|
||||
|
||||
// The frame timeline vsync id, used to correlate a frame
|
||||
// produced by HWUI with the timeline data stored in Surface Flinger.
|
||||
public long vsyncId = FrameInfo.INVALID_VSYNC_ID;
|
||||
@@ -208,6 +214,14 @@ public abstract class DisplayEventReceiver {
|
||||
this.frameInterval = frameInterval;
|
||||
}
|
||||
|
||||
void copyFrom(VsyncEventData other) {
|
||||
preferredFrameTimelineIndex = other.preferredFrameTimelineIndex;
|
||||
frameInterval = other.frameInterval;
|
||||
for (int i = 0; i < frameTimelines.length; i++) {
|
||||
frameTimelines[i].copyFrom(other.frameTimelines[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public FrameTimeline preferredFrameTimeline() {
|
||||
return frameTimelines[preferredFrameTimelineIndex];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user