aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts
diff options
context:
space:
mode:
Diffstat (limited to 'src/opts')
-rw-r--r--src/opts/SkRasterPipeline_opts.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h
index 0a7441b304..07f1e5ab1c 100644
--- a/src/opts/SkRasterPipeline_opts.h
+++ b/src/opts/SkRasterPipeline_opts.h
@@ -704,20 +704,6 @@ STAGE_CTX(load_tables_rgb_u16_be, const LoadTablesContext*) {
a = 1.0f;
}
-STAGE_CTX(store_tables, const StoreTablesContext*) {
- auto ptr = ctx->fDst + x;
-
- float scale = ctx->fCount - 1;
- SkNi ri = SkNf_round(scale, r);
- SkNi gi = SkNf_round(scale, g);
- SkNi bi = SkNf_round(scale, b);
-
- store(tail, ( SkNx_cast<int>(gather(tail, ctx->fR, ri)) << 0
- | SkNx_cast<int>(gather(tail, ctx->fG, gi)) << 8
- | SkNx_cast<int>(gather(tail, ctx->fB, bi)) << 16
- | SkNf_round(255.0f, a) << 24), (int*)ptr);
-}
-
SI SkNf inv(const SkNf& x) { return 1.0f - x; }
RGBA_XFERMODE(clear) { return 0.0f; }
@@ -1145,6 +1131,16 @@ STAGE_CTX(byte_tables, const void*) {
a = SkNf_from_byte(gather(tail, tables->a, SkNf_round(255.0f, a)));
}
+STAGE_CTX(byte_tables_rgb, const void*) {
+ struct Tables { const uint8_t *r, *g, *b; int n; };
+ auto tables = (const Tables*)ctx;
+
+ float scale = tables->n - 1;
+ r = SkNf_from_byte(gather(tail, tables->r, SkNf_round(scale, r)));
+ g = SkNf_from_byte(gather(tail, tables->g, SkNf_round(scale, g)));
+ b = SkNf_from_byte(gather(tail, tables->b, SkNf_round(scale, b)));
+}
+
STAGE_CTX(shader_adapter, SkShader::Context*) {
SkPM4f buf[N];
static_assert(sizeof(buf) == sizeof(r) + sizeof(g) + sizeof(b) + sizeof(a), "");