chromium/skia/public/mojom/image_info_mojom_traits.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "skia/public/mojom/image_info_mojom_traits.h"

#include <optional>

#include "base/notreached.h"
#include "base/numerics/checked_math.h"
#include "base/numerics/safe_conversions.h"
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/modules/skcms/skcms.h"

namespace mojo {

namespace {

std::optional<SkImageInfo> MakeSkImageInfo(
    SkColorType color_type,
    SkAlphaType alpha_type,
    int width,
    int height,
    mojo::ArrayDataView<float> color_transfer_function,
    mojo::ArrayDataView<float> color_to_xyz_matrix) {}

}  // namespace

// static
skia::mojom::AlphaType EnumTraits<skia::mojom::AlphaType, SkAlphaType>::ToMojom(
    SkAlphaType type) {}

// static
bool EnumTraits<skia::mojom::AlphaType, SkAlphaType>::FromMojom(
    skia::mojom::AlphaType in,
    SkAlphaType* out) {}

// static
skia::mojom::ColorType EnumTraits<skia::mojom::ColorType, SkColorType>::ToMojom(
    SkColorType type) {}

// static
bool EnumTraits<skia::mojom::ColorType, SkColorType>::FromMojom(
    skia::mojom::ColorType in,
    SkColorType* out) {}

// static
uint32_t StructTraits<skia::mojom::ImageInfoDataView, SkImageInfo>::width(
    const SkImageInfo& info) {}

// static
uint32_t StructTraits<skia::mojom::ImageInfoDataView, SkImageInfo>::height(
    const SkImageInfo& info) {}

// static
std::optional<std::vector<float>>
StructTraits<skia::mojom::ImageInfoDataView,
             SkImageInfo>::color_transfer_function(const SkImageInfo& info) {}

// static
std::optional<std::vector<float>>
StructTraits<skia::mojom::ImageInfoDataView, SkImageInfo>::color_to_xyz_matrix(
    const SkImageInfo& info) {}

// static
bool StructTraits<skia::mojom::ImageInfoDataView, SkImageInfo>::Read(
    skia::mojom::ImageInfoDataView data,
    SkImageInfo* info) {}

// static
bool StructTraits<skia::mojom::BitmapN32ImageInfoDataView, SkImageInfo>::Read(
    skia::mojom::BitmapN32ImageInfoDataView data,
    SkImageInfo* info) {}

}  // namespace mojo