// gpu/ipc/common/capabilities.mojom-blink.cc is auto generated by mojom_bindings_generator.py, do not edit

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

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

#include "gpu/ipc/common/capabilities.mojom-blink.h"
#include <stdint.h>
#include <utility>
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "gpu/ipc/common/capabilities.mojom-params-data.h"
#include "gpu/ipc/common/capabilities.mojom-shared-message-ids.h"

#include "gpu/ipc/common/capabilities.mojom-blink-import-headers.h"
#include "gpu/ipc/common/capabilities.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"


namespace gpu::mojom::blink {
Capabilities::Capabilities()
    : max_texture_size(),
      egl_image_external(),
      texture_format_bgra8888(),
      texture_format_etc1_npot(),
      disable_mac_swangle_rgbx(),
      sync_query(),
      texture_rg(),
      texture_norm16(),
      texture_half_float_linear(),
      image_ar30(),
      image_ab30(),
      render_buffer_format_bgra8888(),
      msaa_is_slow(),
      avoid_stencil_buffers(),
      supports_rgb_to_yuv_conversion(),
      supports_yuv_readback(),
      mesa_framebuffer_flip_y(),
      context_supports_distance_field_text(),
      using_vulkan_context(),
      use_deferred_graphite_submit(),
      drm_formats_and_modifiers(),
      drm_device_id() {}

Capabilities::Capabilities(
    int32_t max_texture_size_in,
    bool egl_image_external_in,
    bool texture_format_bgra8888_in,
    bool texture_format_etc1_npot_in,
    bool disable_mac_swangle_rgbx_in,
    bool sync_query_in,
    bool texture_rg_in,
    bool texture_norm16_in,
    bool texture_half_float_linear_in,
    bool image_ar30_in,
    bool image_ab30_in,
    bool render_buffer_format_bgra8888_in,
    bool msaa_is_slow_in,
    bool avoid_stencil_buffers_in,
    bool supports_rgb_to_yuv_conversion_in,
    bool supports_yuv_readback_in,
    bool mesa_framebuffer_flip_y_in,
    bool context_supports_distance_field_text_in,
    bool using_vulkan_context_in,
    bool use_deferred_graphite_submit_in,
    const ::blink::HashMap<uint32_t, ::blink::Vector<uint64_t>>& drm_formats_and_modifiers_in,
    uint64_t drm_device_id_in)
    : max_texture_size(std::move(max_texture_size_in)),
      egl_image_external(std::move(egl_image_external_in)),
      texture_format_bgra8888(std::move(texture_format_bgra8888_in)),
      texture_format_etc1_npot(std::move(texture_format_etc1_npot_in)),
      disable_mac_swangle_rgbx(std::move(disable_mac_swangle_rgbx_in)),
      sync_query(std::move(sync_query_in)),
      texture_rg(std::move(texture_rg_in)),
      texture_norm16(std::move(texture_norm16_in)),
      texture_half_float_linear(std::move(texture_half_float_linear_in)),
      image_ar30(std::move(image_ar30_in)),
      image_ab30(std::move(image_ab30_in)),
      render_buffer_format_bgra8888(std::move(render_buffer_format_bgra8888_in)),
      msaa_is_slow(std::move(msaa_is_slow_in)),
      avoid_stencil_buffers(std::move(avoid_stencil_buffers_in)),
      supports_rgb_to_yuv_conversion(std::move(supports_rgb_to_yuv_conversion_in)),
      supports_yuv_readback(std::move(supports_yuv_readback_in)),
      mesa_framebuffer_flip_y(std::move(mesa_framebuffer_flip_y_in)),
      context_supports_distance_field_text(std::move(context_supports_distance_field_text_in)),
      using_vulkan_context(std::move(using_vulkan_context_in)),
      use_deferred_graphite_submit(std::move(use_deferred_graphite_submit_in)),
      drm_formats_and_modifiers(std::move(drm_formats_and_modifiers_in)),
      drm_device_id(std::move(drm_device_id_in)) {}

Capabilities::~Capabilities() = default;

void Capabilities::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_texture_size"), this->max_texture_size,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "egl_image_external"), this->egl_image_external,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "texture_format_bgra8888"), this->texture_format_bgra8888,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "texture_format_etc1_npot"), this->texture_format_etc1_npot,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "disable_mac_swangle_rgbx"), this->disable_mac_swangle_rgbx,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "sync_query"), this->sync_query,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "texture_rg"), this->texture_rg,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "texture_norm16"), this->texture_norm16,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "texture_half_float_linear"), this->texture_half_float_linear,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "image_ar30"), this->image_ar30,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "image_ab30"), this->image_ab30,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "render_buffer_format_bgra8888"), this->render_buffer_format_bgra8888,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "msaa_is_slow"), this->msaa_is_slow,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "avoid_stencil_buffers"), this->avoid_stencil_buffers,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "supports_rgb_to_yuv_conversion"), this->supports_rgb_to_yuv_conversion,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "supports_yuv_readback"), this->supports_yuv_readback,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "mesa_framebuffer_flip_y"), this->mesa_framebuffer_flip_y,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "context_supports_distance_field_text"), this->context_supports_distance_field_text,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "using_vulkan_context"), this->using_vulkan_context,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "use_deferred_graphite_submit"), this->use_deferred_graphite_submit,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "drm_formats_and_modifiers"), this->drm_formats_and_modifiers,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const ::blink::HashMap<uint32_t, ::blink::Vector<uint64_t>>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "drm_device_id"), this->drm_device_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type uint64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool Capabilities::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
ShaderPrecision::ShaderPrecision()
    : min_range(),
      max_range(),
      precision() {}

ShaderPrecision::ShaderPrecision(
    int32_t min_range_in,
    int32_t max_range_in,
    int32_t precision_in)
    : min_range(std::move(min_range_in)),
      max_range(std::move(max_range_in)),
      precision(std::move(precision_in)) {}

ShaderPrecision::~ShaderPrecision() = default;
size_t ShaderPrecision::Hash(size_t seed) const {
  seed = mojo::internal::WTFHash(seed, this->min_range);
  seed = mojo::internal::WTFHash(seed, this->max_range);
  seed = mojo::internal::WTFHash(seed, this->precision);
  return seed;
}

void ShaderPrecision::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "min_range"), this->min_range,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_range"), this->max_range,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "precision"), this->precision,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool ShaderPrecision::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
PerStagePrecisions::PerStagePrecisions()
    : low_int(),
      medium_int(),
      high_int(),
      low_float(),
      medium_float(),
      high_float() {}

PerStagePrecisions::PerStagePrecisions(
    ShaderPrecisionPtr low_int_in,
    ShaderPrecisionPtr medium_int_in,
    ShaderPrecisionPtr high_int_in,
    ShaderPrecisionPtr low_float_in,
    ShaderPrecisionPtr medium_float_in,
    ShaderPrecisionPtr high_float_in)
    : low_int(std::move(low_int_in)),
      medium_int(std::move(medium_int_in)),
      high_int(std::move(high_int_in)),
      low_float(std::move(low_float_in)),
      medium_float(std::move(medium_float_in)),
      high_float(std::move(high_float_in)) {}

PerStagePrecisions::~PerStagePrecisions() = default;
size_t PerStagePrecisions::Hash(size_t seed) const {
  seed = mojo::internal::WTFHash(seed, this->low_int);
  seed = mojo::internal::WTFHash(seed, this->medium_int);
  seed = mojo::internal::WTFHash(seed, this->high_int);
  seed = mojo::internal::WTFHash(seed, this->low_float);
  seed = mojo::internal::WTFHash(seed, this->medium_float);
  seed = mojo::internal::WTFHash(seed, this->high_float);
  return seed;
}

void PerStagePrecisions::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "low_int"), this->low_int,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ShaderPrecisionPtr>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "medium_int"), this->medium_int,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ShaderPrecisionPtr>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "high_int"), this->high_int,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ShaderPrecisionPtr>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "low_float"), this->low_float,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ShaderPrecisionPtr>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "medium_float"), this->medium_float,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ShaderPrecisionPtr>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "high_float"), this->high_float,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ShaderPrecisionPtr>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool PerStagePrecisions::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
GLCapabilities::GLCapabilities()
    : vertex_shader_precisions(),
      fragment_shader_precisions(),
      major_version(),
      minor_version(),
      max_combined_texture_image_units(),
      max_cube_map_texture_size(),
      max_fragment_uniform_vectors(),
      max_renderbuffer_size(),
      max_texture_image_units(),
      max_varying_vectors(),
      max_vertex_attribs(),
      max_vertex_texture_image_units(),
      max_vertex_uniform_vectors(),
      max_viewport_width(),
      max_viewport_height(),
      num_compressed_texture_formats(),
      num_shader_binary_formats(),
      max_3d_texture_size(),
      max_array_texture_layers(),
      max_color_attachments(),
      max_combined_fragment_uniform_components(),
      max_combined_uniform_blocks(),
      max_combined_vertex_uniform_components(),
      max_draw_buffers(),
      max_element_index(),
      max_elements_indices(),
      max_elements_vertices(),
      max_fragment_input_components(),
      max_fragment_uniform_blocks(),
      max_fragment_uniform_components(),
      max_program_texel_offset(),
      max_samples(),
      max_server_wait_timeout(),
      max_texture_lod_bias(),
      max_transform_feedback_interleaved_components(),
      max_transform_feedback_separate_attribs(),
      max_transform_feedback_separate_components(),
      max_uniform_block_size(),
      max_uniform_buffer_bindings(),
      max_varying_components(),
      max_vertex_output_components(),
      max_vertex_uniform_blocks(),
      max_vertex_uniform_components(),
      min_program_texel_offset(),
      num_program_binary_formats(),
      uniform_buffer_offset_alignment(),
      occlusion_query_boolean(),
      timer_queries(),
      max_texture_size(),
      sync_query() {}

GLCapabilities::GLCapabilities(
    PerStagePrecisionsPtr vertex_shader_precisions_in,
    PerStagePrecisionsPtr fragment_shader_precisions_in,
    int32_t major_version_in,
    int32_t minor_version_in,
    int32_t max_combined_texture_image_units_in,
    int32_t max_cube_map_texture_size_in,
    int32_t max_fragment_uniform_vectors_in,
    int32_t max_renderbuffer_size_in,
    int32_t max_texture_image_units_in,
    int32_t max_varying_vectors_in,
    int32_t max_vertex_attribs_in,
    int32_t max_vertex_texture_image_units_in,
    int32_t max_vertex_uniform_vectors_in,
    int32_t max_viewport_width_in,
    int32_t max_viewport_height_in,
    int32_t num_compressed_texture_formats_in,
    int32_t num_shader_binary_formats_in,
    int32_t max_3d_texture_size_in,
    int32_t max_array_texture_layers_in,
    int32_t max_color_attachments_in,
    int64_t max_combined_fragment_uniform_components_in,
    int32_t max_combined_uniform_blocks_in,
    int64_t max_combined_vertex_uniform_components_in,
    int32_t max_draw_buffers_in,
    int64_t max_element_index_in,
    int32_t max_elements_indices_in,
    int32_t max_elements_vertices_in,
    int32_t max_fragment_input_components_in,
    int32_t max_fragment_uniform_blocks_in,
    int32_t max_fragment_uniform_components_in,
    int32_t max_program_texel_offset_in,
    int32_t max_samples_in,
    int64_t max_server_wait_timeout_in,
    float max_texture_lod_bias_in,
    int32_t max_transform_feedback_interleaved_components_in,
    int32_t max_transform_feedback_separate_attribs_in,
    int32_t max_transform_feedback_separate_components_in,
    int64_t max_uniform_block_size_in,
    int32_t max_uniform_buffer_bindings_in,
    int32_t max_varying_components_in,
    int32_t max_vertex_output_components_in,
    int32_t max_vertex_uniform_blocks_in,
    int32_t max_vertex_uniform_components_in,
    int32_t min_program_texel_offset_in,
    int32_t num_program_binary_formats_in,
    int32_t uniform_buffer_offset_alignment_in,
    bool occlusion_query_boolean_in,
    bool timer_queries_in,
    int32_t max_texture_size_in,
    bool sync_query_in)
    : vertex_shader_precisions(std::move(vertex_shader_precisions_in)),
      fragment_shader_precisions(std::move(fragment_shader_precisions_in)),
      major_version(std::move(major_version_in)),
      minor_version(std::move(minor_version_in)),
      max_combined_texture_image_units(std::move(max_combined_texture_image_units_in)),
      max_cube_map_texture_size(std::move(max_cube_map_texture_size_in)),
      max_fragment_uniform_vectors(std::move(max_fragment_uniform_vectors_in)),
      max_renderbuffer_size(std::move(max_renderbuffer_size_in)),
      max_texture_image_units(std::move(max_texture_image_units_in)),
      max_varying_vectors(std::move(max_varying_vectors_in)),
      max_vertex_attribs(std::move(max_vertex_attribs_in)),
      max_vertex_texture_image_units(std::move(max_vertex_texture_image_units_in)),
      max_vertex_uniform_vectors(std::move(max_vertex_uniform_vectors_in)),
      max_viewport_width(std::move(max_viewport_width_in)),
      max_viewport_height(std::move(max_viewport_height_in)),
      num_compressed_texture_formats(std::move(num_compressed_texture_formats_in)),
      num_shader_binary_formats(std::move(num_shader_binary_formats_in)),
      max_3d_texture_size(std::move(max_3d_texture_size_in)),
      max_array_texture_layers(std::move(max_array_texture_layers_in)),
      max_color_attachments(std::move(max_color_attachments_in)),
      max_combined_fragment_uniform_components(std::move(max_combined_fragment_uniform_components_in)),
      max_combined_uniform_blocks(std::move(max_combined_uniform_blocks_in)),
      max_combined_vertex_uniform_components(std::move(max_combined_vertex_uniform_components_in)),
      max_draw_buffers(std::move(max_draw_buffers_in)),
      max_element_index(std::move(max_element_index_in)),
      max_elements_indices(std::move(max_elements_indices_in)),
      max_elements_vertices(std::move(max_elements_vertices_in)),
      max_fragment_input_components(std::move(max_fragment_input_components_in)),
      max_fragment_uniform_blocks(std::move(max_fragment_uniform_blocks_in)),
      max_fragment_uniform_components(std::move(max_fragment_uniform_components_in)),
      max_program_texel_offset(std::move(max_program_texel_offset_in)),
      max_samples(std::move(max_samples_in)),
      max_server_wait_timeout(std::move(max_server_wait_timeout_in)),
      max_texture_lod_bias(std::move(max_texture_lod_bias_in)),
      max_transform_feedback_interleaved_components(std::move(max_transform_feedback_interleaved_components_in)),
      max_transform_feedback_separate_attribs(std::move(max_transform_feedback_separate_attribs_in)),
      max_transform_feedback_separate_components(std::move(max_transform_feedback_separate_components_in)),
      max_uniform_block_size(std::move(max_uniform_block_size_in)),
      max_uniform_buffer_bindings(std::move(max_uniform_buffer_bindings_in)),
      max_varying_components(std::move(max_varying_components_in)),
      max_vertex_output_components(std::move(max_vertex_output_components_in)),
      max_vertex_uniform_blocks(std::move(max_vertex_uniform_blocks_in)),
      max_vertex_uniform_components(std::move(max_vertex_uniform_components_in)),
      min_program_texel_offset(std::move(min_program_texel_offset_in)),
      num_program_binary_formats(std::move(num_program_binary_formats_in)),
      uniform_buffer_offset_alignment(std::move(uniform_buffer_offset_alignment_in)),
      occlusion_query_boolean(std::move(occlusion_query_boolean_in)),
      timer_queries(std::move(timer_queries_in)),
      max_texture_size(std::move(max_texture_size_in)),
      sync_query(std::move(sync_query_in)) {}

GLCapabilities::~GLCapabilities() = default;
size_t GLCapabilities::Hash(size_t seed) const {
  seed = mojo::internal::WTFHash(seed, this->vertex_shader_precisions);
  seed = mojo::internal::WTFHash(seed, this->fragment_shader_precisions);
  seed = mojo::internal::WTFHash(seed, this->major_version);
  seed = mojo::internal::WTFHash(seed, this->minor_version);
  seed = mojo::internal::WTFHash(seed, this->max_combined_texture_image_units);
  seed = mojo::internal::WTFHash(seed, this->max_cube_map_texture_size);
  seed = mojo::internal::WTFHash(seed, this->max_fragment_uniform_vectors);
  seed = mojo::internal::WTFHash(seed, this->max_renderbuffer_size);
  seed = mojo::internal::WTFHash(seed, this->max_texture_image_units);
  seed = mojo::internal::WTFHash(seed, this->max_varying_vectors);
  seed = mojo::internal::WTFHash(seed, this->max_vertex_attribs);
  seed = mojo::internal::WTFHash(seed, this->max_vertex_texture_image_units);
  seed = mojo::internal::WTFHash(seed, this->max_vertex_uniform_vectors);
  seed = mojo::internal::WTFHash(seed, this->max_viewport_width);
  seed = mojo::internal::WTFHash(seed, this->max_viewport_height);
  seed = mojo::internal::WTFHash(seed, this->num_compressed_texture_formats);
  seed = mojo::internal::WTFHash(seed, this->num_shader_binary_formats);
  seed = mojo::internal::WTFHash(seed, this->max_3d_texture_size);
  seed = mojo::internal::WTFHash(seed, this->max_array_texture_layers);
  seed = mojo::internal::WTFHash(seed, this->max_color_attachments);
  seed = mojo::internal::WTFHash(seed, this->max_combined_fragment_uniform_components);
  seed = mojo::internal::WTFHash(seed, this->max_combined_uniform_blocks);
  seed = mojo::internal::WTFHash(seed, this->max_combined_vertex_uniform_components);
  seed = mojo::internal::WTFHash(seed, this->max_draw_buffers);
  seed = mojo::internal::WTFHash(seed, this->max_element_index);
  seed = mojo::internal::WTFHash(seed, this->max_elements_indices);
  seed = mojo::internal::WTFHash(seed, this->max_elements_vertices);
  seed = mojo::internal::WTFHash(seed, this->max_fragment_input_components);
  seed = mojo::internal::WTFHash(seed, this->max_fragment_uniform_blocks);
  seed = mojo::internal::WTFHash(seed, this->max_fragment_uniform_components);
  seed = mojo::internal::WTFHash(seed, this->max_program_texel_offset);
  seed = mojo::internal::WTFHash(seed, this->max_samples);
  seed = mojo::internal::WTFHash(seed, this->max_server_wait_timeout);
  seed = mojo::internal::WTFHash(seed, this->max_texture_lod_bias);
  seed = mojo::internal::WTFHash(seed, this->max_transform_feedback_interleaved_components);
  seed = mojo::internal::WTFHash(seed, this->max_transform_feedback_separate_attribs);
  seed = mojo::internal::WTFHash(seed, this->max_transform_feedback_separate_components);
  seed = mojo::internal::WTFHash(seed, this->max_uniform_block_size);
  seed = mojo::internal::WTFHash(seed, this->max_uniform_buffer_bindings);
  seed = mojo::internal::WTFHash(seed, this->max_varying_components);
  seed = mojo::internal::WTFHash(seed, this->max_vertex_output_components);
  seed = mojo::internal::WTFHash(seed, this->max_vertex_uniform_blocks);
  seed = mojo::internal::WTFHash(seed, this->max_vertex_uniform_components);
  seed = mojo::internal::WTFHash(seed, this->min_program_texel_offset);
  seed = mojo::internal::WTFHash(seed, this->num_program_binary_formats);
  seed = mojo::internal::WTFHash(seed, this->uniform_buffer_offset_alignment);
  seed = mojo::internal::WTFHash(seed, this->occlusion_query_boolean);
  seed = mojo::internal::WTFHash(seed, this->timer_queries);
  seed = mojo::internal::WTFHash(seed, this->max_texture_size);
  seed = mojo::internal::WTFHash(seed, this->sync_query);
  return seed;
}

void GLCapabilities::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "vertex_shader_precisions"), this->vertex_shader_precisions,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type PerStagePrecisionsPtr>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "fragment_shader_precisions"), this->fragment_shader_precisions,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type PerStagePrecisionsPtr>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "major_version"), this->major_version,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "minor_version"), this->minor_version,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_combined_texture_image_units"), this->max_combined_texture_image_units,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_cube_map_texture_size"), this->max_cube_map_texture_size,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_fragment_uniform_vectors"), this->max_fragment_uniform_vectors,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_renderbuffer_size"), this->max_renderbuffer_size,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_texture_image_units"), this->max_texture_image_units,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_varying_vectors"), this->max_varying_vectors,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_vertex_attribs"), this->max_vertex_attribs,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_vertex_texture_image_units"), this->max_vertex_texture_image_units,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_vertex_uniform_vectors"), this->max_vertex_uniform_vectors,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_viewport_width"), this->max_viewport_width,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_viewport_height"), this->max_viewport_height,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "num_compressed_texture_formats"), this->num_compressed_texture_formats,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "num_shader_binary_formats"), this->num_shader_binary_formats,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_3d_texture_size"), this->max_3d_texture_size,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_array_texture_layers"), this->max_array_texture_layers,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_color_attachments"), this->max_color_attachments,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_combined_fragment_uniform_components"), this->max_combined_fragment_uniform_components,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_combined_uniform_blocks"), this->max_combined_uniform_blocks,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_combined_vertex_uniform_components"), this->max_combined_vertex_uniform_components,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_draw_buffers"), this->max_draw_buffers,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_element_index"), this->max_element_index,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_elements_indices"), this->max_elements_indices,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_elements_vertices"), this->max_elements_vertices,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_fragment_input_components"), this->max_fragment_input_components,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_fragment_uniform_blocks"), this->max_fragment_uniform_blocks,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_fragment_uniform_components"), this->max_fragment_uniform_components,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_program_texel_offset"), this->max_program_texel_offset,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_samples"), this->max_samples,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_server_wait_timeout"), this->max_server_wait_timeout,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_texture_lod_bias"), this->max_texture_lod_bias,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type float>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_transform_feedback_interleaved_components"), this->max_transform_feedback_interleaved_components,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_transform_feedback_separate_attribs"), this->max_transform_feedback_separate_attribs,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_transform_feedback_separate_components"), this->max_transform_feedback_separate_components,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_uniform_block_size"), this->max_uniform_block_size,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_uniform_buffer_bindings"), this->max_uniform_buffer_bindings,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_varying_components"), this->max_varying_components,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_vertex_output_components"), this->max_vertex_output_components,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_vertex_uniform_blocks"), this->max_vertex_uniform_blocks,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_vertex_uniform_components"), this->max_vertex_uniform_components,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "min_program_texel_offset"), this->min_program_texel_offset,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "num_program_binary_formats"), this->num_program_binary_formats,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "uniform_buffer_offset_alignment"), this->uniform_buffer_offset_alignment,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "occlusion_query_boolean"), this->occlusion_query_boolean,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "timer_queries"), this->timer_queries,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "max_texture_size"), this->max_texture_size,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "sync_query"), this->sync_query,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool GLCapabilities::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}


}  // gpu::mojom::blink


namespace mojo {


// static
bool StructTraits<::gpu::mojom::blink::Capabilities::DataView, ::gpu::mojom::blink::CapabilitiesPtr>::Read(
    ::gpu::mojom::blink::Capabilities::DataView input,
    ::gpu::mojom::blink::CapabilitiesPtr* output) {
  bool success = true;
  ::gpu::mojom::blink::CapabilitiesPtr result(::gpu::mojom::blink::Capabilities::New());
  
      if (success)
        result->max_texture_size = input.max_texture_size();
      if (success)
        result->egl_image_external = input.egl_image_external();
      if (success)
        result->texture_format_bgra8888 = input.texture_format_bgra8888();
      if (success)
        result->texture_format_etc1_npot = input.texture_format_etc1_npot();
      if (success)
        result->disable_mac_swangle_rgbx = input.disable_mac_swangle_rgbx();
      if (success)
        result->sync_query = input.sync_query();
      if (success)
        result->texture_rg = input.texture_rg();
      if (success)
        result->texture_norm16 = input.texture_norm16();
      if (success)
        result->texture_half_float_linear = input.texture_half_float_linear();
      if (success)
        result->image_ar30 = input.image_ar30();
      if (success)
        result->image_ab30 = input.image_ab30();
      if (success)
        result->render_buffer_format_bgra8888 = input.render_buffer_format_bgra8888();
      if (success)
        result->msaa_is_slow = input.msaa_is_slow();
      if (success)
        result->avoid_stencil_buffers = input.avoid_stencil_buffers();
      if (success)
        result->supports_rgb_to_yuv_conversion = input.supports_rgb_to_yuv_conversion();
      if (success)
        result->supports_yuv_readback = input.supports_yuv_readback();
      if (success)
        result->mesa_framebuffer_flip_y = input.mesa_framebuffer_flip_y();
      if (success)
        result->context_supports_distance_field_text = input.context_supports_distance_field_text();
      if (success)
        result->using_vulkan_context = input.using_vulkan_context();
      if (success)
        result->use_deferred_graphite_submit = input.use_deferred_graphite_submit();
      if (success && !input.ReadDrmFormatsAndModifiers(&result->drm_formats_and_modifiers))
        success = false;
      if (success)
        result->drm_device_id = input.drm_device_id();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::gpu::mojom::blink::ShaderPrecision::DataView, ::gpu::mojom::blink::ShaderPrecisionPtr>::Read(
    ::gpu::mojom::blink::ShaderPrecision::DataView input,
    ::gpu::mojom::blink::ShaderPrecisionPtr* output) {
  bool success = true;
  ::gpu::mojom::blink::ShaderPrecisionPtr result(::gpu::mojom::blink::ShaderPrecision::New());
  
      if (success)
        result->min_range = input.min_range();
      if (success)
        result->max_range = input.max_range();
      if (success)
        result->precision = input.precision();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::gpu::mojom::blink::PerStagePrecisions::DataView, ::gpu::mojom::blink::PerStagePrecisionsPtr>::Read(
    ::gpu::mojom::blink::PerStagePrecisions::DataView input,
    ::gpu::mojom::blink::PerStagePrecisionsPtr* output) {
  bool success = true;
  ::gpu::mojom::blink::PerStagePrecisionsPtr result(::gpu::mojom::blink::PerStagePrecisions::New());
  
      if (success && !input.ReadLowInt(&result->low_int))
        success = false;
      if (success && !input.ReadMediumInt(&result->medium_int))
        success = false;
      if (success && !input.ReadHighInt(&result->high_int))
        success = false;
      if (success && !input.ReadLowFloat(&result->low_float))
        success = false;
      if (success && !input.ReadMediumFloat(&result->medium_float))
        success = false;
      if (success && !input.ReadHighFloat(&result->high_float))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::gpu::mojom::blink::GLCapabilities::DataView, ::gpu::mojom::blink::GLCapabilitiesPtr>::Read(
    ::gpu::mojom::blink::GLCapabilities::DataView input,
    ::gpu::mojom::blink::GLCapabilitiesPtr* output) {
  bool success = true;
  ::gpu::mojom::blink::GLCapabilitiesPtr result(::gpu::mojom::blink::GLCapabilities::New());
  
      if (success && !input.ReadVertexShaderPrecisions(&result->vertex_shader_precisions))
        success = false;
      if (success && !input.ReadFragmentShaderPrecisions(&result->fragment_shader_precisions))
        success = false;
      if (success)
        result->major_version = input.major_version();
      if (success)
        result->minor_version = input.minor_version();
      if (success)
        result->max_combined_texture_image_units = input.max_combined_texture_image_units();
      if (success)
        result->max_cube_map_texture_size = input.max_cube_map_texture_size();
      if (success)
        result->max_fragment_uniform_vectors = input.max_fragment_uniform_vectors();
      if (success)
        result->max_renderbuffer_size = input.max_renderbuffer_size();
      if (success)
        result->max_texture_image_units = input.max_texture_image_units();
      if (success)
        result->max_varying_vectors = input.max_varying_vectors();
      if (success)
        result->max_vertex_attribs = input.max_vertex_attribs();
      if (success)
        result->max_vertex_texture_image_units = input.max_vertex_texture_image_units();
      if (success)
        result->max_vertex_uniform_vectors = input.max_vertex_uniform_vectors();
      if (success)
        result->max_viewport_width = input.max_viewport_width();
      if (success)
        result->max_viewport_height = input.max_viewport_height();
      if (success)
        result->num_compressed_texture_formats = input.num_compressed_texture_formats();
      if (success)
        result->num_shader_binary_formats = input.num_shader_binary_formats();
      if (success)
        result->max_3d_texture_size = input.max_3d_texture_size();
      if (success)
        result->max_array_texture_layers = input.max_array_texture_layers();
      if (success)
        result->max_color_attachments = input.max_color_attachments();
      if (success)
        result->max_combined_fragment_uniform_components = input.max_combined_fragment_uniform_components();
      if (success)
        result->max_combined_uniform_blocks = input.max_combined_uniform_blocks();
      if (success)
        result->max_combined_vertex_uniform_components = input.max_combined_vertex_uniform_components();
      if (success)
        result->max_draw_buffers = input.max_draw_buffers();
      if (success)
        result->max_element_index = input.max_element_index();
      if (success)
        result->max_elements_indices = input.max_elements_indices();
      if (success)
        result->max_elements_vertices = input.max_elements_vertices();
      if (success)
        result->max_fragment_input_components = input.max_fragment_input_components();
      if (success)
        result->max_fragment_uniform_blocks = input.max_fragment_uniform_blocks();
      if (success)
        result->max_fragment_uniform_components = input.max_fragment_uniform_components();
      if (success)
        result->max_program_texel_offset = input.max_program_texel_offset();
      if (success)
        result->max_samples = input.max_samples();
      if (success)
        result->max_server_wait_timeout = input.max_server_wait_timeout();
      if (success)
        result->max_texture_lod_bias = input.max_texture_lod_bias();
      if (success)
        result->max_transform_feedback_interleaved_components = input.max_transform_feedback_interleaved_components();
      if (success)
        result->max_transform_feedback_separate_attribs = input.max_transform_feedback_separate_attribs();
      if (success)
        result->max_transform_feedback_separate_components = input.max_transform_feedback_separate_components();
      if (success)
        result->max_uniform_block_size = input.max_uniform_block_size();
      if (success)
        result->max_uniform_buffer_bindings = input.max_uniform_buffer_bindings();
      if (success)
        result->max_varying_components = input.max_varying_components();
      if (success)
        result->max_vertex_output_components = input.max_vertex_output_components();
      if (success)
        result->max_vertex_uniform_blocks = input.max_vertex_uniform_blocks();
      if (success)
        result->max_vertex_uniform_components = input.max_vertex_uniform_components();
      if (success)
        result->min_program_texel_offset = input.min_program_texel_offset();
      if (success)
        result->num_program_binary_formats = input.num_program_binary_formats();
      if (success)
        result->uniform_buffer_offset_alignment = input.uniform_buffer_offset_alignment();
      if (success)
        result->occlusion_query_boolean = input.occlusion_query_boolean();
      if (success)
        result->timer_queries = input.timer_queries();
      if (success)
        result->max_texture_size = input.max_texture_size();
      if (success)
        result->sync_query = input.sync_query();
  *output = std::move(result);
  return success;
}

}  // namespace mojo


// Symbols declared in the -test-utils.h header are defined here instead of a
// separate .cc file to save compile time.


namespace gpu::mojom::blink {




}  // gpu::mojom::blink


#if defined(__clang__)
#pragma clang diagnostic pop
#endif