chromium/components/viz/common/resources/shared_image_format.cc

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

#include "components/viz/common/resources/shared_image_format.h"

#include <compare>
#include <optional>
#include <type_traits>

#include "base/check_op.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/strings/stringprintf.h"

namespace viz {
namespace {

static size_t ConvertBitsToBytes(size_t bits) {}

const char* SinglePlaneFormatToString(SharedImageFormat format) {}

int BitsPerPixelForTrueSinglePlaneFormat(SharedImageFormat format) {}

uint64_t StorageBytesPerElement(SharedImageFormat::ChannelFormat channel) {}

const char* PlaneConfigToString(SharedImageFormat::PlaneConfig plane) {}

const char* SubsamplingToString(SharedImageFormat::Subsampling subsampling) {}

const char* ChannelFormatToString(SharedImageFormat::ChannelFormat channel) {}

const char* PrefersExternalSamplerToString(SharedImageFormat format) {}

SharedImageFormat GetEquivalentMultiplanarFormat(SharedImageFormat format) {}

}  // namespace

// Ensure that SharedImageFormat is suitable for passing around by value.
static_assert;
static_assert;
static_assert;

// TODO(kylechar): Ideally SharedImageFormat would be "trivially comparable" so
// that operator==() is just memcmp(). That would probably require something
// like manually packing bits into a single uint64_t for storage.

bool SharedImageFormat::IsBitmapFormatSupported() const {}

int SharedImageFormat::NumberOfPlanes() const {}

bool SharedImageFormat::IsValidPlaneIndex(int plane_index) const {}

std::optional<size_t> SharedImageFormat::MaybeEstimatedPlaneSizeInBytes(
    int plane_index,
    const gfx::Size& size) const {}

std::optional<size_t> SharedImageFormat::MaybeEstimatedSizeInBytes(
    const gfx::Size& size) const {}

size_t SharedImageFormat::EstimatedSizeInBytes(const gfx::Size& size) const {}

bool SharedImageFormat::VerifySizeInBytes(const gfx::Size& size) const {}

gfx::Size SharedImageFormat::GetPlaneSize(int plane_index,
                                          const gfx::Size& size) const {}

// For multiplanar formats.
int SharedImageFormat::NumChannelsInPlane(int plane_index) const {}

// For multiplanar formats.
int SharedImageFormat::MultiplanarBitDepth() const {}

std::string SharedImageFormat::ToString() const {}

std::string SharedImageFormat::ToTestParamString() const {}

bool SharedImageFormat::HasAlpha() const {}

bool SharedImageFormat::IsCompressed() const {}

bool SharedImageFormat::IsLegacyMultiplanar() const {}

int SharedImageFormat::BitsPerPixel() const {}

bool SharedImageFormat::operator==(const SharedImageFormat& o) const {}

std::weak_ordering SharedImageFormat::operator<=>(
    const SharedImageFormat& o) const {}

bool SharedImageFormat::SharedImageFormatUnion::MultiplanarFormat::operator==(
    const MultiplanarFormat& o) const {}

std::weak_ordering
SharedImageFormat::SharedImageFormatUnion::MultiplanarFormat::operator<=>(
    const MultiplanarFormat& o) const {}

}  // namespace viz