33 fBackend = that.fBackend;
34 fSampleCount = that.fSampleCount;
35 fMipmapped = that.fMipmapped;
36 fProtected = that.fProtected;
41 fDawnSpec = that.fDawnSpec;
46 fMtlSpec = that.fMtlSpec;
51 fVkSpec = that.fVkSpec;
70 if (fBackend != that.fBackend) {
74 if (fSampleCount != that.fSampleCount ||
75 fMipmapped != that.fMipmapped ||
76 fProtected != that.fProtected) {
83 return fDawnSpec == that.fDawnSpec;
87 return fMtlSpec == that.fMtlSpec;
91 return fVkSpec == that.fVkSpec;
103 if (fSampleCount != that.fSampleCount ||
104 fMipmapped != that.fMipmapped ||
105 fProtected != that.fProtected) {
109 if (fBackend != that.fBackend) {
116 return fDawnSpec.isCompatible(that.fDawnSpec);
120 return fMtlSpec.isCompatible(that.fMtlSpec);
124 return fVkSpec.isCompatible(that.fVkSpec);
146 ret.
appendf(
"Dawn(%s,", fDawnSpec.toString().c_str());
151 ret.
appendf(
"Metal(%s,", fMtlSpec.toString().c_str());
156 ret.
appendf(
"Vulkan(%s,", fVkSpec.toString().c_str());
166 ret.
appendf(
"bytesPerPixel=%zu,sampleCount=%u,mipmapped=%d,protected=%d)",
167 this->bytesPerPixel(),
169 static_cast<int>(fMipmapped),
170 static_cast<int>(fProtected));
180 static_cast<unsigned int>(fDawnSpec.fViewFormat), fSampleCount);
185 static_cast<unsigned int>(fMtlSpec.fFormat), fSampleCount);
190 static_cast<unsigned int>(fVkSpec.fFormat), fSampleCount);
199size_t TextureInfo::bytesPerPixel()
const {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define SK_ABORT(message,...)
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
SkTextureCompressionType compressionType() const
TextureInfo & operator=(const TextureInfo &)
SkString toString() const
bool isCompatible(const TextureInfo &that) const
BackendApi backend() const
bool operator==(const TextureInfo &) const
SkString toRPAttachmentString() const
unsigned int MtlPixelFormat
SkTextureCompressionType DawnFormatToCompressionType(wgpu::TextureFormat format)
DawnTextureInfo DawnTextureSpecToTextureInfo(const DawnTextureSpec &dawnSpec, uint32_t sampleCount, Mipmapped mipmapped)
size_t MtlFormatBytesPerBlock(MtlPixelFormat format)
size_t DawnFormatBytesPerBlock(wgpu::TextureFormat format)
SkTextureCompressionType MtlFormatToCompressionType(MtlPixelFormat format)
static constexpr size_t VkFormatBytesPerBlock(VkFormat vkFormat)
static constexpr SkTextureCompressionType VkFormatToCompressionType(VkFormat vkFormat)