Loading core/java/android/view/Choreographer.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -195,7 +195,7 @@ public final class Choreographer { private boolean mDebugPrintNextFrameTimeDelta; private boolean mDebugPrintNextFrameTimeDelta; private int mFPSDivisor = 1; private int mFPSDivisor = 1; private DisplayEventReceiver.VsyncEventData mLastVsyncEventData = private final DisplayEventReceiver.VsyncEventData mLastVsyncEventData = new DisplayEventReceiver.VsyncEventData(); new DisplayEventReceiver.VsyncEventData(); private final FrameData mFrameData = new FrameData(); private final FrameData mFrameData = new FrameData(); Loading Loading @@ -857,7 +857,7 @@ public final class Choreographer { mFrameScheduled = false; mFrameScheduled = false; mLastFrameTimeNanos = frameTimeNanos; mLastFrameTimeNanos = frameTimeNanos; mLastFrameIntervalNanos = frameIntervalNanos; mLastFrameIntervalNanos = frameIntervalNanos; mLastVsyncEventData = vsyncEventData; mLastVsyncEventData.copyFrom(vsyncEventData); } } AnimationUtils.lockAnimationClock(frameTimeNanos / TimeUtils.NANOS_PER_MS); AnimationUtils.lockAnimationClock(frameTimeNanos / TimeUtils.NANOS_PER_MS); Loading Loading @@ -1247,7 +1247,7 @@ public final class Choreographer { private boolean mHavePendingVsync; private boolean mHavePendingVsync; private long mTimestampNanos; private long mTimestampNanos; private int mFrame; private int mFrame; private VsyncEventData mLastVsyncEventData = new VsyncEventData(); private final VsyncEventData mLastVsyncEventData = new VsyncEventData(); FrameDisplayEventReceiver(Looper looper, int vsyncSource, long layerHandle) { FrameDisplayEventReceiver(Looper looper, int vsyncSource, long layerHandle) { super(looper, vsyncSource, /* eventRegistration */ 0, layerHandle); super(looper, vsyncSource, /* eventRegistration */ 0, layerHandle); Loading Loading @@ -1287,7 +1287,7 @@ public final class Choreographer { mTimestampNanos = timestampNanos; mTimestampNanos = timestampNanos; mFrame = frame; mFrame = frame; mLastVsyncEventData = vsyncEventData; mLastVsyncEventData.copyFrom(vsyncEventData); Message msg = Message.obtain(mHandler, this); Message msg = Message.obtain(mHandler, this); msg.setAsynchronous(true); msg.setAsynchronous(true); mHandler.sendMessageAtTime(msg, timestampNanos / TimeUtils.NANOS_PER_MS); mHandler.sendMessageAtTime(msg, timestampNanos / TimeUtils.NANOS_PER_MS); Loading core/java/android/view/DisplayEventReceiver.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -164,6 +164,12 @@ public abstract class DisplayEventReceiver { this.deadline = deadline; 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 // The frame timeline vsync id, used to correlate a frame // produced by HWUI with the timeline data stored in Surface Flinger. // produced by HWUI with the timeline data stored in Surface Flinger. public long vsyncId = FrameInfo.INVALID_VSYNC_ID; public long vsyncId = FrameInfo.INVALID_VSYNC_ID; Loading Loading @@ -203,6 +209,14 @@ public abstract class DisplayEventReceiver { this.frameInterval = frameInterval; 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() { public FrameTimeline preferredFrameTimeline() { return frameTimelines[preferredFrameTimelineIndex]; return frameTimelines[preferredFrameTimelineIndex]; } } Loading Loading
core/java/android/view/Choreographer.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -195,7 +195,7 @@ public final class Choreographer { private boolean mDebugPrintNextFrameTimeDelta; private boolean mDebugPrintNextFrameTimeDelta; private int mFPSDivisor = 1; private int mFPSDivisor = 1; private DisplayEventReceiver.VsyncEventData mLastVsyncEventData = private final DisplayEventReceiver.VsyncEventData mLastVsyncEventData = new DisplayEventReceiver.VsyncEventData(); new DisplayEventReceiver.VsyncEventData(); private final FrameData mFrameData = new FrameData(); private final FrameData mFrameData = new FrameData(); Loading Loading @@ -857,7 +857,7 @@ public final class Choreographer { mFrameScheduled = false; mFrameScheduled = false; mLastFrameTimeNanos = frameTimeNanos; mLastFrameTimeNanos = frameTimeNanos; mLastFrameIntervalNanos = frameIntervalNanos; mLastFrameIntervalNanos = frameIntervalNanos; mLastVsyncEventData = vsyncEventData; mLastVsyncEventData.copyFrom(vsyncEventData); } } AnimationUtils.lockAnimationClock(frameTimeNanos / TimeUtils.NANOS_PER_MS); AnimationUtils.lockAnimationClock(frameTimeNanos / TimeUtils.NANOS_PER_MS); Loading Loading @@ -1247,7 +1247,7 @@ public final class Choreographer { private boolean mHavePendingVsync; private boolean mHavePendingVsync; private long mTimestampNanos; private long mTimestampNanos; private int mFrame; private int mFrame; private VsyncEventData mLastVsyncEventData = new VsyncEventData(); private final VsyncEventData mLastVsyncEventData = new VsyncEventData(); FrameDisplayEventReceiver(Looper looper, int vsyncSource, long layerHandle) { FrameDisplayEventReceiver(Looper looper, int vsyncSource, long layerHandle) { super(looper, vsyncSource, /* eventRegistration */ 0, layerHandle); super(looper, vsyncSource, /* eventRegistration */ 0, layerHandle); Loading Loading @@ -1287,7 +1287,7 @@ public final class Choreographer { mTimestampNanos = timestampNanos; mTimestampNanos = timestampNanos; mFrame = frame; mFrame = frame; mLastVsyncEventData = vsyncEventData; mLastVsyncEventData.copyFrom(vsyncEventData); Message msg = Message.obtain(mHandler, this); Message msg = Message.obtain(mHandler, this); msg.setAsynchronous(true); msg.setAsynchronous(true); mHandler.sendMessageAtTime(msg, timestampNanos / TimeUtils.NANOS_PER_MS); mHandler.sendMessageAtTime(msg, timestampNanos / TimeUtils.NANOS_PER_MS); Loading
core/java/android/view/DisplayEventReceiver.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -164,6 +164,12 @@ public abstract class DisplayEventReceiver { this.deadline = deadline; 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 // The frame timeline vsync id, used to correlate a frame // produced by HWUI with the timeline data stored in Surface Flinger. // produced by HWUI with the timeline data stored in Surface Flinger. public long vsyncId = FrameInfo.INVALID_VSYNC_ID; public long vsyncId = FrameInfo.INVALID_VSYNC_ID; Loading Loading @@ -203,6 +209,14 @@ public abstract class DisplayEventReceiver { this.frameInterval = frameInterval; 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() { public FrameTimeline preferredFrameTimeline() { return frameTimelines[preferredFrameTimelineIndex]; return frameTimelines[preferredFrameTimelineIndex]; } } Loading