diff options
author | Leon Scroggins III <scroggo@google.com> | 2017-05-23 16:58:09 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-24 12:05:11 +0000 |
commit | eceee040d69a2dd07c58c67c0a18b55f088cd35d (patch) | |
tree | 0e563fcfdc59fda2d5def4408baf3f7fded8a225 | |
parent | 76f70622cfe06c2a805d4ff7d1f539e702ec4e46 (diff) |
Premultiply in DM before drawing unpremul f16
We special case N32, but need to also handle f16
Change-Id: I0d6061d55e55c5952c740255e4600366d8d77919
Reviewed-on: https://skia-review.googlesource.com/17786
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
-rw-r--r-- | dm/DMSrcSink.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index 8979d2d285..643a1a48d0 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -326,6 +326,16 @@ static void premultiply_if_necessary(SkBitmap& bitmap) { } switch (bitmap.colorType()) { + case kRGBA_F16_SkColorType: + for (int y = 0; y < bitmap.height(); y++) { + void* row = bitmap.getAddr(0, y); + SkRasterPipeline p; + p.append(SkRasterPipeline::load_f16, &row); + p.append(SkRasterPipeline::premul); + p.append(SkRasterPipeline::store_f16, &row); + p.run(0, bitmap.width()); + } + break; case kN32_SkColorType: for (int y = 0; y < bitmap.height(); y++) { uint32_t* row = (uint32_t*) bitmap.getAddr(0, y); |