remove min from repeat and mirror generally

I don't think they do anything anymore after the inclusive/exclusive
refactoring.

Change-Id: I63f2e010a00953b5b6415de002bcb51ec2b73458
Reviewed-on: https://skia-review.googlesource.com/17490
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
This commit is contained in:
Mike Klein 2017-05-23 08:07:43 -04:00 committed by Skia Commit-Bot
parent 9f85d68887
commit 8ca3356290
3 changed files with 2816 additions and 2859 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -994,16 +994,13 @@ STAGE(store_f32) {
}
SI F clamp(F v, float limit) {
v = max(0, v);
return min(v, limit);
return min(max(0, v), limit);
}
SI F repeat(F v, float limit) {
v = v - floor_(v/limit)*limit;
return min(v, limit);
return v - floor_(v/limit)*limit;
}
SI F mirror(F v, float limit) {
v = abs_( (v-limit) - (limit+limit)*floor_((v-limit)/(limit+limit)) - limit );
return min(v, limit);
return abs_( (v-limit) - (limit+limit)*floor_((v-limit)/(limit+limit)) - limit );
}
STAGE(clamp_x) { r = clamp (r, *(const float*)ctx); }
STAGE(clamp_y) { g = clamp (g, *(const float*)ctx); }
@ -1012,8 +1009,8 @@ STAGE(repeat_y) { g = repeat(g, *(const float*)ctx); }
STAGE(mirror_x) { r = mirror(r, *(const float*)ctx); }
STAGE(mirror_y) { g = mirror(g, *(const float*)ctx); }
STAGE( clamp_x_1) { r = min(max(0, r), 1); }
STAGE(repeat_x_1) { r = r - floor_(r); }
STAGE( clamp_x_1) { r = clamp (r, 1.0f); }
STAGE(repeat_x_1) { r = repeat(r, 1.0f); }
STAGE(mirror_x_1) { r = abs_( (r-1.0f) - two(floor_((r-1.0f)*0.5f)) - 1.0f ); }
STAGE(luminance_to_alpha) {