// skia/public/mojom/skcolor.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 SKIA_PUBLIC_MOJOM_SKCOLOR_MOJOM_DATA_VIEW_H_
#define SKIA_PUBLIC_MOJOM_SKCOLOR_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 "skia/public/mojom/skcolor.mojom-shared-internal.h"


namespace skia::mojom {
class SkColorDataView;



}  // skia::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::skia::mojom::SkColorDataView> {
  using Data = ::skia::mojom::internal::SkColor_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace skia::mojom {


class SkColorDataView {
 public:
  SkColorDataView() = default;

  SkColorDataView(
      internal::SkColor_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  uint32_t value() const {
    return data_->value;
  }
 private:
  internal::SkColor_Data* data_ = nullptr;
};


}  // skia::mojom

#endif  // SKIA_PUBLIC_MOJOM_SKCOLOR_MOJOM_DATA_VIEW_H_