This source file includes following definitions.
- GetVSyncParameters
#include "ui/gfx/ozone/dri/dri_vsync_provider.h"
#include "base/time/time.h"
#include "ui/gfx/ozone/dri/hardware_display_controller.h"
namespace gfx {
DriVSyncProvider::DriVSyncProvider(HardwareDisplayController* controller)
: controller_(controller) {}
DriVSyncProvider::~DriVSyncProvider() {}
void DriVSyncProvider::GetVSyncParameters(const UpdateVSyncCallback& callback) {
if (controller_->get_time_of_last_flip() == 0)
return;
base::TimeTicks timebase =
base::TimeTicks::FromInternalValue(controller_->get_time_of_last_flip());
base::TimeDelta interval =
base::TimeDelta::FromSeconds(1) / controller_->get_mode().vrefresh;
callback.Run(timebase, interval);
}
}