This source file includes following definitions.
- interval
- interval
- Create
- CreateForSynchronousCompositor
- CreateForTesting
- CreateExpiredForTesting
- DefaultDeadlineAdjustment
- DefaultInterval
- DefaultRetroactiveBeginFramePeriod
#include "cc/output/begin_frame_args.h"
#include "ui/gfx/frame_time.h"
namespace cc {
BeginFrameArgs::BeginFrameArgs()
: frame_time(base::TimeTicks()),
deadline(base::TimeTicks()),
interval(base::TimeDelta::FromMicroseconds(-1)) {
}
BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time,
base::TimeTicks deadline,
base::TimeDelta interval)
: frame_time(frame_time),
deadline(deadline),
interval(interval)
{}
BeginFrameArgs BeginFrameArgs::Create(base::TimeTicks frame_time,
base::TimeTicks deadline,
base::TimeDelta interval) {
return BeginFrameArgs(frame_time, deadline, interval);
}
BeginFrameArgs BeginFrameArgs::CreateForSynchronousCompositor() {
return BeginFrameArgs(gfx::FrameTime::Now(),
base::TimeTicks(),
DefaultInterval());
}
BeginFrameArgs BeginFrameArgs::CreateForTesting() {
base::TimeTicks now = gfx::FrameTime::Now();
return BeginFrameArgs(now,
now + (DefaultInterval() / 2),
DefaultInterval());
}
BeginFrameArgs BeginFrameArgs::CreateExpiredForTesting() {
base::TimeTicks now = gfx::FrameTime::Now();
return BeginFrameArgs(now,
now - DefaultInterval(),
DefaultInterval());
}
base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() {
return base::TimeDelta::FromMicroseconds(-16666 / 3);
}
base::TimeDelta BeginFrameArgs::DefaultInterval() {
return base::TimeDelta::FromMicroseconds(16666);
}
base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() {
return base::TimeDelta::FromMicroseconds(4444);
}
}