chromium/third_party/skia/src/gpu/graphite/dawn/DawnGraphiteTypesPriv.h

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

#ifndef skgpu_graphite_DawnTypesPriv_DEFINED
#define skgpu_graphite_DawnTypesPriv_DEFINED

#include "include/core/SkString.h"
#include "include/gpu/graphite/dawn/DawnTypes.h"

namespace skgpu::graphite {
#if !defined(__EMSCRIPTEN__)
namespace ycbcrUtils {
bool DawnDescriptorsAreEquivalent(const wgpu::YCbCrVkDescriptor&, const wgpu::YCbCrVkDescriptor&);
}
#endif

struct DawnTextureSpec {};

DawnTextureInfo DawnTextureSpecToTextureInfo(const DawnTextureSpec& dawnSpec,
                                             uint32_t sampleCount,
                                             Mipmapped mipmapped);

DawnTextureInfo DawnTextureInfoFromWGPUTexture(WGPUTexture texture);

namespace TextureInfos {
DawnTextureSpec GetDawnTextureSpec(const TextureInfo& dawnInfo);

wgpu::TextureFormat GetDawnViewFormat(const TextureInfo& dawnInfo);
wgpu::TextureAspect GetDawnAspect(const TextureInfo& dawnInfo);
}  // namespace TextureInfos

namespace BackendTextures {
WGPUTexture GetDawnTexturePtr(const BackendTexture&);
WGPUTextureView GetDawnTextureViewPtr(const BackendTexture&);
}  // namespace BackendTextures

}  // namespace skgpu::graphite

#endif  // skgpu_graphite_DawnTypesPriv_DEFINED