support a8

Most of this is plumbing through the full paint to shaders instead of just the filter quality.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I6afde07566afa3a4391c24dca7017a9a4f5ec700
Reviewed-on: https://skia-review.googlesource.com/5317
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h
index 88a872c..a40fe6c 100644
--- a/src/opts/SkRasterPipeline_opts.h
+++ b/src/opts/SkRasterPipeline_opts.h
@@ -288,6 +288,13 @@
     b *= a;
 }
 
+STAGE(set_rgb) {
+    auto rgb = (const float*)ctx;
+    r = rgb[0];
+    g = rgb[1];
+    b = rgb[2];
+}
+
 STAGE(move_src_dst) {
     dr = r;
     dg = g;
@@ -777,7 +784,13 @@
     return offset;
 }
 
-STAGE(gather_a8) {}  // TODO
+STAGE(gather_a8) {
+    const uint8_t* p;
+    SkNi offset = offset_and_ptr(&p, ctx, r, g);
+
+    r = g = b = 0.0f;
+    a = SkNx_cast<float>(gather(tail, p, offset)) * (1/255.0f);
+}
 STAGE(gather_i8) {
     auto sc = (const SkImageShaderContext*)ctx;
     const uint8_t* p;