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:
parent
7fd83ebd39
commit
3b6ee00686
@ -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);
|
||||
};
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user