// services/viz/privileged/mojom/compositing/display_private.mojom-data-view.h is auto generated by mojom_bindings_generator.py, do not edit

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

// This file defines XDataView for type traits and can be included in
// _mojom_traits.h definitions but otherwise please use .mojom-forward.h,
// .mojom-shared.h or .mojom.h.

// IWYU pragma: private
// IWYU pragma: friend "traits"

#ifndef SERVICES_VIZ_PRIVILEGED_MOJOM_COMPOSITING_DISPLAY_PRIVATE_MOJOM_DATA_VIEW_H_
#define SERVICES_VIZ_PRIVILEGED_MOJOM_COMPOSITING_DISPLAY_PRIVATE_MOJOM_DATA_VIEW_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "services/viz/privileged/mojom/compositing/display_private.mojom-shared-internal.h"
#include "gpu/ipc/common/context_result.mojom-shared.h"
#include "gpu/ipc/common/surface_handle.mojom-shared.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"
#include "ui/display/mojom/display_constants.mojom-shared.h"
#include "ui/gfx/mojom/ca_layer_params.mojom-shared.h"
#include "ui/gfx/mojom/delegated_ink_point_renderer.mojom-shared.h"
#include "ui/gfx/mojom/display_color_spaces.mojom-shared.h"
#include "ui/gfx/mojom/overlay_transform.mojom-shared.h"
#include "ui/gfx/mojom/transform.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"
#include "ui/latency/mojom/latency_info.mojom-shared.h"
#include "services/viz/privileged/mojom/compositing/begin_frame_observer.mojom-shared.h"
#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom-shared.h"
#include "services/viz/privileged/mojom/compositing/vsync_parameter_observer.mojom-shared.h"


namespace viz::mojom {
class FrameRateVelocityPointDataView;

class AdaptiveRefreshRateInfoDataView;



}  // viz::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::viz::mojom::FrameRateVelocityPointDataView> {
  using Data = ::viz::mojom::internal::FrameRateVelocityPoint_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::viz::mojom::AdaptiveRefreshRateInfoDataView> {
  using Data = ::viz::mojom::internal::AdaptiveRefreshRateInfo_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace viz::mojom {
// Interface base classes. They are used for type safety check.
class DisplayPrivateInterfaceBase {};

using DisplayPrivatePtrDataView =
    mojo::InterfacePtrDataView<DisplayPrivateInterfaceBase>;
using DisplayPrivateRequestDataView =
    mojo::InterfaceRequestDataView<DisplayPrivateInterfaceBase>;
using DisplayPrivateAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<DisplayPrivateInterfaceBase>;
using DisplayPrivateAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<DisplayPrivateInterfaceBase>;
class DisplayClientInterfaceBase {};

using DisplayClientPtrDataView =
    mojo::InterfacePtrDataView<DisplayClientInterfaceBase>;
using DisplayClientRequestDataView =
    mojo::InterfaceRequestDataView<DisplayClientInterfaceBase>;
using DisplayClientAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<DisplayClientInterfaceBase>;
using DisplayClientAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<DisplayClientInterfaceBase>;


class FrameRateVelocityPointDataView {
 public:
  FrameRateVelocityPointDataView() = default;

  FrameRateVelocityPointDataView(
      internal::FrameRateVelocityPoint_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  float frame_per_second() const {
    return data_->frame_per_second;
  }
  float dp_per_second() const {
    return data_->dp_per_second;
  }
 private:
  internal::FrameRateVelocityPoint_Data* data_ = nullptr;
};


class AdaptiveRefreshRateInfoDataView {
 public:
  AdaptiveRefreshRateInfoDataView() = default;

  AdaptiveRefreshRateInfoDataView(
      internal::AdaptiveRefreshRateInfo_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  bool has_support() const {
    return data_->has_support;
  }
  float suggested_high() const {
    return data_->suggested_high;
  }
  inline void GetVelocityMappingDataView(
      mojo::ArrayDataView<FrameRateVelocityPointDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadVelocityMapping(UserType* output) {
    
    auto* pointer = data_->velocity_mapping.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::viz::mojom::FrameRateVelocityPointDataView>>(
        pointer, output, message_);
  }
  float device_scale_factor() const {
    return data_->device_scale_factor;
  }
 private:
  internal::AdaptiveRefreshRateInfo_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // viz::mojom

#endif  // SERVICES_VIZ_PRIVILEGED_MOJOM_COMPOSITING_DISPLAY_PRIVATE_MOJOM_DATA_VIEW_H_