Leverage readPixels to simplify PDF bitmap output
Leverage readPixels to simplify PDF bitmap output

This keeps the special handling for Alpha8 and Gray8. All other formats
are converted to 8888. To make everything simpler, we always convert to
kBGRA, so we can just use SkColor macros to get the components.

This maintains the neighbor-averaging for fully transparent pixels, but
the implementation is slightly different. Before, we averaged RGB and A
while the pixels were premul, then unpremultiplied. Now, we pre-convert
everything to unpremul, then just average RGB over the (not fully
transparent) neighbors.

Bug: skia:
Change-Id: Ib5a0d8536e2507952a44365347518b2d57d07549
Reviewed-on: https://skia-review.googlesource.com/c/167660
Commit-Queue: Brian Osman <794c0b5534edf5601d88e1d41975d0262da12894@google.com>
Reviewed-by: Mike Klein <14574f09dfa9b4e14759b88c3426a495a0e627b0@google.com>

rubenvb/skia,rubenvb/skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,rubenvb/skia,google/skia,HalCanary/skia-hc,rubenvb/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,rubenvb/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,google/skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,google/skia,rubenvb/skia,google/skia,google/skia,Hikari-no-Tenshi/android_external_skia