14 switch (channelFlags) {
24 SkDEBUGFAILF(
"Unexpected channel combination 0x%08x", channelFlags);
33 : fYUVAInfo(yuvaInfo), fTextureOrigin(textureOrigin) {
41 for (
int i = 0;
i < n; ++
i) {
47 textureChannelMasks[
i] =
proxies[
i]->backendFormat().channelMask();
50 if (fYUVALocations[0].fPlane < 0) {
56 for (
size_t i = 0; i < static_cast<size_t>(n); ++
i) {
74 : fYUVAInfo(yuvaInfo) {
83 for (
int i = 0;
i < n; ++
i) {
87 if (!views[
i] || views[
i].origin() != views[0].origin()) {
98 if (fYUVALocations[0].fPlane < 0) {
106 int plane = fYUVALocations[
i].fPlane;
108 int chanAsIdx =
static_cast<int>(fYUVALocations[
i].fChannel);
109 switch (views[plane].swizzle()[chanAsIdx]) {
116 SkDEBUGFAILF(
"Unexpected swizzle value: %c", views[
i].swizzle()[chanAsIdx]);
123 for (
int i = 0;
i < n; ++
i) {
124 fProxies[
i] = views[
i].detachProxy();
126 fTextureOrigin = views[0].origin();
static constexpr uint32_t GrColorTypeChannelFlags(GrColorType ct)
static int num_channels(const GrBackendFormat &format)
#define SkDEBUGFAILF(fmt,...)
@ kRGB_SkColorChannelFlags
@ kRGBA_SkColorChannelFlags
@ kRed_SkColorChannelFlag
@ kGrayAlpha_SkColorChannelFlags
@ kRG_SkColorChannelFlags
@ kAlpha_SkColorChannelFlag
@ kGray_SkColorChannelFlag
GrSurfaceProxy * proxy(int i) const
const SkYUVAInfo & yuvaInfo() const
const std::array< sk_sp< GrSurfaceProxy >, SkYUVAInfo::kMaxPlanes > & proxies() const
skgpu::Mipmapped mipmapped() const
GrYUVATextureProxies()=default
static constexpr int kMaxPlanes
YUVALocations toYUVALocations(const uint32_t *channelFlags) const
static constexpr int kYUVAChannelCount