lowp impl for decal stages

Bug: skia:
Change-Id: If6481d202bf22a95f1dea0c5bf7d84698b63869a
Reviewed-on: https://skia-review.googlesource.com/109241
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Mike Reed 2018-02-21 16:37:51 -05:00 committed by Skia Commit-Bot
parent 2bafb796e5
commit 529cb2cd75
4 changed files with 8470 additions and 7119 deletions

View File

@ -244,8 +244,8 @@ extern "C" {
NOPE(lab_to_xyz)
TODO(mirror_x) TODO(repeat_x)
TODO(mirror_y) TODO(repeat_y)
TODO(decal_x) TODO(decal_y) TODO(decal_x_and_y)
TODO(check_decal_mask)
LOWP(decal_x) LOWP(decal_y) LOWP(decal_x_and_y)
LOWP(check_decal_mask)
TODO(bilinear_nx) TODO(bilinear_px) TODO(bilinear_ny) TODO(bilinear_py)
TODO(bicubic_n3x) TODO(bicubic_n1x) TODO(bicubic_p1x) TODO(bicubic_p3x)
TODO(bicubic_n3y) TODO(bicubic_n1y) TODO(bicubic_p1y) TODO(bicubic_p3y)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -809,6 +809,30 @@ STAGE_GG(mirror_x_1, Ctx::None) {
x = clamp_01(abs_( (x-1.0f) - two(floor_((x-1.0f)*0.5f)) - 1.0f ));
}
SI I16 cond_to_mask_16(I32 cond) { return cast<I16>(cond); }
STAGE_GG(decal_x, SkJumper_DecalTileCtx* ctx) {
auto w = ctx->limit_x;
unaligned_store(ctx->mask, cond_to_mask_16((0 <= x) & (x < w)));
}
STAGE_GG(decal_y, SkJumper_DecalTileCtx* ctx) {
auto h = ctx->limit_y;
unaligned_store(ctx->mask, cond_to_mask_16((0 <= y) & (y < h)));
}
STAGE_GG(decal_x_and_y, SkJumper_DecalTileCtx* ctx) {
auto w = ctx->limit_x;
auto h = ctx->limit_y;
unaligned_store(ctx->mask, cond_to_mask_16((0 <= x) & (x < w) & (0 <= y) & (y < h)));
}
STAGE_PP(check_decal_mask, SkJumper_DecalTileCtx* ctx) {
auto mask = unaligned_load<U16>(ctx->mask);
r = r & mask;
g = g & mask;
b = b & mask;
a = a & mask;
}
SI U16 round_F_to_U16(F x) { return cast<U16>(x * 255.0f + 0.5f); }
SI void gradient_lookup(const SkJumper_GradientCtx* c, U32 idx, F t,