jumper, u16_be load_tables stages

Change-Id: I738da1dac2ef5b74ef34cca14938c0b6cce2fe16
Reviewed-on: https://skia-review.googlesource.com/13596
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Mike Klein 2017-04-17 13:19:05 -04:00 committed by Skia Commit-Bot
parent 249b8e3a2b
commit a3735cd34b
5 changed files with 2387 additions and 483 deletions

View File

@ -88,6 +88,8 @@ static K kConstants = {
M(lerp_u8) \
M(lerp_565) \
M(load_tables) \
M(load_tables_u16_be) \
M(load_tables_rgb_u16_be) \
M(byte_tables) \
M(byte_tables_rgb) \
M(load_a8) \

View File

@ -86,4 +86,9 @@ struct SkJumper_CallbackCtx {
void* arg;
};
struct SkJumper_LoadTablesCtx {
const void* src;
const float *r, *g, *b;
};
#endif//SkJumper_DEFINED

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -608,18 +608,40 @@ STAGE(lerp_565) {
}
STAGE(load_tables) {
struct Ctx {
const uint32_t* src;
const float *r, *g, *b;
};
auto c = (const Ctx*)ctx;
auto c = (const SkJumper_LoadTablesCtx*)ctx;
auto px = load<U32>(c->src + x, tail);
auto px = load<U32>((const uint32_t*)c->src + x, tail);
r = gather(c->r, (px ) & 0xff_i);
g = gather(c->g, (px >> 8) & 0xff_i);
b = gather(c->b, (px >> 16) & 0xff_i);
a = cast( (px >> 24)) * C(1/255.0f);
}
STAGE(load_tables_u16_be) {
auto c = (const SkJumper_LoadTablesCtx*)ctx;
auto ptr = (const uint16_t*)c->src + 4*x;
U16 R,G,B,A;
load4(ptr, tail, &R,&G,&B,&A);
// c->src is big-endian, so & 0xff_i grabs the 8 most signficant bits.
r = gather(c->r, expand(R) & 0xff_i);
g = gather(c->g, expand(G) & 0xff_i);
b = gather(c->b, expand(B) & 0xff_i);
a = C(1/65535.0f) * cast(expand(bswap(A)));
}
STAGE(load_tables_rgb_u16_be) {
auto c = (const SkJumper_LoadTablesCtx*)ctx;
auto ptr = (const uint16_t*)c->src + 3*x;
U16 R,G,B;
load3(ptr, tail, &R,&G,&B);
// c->src is big-endian, so & 0xff_i grabs the 8 most signficant bits.
r = gather(c->r, expand(R) & 0xff_i);
g = gather(c->g, expand(G) & 0xff_i);
b = gather(c->b, expand(B) & 0xff_i);
a = 1.0_f;
}
STAGE(byte_tables) {
struct Tables { const uint8_t *r, *g, *b, *a; };