// services/viz/public/mojom/compositing/compositor_render_pass.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_PUBLIC_MOJOM_COMPOSITING_COMPOSITOR_RENDER_PASS_MOJOM_DATA_VIEW_H_
#define SERVICES_VIZ_PUBLIC_MOJOM_COMPOSITING_COMPOSITOR_RENDER_PASS_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/public/mojom/compositing/compositor_render_pass.mojom-shared-internal.h"
#include "services/viz/public/mojom/compositing/compositor_render_pass_id.mojom-shared.h"
#include "services/viz/public/mojom/compositing/copy_output_request.mojom-shared.h"
#include "services/viz/public/mojom/compositing/filter_operations.mojom-shared.h"
#include "services/viz/public/mojom/compositing/quads.mojom-shared.h"
#include "services/viz/public/mojom/compositing/view_transition_element_resource_id.mojom-shared.h"
#include "services/viz/public/mojom/compositing/subtree_capture_id.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"
#include "ui/gfx/mojom/transform.mojom-shared.h"
#include "skia/public/mojom/skpath.mojom-shared.h"


namespace viz::mojom {
class CompositorRenderPassDataView;



}  // viz::mojom


namespace mojo {
namespace internal {

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

}  // namespace internal
}  // namespace mojo


namespace viz::mojom {


class CompositorRenderPassDataView {
 public:
  CompositorRenderPassDataView() = default;

  CompositorRenderPassDataView(
      internal::CompositorRenderPass_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetIdDataView(
      ::viz::mojom::CompositorRenderPassIdDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadId(UserType* output) {
    
    auto* pointer = data_->id.Get();
    return mojo::internal::Deserialize<::viz::mojom::CompositorRenderPassIdDataView>(
        pointer, output, message_);
  }
  inline void GetOutputRectDataView(
      ::gfx::mojom::RectDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadOutputRect(UserType* output) {
    
    auto* pointer = data_->output_rect.Get();
    return mojo::internal::Deserialize<::gfx::mojom::RectDataView>(
        pointer, output, message_);
  }
  inline void GetDamageRectDataView(
      ::gfx::mojom::RectDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDamageRect(UserType* output) {
    
    auto* pointer = data_->damage_rect.Get();
    return mojo::internal::Deserialize<::gfx::mojom::RectDataView>(
        pointer, output, message_);
  }
  inline void GetTransformToRootTargetDataView(
      ::gfx::mojom::TransformDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadTransformToRootTarget(UserType* output) {
    
    auto* pointer = data_->transform_to_root_target.Get();
    return mojo::internal::Deserialize<::gfx::mojom::TransformDataView>(
        pointer, output, message_);
  }
  inline void GetFiltersDataView(
      ::viz::mojom::FilterOperationsDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFilters(UserType* output) {
    
    auto* pointer = data_->filters.Get();
    return mojo::internal::Deserialize<::viz::mojom::FilterOperationsDataView>(
        pointer, output, message_);
  }
  inline void GetBackdropFiltersDataView(
      ::viz::mojom::FilterOperationsDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadBackdropFilters(UserType* output) {
    
    auto* pointer = data_->backdrop_filters.Get();
    return mojo::internal::Deserialize<::viz::mojom::FilterOperationsDataView>(
        pointer, output, message_);
  }
  inline void GetBackdropFilterBoundsDataView(
      ::skia::mojom::SkPathDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadBackdropFilterBounds(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::skia::mojom::SkPathDataView, UserType>(),
    "Attempting to read the optional `backdrop_filter_bounds` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadBackdropFilterBounds` instead "
    "of `ReadBackdropFilterBounds if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->backdrop_filter_bounds.Get();
    return mojo::internal::Deserialize<::skia::mojom::SkPathDataView>(
        pointer, output, message_);
  }
  inline void GetSubtreeCaptureIdDataView(
      ::viz::mojom::SubtreeCaptureIdDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSubtreeCaptureId(UserType* output) {
    
    auto* pointer = data_->subtree_capture_id.Get();
    return mojo::internal::Deserialize<::viz::mojom::SubtreeCaptureIdDataView>(
        pointer, output, message_);
  }
  inline void GetSubtreeSizeDataView(
      ::gfx::mojom::SizeDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSubtreeSize(UserType* output) {
    
    auto* pointer = data_->subtree_size.Get();
    return mojo::internal::Deserialize<::gfx::mojom::SizeDataView>(
        pointer, output, message_);
  }
  inline void GetViewTransitionElementResourceIdDataView(
      ::viz::mojom::ViewTransitionElementResourceIdDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadViewTransitionElementResourceId(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::viz::mojom::ViewTransitionElementResourceIdDataView, UserType>(),
    "Attempting to read the optional `view_transition_element_resource_id` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadViewTransitionElementResourceId` instead "
    "of `ReadViewTransitionElementResourceId if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->view_transition_element_resource_id.Get();
    return mojo::internal::Deserialize<::viz::mojom::ViewTransitionElementResourceIdDataView>(
        pointer, output, message_);
  }
  bool has_transparent_background() const {
    return data_->has_transparent_background;
  }
  bool cache_render_pass() const {
    return data_->cache_render_pass;
  }
  bool has_damage_from_contributing_content() const {
    return data_->has_damage_from_contributing_content;
  }
  bool generate_mipmap() const {
    return data_->generate_mipmap;
  }
  inline void GetCopyRequestsDataView(
      mojo::ArrayDataView<::viz::mojom::CopyOutputRequestDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadCopyRequests(UserType* output) {
    
    auto* pointer = data_->copy_requests.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::viz::mojom::CopyOutputRequestDataView>>(
        pointer, output, message_);
  }
  inline void GetQuadListDataView(
      mojo::ArrayDataView<::viz::mojom::DrawQuadDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadQuadList(UserType* output) {
    
    auto* pointer = data_->quad_list.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::viz::mojom::DrawQuadDataView>>(
        pointer, output, message_);
  }
  bool has_per_quad_damage() const {
    return data_->has_per_quad_damage;
  }
 private:
  internal::CompositorRenderPass_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // viz::mojom

#endif  // SERVICES_VIZ_PUBLIC_MOJOM_COMPOSITING_COMPOSITOR_RENDER_PASS_MOJOM_DATA_VIEW_H_