aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-06-26 11:43:06 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-26 19:02:52 +0000
commit3785471ff641b7ec4218a32fcf76363b9ac81bab (patch)
tree7596487528841f9a6e32c105c909667c54799d72 /src/opts
parent9b6125d046198bff736a509769b51908aaff326a (diff)
basic first pass at RGBA F32 support
Draws basically the same as f16. The existing load_f32, load_f32_dst, and store_f32 stages all had the same bug that we'd never noticed because dy was always 0 until now. Change-Id: Ibbd393fa1acc5df414be4cdef0f5a9d11dcccdb3 Reviewed-on: https://skia-review.googlesource.com/137585 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/opts')
-rw-r--r--src/opts/SkRasterPipeline_opts.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h
index fac5d1b93b..2431ad78f9 100644
--- a/src/opts/SkRasterPipeline_opts.h
+++ b/src/opts/SkRasterPipeline_opts.h
@@ -1712,15 +1712,23 @@ STAGE(store_u16_be, const SkJumper_MemoryCtx* ctx) {
}
STAGE(load_f32, const SkJumper_MemoryCtx* ctx) {
- auto ptr = ptr_at_xy<const float>(ctx, 4*dx,dy);
+ auto ptr = ptr_at_xy<const float>(ctx, 4*dx,4*dy);
load4(ptr,tail, &r,&g,&b,&a);
}
STAGE(load_f32_dst, const SkJumper_MemoryCtx* ctx) {
- auto ptr = ptr_at_xy<const float>(ctx, 4*dx,dy);
+ auto ptr = ptr_at_xy<const float>(ctx, 4*dx,4*dy);
load4(ptr,tail, &dr,&dg,&db,&da);
}
+STAGE(gather_f32, const SkJumper_GatherCtx* ctx) {
+ const float* ptr;
+ U32 ix = ix_and_ptr(&ptr, ctx, r,g);
+ r = gather(ptr, 4*ix + 0);
+ g = gather(ptr, 4*ix + 1);
+ b = gather(ptr, 4*ix + 2);
+ a = gather(ptr, 4*ix + 3);
+}
STAGE(store_f32, const SkJumper_MemoryCtx* ctx) {
- auto ptr = ptr_at_xy<float>(ctx, 4*dx,dy);
+ auto ptr = ptr_at_xy<float>(ctx, 4*dx,4*dy);
store4(ptr,tail, r,g,b,a);
}