Fix bug in filterSpan4f - read the source, rather than the dest
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2091793003 Review-Url: https://codereview.chromium.org/2091793003
This commit is contained in:
parent
9834696ed8
commit
ff723af8b6
@ -37,19 +37,20 @@ sk_sp<GrFragmentProcessor> SkColorFilter::asFragmentProcessor(GrContext*) const
|
||||
}
|
||||
#endif
|
||||
|
||||
void SkColorFilter::filterSpan4f(const SkPM4f[], int count, SkPM4f span[]) const {
|
||||
void SkColorFilter::filterSpan4f(const SkPM4f src[], int count, SkPM4f result[]) const {
|
||||
const int N = 128;
|
||||
SkPMColor tmp[N];
|
||||
while (count > 0) {
|
||||
int n = SkTMin(count, N);
|
||||
for (int i = 0; i < n; ++i) {
|
||||
SkNx_cast<uint8_t>(Sk4f::Load(span[i].fVec) * Sk4f(255) + Sk4f(0.5f)).store(&tmp[i]);
|
||||
SkNx_cast<uint8_t>(Sk4f::Load(src[i].fVec) * Sk4f(255) + Sk4f(0.5f)).store(&tmp[i]);
|
||||
}
|
||||
this->filterSpan(tmp, n, tmp);
|
||||
for (int i = 0; i < n; ++i) {
|
||||
span[i] = SkPM4f::FromPMColor(tmp[i]);
|
||||
result[i] = SkPM4f::FromPMColor(tmp[i]);
|
||||
}
|
||||
span += n;
|
||||
src += n;
|
||||
result += n;
|
||||
count -= n;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user