blob: 33f8e09a0810a75b2b0c5189aea7465f14a3f48c [file] [log] [blame] [edit]
// Copyright 2025 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.ui.display.singleton;
using zx;
@available(added=HEAD)
@discoverable
closed protocol VsyncSource {
/// Enables or disables receiving `OnVsync` for the given display.
///
/// The client receives `OnVsync` callbacks iff this function is called with `enabled=true`.
/// Calling this with `enabled=false` stops generating callbacks. Note that there may be a
/// race with a server receiving this and extra `OnVsync` may be received.
///
/// By default, the listener is assumed to have called `enabled=false`.
strict SetVsyncEnabled(struct {
enabled bool;
});
/// Notifies the client that a vsync event has occurred.
strict -> OnVsync(struct {
/// The time when the VSync occurred.
///
/// The accuracy of this timestamp depends on the display hardware.
timestamp zx.Time;
});
};