Rename outputSwizzle->writeSwizzle.
It is also used for writes to surfaces other than fragment shader
output. e.g. clears.
Change-Id: Id1eb79be6d1a8aed936456bffa59dee32661cec8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280344
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/core/SkDeferredDisplayListRecorder.cpp b/src/core/SkDeferredDisplayListRecorder.cpp
index a1fb9f7..f26f8f3 100644
--- a/src/core/SkDeferredDisplayListRecorder.cpp
+++ b/src/core/SkDeferredDisplayListRecorder.cpp
@@ -176,11 +176,10 @@
return false;
}
- GrSwizzle outputSwizzle = caps->getOutputSwizzle(fCharacterization.backendFormat(),
- grColorType);
+ GrSwizzle writeSwizzle = caps->getWriteSwizzle(fCharacterization.backendFormat(), grColorType);
GrSurfaceProxyView readView(proxy, fCharacterization.origin(), readSwizzle);
- GrSurfaceProxyView outputView(std::move(proxy), fCharacterization.origin(), outputSwizzle);
+ GrSurfaceProxyView outputView(std::move(proxy), fCharacterization.origin(), writeSwizzle);
auto rtc = std::make_unique<GrRenderTargetContext>(fContext.get(), std::move(readView),
std::move(outputView), grColorType,
diff --git a/src/gpu/GrCaps.h b/src/gpu/GrCaps.h
index b22010a..5f36fa9 100644
--- a/src/gpu/GrCaps.h
+++ b/src/gpu/GrCaps.h
@@ -418,10 +418,10 @@
virtual GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const = 0;
/**
- * Returns the GrSwizzle to use when outputting to a render target with the passed in
+ * Returns the GrSwizzle to use when writing colors to a surface with the passed in
* GrBackendFormat and GrColorType.
*/
- virtual GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const = 0;
+ virtual GrSwizzle getWriteSwizzle(const GrBackendFormat&, GrColorType) const = 0;
virtual uint64_t computeFormatKey(const GrBackendFormat&) const = 0;
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index c21b65d..deda9e3 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -505,7 +505,7 @@
}
GrColorType grColorType = SkColorTypeToGrColorType(skColorType);
- SkColor4f swizzledColor = this->caps()->getOutputSwizzle(format, grColorType).applyTo(color);
+ SkColor4f swizzledColor = this->caps()->getWriteSwizzle(format, grColorType).applyTo(color);
return this->createBackendTexture(width, height, format, swizzledColor, mipMapped, renderable,
isProtected);
diff --git a/src/gpu/GrOpFlushState.h b/src/gpu/GrOpFlushState.h
index 0fd90cb..2e72bae 100644
--- a/src/gpu/GrOpFlushState.h
+++ b/src/gpu/GrOpFlushState.h
@@ -69,7 +69,7 @@
}
GrSurfaceOrigin origin() const { return fSurfaceView->origin(); }
- GrSwizzle outputSwizzle() const { return fSurfaceView->swizzle(); }
+ GrSwizzle writeSwizzle() const { return fSurfaceView->swizzle(); }
GrOp* op() { return fOp; }
const GrSurfaceProxyView* outputView() const { return fSurfaceView; }
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 3e18d5b..58c8f0c 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -15,9 +15,10 @@
#include "src/gpu/ops/GrOp.h"
-GrPipeline::GrPipeline(const InitArgs& args, sk_sp<const GrXferProcessor> xferProcessor,
+GrPipeline::GrPipeline(const InitArgs& args,
+ sk_sp<const GrXferProcessor> xferProcessor,
const GrAppliedHardClip& hardClip)
- : fOutputSwizzle(args.fOutputSwizzle) {
+ : fWriteSwizzle(args.fWriteSwizzle) {
fFlags = (Flags)args.fInputFlags;
if (hardClip.hasStencilClip()) {
fFlags |= Flags::kHasStencilClip;
@@ -68,13 +69,15 @@
return this->getXferProcessor().xferBarrierType(caps);
}
-GrPipeline::GrPipeline(GrScissorTest scissorTest, sk_sp<const GrXferProcessor> xp,
- const GrSwizzle& outputSwizzle, InputFlags inputFlags,
+GrPipeline::GrPipeline(GrScissorTest scissorTest,
+ sk_sp<const GrXferProcessor> xp,
+ const GrSwizzle& writeSwizzle,
+ InputFlags inputFlags,
const GrUserStencilSettings* userStencil)
: fWindowRectsState()
, fFlags((Flags)inputFlags)
, fXferProcessor(std::move(xp))
- , fOutputSwizzle(outputSwizzle) {
+ , fWriteSwizzle(writeSwizzle) {
if (GrScissorTest::kEnabled == scissorTest) {
fFlags |= Flags::kScissorTestEnabled;
}
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index f07dbb5..a59adde 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -71,7 +71,7 @@
const GrUserStencilSettings* fUserStencil = &GrUserStencilSettings::kUnused;
const GrCaps* fCaps = nullptr;
GrXferProcessor::DstProxyView fDstProxyView;
- GrSwizzle fOutputSwizzle;
+ GrSwizzle fWriteSwizzle;
};
/**
@@ -79,14 +79,20 @@
* must be "Porter Duff" (<= kLastCoeffMode). If using GrScissorTest::kEnabled, the caller must
* specify a scissor rectangle through the DynamicState struct.
**/
- GrPipeline(GrScissorTest scissor, SkBlendMode blend, const GrSwizzle& outputSwizzle,
+ GrPipeline(GrScissorTest scissor,
+ SkBlendMode blend,
+ const GrSwizzle& writeSwizzle,
InputFlags flags = InputFlags::kNone,
const GrUserStencilSettings* stencil = &GrUserStencilSettings::kUnused)
- : GrPipeline(scissor, GrPorterDuffXPFactory::MakeNoCoverageXP(blend), outputSwizzle,
- flags, stencil) {
- }
+ : GrPipeline(scissor,
+ GrPorterDuffXPFactory::MakeNoCoverageXP(blend),
+ writeSwizzle,
+ flags,
+ stencil) {}
- GrPipeline(GrScissorTest, sk_sp<const GrXferProcessor>, const GrSwizzle& outputSwizzle,
+ GrPipeline(GrScissorTest,
+ sk_sp<const GrXferProcessor>,
+ const GrSwizzle& writeSwizzle,
InputFlags = InputFlags::kNone,
const GrUserStencilSettings* = &GrUserStencilSettings::kUnused);
@@ -204,7 +210,7 @@
// Used by Vulkan and Metal to cache their respective pipeline objects
void genKey(GrProcessorKeyBuilder*, const GrCaps&) const;
- const GrSwizzle& outputSwizzle() const { return fOutputSwizzle; }
+ const GrSwizzle& writeSwizzle() const { return fWriteSwizzle; }
void visitProxies(const GrOp::VisitProxyFunc&) const;
@@ -235,7 +241,7 @@
// This value is also the index in fFragmentProcessors where coverage processors begin.
int fNumColorProcessors = 0;
- GrSwizzle fOutputSwizzle;
+ GrSwizzle fWriteSwizzle;
};
GR_MAKE_BITFIELD_CLASS_OPS(GrPipeline::InputFlags);
diff --git a/src/gpu/GrProgramDesc.cpp b/src/gpu/GrProgramDesc.cpp
index 432493c..2a9f1ae 100644
--- a/src/gpu/GrProgramDesc.cpp
+++ b/src/gpu/GrProgramDesc.cpp
@@ -232,7 +232,7 @@
// make sure any padding in the header is zeroed.
memset(header, 0, kHeaderSize);
- header->fOutputSwizzle = programInfo.pipeline().outputSwizzle().asKey();
+ header->fWriteSwizzle = programInfo.pipeline().writeSwizzle().asKey();
header->fColorFragmentProcessorCnt = programInfo.pipeline().numColorFragmentProcessors();
header->fCoverageFragmentProcessorCnt = programInfo.pipeline().numCoverageFragmentProcessors();
// Fail if the client requested more processors than the key can fit.
diff --git a/src/gpu/GrProgramDesc.h b/src/gpu/GrProgramDesc.h
index 916d0fc..2fd7324 100644
--- a/src/gpu/GrProgramDesc.h
+++ b/src/gpu/GrProgramDesc.h
@@ -104,7 +104,7 @@
// TODO: this should be removed and converted to just data added to the key
struct KeyHeader {
// Set to uniquely identify any swizzling of the shader's output color(s).
- uint16_t fOutputSwizzle;
+ uint16_t fWriteSwizzle;
uint8_t fColorFragmentProcessorCnt; // Can be packed into 4 bits if required.
uint8_t fCoverageFragmentProcessorCnt;
// Set to uniquely identify the rt's origin, or 0 if the shader does not require this info.
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index fe3ef5d..e5dc4c5 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -152,7 +152,7 @@
const GrBackendFormat& format = proxy->backendFormat();
GrSwizzle readSwizzle = context->priv().caps()->getReadSwizzle(format, colorType);
- GrSwizzle outSwizzle = context->priv().caps()->getOutputSwizzle(format, colorType);
+ GrSwizzle outSwizzle = context->priv().caps()->getWriteSwizzle(format, colorType);
GrSurfaceProxyView readView(proxy, origin, readSwizzle);
GrSurfaceProxyView outputView(std::move(proxy), origin, outSwizzle);
diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index 7e18008..4d1b23b 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -47,8 +47,8 @@
SkASSERT(kPremul_SkAlphaType == alphaType || kOpaque_SkAlphaType == alphaType);
// Will we ever want a swizzle that is not the default output swizzle for the format and
// colorType here? If so we will need to manually pass that in.
- GrSwizzle outSwizzle = context->priv().caps()->getOutputSwizzle(proxy->backendFormat(),
- colorType);
+ GrSwizzle outSwizzle =
+ context->priv().caps()->getWriteSwizzle(proxy->backendFormat(), colorType);
GrSurfaceProxyView outputView(readView.refProxy(), readView.origin(), outSwizzle);
surfaceContext.reset(new GrRenderTargetContext(context, std::move(readView),
std::move(outputView), colorType,
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.cpp b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
index d779bf1..4c31602 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.cpp
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
@@ -434,7 +434,7 @@
GrPipeline::InitArgs initArgs;
initArgs.fCaps = &flushState->caps();
initArgs.fDstProxyView = flushState->drawOpArgs().dstProxyView();
- initArgs.fOutputSwizzle = flushState->drawOpArgs().outputSwizzle();
+ initArgs.fWriteSwizzle = flushState->drawOpArgs().writeSwizzle();
auto clip = flushState->detachAppliedClip();
GrPipeline pipeline(initArgs, std::move(fProcessors), std::move(clip));
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.cpp b/src/gpu/ccpr/GrCCPerFlushResources.cpp
index 06dd3ff..184acc1 100644
--- a/src/gpu/ccpr/GrCCPerFlushResources.cpp
+++ b/src/gpu/ccpr/GrCCPerFlushResources.cpp
@@ -98,7 +98,7 @@
GrCCAtlas::kTextureOrigin);
GrPipeline pipeline(GrScissorTest::kDisabled, SkBlendMode::kSrc,
- flushState->drawOpArgs().outputSwizzle());
+ flushState->drawOpArgs().writeSwizzle());
pathProc.drawPaths(flushState, pipeline, *fSrcProxy, *fResources, fBaseInstance,
fEndInstance, this->bounds());
@@ -139,7 +139,7 @@
void onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) override {
ProcessorType proc;
GrPipeline pipeline(GrScissorTest::kEnabled, SkBlendMode::kPlus,
- flushState->drawOpArgs().outputSwizzle());
+ flushState->drawOpArgs().writeSwizzle());
fResources->filler().drawFills(flushState, &proc, pipeline, fFillBatchID, fDrawBounds);
fResources->stroker().drawStrokes(flushState, &proc, fStrokeBatchID, fDrawBounds);
}
diff --git a/src/gpu/ccpr/GrCCStroker.cpp b/src/gpu/ccpr/GrCCStroker.cpp
index 4b5ef14..88a25f6 100644
--- a/src/gpu/ccpr/GrCCStroker.cpp
+++ b/src/gpu/ccpr/GrCCStroker.cpp
@@ -698,7 +698,7 @@
? &fZeroTallies : fScissorSubBatches[startScissorSubBatch - 1].fEndInstances;
GrPipeline pipeline(GrScissorTest::kEnabled, SkBlendMode::kPlus,
- flushState->drawOpArgs().outputSwizzle());
+ flushState->drawOpArgs().writeSwizzle());
// Draw linear strokes.
this->drawLog2Strokes(0, flushState, LinearStrokeProcessor(), pipeline, batch, startIndices,
diff --git a/src/gpu/ccpr/GrStencilAtlasOp.cpp b/src/gpu/ccpr/GrStencilAtlasOp.cpp
index 586707f..aab037a 100644
--- a/src/gpu/ccpr/GrStencilAtlasOp.cpp
+++ b/src/gpu/ccpr/GrStencilAtlasOp.cpp
@@ -120,7 +120,7 @@
SkIRect drawBoundsRect = SkIRect::MakeWH(fDrawBounds.width(), fDrawBounds.height());
GrPipeline pipeline(GrScissorTest::kEnabled, GrDisableColorXPFactory::MakeXferProcessor(),
- flushState->drawOpArgs().outputSwizzle(),
+ flushState->drawOpArgs().writeSwizzle(),
GrPipeline::InputFlags::kHWAntialias, &kIncrDecrStencil);
GrSampleMaskProcessor sampleMaskProc;
@@ -143,7 +143,7 @@
: &kResolveStencilCoverageAndReset;
GrPipeline resolvePipeline(GrScissorTest::kEnabled, SkBlendMode::kSrc,
- flushState->drawOpArgs().outputSwizzle(), noHWAA,
+ flushState->drawOpArgs().writeSwizzle(), noHWAA,
stencilResolveSettings);
StencilResolveProcessor primProc;
diff --git a/src/gpu/d3d/GrD3DCaps.cpp b/src/gpu/d3d/GrD3DCaps.cpp
index 1f4fbe7..13b70b2 100644
--- a/src/gpu/d3d/GrD3DCaps.cpp
+++ b/src/gpu/d3d/GrD3DCaps.cpp
@@ -327,7 +327,7 @@
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle("rrrr");
- ctInfo.fOutputSwizzle = GrSwizzle("aaaa");
+ ctInfo.fWriteSwizzle = GrSwizzle("aaaa");
}
// Format: DXGI_FORMAT_R8_UNORM, Surface: kGray_8
{
@@ -420,7 +420,7 @@
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle("rrrr");
- ctInfo.fOutputSwizzle = GrSwizzle("aaaa");
+ ctInfo.fWriteSwizzle = GrSwizzle("aaaa");
}
}
}
@@ -479,7 +479,7 @@
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle("bgra");
- ctInfo.fOutputSwizzle = GrSwizzle("bgra");
+ ctInfo.fWriteSwizzle = GrSwizzle("bgra");
}
}
}
@@ -519,7 +519,7 @@
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle("rrrr");
- ctInfo.fOutputSwizzle = GrSwizzle("aaaa");
+ ctInfo.fWriteSwizzle = GrSwizzle("aaaa");
}
}
}
@@ -948,14 +948,14 @@
return {};
}
-GrSwizzle GrD3DCaps::getOutputSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+GrSwizzle GrD3DCaps::getWriteSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
DXGI_FORMAT dxgiFormat;
SkAssertResult(format.asDxgiFormat(&dxgiFormat));
const auto& info = this->getFormatInfo(dxgiFormat);
for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
const auto& ctInfo = info.fColorTypeInfos[i];
if (ctInfo.fColorType == colorType) {
- return ctInfo.fOutputSwizzle;
+ return ctInfo.fWriteSwizzle;
}
}
SkDEBUGFAIL("Illegal color type/format combination.");
diff --git a/src/gpu/d3d/GrD3DCaps.h b/src/gpu/d3d/GrD3DCaps.h
index cb3d1fd..c2a8cde 100644
--- a/src/gpu/d3d/GrD3DCaps.h
+++ b/src/gpu/d3d/GrD3DCaps.h
@@ -63,7 +63,7 @@
}
GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override;
- GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override;
+ GrSwizzle getWriteSwizzle(const GrBackendFormat&, GrColorType) const override;
uint64_t computeFormatKey(const GrBackendFormat&) const override;
@@ -122,7 +122,7 @@
uint32_t fFlags = 0;
GrSwizzle fReadSwizzle;
- GrSwizzle fOutputSwizzle;
+ GrSwizzle fWriteSwizzle;
};
struct FormatInfo {
diff --git a/src/gpu/dawn/GrDawnCaps.cpp b/src/gpu/dawn/GrDawnCaps.cpp
index 9a35437..243e90b 100644
--- a/src/gpu/dawn/GrDawnCaps.cpp
+++ b/src/gpu/dawn/GrDawnCaps.cpp
@@ -127,8 +127,7 @@
return get_swizzle(format, colorType, false);
}
-GrSwizzle GrDawnCaps::getOutputSwizzle(const GrBackendFormat& format, GrColorType colorType) const
-{
+GrSwizzle GrDawnCaps::getWriteSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
return get_swizzle(format, colorType, true);
}
diff --git a/src/gpu/dawn/GrDawnCaps.h b/src/gpu/dawn/GrDawnCaps.h
index bd0e592..3c89196 100644
--- a/src/gpu/dawn/GrDawnCaps.h
+++ b/src/gpu/dawn/GrDawnCaps.h
@@ -51,7 +51,7 @@
GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override;
- GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override;
+ GrSwizzle getWriteSwizzle(const GrBackendFormat&, GrColorType) const override;
uint64_t computeFormatKey(const GrBackendFormat&) const override;
diff --git a/src/gpu/effects/GrDisableColorXP.cpp b/src/gpu/effects/GrDisableColorXP.cpp
index 81ccb5f..0e6760b 100644
--- a/src/gpu/effects/GrDisableColorXP.cpp
+++ b/src/gpu/effects/GrDisableColorXP.cpp
@@ -48,8 +48,10 @@
}
}
- void emitOutputSwizzle(
- GrGLSLXPFragmentBuilder*, const GrSwizzle&, const char*, const char*) const override {
+ void emitWriteSwizzle(GrGLSLXPFragmentBuilder*,
+ const GrSwizzle&,
+ const char*,
+ const char*) const override {
// Don't write any swizzling. This makes sure the final shader does not output a color.
return;
}
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 8771653..78fe8c8 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -1525,7 +1525,7 @@
ctInfo.fColorType = GrColorType::kAlpha_8;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
this->setColorTypeFormat(GrColorType::kAlpha_8, GrGLFormat::kR8);
// External IO ColorTypes:
@@ -2169,7 +2169,7 @@
ctInfo.fColorType = GrColorType::kAlpha_F16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
this->setColorTypeFormat(GrColorType::kAlpha_F16, GrGLFormat::kR16F);
// External IO ColorTypes:
@@ -2253,7 +2253,7 @@
ctInfo.fColorType = GrColorType::kAlpha_F16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
int idx = static_cast<int>(GrColorType::kAlpha_F16);
if (fColorTypeToFormatTable[idx] == GrGLFormat::kUnknown) {
@@ -2770,7 +2770,7 @@
ctInfo.fColorType = GrColorType::kAlpha_16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
this->setColorTypeFormat(GrColorType::kAlpha_16, GrGLFormat::kR16);
// External IO ColorTypes:
@@ -4334,12 +4334,12 @@
return {};
}
-GrSwizzle GrGLCaps::getOutputSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+GrSwizzle GrGLCaps::getWriteSwizzle(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.fOutputSwizzle;
+ return ctInfo.fWriteSwizzle;
}
}
SkDEBUGFAIL("Illegal color type/format combination.");
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 100b548..b4efd5d 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -447,7 +447,7 @@
GrBackendFormat getBackendFormatFromCompressionType(SkImage::CompressionType) const override;
GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override;
- GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override;
+ GrSwizzle getWriteSwizzle(const GrBackendFormat&, GrColorType) const override;
uint64_t computeFormatKey(const GrBackendFormat&) const override;
@@ -588,7 +588,7 @@
uint32_t fFlags = 0;
GrSwizzle fReadSwizzle;
- GrSwizzle fOutputSwizzle;
+ GrSwizzle fWriteSwizzle;
struct ExternalIOFormats {
GrColorType fColorType = GrColorType::kUnknown;
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 6cadeb6..1dc61c4 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1775,7 +1775,7 @@
// Swizzle the blend to match what the shader will output.
this->flushBlendAndColorWrite(programInfo.pipeline().getXferProcessor().getBlendInfo(),
- programInfo.pipeline().outputSwizzle());
+ programInfo.pipeline().writeSwizzle());
fHWProgram->updateUniforms(renderTarget, programInfo);
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index a427be5..fba5b3d 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -255,7 +255,7 @@
fFS.getSecondaryColorOutputName(),
dstTextureSamplerHandle,
dstTextureOrigin,
- this->pipeline().outputSwizzle());
+ this->pipeline().writeSwizzle());
fXferProcessor->emitCode(args);
// We have to check that effects and the code they emit are consistent, ie if an effect
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.cpp b/src/gpu/glsl/GrGLSLXferProcessor.cpp
index d128072..6aa8e8d 100644
--- a/src/gpu/glsl/GrGLSLXferProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLXferProcessor.cpp
@@ -104,13 +104,14 @@
}
// Swizzle the fragment shader outputs if necessary.
- this->emitOutputSwizzle(
- args.fXPFragBuilder, args.fOutputSwizzle, args.fOutputPrimary, args.fOutputSecondary);
+ this->emitWriteSwizzle(args.fXPFragBuilder, args.fWriteSwizzle, args.fOutputPrimary,
+ args.fOutputSecondary);
}
-void GrGLSLXferProcessor::emitOutputSwizzle(
- GrGLSLXPFragmentBuilder* x, const GrSwizzle& swizzle, const char* outColor,
- const char* outColorSecondary) const {
+void GrGLSLXferProcessor::emitWriteSwizzle(GrGLSLXPFragmentBuilder* x,
+ const GrSwizzle& swizzle,
+ const char* outColor,
+ const char* outColorSecondary) const {
if (GrSwizzle::RGBA() != swizzle) {
x->codeAppendf("%s = %s.%s;", outColor, outColor, swizzle.asString().c_str());
if (outColorSecondary) {
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.h b/src/gpu/glsl/GrGLSLXferProcessor.h
index 7c935a1..6f00568 100644
--- a/src/gpu/glsl/GrGLSLXferProcessor.h
+++ b/src/gpu/glsl/GrGLSLXferProcessor.h
@@ -36,7 +36,7 @@
const char* outputSecondary,
const SamplerHandle dstTextureSamplerHandle,
GrSurfaceOrigin dstTextureOrigin,
- const GrSwizzle& outputSwizzle)
+ const GrSwizzle& writeSwizzle)
: fXPFragBuilder(fragBuilder)
, fUniformHandler(uniformHandler)
, fShaderCaps(caps)
@@ -47,8 +47,7 @@
, fOutputSecondary(outputSecondary)
, fDstTextureSamplerHandle(dstTextureSamplerHandle)
, fDstTextureOrigin(dstTextureOrigin)
- , fOutputSwizzle(outputSwizzle) {
- }
+ , fWriteSwizzle(writeSwizzle) {}
GrGLSLXPFragmentBuilder* fXPFragBuilder;
GrGLSLUniformHandler* fUniformHandler;
const GrShaderCaps* fShaderCaps;
@@ -59,7 +58,7 @@
const char* fOutputSecondary;
const SamplerHandle fDstTextureSamplerHandle;
GrSurfaceOrigin fDstTextureOrigin;
- GrSwizzle fOutputSwizzle;
+ GrSwizzle fWriteSwizzle;
};
/**
* This is similar to emitCode() in the base class, except it takes a full shader builder.
@@ -111,10 +110,10 @@
SK_ABORT("emitBlendCodeForDstRead not implemented.");
}
- virtual void emitOutputSwizzle(GrGLSLXPFragmentBuilder*,
- const GrSwizzle&,
- const char* outColor,
- const char* outColorSecondary) const;
+ virtual void emitWriteSwizzle(GrGLSLXPFragmentBuilder*,
+ const GrSwizzle&,
+ const char* outColor,
+ const char* outColorSecondary) const;
virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) = 0;
diff --git a/src/gpu/mock/GrMockCaps.h b/src/gpu/mock/GrMockCaps.h
index 2400c49..269977f 100644
--- a/src/gpu/mock/GrMockCaps.h
+++ b/src/gpu/mock/GrMockCaps.h
@@ -168,7 +168,7 @@
SkASSERT(this->areColorTypeAndFormatCompatible(ct, format));
return GrSwizzle("rgba");
}
- GrSwizzle getOutputSwizzle(const GrBackendFormat& format, GrColorType ct) const override {
+ GrSwizzle getWriteSwizzle(const GrBackendFormat& format, GrColorType ct) const override {
SkASSERT(this->areColorTypeAndFormatCompatible(ct, format));
return GrSwizzle("rgba");
}
diff --git a/src/gpu/mtl/GrMtlCaps.h b/src/gpu/mtl/GrMtlCaps.h
index f4f6de9..e5be2cc 100644
--- a/src/gpu/mtl/GrMtlCaps.h
+++ b/src/gpu/mtl/GrMtlCaps.h
@@ -86,7 +86,7 @@
}
GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override;
- GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override;
+ GrSwizzle getWriteSwizzle(const GrBackendFormat&, GrColorType) const override;
uint64_t computeFormatKey(const GrBackendFormat&) const override;
@@ -128,7 +128,7 @@
uint32_t fFlags = 0;
GrSwizzle fReadSwizzle;
- GrSwizzle fOutputSwizzle;
+ GrSwizzle fWriteSwizzle;
};
struct FormatInfo {
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index de7293c..28d98bc 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -539,7 +539,7 @@
ctInfo.fColorType = GrColorType::kAlpha_8;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
}
// Format: R8Unorm, Surface: kGray_8
{
@@ -706,7 +706,7 @@
ctInfo.fColorType = GrColorType::kAlpha_F16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
}
}
@@ -750,7 +750,7 @@
ctInfo.fColorType = GrColorType::kAlpha_16;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
}
}
@@ -947,14 +947,14 @@
return {};
}
-GrSwizzle GrMtlCaps::getOutputSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+GrSwizzle GrMtlCaps::getWriteSwizzle(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.fOutputSwizzle;
+ return ctInfo.fWriteSwizzle;
}
}
SkDEBUGFAIL("Illegal color type/format combination.");
diff --git a/src/gpu/mtl/GrMtlOpsRenderPass.mm b/src/gpu/mtl/GrMtlOpsRenderPass.mm
index d6168da..80980e5 100644
--- a/src/gpu/mtl/GrMtlOpsRenderPass.mm
+++ b/src/gpu/mtl/GrMtlOpsRenderPass.mm
@@ -85,7 +85,7 @@
[fActiveRenderCmdEncoder setRenderPipelineState:fActivePipelineState->mtlPipelineState()];
fActivePipelineState->setDrawState(fActiveRenderCmdEncoder,
- programInfo.pipeline().outputSwizzle(),
+ programInfo.pipeline().writeSwizzle(),
programInfo.pipeline().getXferProcessor());
if (this->gpu()->caps()->wireframeMode() || programInfo.pipeline().isWireframe()) {
[fActiveRenderCmdEncoder setTriangleFillMode:MTLTriangleFillModeLines];
diff --git a/src/gpu/mtl/GrMtlPipelineState.h b/src/gpu/mtl/GrMtlPipelineState.h
index d0fa9b9..978f4b6 100644
--- a/src/gpu/mtl/GrMtlPipelineState.h
+++ b/src/gpu/mtl/GrMtlPipelineState.h
@@ -51,7 +51,8 @@
void setTextures(const GrPrimitiveProcessor&, const GrPipeline&, const GrSurfaceProxy* const[]);
void bindTextures(id<MTLRenderCommandEncoder> renderCmdEncoder);
- void setDrawState(id<MTLRenderCommandEncoder>, const GrSwizzle& outputSwizzle,
+ void setDrawState(id<MTLRenderCommandEncoder>,
+ const GrSwizzle& writeSwizzle,
const GrXferProcessor&);
static void SetDynamicScissorRectState(id<MTLRenderCommandEncoder> renderCmdEncoder,
diff --git a/src/gpu/mtl/GrMtlPipelineState.mm b/src/gpu/mtl/GrMtlPipelineState.mm
index 8ec6a65..614b8b7 100644
--- a/src/gpu/mtl/GrMtlPipelineState.mm
+++ b/src/gpu/mtl/GrMtlPipelineState.mm
@@ -116,11 +116,11 @@
}
void GrMtlPipelineState::setDrawState(id<MTLRenderCommandEncoder> renderCmdEncoder,
- const GrSwizzle& outputSwizzle,
+ const GrSwizzle& writeSwizzle,
const GrXferProcessor& xferProcessor) {
[renderCmdEncoder pushDebugGroup:@"setDrawState"];
this->bindUniforms(renderCmdEncoder);
- this->setBlendConstants(renderCmdEncoder, outputSwizzle, xferProcessor);
+ this->setBlendConstants(renderCmdEncoder, writeSwizzle, xferProcessor);
this->setDepthStencilState(renderCmdEncoder);
[renderCmdEncoder popDebugGroup];
}
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp b/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp
index 89aee8f..95a9fb4 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp
@@ -123,7 +123,7 @@
pipelineArgs.fUserStencil = stencilSettings;
pipelineArgs.fCaps = caps;
pipelineArgs.fDstProxyView = dstProxyView;
- pipelineArgs.fOutputSwizzle = outputViewSwizzle;
+ pipelineArgs.fWriteSwizzle = outputViewSwizzle;
return arena->make<GrPipeline>(pipelineArgs,
std::move(processorSet),
diff --git a/src/gpu/tessellate/GrDrawAtlasPathOp.cpp b/src/gpu/tessellate/GrDrawAtlasPathOp.cpp
index f629678..00a3fe1 100644
--- a/src/gpu/tessellate/GrDrawAtlasPathOp.cpp
+++ b/src/gpu/tessellate/GrDrawAtlasPathOp.cpp
@@ -168,7 +168,7 @@
}
initArgs.fCaps = &state->caps();
initArgs.fDstProxyView = state->drawOpArgs().dstProxyView();
- initArgs.fOutputSwizzle = state->drawOpArgs().outputSwizzle();
+ initArgs.fWriteSwizzle = state->drawOpArgs().writeSwizzle();
GrPipeline pipeline(initArgs, std::move(fProcessors), state->detachAppliedClip());
GrSwizzle swizzle = state->caps().getReadSwizzle(fAtlasProxy->backendFormat(),
diff --git a/src/gpu/tessellate/GrTessellatePathOp.cpp b/src/gpu/tessellate/GrTessellatePathOp.cpp
index e00ff29..ec94176 100644
--- a/src/gpu/tessellate/GrTessellatePathOp.cpp
+++ b/src/gpu/tessellate/GrTessellatePathOp.cpp
@@ -190,7 +190,7 @@
}
initArgs.fCaps = &state->caps();
initArgs.fDstProxyView = state->drawOpArgs().dstProxyView();
- initArgs.fOutputSwizzle = state->drawOpArgs().outputSwizzle();
+ initArgs.fWriteSwizzle = state->drawOpArgs().writeSwizzle();
GrPipeline pipeline(initArgs, std::move(fProcessors), state->detachAppliedClip());
if (fFillPathShader) {
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 9579803..a35d103 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -795,7 +795,7 @@
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
}
// Format: VK_FORMAT_R8_UNORM, Surface: kGray_8
{
@@ -888,7 +888,7 @@
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
}
}
}
@@ -966,7 +966,7 @@
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::BGRA();
- ctInfo.fOutputSwizzle = GrSwizzle::BGRA();
+ ctInfo.fWriteSwizzle = GrSwizzle::BGRA();
}
}
}
@@ -1025,7 +1025,7 @@
ctInfo.fColorType = ct;
ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
ctInfo.fReadSwizzle = GrSwizzle::RRRR();
- ctInfo.fOutputSwizzle = GrSwizzle::AAAA();
+ ctInfo.fWriteSwizzle = GrSwizzle::AAAA();
}
}
}
@@ -1597,14 +1597,14 @@
return {};
}
-GrSwizzle GrVkCaps::getOutputSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
+GrSwizzle GrVkCaps::getWriteSwizzle(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.fOutputSwizzle;
+ return ctInfo.fWriteSwizzle;
}
}
SkDEBUGFAIL("Illegal color type/format combination.");
diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h
index cf009f5..356e151 100644
--- a/src/gpu/vk/GrVkCaps.h
+++ b/src/gpu/vk/GrVkCaps.h
@@ -177,7 +177,7 @@
}
GrSwizzle getReadSwizzle(const GrBackendFormat&, GrColorType) const override;
- GrSwizzle getOutputSwizzle(const GrBackendFormat&, GrColorType) const override;
+ GrSwizzle getWriteSwizzle(const GrBackendFormat&, GrColorType) const override;
uint64_t computeFormatKey(const GrBackendFormat&) const override;
@@ -245,7 +245,7 @@
uint32_t fFlags = 0;
GrSwizzle fReadSwizzle;
- GrSwizzle fOutputSwizzle;
+ GrSwizzle fWriteSwizzle;
};
struct FormatInfo {
diff --git a/src/gpu/vk/GrVkOpsRenderPass.cpp b/src/gpu/vk/GrVkOpsRenderPass.cpp
index facdd12..631c98d 100644
--- a/src/gpu/vk/GrVkOpsRenderPass.cpp
+++ b/src/gpu/vk/GrVkOpsRenderPass.cpp
@@ -483,7 +483,7 @@
}
GrVkPipeline::SetDynamicViewportState(fGpu, currentCB, fRenderTarget);
GrVkPipeline::SetDynamicBlendConstantState(fGpu, currentCB,
- programInfo.pipeline().outputSwizzle(),
+ programInfo.pipeline().writeSwizzle(),
programInfo.pipeline().getXferProcessor());
return true;
diff --git a/src/gpu/vk/GrVkPipeline.h b/src/gpu/vk/GrVkPipeline.h
index 10484ae..af2c04d 100644
--- a/src/gpu/vk/GrVkPipeline.h
+++ b/src/gpu/vk/GrVkPipeline.h
@@ -38,8 +38,9 @@
static void SetDynamicScissorRectState(GrVkGpu*, GrVkCommandBuffer*, const GrRenderTarget*,
GrSurfaceOrigin, const SkIRect& scissorRect);
static void SetDynamicViewportState(GrVkGpu*, GrVkCommandBuffer*, const GrRenderTarget*);
- static void SetDynamicBlendConstantState(GrVkGpu*, GrVkCommandBuffer*,
- const GrSwizzle& outputSwizzle,
+ static void SetDynamicBlendConstantState(GrVkGpu*,
+ GrVkCommandBuffer*,
+ const GrSwizzle& writeSwizzle,
const GrXferProcessor&);
#ifdef SK_TRACE_MANAGED_RESOURCES
diff --git a/src/image/SkSurface_GpuMtl.mm b/src/image/SkSurface_GpuMtl.mm
index 8b4a139..6c74adf 100644
--- a/src/image/SkSurface_GpuMtl.mm
+++ b/src/image/SkSurface_GpuMtl.mm
@@ -87,13 +87,13 @@
GrSurfaceProxy::UseAllocator::kYes);
GrSwizzle readSwizzle = caps->getReadSwizzle(backendFormat, grColorType);
- GrSwizzle outputSwizzle = caps->getOutputSwizzle(backendFormat, grColorType);
+ GrSwizzle writeSwizzle = caps->getWriteSwizzle(backendFormat, grColorType);
GrSurfaceProxyView readView(proxy, origin, readSwizzle);
- GrSurfaceProxyView outputView(std::move(proxy), origin, outputSwizzle);
+ GrSurfaceProxyView writeView(std::move(proxy), origin, writeSwizzle);
auto rtc = std::make_unique<GrRenderTargetContext>(context, std::move(readView),
- std::move(outputView), grColorType,
+ std::move(writeView), grColorType,
colorSpace, surfaceProps);
sk_sp<SkSurface> surface = SkSurface_Gpu::MakeWrappedRenderTarget(context, std::move(rtc));
@@ -157,13 +157,13 @@
GrSurfaceProxy::UseAllocator::kYes);
GrSwizzle readSwizzle = caps->getReadSwizzle(backendFormat, grColorType);
- GrSwizzle outputSwizzle = caps->getOutputSwizzle(backendFormat, grColorType);
+ GrSwizzle writeSwizzle = caps->getWriteSwizzle(backendFormat, grColorType);
GrSurfaceProxyView readView(proxy, origin, readSwizzle);
- GrSurfaceProxyView outputView(std::move(proxy), origin, outputSwizzle);
+ GrSurfaceProxyView writeView(std::move(proxy), origin, writeSwizzle);
auto rtc = std::make_unique<GrRenderTargetContext>(context, std::move(readView),
- std::move(outputView), grColorType,
+ std::move(writeView), grColorType,
colorSpace, surfaceProps);
sk_sp<SkSurface> surface = SkSurface_Gpu::MakeWrappedRenderTarget(context, std::move(rtc));