Rename GrCaps textureSwizzle to readSwizzle.
Change-Id: Ia5e2c4d3ca7346a1ad7559cd158ed632a70145bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260699
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrCaps.h b/src/gpu/GrCaps.h
index 129766d..6671326 100644
--- a/src/gpu/GrCaps.h
+++ b/src/gpu/GrCaps.h
@@ -419,10 +419,10 @@
bool clampToBorderSupport() const { return fClampToBorderSupport; }
/**
- * Returns the GrSwizzle to use when sampling from a texture with the passed in GrBackendFormat
- * and GrColorType.
+ * Returns the GrSwizzle to use when sampling or reading back from a texture with the passed in
+ * GrBackendFormat and GrColorType.
*/
- virtual GrSwizzle getTextureSwizzle(const GrBackendFormat&, GrColorType) const = 0;
+ virtual GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const = 0;
/**
* Returns the GrSwizzle to use when outputting to a render target with the passed in
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index 03a96f6..1a217f8 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -540,7 +540,7 @@
if (!proxy) {
return false;
}
- GrSwizzle swizzle = proxyProvider->caps()->getTextureSwizzle(fFormat, fColorType);
+ GrSwizzle swizzle = proxyProvider->caps()->getReadSwizzle(fFormat, fColorType);
fViews[i] = GrSurfaceProxyView(std::move(proxy), kTopLeft_GrSurfaceOrigin, swizzle);
// set up allocated plots
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index aa8fb27..6e24270 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -924,7 +924,7 @@
sk_sp<GrRenderTargetProxy> renderTargetProxy(sk_ref_sp(sProxy->asRenderTargetProxy()));
GrSurfaceOrigin origin = renderTargetProxy->origin();
- GrSwizzle texSwizzle = fContext->priv().caps()->getTextureSwizzle(sProxy->backendFormat(),
+ GrSwizzle readSwizzle = fContext->priv().caps()->getReadSwizzle(sProxy->backendFormat(),
colorType);
GrSwizzle outSwizzle = fContext->priv().caps()->getOutputSwizzle(sProxy->backendFormat(),
colorType);
@@ -934,7 +934,7 @@
std::move(renderTargetProxy),
colorType,
origin,
- texSwizzle,
+ readSwizzle,
outSwizzle,
std::move(colorSpace),
surfaceProps,
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index 5a7dba3..f4d3f9e 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -195,14 +195,14 @@
SkASSERT(!this->findProxyByUniqueKey(tex->getUniqueKey(), origin));
}
#endif
- GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(tex->backendFormat(), colorType);
+ GrSwizzle readSwizzle = this->caps()->getReadSwizzle(tex->backendFormat(), colorType);
if (tex->asRenderTarget()) {
return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(
- std::move(tex), origin, texSwizzle, useAllocator));
+ std::move(tex), origin, readSwizzle, useAllocator));
} else {
return sk_sp<GrTextureProxy>(
- new GrTextureProxy(std::move(tex), origin, texSwizzle, useAllocator));
+ new GrTextureProxy(std::move(tex), origin, readSwizzle, useAllocator));
}
}
@@ -241,7 +241,7 @@
// createWrapped should've added this for us
SkASSERT(fUniquelyKeyedProxies.find(key));
SkASSERT(result->textureSwizzle() ==
- this->caps()->getTextureSwizzle(result->backendFormat(), colorType));
+ this->caps()->getReadSwizzle(result->backendFormat(), colorType));
return result;
}
@@ -465,7 +465,7 @@
GrMipMapsStatus mipMapsStatus = (GrMipMapped::kYes == mipMapped)
? GrMipMapsStatus::kDirty
: GrMipMapsStatus::kNotAllocated;
- GrSwizzle texSwizzle = caps->getTextureSwizzle(format, colorType);
+ GrSwizzle readSwizzle = caps->getReadSwizzle(format, colorType);
if (renderable == GrRenderable::kYes) {
renderTargetSampleCnt =
caps->getRenderTargetSampleCount(renderTargetSampleCnt, format);
@@ -474,11 +474,11 @@
// both texturable and renderable
return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(
*caps, format, copyDesc, renderTargetSampleCnt, origin, mipMapped, mipMapsStatus,
- texSwizzle, fit, budgeted, isProtected, surfaceFlags, useAllocator));
+ readSwizzle, fit, budgeted, isProtected, surfaceFlags, useAllocator));
}
return sk_sp<GrTextureProxy>(new GrTextureProxy(format, copyDesc, origin, mipMapped,
- mipMapsStatus, texSwizzle, fit, budgeted,
+ mipMapsStatus, readSwizzle, fit, budgeted,
isProtected, surfaceFlags, useAllocator));
}
@@ -561,10 +561,10 @@
// Make sure we match how we created the proxy with SkBudgeted::kNo
SkASSERT(GrBudgetedType::kBudgeted != tex->resourcePriv().budgetedType());
- GrSwizzle texSwizzle = caps->getTextureSwizzle(tex->backendFormat(), grColorType);
+ GrSwizzle readSwizzle = caps->getReadSwizzle(tex->backendFormat(), grColorType);
return sk_sp<GrTextureProxy>(
- new GrTextureProxy(std::move(tex), origin, texSwizzle, UseAllocator::kNo));
+ new GrTextureProxy(std::move(tex), origin, readSwizzle, UseAllocator::kNo));
}
sk_sp<GrTextureProxy> GrProxyProvider::wrapRenderableBackendTexture(
@@ -608,9 +608,9 @@
// Make sure we match how we created the proxy with SkBudgeted::kNo
SkASSERT(GrBudgetedType::kBudgeted != tex->resourcePriv().budgetedType());
- GrSwizzle texSwizzle = caps->getTextureSwizzle(tex->backendFormat(), colorType);
+ GrSwizzle readSwizzle = caps->getReadSwizzle(tex->backendFormat(), colorType);
- return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(std::move(tex), origin, texSwizzle,
+ return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(std::move(tex), origin, readSwizzle,
UseAllocator::kNo));
}
@@ -645,9 +645,9 @@
// Make sure we match how we created the proxy with SkBudgeted::kNo
SkASSERT(GrBudgetedType::kBudgeted != rt->resourcePriv().budgetedType());
- GrSwizzle texSwizzle = caps->getTextureSwizzle(rt->backendFormat(), grColorType);
+ GrSwizzle readSwizzle = caps->getReadSwizzle(rt->backendFormat(), grColorType);
- return sk_sp<GrRenderTargetProxy>(new GrRenderTargetProxy(std::move(rt), origin, texSwizzle,
+ return sk_sp<GrRenderTargetProxy>(new GrRenderTargetProxy(std::move(rt), origin, readSwizzle,
UseAllocator::kNo));
}
@@ -678,9 +678,9 @@
// This proxy should be unbudgeted because we're just wrapping an external resource
SkASSERT(GrBudgetedType::kBudgeted != rt->resourcePriv().budgetedType());
- GrSwizzle texSwizzle = caps->getTextureSwizzle(rt->backendFormat(), grColorType);
+ GrSwizzle readSwizzle = caps->getReadSwizzle(rt->backendFormat(), grColorType);
- return sk_sp<GrSurfaceProxy>(new GrRenderTargetProxy(std::move(rt), origin, texSwizzle,
+ return sk_sp<GrSurfaceProxy>(new GrRenderTargetProxy(std::move(rt), origin, readSwizzle,
UseAllocator::kNo));
}
@@ -710,7 +710,7 @@
SkASSERT(GrBudgetedType::kBudgeted != rt->resourcePriv().budgetedType());
GrColorType colorType = SkColorTypeToGrColorType(imageInfo.colorType());
- GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(rt->backendFormat(), colorType);
+ GrSwizzle readSwizzle = this->caps()->getReadSwizzle(rt->backendFormat(), colorType);
if (!this->caps()->isFormatAsColorTypeRenderable(colorType, rt->backendFormat(),
rt->numSamples())) {
@@ -719,7 +719,7 @@
// All Vulkan surfaces uses top left origins.
return sk_sp<GrRenderTargetProxy>(new GrRenderTargetProxy(
- std::move(rt), kTopLeft_GrSurfaceOrigin, texSwizzle, UseAllocator::kNo,
+ std::move(rt), kTopLeft_GrSurfaceOrigin, readSwizzle, UseAllocator::kNo,
GrRenderTargetProxy::WrapsVkSecondaryCB::kYes));
}
@@ -749,7 +749,7 @@
}
GrColorType colorType = GrPixelConfigToColorType(desc.fConfig);
- GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(format, colorType);
+ GrSwizzle readSwizzle = this->caps()->getReadSwizzle(format, colorType);
if (renderable == GrRenderable::kYes) {
return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(*this->caps(),
@@ -760,7 +760,7 @@
origin,
mipMapped,
mipMapsStatus,
- texSwizzle,
+ readSwizzle,
fit,
budgeted,
isProtected,
@@ -773,7 +773,7 @@
origin,
mipMapped,
mipMapsStatus,
- texSwizzle,
+ readSwizzle,
fit,
budgeted,
isProtected,
@@ -805,7 +805,7 @@
}
GrColorType colorType = GrPixelConfigToColorType(desc.fConfig);
- GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(format, colorType);
+ GrSwizzle readSwizzle = this->caps()->getReadSwizzle(format, colorType);
if (textureInfo) {
// Wrapped vulkan secondary command buffers don't support texturing since we won't have an
@@ -813,7 +813,7 @@
SkASSERT(!wrapsVkSecondaryCB);
return sk_sp<GrRenderTargetProxy>(new GrTextureRenderTargetProxy(
*this->caps(), std::move(callback), format, desc, sampleCnt, origin,
- textureInfo->fMipMapped, mipMapsStatus, texSwizzle, fit, budgeted, isProtected,
+ textureInfo->fMipMapped, mipMapsStatus, readSwizzle, fit, budgeted, isProtected,
surfaceFlags, useAllocator));
}
@@ -822,7 +822,7 @@
: GrRenderTargetProxy::WrapsVkSecondaryCB::kNo;
return sk_sp<GrRenderTargetProxy>(new GrRenderTargetProxy(
- std::move(callback), format, desc, sampleCnt, origin, texSwizzle, fit, budgeted,
+ std::move(callback), format, desc, sampleCnt, origin, readSwizzle, fit, budgeted,
isProtected, surfaceFlags, useAllocator, vkSCB));
}
@@ -847,18 +847,18 @@
desc.fConfig = config;
GrColorType colorType = GrPixelConfigToColorType(desc.fConfig);
- GrSwizzle texSwizzle = caps.getTextureSwizzle(format, colorType);
+ GrSwizzle readSwizzle = caps.getReadSwizzle(format, colorType);
if (GrRenderable::kYes == renderable) {
return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(
caps, std::move(callback), format, desc, renderTargetSampleCnt, origin,
- GrMipMapped::kNo, GrMipMapsStatus::kNotAllocated, texSwizzle, SkBackingFit::kApprox,
- SkBudgeted::kYes, isProtected, surfaceFlags, useAllocator));
+ GrMipMapped::kNo, GrMipMapsStatus::kNotAllocated, readSwizzle,
+ SkBackingFit::kApprox, SkBudgeted::kYes, isProtected, surfaceFlags, useAllocator));
} else {
return sk_sp<GrTextureProxy>(new GrTextureProxy(
std::move(callback), format, desc, origin, GrMipMapped::kNo,
- GrMipMapsStatus::kNotAllocated, texSwizzle, SkBackingFit::kApprox, SkBudgeted::kYes,
- isProtected, surfaceFlags, useAllocator));
+ GrMipMapsStatus::kNotAllocated, readSwizzle, SkBackingFit::kApprox,
+ SkBudgeted::kYes, isProtected, surfaceFlags, useAllocator));
}
}
diff --git a/src/gpu/dawn/GrDawnCaps.cpp b/src/gpu/dawn/GrDawnCaps.cpp
index b55605a..81f1865 100644
--- a/src/gpu/dawn/GrDawnCaps.cpp
+++ b/src/gpu/dawn/GrDawnCaps.cpp
@@ -188,7 +188,7 @@
return GrBackendFormat();
}
-GrSwizzle GrDawnCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const
+GrSwizzle GrDawnCaps::getReadSwizzle(const GrBackendFormat& format, GrColorType colorType) const
{
return get_swizzle(format, colorType, false);
}
diff --git a/src/gpu/dawn/GrDawnCaps.h b/src/gpu/dawn/GrDawnCaps.h
index d7d8a3f..b44756a 100644
--- a/src/gpu/dawn/GrDawnCaps.h
+++ b/src/gpu/dawn/GrDawnCaps.h
@@ -50,7 +50,7 @@
GrBackendFormat getBackendFormatFromCompressionType(SkImage::CompressionType) const override;
- GrSwizzle getTextureSwizzle(const GrBackendFormat&, GrColorType) const override;
+ GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override;
GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override;
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 52d2aef..364ac3a 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -1429,7 +1429,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kRGB_888x;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RGB1();
+ ctInfo.fReadSwizzle = GrSwizzle::RGB1();
// External IO ColorTypes:
ctInfo.fExternalIOFormatCount = 1;
@@ -1486,7 +1486,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kAlpha_8;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
this->setColorTypeFormat(GrColorType::kAlpha_8, GrGLFormat::kR8);
@@ -1519,7 +1519,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kGray_8;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle("rrr1");
+ ctInfo.fReadSwizzle = GrSwizzle("rrr1");
this->setColorTypeFormat(GrColorType::kGray_8, GrGLFormat::kR8);
// External IO ColorTypes:
@@ -1610,7 +1610,7 @@
ctInfo.fColorType = GrColorType::kAlpha_8;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag |
ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::AAAA();
+ ctInfo.fReadSwizzle = GrSwizzle::AAAA();
int idx = static_cast<int>(GrColorType::kAlpha_8);
if (fColorTypeToFormatTable[idx] == GrGLFormat::kUnknown) {
this->setColorTypeFormat(GrColorType::kAlpha_8, GrGLFormat::kALPHA8);
@@ -2115,7 +2115,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kAlpha_F16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
this->setColorTypeFormat(GrColorType::kAlpha_F16, GrGLFormat::kR16F);
@@ -2197,7 +2197,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kAlpha_F16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
int idx = static_cast<int>(GrColorType::kAlpha_F16);
@@ -2682,7 +2682,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kAlpha_16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
this->setColorTypeFormat(GrColorType::kAlpha_16, GrGLFormat::kR16);
@@ -4228,12 +4228,12 @@
SkUNREACHABLE;
}
-GrSwizzle GrGLCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+GrSwizzle GrGLCaps::getReadSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
const auto& info = this->getFormatInfo(format.asGLFormat());
for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
const auto& ctInfo = info.fColorTypeInfos[i];
if (ctInfo.fColorType == colorType) {
- return ctInfo.fTextureSwizzle;
+ return ctInfo.fReadSwizzle;
}
}
return GrSwizzle::RGBA();
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index d2d6314..18c894f 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -421,7 +421,7 @@
GrBackendFormat getBackendFormatFromCompressionType(SkImage::CompressionType) const override;
- GrSwizzle getTextureSwizzle(const GrBackendFormat&, GrColorType) const override;
+ GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override;
GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override;
GrProgramDesc makeDesc(const GrRenderTarget*, const GrProgramInfo&) const override;
@@ -558,7 +558,7 @@
};
uint32_t fFlags = 0;
- GrSwizzle fTextureSwizzle;
+ GrSwizzle fReadSwizzle;
GrSwizzle fOutputSwizzle;
struct ExternalIOFormats {
diff --git a/src/gpu/mock/GrMockCaps.h b/src/gpu/mock/GrMockCaps.h
index aaf6afa..1e8da18 100644
--- a/src/gpu/mock/GrMockCaps.h
+++ b/src/gpu/mock/GrMockCaps.h
@@ -169,7 +169,7 @@
return {};
}
- GrSwizzle getTextureSwizzle(const GrBackendFormat&, GrColorType) const override {
+ GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override {
return GrSwizzle();
}
GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override {
diff --git a/src/gpu/mtl/GrMtlCaps.h b/src/gpu/mtl/GrMtlCaps.h
index fa2de1c..6b830d6 100644
--- a/src/gpu/mtl/GrMtlCaps.h
+++ b/src/gpu/mtl/GrMtlCaps.h
@@ -86,7 +86,7 @@
return fColorTypeToFormatTable[idx];
}
- GrSwizzle getTextureSwizzle(const GrBackendFormat&, GrColorType) const override;
+ GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override;
GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override;
GrProgramDesc makeDesc(const GrRenderTarget*, const GrProgramInfo&) const override;
@@ -127,7 +127,7 @@
};
uint32_t fFlags = 0;
- GrSwizzle fTextureSwizzle;
+ GrSwizzle fReadSwizzle;
GrSwizzle fOutputSwizzle;
};
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index d2df871..bad0396 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -541,7 +541,7 @@
auto& ctInfo = info->fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kAlpha_8;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
}
// Format: R8Unorm, Surface: kGray_8
@@ -549,7 +549,7 @@
auto& ctInfo = info->fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kGray_8;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle("rrr1");
+ ctInfo.fReadSwizzle = GrSwizzle("rrr1");
}
}
@@ -566,7 +566,7 @@
auto& ctInfo = info->fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kAlpha_8;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::AAAA();
+ ctInfo.fReadSwizzle = GrSwizzle::AAAA();
}
}
@@ -623,7 +623,7 @@
auto& ctInfo = info->fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kRGB_888x;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RGB1();
+ ctInfo.fReadSwizzle = GrSwizzle::RGB1();
}
}
@@ -708,7 +708,7 @@
auto& ctInfo = info->fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kAlpha_F16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
}
}
@@ -752,7 +752,7 @@
auto& ctInfo = info->fColorTypeInfos[ctIdx++];
ctInfo.fColorType = GrColorType::kAlpha_16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
}
}
@@ -1049,14 +1049,14 @@
SK_ABORT("Invalid compression type");
}
-GrSwizzle GrMtlCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+GrSwizzle GrMtlCaps::getReadSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
MTLPixelFormat mtlFormat = GrBackendFormatAsMTLPixelFormat(format);
SkASSERT(mtlFormat != MTLPixelFormatInvalid);
const auto& info = this->getFormatInfo(mtlFormat);
for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
const auto& ctInfo = info.fColorTypeInfos[i];
if (ctInfo.fColorType == colorType) {
- return ctInfo.fTextureSwizzle;
+ return ctInfo.fReadSwizzle;
}
}
return GrSwizzle::RGBA();
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index e26a847..c42f351 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -470,7 +470,7 @@
GrSurfaceProxyView view(
std::move(proxy), origin,
- context->priv().caps()->getTextureSwizzle(format, GrColorType::kRGBA_8888));
+ context->priv().caps()->getReadSwizzle(format, GrColorType::kRGBA_8888));
return NonAALatticeOp::Make(context, std::move(paint), viewMatrix, std::move(view),
GrColorType::kRGBA_8888, std::move(csxf), filter, std::move(iter),
diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp
index 1e07a81..f67f5b6 100644
--- a/src/gpu/ops/GrShadowRRectOp.cpp
+++ b/src/gpu/ops/GrShadowRRectOp.cpp
@@ -691,7 +691,7 @@
if (!falloffTexture) {
return nullptr;
}
- GrSwizzle swizzle = context->priv().caps()->getTextureSwizzle(falloffTexture->backendFormat(),
+ GrSwizzle swizzle = context->priv().caps()->getReadSwizzle(falloffTexture->backendFormat(),
GrColorType::kAlpha_8);
GrSurfaceProxyView falloffView(std::move(falloffTexture), kTopLeft_GrSurfaceOrigin, swizzle);
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index 87ad089..bf51e60 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -1315,7 +1315,7 @@
auto saturate = random->nextBool() ? GrTextureOp::Saturate::kYes : GrTextureOp::Saturate::kNo;
GrSurfaceProxyView proxyView(
std::move(proxy), origin,
- context->priv().caps()->getTextureSwizzle(format, GrColorType::kRGBA_8888));
+ context->priv().caps()->getReadSwizzle(format, GrColorType::kRGBA_8888));
auto alphaType = static_cast<SkAlphaType>(
random->nextRangeU(kUnknown_SkAlphaType + 1, kLastEnum_SkAlphaType));
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 76335ea..40441ab 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -748,7 +748,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RGB1();
+ ctInfo.fReadSwizzle = GrSwizzle::RGB1();
}
}
}
@@ -769,7 +769,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
}
// Format: VK_FORMAT_R8_UNORM, Surface: kGray_8
@@ -778,7 +778,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle("rrr1");
+ ctInfo.fReadSwizzle = GrSwizzle("rrr1");
}
}
}
@@ -862,7 +862,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
}
}
@@ -940,7 +940,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::BGRA();
+ ctInfo.fReadSwizzle = GrSwizzle::BGRA();
ctInfo.fOutputSwizzle = GrSwizzle::BGRA();
}
}
@@ -999,7 +999,7 @@
auto& ctInfo = info.fColorTypeInfos[ctIdx++];
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
- ctInfo.fTextureSwizzle = GrSwizzle::RRRR();
+ ctInfo.fReadSwizzle = GrSwizzle::RRRR();
ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
}
}
@@ -1686,14 +1686,14 @@
SkUNREACHABLE;
}
-GrSwizzle GrVkCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+GrSwizzle GrVkCaps::getReadSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
VkFormat vkFormat;
SkAssertResult(format.asVkFormat(&vkFormat));
const auto& info = this->getFormatInfo(vkFormat);
for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
const auto& ctInfo = info.fColorTypeInfos[i];
if (ctInfo.fColorType == colorType) {
- return ctInfo.fTextureSwizzle;
+ return ctInfo.fReadSwizzle;
}
}
return GrSwizzle::RGBA();
diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h
index 95d1c61..270a200 100644
--- a/src/gpu/vk/GrVkCaps.h
+++ b/src/gpu/vk/GrVkCaps.h
@@ -177,7 +177,7 @@
return fColorTypeToFormatTable[idx];
}
- GrSwizzle getTextureSwizzle(const GrBackendFormat&, GrColorType) const override;
+ GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override;
GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override;
int getFragmentUniformBinding() const;
@@ -246,7 +246,7 @@
};
uint32_t fFlags = 0;
- GrSwizzle fTextureSwizzle;
+ GrSwizzle fReadSwizzle;
GrSwizzle fOutputSwizzle;
};