Merge "vsyncId should always be incremental" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
544b5f5b2e
@@ -15,22 +15,28 @@
|
|||||||
*/
|
*/
|
||||||
#include "TimeLord.h"
|
#include "TimeLord.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include "FrameInfo.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace uirenderer {
|
namespace uirenderer {
|
||||||
namespace renderthread {
|
namespace renderthread {
|
||||||
|
|
||||||
TimeLord::TimeLord() : mFrameIntervalNanos(milliseconds_to_nanoseconds(16)),
|
TimeLord::TimeLord()
|
||||||
mFrameTimeNanos(0),
|
: mFrameIntervalNanos(milliseconds_to_nanoseconds(16))
|
||||||
mFrameIntendedTimeNanos(0),
|
, mFrameTimeNanos(0)
|
||||||
mFrameVsyncId(-1),
|
, mFrameIntendedTimeNanos(0)
|
||||||
mFrameDeadline(std::numeric_limits<int64_t>::max()){}
|
, mFrameVsyncId(UiFrameInfoBuilder::INVALID_VSYNC_ID)
|
||||||
|
, mFrameDeadline(std::numeric_limits<int64_t>::max()) {}
|
||||||
|
|
||||||
bool TimeLord::vsyncReceived(nsecs_t vsync, nsecs_t intendedVsync, int64_t vsyncId,
|
bool TimeLord::vsyncReceived(nsecs_t vsync, nsecs_t intendedVsync, int64_t vsyncId,
|
||||||
int64_t frameDeadline, nsecs_t frameInterval) {
|
int64_t frameDeadline, nsecs_t frameInterval) {
|
||||||
if (intendedVsync > mFrameIntendedTimeNanos) {
|
if (intendedVsync > mFrameIntendedTimeNanos) {
|
||||||
mFrameIntendedTimeNanos = intendedVsync;
|
mFrameIntendedTimeNanos = intendedVsync;
|
||||||
mFrameVsyncId = vsyncId;
|
|
||||||
|
// The intendedVsync might have been advanced to account for scheduling
|
||||||
|
// jitter. Since we don't have a way to advance the vsync id we just
|
||||||
|
// reset it.
|
||||||
|
mFrameVsyncId = (vsyncId > mFrameVsyncId) ? vsyncId : UiFrameInfoBuilder::INVALID_VSYNC_ID;
|
||||||
mFrameDeadline = frameDeadline;
|
mFrameDeadline = frameDeadline;
|
||||||
if (frameInterval > 0) {
|
if (frameInterval > 0) {
|
||||||
mFrameIntervalNanos = frameInterval;
|
mFrameIntervalNanos = frameInterval;
|
||||||
|
|||||||
Reference in New Issue
Block a user