// ui/gfx/mojom/rrect_f.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 "ui/gfx/mojom/rrect_f.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 "ui/gfx/mojom/rrect_f.mojom-params-data.h"
#include "ui/gfx/mojom/rrect_f.mojom-shared-message-ids.h"

#include "ui/gfx/mojom/rrect_f.mojom-blink-import-headers.h"
#include "ui/gfx/mojom/rrect_f.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"


namespace gfx::mojom::blink {
RRectF::RRectF()
    : type(),
      rect(),
      upper_left(),
      upper_right(),
      lower_right(),
      lower_left() {}

RRectF::RRectF(
    RRectFType type_in,
    const ::gfx::RectF& rect_in,
    const ::gfx::Vector2dF& upper_left_in,
    const ::gfx::Vector2dF& upper_right_in,
    const ::gfx::Vector2dF& lower_right_in,
    const ::gfx::Vector2dF& lower_left_in)
    : type(std::move(type_in)),
      rect(std::move(rect_in)),
      upper_left(std::move(upper_left_in)),
      upper_right(std::move(upper_right_in)),
      lower_right(std::move(lower_right_in)),
      lower_left(std::move(lower_left_in)) {}

RRectF::~RRectF() = default;

void RRectF::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "type"), this->type,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type RRectFType>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "rect"), this->rect,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const ::gfx::RectF&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "upper_left"), this->upper_left,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const ::gfx::Vector2dF&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "upper_right"), this->upper_right,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const ::gfx::Vector2dF&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "lower_right"), this->lower_right,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const ::gfx::Vector2dF&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "lower_left"), this->lower_left,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const ::gfx::Vector2dF&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

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


}  // gfx::mojom::blink


namespace mojo {


// static
bool StructTraits<::gfx::mojom::blink::RRectF::DataView, ::gfx::mojom::blink::RRectFPtr>::Read(
    ::gfx::mojom::blink::RRectF::DataView input,
    ::gfx::mojom::blink::RRectFPtr* output) {
  bool success = true;
  ::gfx::mojom::blink::RRectFPtr result(::gfx::mojom::blink::RRectF::New());
  
      if (success && !input.ReadType(&result->type))
        success = false;
      if (success && !input.ReadRect(&result->rect))
        success = false;
      if (success && !input.ReadUpperLeft(&result->upper_left))
        success = false;
      if (success && !input.ReadUpperRight(&result->upper_right))
        success = false;
      if (success && !input.ReadLowerRight(&result->lower_right))
        success = false;
      if (success && !input.ReadLowerLeft(&result->lower_left))
        success = false;
  *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 gfx::mojom::blink {




}  // gfx::mojom::blink


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