Make consistent isRadiusIncreasing decision

This should not affect anything for now. But it may prevent some future
problems where someone accidentally changed isRadiusIncreasing implementation,
and getting confused by the unexpected shading behavior.

Bug: skia:
Change-Id: I45e83f4bc9eefbdc1ad1c196a43444e24c782711
Reviewed-on: https://skia-review.googlesource.com/115162
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
This commit is contained in:
Yuqian Li 2018-03-19 16:43:32 -04:00 committed by Skia Commit-Bot
parent 3b68882918
commit ec46871a0c

View File

@ -239,7 +239,7 @@ protected:
const char* p = coords2D.c_str();
if (effect.getType() == Type::kRadial) {
char sign = effect.diffRadius() < 0 ? '-' : '+';
char sign = effect.isRadiusIncreasing() ? '+' : '-';
fragBuilder->codeAppendf("half %s = %clength(%s) - %s;", tName, sign, p, p0.c_str());
} else {
// output will default to transparent black (we simply won't write anything