Refactor explicit inverse calculation in SkImageShader::onAppendStages()

We have SkShaderBase::computeTotalInverse() which does exactly that.

Change-Id: I77695f9261d700c3ac25fe94250b798e6edfc25d
Reviewed-on: https://skia-review.googlesource.com/105000
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Florin Malita 2018-02-07 10:05:53 -05:00 committed by Skia Commit-Bot
parent a4ead65e2c
commit 7558e4dbec

View File

@ -282,12 +282,8 @@ bool SkImageShader::onAppendStages(const StageRec& rec) const {
SkRasterPipeline* p = rec.fPipeline;
SkArenaAlloc* alloc = rec.fAlloc;
auto matrix = SkMatrix::Concat(rec.fCTM, this->getLocalMatrix());
if (rec.fLocalM) {
matrix.preConcat(*rec.fLocalM);
}
if (!matrix.invert(&matrix)) {
SkMatrix matrix;
if (!this->computeTotalInverse(rec.fCTM, rec.fLocalM, &matrix)) {
return false;
}
auto quality = rec.fPaint.getFilterQuality();