chromium/services/viz/public/mojom/compositing/frame_interval_inputs.mojom

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module viz.mojom;

import "mojo/public/mojom/base/time.mojom";

// See components/viz/common/quads/frame_interval_inputs.h
// These enums/structs are sent from viz clients such as the browser and
// renderer to the viz compositor in the GPU process.

enum ContentFrameIntervalType {
  kVideo,
  kAnimatingImage,
  kScrollBarFadeOutAnimation,
};

struct ContentFrameIntervalInfo {
  ContentFrameIntervalType type;
  mojo_base.mojom.TimeDelta frame_interval;
  uint32 duplicate_count = 0;
};

struct FrameIntervalInputs {
  mojo_base.mojom.TimeTicks frame_time;
  bool has_input;

  // For optimization, clients may (but are NOT required to) merge
  // ContentFrameIntervalInfo of same type and interval by incrementing
  // duplicate_count instead.
  array<ContentFrameIntervalInfo> content_interval_info;
  bool has_only_content_frame_interval_updates = false;
};