remove unused uniforms from update

Change-Id: Icc2cbce4080e9d5a76ea040982279d63fe198f69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/434160
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2021-07-28 15:56:35 -04:00 committed by SkCQ
parent 7fd83ebd39
commit 3b6ee00686
5 changed files with 6 additions and 14 deletions

View File

@ -327,13 +327,10 @@ void SkDraw::drawFixedVertices(const SkVertices* vertices, SkBlendMode blendMode
shaderPaint.setShader(sk_ref_sp(texCoordShader));
if (auto blitter = SkVMBlitter::Make(
fDst, shaderPaint, *fMatrixProvider, outerAlloc, this->fRC->clipShader())) {
auto updater = [&](skvm::Uniforms* uniforms) {
SkMatrix localM;
return texture_to_matrix(state, positions, texCoords, &localM) &&
texCoordShader->update(SkMatrix::Concat(ctm, localM), uniforms);
};
SkMatrix localM;
while (vertProc(&state)) {
if (blitter->updateUniforms(updater)) {
if (texture_to_matrix(state, positions, texCoords, &localM) &&
texCoordShader->update(SkMatrix::Concat(ctm, localM))) {
fill_triangle(state, blitter, *fRC, dev2, dev3);
}
}

View File

@ -36,11 +36,6 @@ public:
~SkVMBlitter() override;
template<typename Updater>
bool updateUniforms(Updater updater) {
return updater(&fUniforms);
}
private:
enum class Coverage { Full, UniformF, MaskA8, MaskLCD16, Mask3D };
struct Key {

View File

@ -266,7 +266,7 @@ private:
class SkUpdatableShader : public SkShaderBase {
public:
virtual bool update(const SkMatrix& ctm, skvm::Uniforms* u) const = 0;
virtual bool update(const SkMatrix& ctm) const = 0;
};
inline SkShaderBase* as_SB(SkShader* shader) {

View File

@ -46,7 +46,7 @@ skvm::Coord SkTransformShader::applyMatrix(
return {x, y};
}
bool SkTransformShader::update(const SkMatrix& ctm, skvm::Uniforms* u) const {
bool SkTransformShader::update(const SkMatrix& ctm) const {
SkMatrix matrix;
if (this->computeTotalInverse(ctm, nullptr, &matrix)) {
for (int i = 0; i < 9; ++i) {

View File

@ -32,7 +32,7 @@ public:
skvm::Uniforms* uniforms) const;
// Change the values represented by the uniforms in fMatrix.
bool update(const SkMatrix& ctm, skvm::Uniforms* u) const override;
bool update(const SkMatrix& ctm) const override;
bool onAppendStages(const SkStageRec& rec) const override;
private: