aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRasterPipeline.h
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-11-28 11:55:58 -0500
committerGravatar Mike Klein <mtklein@chromium.org>2016-11-28 17:28:02 +0000
commitb04c35214cf4c0e4cdfead28d31722d8da457bf9 (patch)
tree555b347574c46fde9302d7a076793f2282875307 /src/core/SkRasterPipeline.h
parent264431d9e2c4021baa2a5357b0c8c7773384d614 (diff)
Split srgb out of accum stages.
By stashing the scales in the context (i.e. on the stack), we can free up enough registers to really simplify how the bitmap sample stages interact. Nearest neighbor is straightforward now: just call the appropriate gather_ function, and you're done. The source pixels end up in the source registers. If they're sRGB encoded, follow up with from_srgb_s To bilerp, we bracket those 1 or 2 gather+from_srgb_s stages with a stage setting up each corner (x += dx, y += dy, save off scale) and a stage that accumulates into the d-registers (load saved scale, dr += scale * r, etc.). When all the samples are accumulated, copy the d-registers into the s-registers. from_srgb_d and to_srgb are lightly sketched here and will be used in the next CL, where I apply this same factoring to non-bitmap loads and stores. This is a little tricky, because we don't actually have a float->float to_srgb yet. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I272a1f278f0ea1b29a2f07ac225f753faa8dae81 Reviewed-on: https://skia-review.googlesource.com/5271 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkRasterPipeline.h')
-rw-r--r--src/core/SkRasterPipeline.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h
index daf4b78b42..0b49af59d1 100644
--- a/src/core/SkRasterPipeline.h
+++ b/src/core/SkRasterPipeline.h
@@ -59,6 +59,7 @@
M(move_src_dst) M(move_dst_src) M(swap_rb) \
M(clamp_0) M(clamp_a) M(clamp_1) \
M(unpremul) M(premul) \
+ M(from_srgb_s) M(from_srgb_d) M(to_srgb) \
M(constant_color) M(store_f32) \
M(load_s_565) M(load_d_565) M(store_565) \
M(load_s_srgb) M(load_d_srgb) M(store_srgb) \
@@ -79,13 +80,10 @@
M(color_lookup_table) M(lab_to_xyz) \
M(clamp_x) M(mirror_x) M(repeat_x) \
M(clamp_y) M(mirror_y) M(repeat_y) \
- M(accum_f16) M(accum_a8) \
- M(accum_g8) M(accum_g8_srgb) \
- M(accum_i8) M(accum_i8_srgb) \
- M(accum_565) M(accum_565_srgb) \
- M(accum_4444) M(accum_4444_srgb) \
- M(accum_8888) M(accum_8888_srgb) \
- M(top_left) M(top_right) M(bottom_left) M(bottom_right)
+ M(gather_a8) M(gather_g8) M(gather_i8) \
+ M(gather_565) M(gather_4444) M(gather_8888) M(gather_f16) \
+ M(top_left) M(top_right) M(bottom_left) M(bottom_right) \
+ M(accumulate)
class SkRasterPipeline {
public: