20 case MTLPixelFormatStencil8:
21 case MTLPixelFormatDepth16Unorm:
22 case MTLPixelFormatDepth32Float:
23#if defined(SK_BUILD_FOR_MAC)
24 case MTLPixelFormatDepth24Unorm_Stencil8:
26 case MTLPixelFormatDepth32Float_Stencil8:
35 case MTLPixelFormatDepth16Unorm:
36 case MTLPixelFormatDepth32Float:
37#if defined(SK_BUILD_FOR_MAC)
38 case MTLPixelFormatDepth24Unorm_Stencil8:
40 case MTLPixelFormatDepth32Float_Stencil8:
49 case MTLPixelFormatStencil8:
50#if defined(SK_BUILD_FOR_MAC)
51 case MTLPixelFormatDepth24Unorm_Stencil8:
53 case MTLPixelFormatDepth32Float_Stencil8:
62 case MTLPixelFormatETC2_RGB8:
64#ifdef SK_BUILD_FOR_MAC
65 case MTLPixelFormatBC1_RGBA:
75 case MTLPixelFormatInvalid:
return "Invalid";
76 case MTLPixelFormatRGBA8Unorm:
return "RGBA8Unorm";
77 case MTLPixelFormatR8Unorm:
return "R8Unorm";
78 case MTLPixelFormatA8Unorm:
return "A8Unorm";
79 case MTLPixelFormatBGRA8Unorm:
return "BGRA8Unorm";
80 case MTLPixelFormatB5G6R5Unorm:
return "B5G6R5Unorm";
81 case MTLPixelFormatRGBA16Float:
return "RGBA16Float";
82 case MTLPixelFormatR16Float:
return "R16Float";
83 case MTLPixelFormatRG8Unorm:
return "RG8Unorm";
84 case MTLPixelFormatRGB10A2Unorm:
return "RGB10A2Unorm";
85 case MTLPixelFormatBGR10A2Unorm:
return "BGR10A2Unorm";
86 case MTLPixelFormatABGR4Unorm:
return "ABGR4Unorm";
87 case MTLPixelFormatRGBA8Unorm_sRGB:
return "RGBA8Unorm_sRGB";
88 case MTLPixelFormatR16Unorm:
return "R16Unorm";
89 case MTLPixelFormatRG16Unorm:
return "RG16Unorm";
90 case MTLPixelFormatETC2_RGB8:
return "ETC2_RGB8";
91#ifdef SK_BUILD_FOR_MAC
92 case MTLPixelFormatBC1_RGBA:
return "BC1_RGBA";
94 case MTLPixelFormatRGBA16Unorm:
return "RGBA16Unorm";
95 case MTLPixelFormatRG16Float:
return "RG16Float";
96 case MTLPixelFormatStencil8:
return "Stencil8";
98 default:
return "Unknown";
119#ifdef SK_BUILD_FOR_MAC
124 case MTLPixelFormatStencil8:
return 0;
132 case MTLPixelFormatInvalid:
return 0;
133 case MTLPixelFormatRGBA8Unorm:
return 4;
134 case MTLPixelFormatR8Unorm:
return 1;
135 case MTLPixelFormatA8Unorm:
return 1;
136 case MTLPixelFormatBGRA8Unorm:
return 4;
137 case MTLPixelFormatB5G6R5Unorm:
return 2;
138 case MTLPixelFormatRGBA16Float:
return 8;
139 case MTLPixelFormatR16Float:
return 2;
140 case MTLPixelFormatRG8Unorm:
return 2;
141 case MTLPixelFormatRGB10A2Unorm:
return 4;
142 case MTLPixelFormatBGR10A2Unorm:
return 4;
143 case MTLPixelFormatABGR4Unorm:
return 2;
144 case MTLPixelFormatRGBA8Unorm_sRGB:
return 4;
145 case MTLPixelFormatR16Unorm:
return 2;
146 case MTLPixelFormatRG16Unorm:
return 4;
147 case MTLPixelFormatETC2_RGB8:
return 8;
148#ifdef SK_BUILD_FOR_MAC
149 case MTLPixelFormatBC1_RGBA:
return 8;
151 case MTLPixelFormatRGBA16Unorm:
return 8;
152 case MTLPixelFormatRG16Float:
return 4;
153 case MTLPixelFormatStencil8:
return 1;
162#ifdef SK_BUILD_FOR_MAC
@ kRGB_SkColorChannelFlags
@ kRGBA_SkColorChannelFlags
@ kRed_SkColorChannelFlag
@ kRG_SkColorChannelFlags
@ kAlpha_SkColorChannelFlag
uint32_t uint32_t * format
uint32_t MtlFormatChannels(MTLPixelFormat mtlFormat)
const char * MtlFormatToString(MTLPixelFormat mtlFormat)
bool MtlFormatIsStencil(MTLPixelFormat format)
bool MtlFormatIsDepthOrStencil(MTLPixelFormat format)
bool MtlFormatIsDepth(MTLPixelFormat format)
SkTextureCompressionType MtlFormatToCompressionType(MTLPixelFormat mtlFormat)
bool MtlFormatIsCompressed(MTLPixelFormat mtlFormat)
size_t MtlFormatBytesPerBlock(MTLPixelFormat mtlFormat)