diff options
author | Mike Klein <mtklein@chromium.org> | 2017-06-27 19:53:21 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-28 17:41:56 +0000 |
commit | c2d207603edbbd3809d5144fe4a048a2ad774910 (patch) | |
tree | 085c3b6856acffa6f2a1f88616517c3186046a73 /src/core/SkXfermode.cpp | |
parent | e5cb7c9a5eb3d4d848a0adb50502382be14d193d (diff) |
clean up low-hanging swap_rb
There are two remaining swap_rb uses that both look non-trivial to
replace:
- sampling out of index8 when the color table is bgra
- table transforms on bgra inputs in SkColorSpaceXform
I don't think it's a big deal to just leave swap_rb around,
just a little sad.
Change-Id: I3d30200cf867cbf37d6f86572b1574d3e22e3490
Reviewed-on: https://skia-review.googlesource.com/21040
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkXfermode.cpp')
-rw-r--r-- | src/core/SkXfermode.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp index 54ac5891a3..e96d2f4abf 100644 --- a/src/core/SkXfermode.cpp +++ b/src/core/SkXfermode.cpp @@ -34,19 +34,14 @@ public: const SkAlpha aa[]) const override { SkASSERT(dst && src && count >= 0); - bool needs_swap = (kN32_SkColorType == kBGRA_8888_SkColorType) && - SkBlendMode_CaresAboutRBOrder(fMode); - SkRasterPipeline_<256> p; - p.append(SkRasterPipeline::load_8888, &dst); - if (needs_swap) { - p.append(SkRasterPipeline::swap_rb); - } - p.append(SkRasterPipeline::move_src_dst); - p.append(SkRasterPipeline::load_8888, &src); - if (needs_swap) { - p.append(SkRasterPipeline::swap_rb); + if (kN32_SkColorType == kBGRA_8888_SkColorType) { + p.append(SkRasterPipeline::load_bgra_dst, &dst); + p.append(SkRasterPipeline::load_bgra , &src); + } else { + p.append(SkRasterPipeline::load_8888_dst, &dst); + p.append(SkRasterPipeline::load_8888, &src); } SkBlendMode_AppendStagesNoClamp(fMode, &p); @@ -55,10 +50,11 @@ public: } SkBlendMode_AppendClampIfNeeded(fMode, &p); - if (needs_swap) { - p.append(SkRasterPipeline::swap_rb); + if (kN32_SkColorType == kBGRA_8888_SkColorType) { + p.append(SkRasterPipeline::store_bgra, &dst); + } else { + p.append(SkRasterPipeline::store_8888, &dst); } - p.append(SkRasterPipeline::store_8888, &dst); p.run(0, 0, count); } |