// services/viz/privileged/mojom/compositing/renderer_settings.mojom-send-validation.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.

#ifndef SERVICES_VIZ_PRIVILEGED_MOJOM_COMPOSITING_RENDERER_SETTINGS_MOJOM_SEND_VALIDATION_H_
#define SERVICES_VIZ_PRIVILEGED_MOJOM_COMPOSITING_RENDERER_SETTINGS_MOJOM_SEND_VALIDATION_H_

#include "services/viz/privileged/mojom/compositing/renderer_settings.mojom-shared-internal.h"
#include "services/viz/privileged/mojom/compositing/overlay_strategy.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"
#include "ui/gfx/mojom/color_space.mojom-shared.h"

#include "services/viz/privileged/mojom/compositing/renderer_settings.mojom-data-view.h"

#include "mojo/public/cpp/bindings/lib/send_validation_type.h"
#include "mojo/public/cpp/bindings/lib/send_validation.h"

namespace mojo::internal {

template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation>
struct SendValidationSerializer<::viz::mojom::OcclusionCullerSettingsDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::viz::mojom::OcclusionCullerSettingsDataView, UserType>;
  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::viz::mojom::internal::OcclusionCullerSettings_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

      fragment->quad_split_limit = Traits::quad_split_limit(input);

      fragment->maximum_occluder_complexity = Traits::maximum_occluder_complexity(input);

      fragment->minimum_fragments_reduced = Traits::minimum_fragments_reduced(input);

      fragment->generate_complex_occluder_for_rounded_corners = Traits::generate_complex_occluder_for_rounded_corners(input);
  }
};

template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation>
struct SendValidationSerializer<::viz::mojom::RendererSettingsDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::viz::mojom::RendererSettingsDataView, UserType>;
  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::viz::mojom::internal::RendererSettings_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

      fragment->allow_antialiasing = Traits::allow_antialiasing(input);

      fragment->force_antialiasing = Traits::force_antialiasing(input);

      fragment->force_blending_with_shaders = Traits::force_blending_with_shaders(input);

      fragment->highp_threshold_min = Traits::highp_threshold_min(input);

      fragment->partial_swap_enabled = Traits::partial_swap_enabled(input);

      fragment->release_overlay_resources_after_gpu_query = Traits::release_overlay_resources_after_gpu_query(input);

      fragment->should_clear_root_render_pass = Traits::should_clear_root_render_pass(input);

      fragment->slow_down_compositing_scale_factor = Traits::slow_down_compositing_scale_factor(input);

      fragment->auto_resize_output_surface = Traits::auto_resize_output_surface(input);

      fragment->requires_alpha_channel = Traits::requires_alpha_channel(input);

      decltype(Traits::occlusion_culler_settings(input)) in_occlusion_culler_settings = Traits::occlusion_culler_settings(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->occlusion_culler_settings)::BaseType> occlusion_culler_settings_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::viz::mojom::OcclusionCullerSettingsDataView, send_validation>(
        in_occlusion_culler_settings,
        occlusion_culler_settings_fragment);

      fragment->occlusion_culler_settings.Set(
          occlusion_culler_settings_fragment.is_null() ? nullptr : occlusion_culler_settings_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->occlusion_culler_settings.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null occlusion_culler_settings in RendererSettings struct");
  }
};

template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation>
struct SendValidationSerializer<::viz::mojom::DebugRendererSettingsDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::viz::mojom::DebugRendererSettingsDataView, UserType>;
  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::viz::mojom::internal::DebugRendererSettings_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

      fragment->tint_composited_content = Traits::tint_composited_content(input);

      fragment->tint_composited_content_modulate = Traits::tint_composited_content_modulate(input);

      fragment->show_overdraw_feedback = Traits::show_overdraw_feedback(input);

      fragment->show_dc_layer_debug_borders = Traits::show_dc_layer_debug_borders(input);

      fragment->show_aggregated_damage = Traits::show_aggregated_damage(input);
  }
};

}  // namespace mojo::internal

#endif  // SERVICES_VIZ_PRIVILEGED_MOJOM_COMPOSITING_RENDERER_SETTINGS_MOJOM_SEND_VALIDATION_H_