From 80468375c0d591b8781f33c254cc19e1d18880c0 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Fri, 19 Mar 2021 14:05:19 -0400 Subject: [PATCH] Remove unused quality param for skvm program No behavior/pixel differences expected. Change-Id: I9916a74de5063fd81f78bc3744ed32460e12c656 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387236 Reviewed-by: Brian Osman Commit-Queue: Mike Reed --- modules/particles/src/SkParticleBinding.cpp | 2 +- src/core/SkDraw_vertices.cpp | 3 +-- src/core/SkRuntimeEffect.cpp | 5 ++--- src/core/SkVMBlitter.cpp | 20 +++++++------------- src/shaders/SkColorFilterShader.cpp | 5 ++--- src/shaders/SkColorFilterShader.h | 3 +-- src/shaders/SkColorShader.cpp | 10 ++++------ src/shaders/SkColorShader.h | 6 ++---- src/shaders/SkComposeShader.cpp | 16 ++++++++-------- src/shaders/SkComposeShader.h | 6 ++---- src/shaders/SkEmptyShader.h | 3 +-- src/shaders/SkImageShader.cpp | 2 +- src/shaders/SkImageShader.h | 3 +-- src/shaders/SkLocalMatrixShader.cpp | 10 ++++------ src/shaders/SkLocalMatrixShader.h | 3 +-- src/shaders/SkPerlinNoiseShader.cpp | 3 +-- src/shaders/SkPictureShader.cpp | 5 ++--- src/shaders/SkPictureShader.h | 3 +-- src/shaders/SkShader.cpp | 7 +++---- src/shaders/SkShaderBase.h | 11 ++++------- src/shaders/gradients/SkGradientShader.cpp | 2 +- src/shaders/gradients/SkGradientShaderPriv.h | 3 +-- 22 files changed, 51 insertions(+), 80 deletions(-) diff --git a/modules/particles/src/SkParticleBinding.cpp b/modules/particles/src/SkParticleBinding.cpp index c57425e7da..192f6397c0 100644 --- a/modules/particles/src/SkParticleBinding.cpp +++ b/modules/particles/src/SkParticleBinding.cpp @@ -189,7 +189,7 @@ public: skvm::Color result = as_SB(fShader)->program( builder, /*device=*/coord, /*local=*/coord, /*paint=*/{zero, zero, zero, zero}, - matrixProvider, /*localM=*/nullptr, kLow_SkFilterQuality, colorInfo, fUniforms, + matrixProvider, /*localM=*/nullptr, colorInfo, fUniforms, fAlloc); SkASSERT(result); outResult[0] = result.r; diff --git a/src/core/SkDraw_vertices.cpp b/src/core/SkDraw_vertices.cpp index 432f24dc97..fca9aade7e 100644 --- a/src/core/SkDraw_vertices.cpp +++ b/src/core/SkDraw_vertices.cpp @@ -150,8 +150,7 @@ protected: skvm::Color onProgram(skvm::Builder*, skvm::Coord, skvm::Coord, skvm::Color, - const SkMatrixProvider&, const SkMatrix*, - SkFilterQuality, const SkColorInfo&, + const SkMatrixProvider&, const SkMatrix*, const SkColorInfo&, skvm::Uniforms*, SkArenaAlloc*) const override { // TODO? return {}; diff --git a/src/core/SkRuntimeEffect.cpp b/src/core/SkRuntimeEffect.cpp index 3997ae9472..90ce704a5e 100644 --- a/src/core/SkRuntimeEffect.cpp +++ b/src/core/SkRuntimeEffect.cpp @@ -687,7 +687,7 @@ public: skvm::Color onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& matrices, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const override { sk_sp inputs = get_xformed_uniforms(fEffect.get(), fUniforms, &matrices, dst.colorSpace()); @@ -705,8 +705,7 @@ public: if (fChildren[ix]) { SkOverrideDeviceMatrixProvider mats{matrices, SkMatrix::I()}; return as_SB(fChildren[ix])->program(p, device, coord, paint, - mats, nullptr, - quality, dst, + mats, nullptr, dst, uniforms, alloc); } else { return paint; diff --git a/src/core/SkVMBlitter.cpp b/src/core/SkVMBlitter.cpp index e6eed857fe..debec7cdba 100644 --- a/src/core/SkVMBlitter.cpp +++ b/src/core/SkVMBlitter.cpp @@ -42,7 +42,6 @@ namespace { SkBlendMode blendMode; Coverage coverage; SkColor4f paint; - SkFilterQuality quality; const SkMatrixProvider& matrices; Params withCoverage(Coverage c) const { @@ -144,8 +143,7 @@ namespace { if (auto c = sb->program(&p, device,/*local=*/device, paint, params.matrices, /*localM=*/nullptr, - params.quality, params.dst, - uniforms,alloc)) { + params.dst, uniforms,alloc)) { hash = p.hash(); // p.hash() folds in all instructions to produce r,g,b,a but does not know // precisely which value we'll treat as which channel. Imagine the shader @@ -200,8 +198,7 @@ namespace { // See note about arguments above: a SpriteShader will call p->arg() once during program(). skvm::Color src = as_SB(params.shader)->program(p, device,/*local=*/device, paint, params.matrices, /*localM=*/nullptr, - params.quality, params.dst, - uniforms, alloc); + params.dst, uniforms, alloc); SkASSERT(src); if (params.coverage == Coverage::Mask3D) { skvm::F32 M = from_unorm(8, p->load8(p->varying())), @@ -271,8 +268,7 @@ namespace { if (params.clip) { skvm::Color clip = as_SB(params.clip)->program(p, device,/*local=*/device, paint, params.matrices, /*localM=*/nullptr, - params.quality, params.dst, - uniforms, alloc); + params.dst, uniforms, alloc); SkAssertResult(clip); cov.r *= clip.a; // We use the alpha channel of clip for all four. cov.g *= clip.a; @@ -353,7 +349,7 @@ namespace { skvm::Color onProgram(skvm::Builder* p, skvm::Coord /*device*/, skvm::Coord /*local*/, skvm::Color /*paint*/, const SkMatrixProvider&, const SkMatrix* /*localM*/, - SkFilterQuality, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc*) const override { const SkColorType ct = fSprite.colorType(); @@ -379,11 +375,11 @@ namespace { skvm::Color onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& matrices, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const override { // Run our wrapped shader. skvm::Color c = as_SB(fShader)->program(p, device,local, paint, - matrices,localM, quality,dst, uniforms,alloc); + matrices,localM, dst, uniforms,alloc); if (!c) { return {}; } @@ -465,8 +461,7 @@ namespace { skvm::Color onProgram(skvm::Builder*, skvm::Coord, skvm::Coord, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix*, - SkFilterQuality, const SkColorInfo&, + const SkMatrixProvider&, const SkMatrix*, const SkColorInfo&, skvm::Uniforms*, SkArenaAlloc*) const override { // Incoming `paint` is unpremul in the destination color space, // so we just need to premul it. @@ -537,7 +532,6 @@ namespace { blendMode, Coverage::Full, // Placeholder... withCoverage() will change as needed. paintColor, - paint.getFilterQuality(), matrices, }; } diff --git a/src/shaders/SkColorFilterShader.cpp b/src/shaders/SkColorFilterShader.cpp index a5b16f7119..3ac83b250a 100644 --- a/src/shaders/SkColorFilterShader.cpp +++ b/src/shaders/SkColorFilterShader.cpp @@ -65,12 +65,11 @@ bool SkColorFilterShader::onAppendStages(const SkStageRec& rec) const { skvm::Color SkColorFilterShader::onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& matrices, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const { // Run the shader. skvm::Color c = as_SB(fShader)->program(p, device,local, paint, - matrices,localM, - quality,dst, + matrices,localM, dst, uniforms,alloc); if (!c) { return {}; diff --git a/src/shaders/SkColorFilterShader.h b/src/shaders/SkColorFilterShader.h index cc6f98df99..25dc3ca922 100644 --- a/src/shaders/SkColorFilterShader.h +++ b/src/shaders/SkColorFilterShader.h @@ -27,8 +27,7 @@ private: bool onAppendStages(const SkStageRec&) const override; skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc*) const override; SK_FLATTENABLE_HOOKS(SkColorFilterShader) diff --git a/src/shaders/SkColorShader.cpp b/src/shaders/SkColorShader.cpp index 53c0d43faa..cc1976552b 100644 --- a/src/shaders/SkColorShader.cpp +++ b/src/shaders/SkColorShader.cpp @@ -93,9 +93,8 @@ bool SkColor4Shader::onAppendStages(const SkStageRec& rec) const { skvm::Color SkColorShader::onProgram(skvm::Builder* p, skvm::Coord /*device*/, skvm::Coord /*local*/, - skvm::Color /*paint*/, - const SkMatrixProvider&, const SkMatrix* /*localM*/, - SkFilterQuality /*quality*/, const SkColorInfo& dst, + skvm::Color /*paint*/, const SkMatrixProvider&, + const SkMatrix* /*localM*/, const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc*) const { SkColor4f color = SkColor4f::FromColor(fColor); SkColorSpaceXformSteps(sk_srgb_singleton(), kUnpremul_SkAlphaType, @@ -104,9 +103,8 @@ skvm::Color SkColorShader::onProgram(skvm::Builder* p, } skvm::Color SkColor4Shader::onProgram(skvm::Builder* p, skvm::Coord /*device*/, skvm::Coord /*local*/, - skvm::Color /*paint*/, - const SkMatrixProvider&, const SkMatrix* /*localM*/, - SkFilterQuality /*quality*/, const SkColorInfo& dst, + skvm::Color /*paint*/, const SkMatrixProvider&, + const SkMatrix* /*localM*/, const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc*) const { SkColor4f color = fColor; SkColorSpaceXformSteps(fColorSpace.get(), kUnpremul_SkAlphaType, diff --git a/src/shaders/SkColorShader.h b/src/shaders/SkColorShader.h index 5b87665597..17ffeb1805 100644 --- a/src/shaders/SkColorShader.h +++ b/src/shaders/SkColorShader.h @@ -45,8 +45,7 @@ private: bool onAppendStages(const SkStageRec&) const override; skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc*) const override; SkColor fColor; @@ -70,8 +69,7 @@ private: bool onAppendStages(const SkStageRec&) const override; skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc*) const override; sk_sp fColorSpace; diff --git a/src/shaders/SkComposeShader.cpp b/src/shaders/SkComposeShader.cpp index a309251284..19d73340f3 100644 --- a/src/shaders/SkComposeShader.cpp +++ b/src/shaders/SkComposeShader.cpp @@ -130,20 +130,20 @@ bool SkShader_Blend::onAppendStages(const SkStageRec& orig_rec) const { static skvm::Color program_or_paint(const sk_sp& sh, skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& mats, const SkMatrix* localM, - SkFilterQuality q, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) { - return sh ? as_SB(sh)->program(p, device,local, paint, mats,localM, q,dst, uniforms,alloc) + return sh ? as_SB(sh)->program(p, device,local, paint, mats,localM, dst, uniforms,alloc) : p->premul(paint); } skvm::Color SkShader_Blend::onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& mats, const SkMatrix* localM, - SkFilterQuality q, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const { skvm::Color d,s; - if ((d = program_or_paint(fDst, p, device,local, paint, mats,localM, q,dst, uniforms,alloc)) && - (s = program_or_paint(fSrc, p, device,local, paint, mats,localM, q,dst, uniforms,alloc))) + if ((d = program_or_paint(fDst, p, device,local, paint, mats,localM, dst, uniforms,alloc)) && + (s = program_or_paint(fSrc, p, device,local, paint, mats,localM, dst, uniforms,alloc))) { return p->blend(fMode, s,d); } @@ -180,11 +180,11 @@ bool SkShader_Lerp::onAppendStages(const SkStageRec& orig_rec) const { skvm::Color SkShader_Lerp::onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& mats, const SkMatrix* localM, - SkFilterQuality q, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const { skvm::Color d,s; - if ((d = program_or_paint(fDst, p, device,local, paint, mats,localM, q,dst, uniforms,alloc)) && - (s = program_or_paint(fSrc, p, device,local, paint, mats,localM, q,dst, uniforms,alloc))) + if ((d = program_or_paint(fDst, p, device,local, paint, mats,localM, dst, uniforms,alloc)) && + (s = program_or_paint(fSrc, p, device,local, paint, mats,localM, dst, uniforms,alloc))) { auto t = p->uniformF(uniforms->pushF(fWeight)); return { diff --git a/src/shaders/SkComposeShader.h b/src/shaders/SkComposeShader.h index 662d2e9c5b..8ceaf38d70 100644 --- a/src/shaders/SkComposeShader.h +++ b/src/shaders/SkComposeShader.h @@ -28,8 +28,7 @@ protected: void flatten(SkWriteBuffer&) const override; bool onAppendStages(const SkStageRec&) const override; skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality, const SkColorInfo& dst, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dst, skvm::Uniforms*, SkArenaAlloc*) const override; private: @@ -61,8 +60,7 @@ protected: void flatten(SkWriteBuffer&) const override; bool onAppendStages(const SkStageRec&) const override; skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality, const SkColorInfo& dst, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dst, skvm::Uniforms*, SkArenaAlloc*) const override; private: diff --git a/src/shaders/SkEmptyShader.h b/src/shaders/SkEmptyShader.h index e374815f40..4f60517657 100644 --- a/src/shaders/SkEmptyShader.h +++ b/src/shaders/SkEmptyShader.h @@ -38,8 +38,7 @@ protected: } skvm::Color onProgram(skvm::Builder*, skvm::Coord, skvm::Coord, skvm::Color, - const SkMatrixProvider&, const SkMatrix*, - SkFilterQuality, const SkColorInfo&, + const SkMatrixProvider&, const SkMatrix*, const SkColorInfo&, skvm::Uniforms*, SkArenaAlloc*) const override; private: diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp index 1fdfed2544..d18f549a0d 100755 --- a/src/shaders/SkImageShader.cpp +++ b/src/shaders/SkImageShader.cpp @@ -811,7 +811,7 @@ SkStageUpdater* SkImageShader::onAppendUpdatableStages(const SkStageRec& rec) co skvm::Color SkImageShader::onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord origLocal, skvm::Color paint, const SkMatrixProvider& matrices, const SkMatrix* localM, - SkFilterQuality, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const { SkMatrix baseInv; if (!this->computeTotalInverse(matrices.localToDevice(), localM, &baseInv)) { diff --git a/src/shaders/SkImageShader.h b/src/shaders/SkImageShader.h index 0d2e1d083b..67202cb405 100644 --- a/src/shaders/SkImageShader.h +++ b/src/shaders/SkImageShader.h @@ -52,8 +52,7 @@ private: SkStageUpdater* onAppendUpdatableStages(const SkStageRec&) const override; skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc*) const override; bool doStages(const SkStageRec&, SkImageStageUpdater* = nullptr) const; diff --git a/src/shaders/SkLocalMatrixShader.cpp b/src/shaders/SkLocalMatrixShader.cpp index 14656b87a8..218fc3d43c 100644 --- a/src/shaders/SkLocalMatrixShader.cpp +++ b/src/shaders/SkLocalMatrixShader.cpp @@ -81,15 +81,14 @@ bool SkLocalMatrixShader::onAppendStages(const SkStageRec& rec) const { skvm::Color SkLocalMatrixShader::onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& matrices, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const { SkTCopyOnFirstWrite lm(this->getLocalMatrix()); if (localM) { lm.writable()->preConcat(*localM); } return as_SB(fProxyShader)->program(p, device,local, paint, - matrices,lm.get(), - quality,dst, + matrices,lm.get(), dst, uniforms,alloc); } @@ -160,12 +159,11 @@ protected: skvm::Color onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& matrices, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const override { SkOverrideDeviceMatrixProvider matrixProvider(matrices, fCTM); return as_SB(fProxyShader)->program(p, device,local, paint, - matrixProvider,localM, - quality,dst, + matrixProvider,localM, dst, uniforms,alloc); } diff --git a/src/shaders/SkLocalMatrixShader.h b/src/shaders/SkLocalMatrixShader.h index bc8fed539a..6181384104 100644 --- a/src/shaders/SkLocalMatrixShader.h +++ b/src/shaders/SkLocalMatrixShader.h @@ -49,8 +49,7 @@ protected: bool onAppendStages(const SkStageRec&) const override; skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc*) const override; private: diff --git a/src/shaders/SkPerlinNoiseShader.cpp b/src/shaders/SkPerlinNoiseShader.cpp index 760135725b..6dc5953ef4 100644 --- a/src/shaders/SkPerlinNoiseShader.cpp +++ b/src/shaders/SkPerlinNoiseShader.cpp @@ -304,8 +304,7 @@ public: skvm::Color onProgram(skvm::Builder*, skvm::Coord, skvm::Coord, skvm::Color, - const SkMatrixProvider&, const SkMatrix*, - SkFilterQuality, const SkColorInfo&, + const SkMatrixProvider&, const SkMatrix*, const SkColorInfo&, skvm::Uniforms*, SkArenaAlloc*) const override { // TODO? return {}; diff --git a/src/shaders/SkPictureShader.cpp b/src/shaders/SkPictureShader.cpp index 268878e591..27934283a8 100644 --- a/src/shaders/SkPictureShader.cpp +++ b/src/shaders/SkPictureShader.cpp @@ -296,7 +296,7 @@ bool SkPictureShader::onAppendStages(const SkStageRec& rec) const { skvm::Color SkPictureShader::onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& matrices, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const { auto lm = this->totalLocalMatrix(localM); @@ -309,8 +309,7 @@ skvm::Color SkPictureShader::onProgram(skvm::Builder* p, } return as_SB(bitmapShader)->program(p, device,local, paint, - matrices,lm, - quality,dst, + matrices,lm, dst, uniforms,alloc); } diff --git a/src/shaders/SkPictureShader.h b/src/shaders/SkPictureShader.h index 837622910c..e26649968a 100644 --- a/src/shaders/SkPictureShader.h +++ b/src/shaders/SkPictureShader.h @@ -36,8 +36,7 @@ protected: void flatten(SkWriteBuffer&) const override; bool onAppendStages(const SkStageRec&) const override; skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const override; #ifdef SK_ENABLE_LEGACY_SHADERCONTEXT diff --git a/src/shaders/SkShader.cpp b/src/shaders/SkShader.cpp index 58675b8ae9..5fbc328690 100644 --- a/src/shaders/SkShader.cpp +++ b/src/shaders/SkShader.cpp @@ -198,7 +198,7 @@ bool SkShaderBase::onAppendStages(const SkStageRec& rec) const { skvm::Color SkShaderBase::program(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider& matrices, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const { // Shader subclasses should always act as if the destination were premul or opaque. // SkVMBlitter handles all the coordination of unpremul itself, via premul. @@ -218,7 +218,7 @@ skvm::Color SkShaderBase::program(skvm::Builder* p, // shader program hash and blitter Key. This makes it safe for us to use // that bit to make decisions when constructing an SkVMBlitter, like doing // SrcOver -> Src strength reduction. - if (auto color = this->onProgram(p, device,local, paint, matrices,localM, quality,tweaked, + if (auto color = this->onProgram(p, device,local, paint, matrices,localM, tweaked, uniforms,alloc)) { if (this->isOpaque()) { color.a = p->splat(1.0f); @@ -265,8 +265,7 @@ skvm::Coord SkShaderBase::ApplyMatrix(skvm::Builder* p, const SkMatrix& m, /////////////////////////////////////////////////////////////////////////////////////////////////// skvm::Color SkEmptyShader::onProgram(skvm::Builder*, skvm::Coord, skvm::Coord, skvm::Color, - const SkMatrixProvider&, const SkMatrix*, - SkFilterQuality, const SkColorInfo&, + const SkMatrixProvider&, const SkMatrix*, const SkColorInfo&, skvm::Uniforms*, SkArenaAlloc*) const { return {}; // signal failure } diff --git a/src/shaders/SkShaderBase.h b/src/shaders/SkShaderBase.h index 680cf1bd5a..f81c1a0c17 100644 --- a/src/shaders/SkShaderBase.h +++ b/src/shaders/SkShaderBase.h @@ -8,7 +8,6 @@ #ifndef SkShaderBase_DEFINED #define SkShaderBase_DEFINED -#include "include/core/SkFilterQuality.h" #include "include/core/SkMatrix.h" #include "include/core/SkPaint.h" #include "include/core/SkSamplingOptions.h" @@ -98,8 +97,8 @@ public: const SkMatrix* fLocalMatrix; // optional local matrix SkColorType fDstColorType; // the color type of the dest surface SkColorSpace* fDstColorSpace; // the color space of the dest surface (if any) - SkAlpha fPaintAlpha; - bool fPaintDither; + SkAlpha fPaintAlpha; + bool fPaintDither; bool isLegacyCompatible(SkColorSpace* shadersColorSpace) const; }; @@ -218,8 +217,7 @@ public: SK_WARN_UNUSED_RESULT skvm::Color program(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dst, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const; protected: @@ -256,8 +254,7 @@ private: virtual skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dst, - skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const = 0; + const SkColorInfo& dst, skvm::Uniforms*, SkArenaAlloc*) const = 0; using INHERITED = SkShader; }; diff --git a/src/shaders/gradients/SkGradientShader.cpp b/src/shaders/gradients/SkGradientShader.cpp index dce7230335..993fde69da 100644 --- a/src/shaders/gradients/SkGradientShader.cpp +++ b/src/shaders/gradients/SkGradientShader.cpp @@ -424,7 +424,7 @@ skvm::Color SkGradientShaderBase::onProgram(skvm::Builder* p, skvm::Coord device, skvm::Coord local, skvm::Color /*paint*/, const SkMatrixProvider& mats, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dstInfo, + const SkColorInfo& dstInfo, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const { SkMatrix inv; if (!this->computeTotalInverse(mats.localToDevice(), localM, &inv)) { diff --git a/src/shaders/gradients/SkGradientShaderPriv.h b/src/shaders/gradients/SkGradientShaderPriv.h index ff59d47b4c..07bb261c44 100644 --- a/src/shaders/gradients/SkGradientShaderPriv.h +++ b/src/shaders/gradients/SkGradientShaderPriv.h @@ -80,8 +80,7 @@ protected: bool onAppendStages(const SkStageRec&) const override; skvm::Color onProgram(skvm::Builder*, skvm::Coord device, skvm::Coord local, skvm::Color paint, - const SkMatrixProvider&, const SkMatrix* localM, - SkFilterQuality quality, const SkColorInfo& dstCS, + const SkMatrixProvider&, const SkMatrix* localM, const SkColorInfo& dstCS, skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const override; virtual void appendGradientStages(SkArenaAlloc* alloc, SkRasterPipeline* tPipeline,