add srcover_bgra_8888
Chrome generally uses BGRA buffers, so srcover_rgba_8888 isn't really
doing them any good. Probably a good idea to cover both kN32 options
any time we specialize like this?
There's one small diff, so I've lazily guarded this by
SK_LEGACY_LOWP_STAGES, which I want to rebaseline today anyway.
Change-Id: Ice672aa01a3fc83be0798580d6730a54df075478
Reviewed-on: https://skia-review.googlesource.com/63301
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/src/core/SkRasterPipelineBlitter.cpp b/src/core/SkRasterPipelineBlitter.cpp
index b0ee301..d2eb099 100644
--- a/src/core/SkRasterPipelineBlitter.cpp
+++ b/src/core/SkRasterPipelineBlitter.cpp
@@ -305,6 +305,7 @@
if (!fBlitRect) {
SkRasterPipeline p(fAlloc);
p.extend(fColorPipeline);
+ #if defined(SK_LEGACY_LOWP_STAGES)
if (fBlend == SkBlendMode::kSrcOver
&& fDst.info().colorType() == kRGBA_8888_SkColorType
&& !fDst.colorSpace()
@@ -312,6 +313,19 @@
&& fDitherRate == 0.0f) {
p.clamp_if_unclamped(kPremul_SkAlphaType);
p.append(SkRasterPipeline::srcover_rgba_8888, &fDstPtr);
+ #else
+ if (fBlend == SkBlendMode::kSrcOver
+ && (fDst.info().colorType() == kRGBA_8888_SkColorType ||
+ fDst.info().colorType() == kBGRA_8888_SkColorType)
+ && !fDst.colorSpace()
+ && fDst.info().alphaType() != kUnpremul_SkAlphaType
+ && fDitherRate == 0.0f) {
+ p.clamp_if_unclamped(kPremul_SkAlphaType);
+ auto stage = fDst.info().colorType() == kRGBA_8888_SkColorType
+ ? SkRasterPipeline::srcover_rgba_8888
+ : SkRasterPipeline::srcover_bgra_8888;
+ p.append(stage, &fDstPtr);
+ #endif
} else {
if (fBlend != SkBlendMode::kSrc) {
this->append_load_dst(&p);