Revert "Retry "SkRasterPipelineBlitter: support A8"..."

This reverts commit f55ea6a1de.

Reason for revert: crbug.com/679147

Original change's description:
> Retry "SkRasterPipelineBlitter: support A8"...
> 
>     ...preferring SkA8_Coverage_Blitter over SkRasterPipelineBlitter.
> 
> I think we could make this work with SkRasterPipelineBlitter (tell it, draw white in Src mode with this mask), but the existing blitter is pretty hard to beat in efficiency and correctness.
> 
> CQ_INCLUDE_TRYBOTS=skia.primary:Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
> 
> 
> Change-Id: I72df9995c63f3334d8111c59711818cb5ed1e63c
> Reviewed-on: https://skia-review.googlesource.com/6627
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> 

TBR=mtklein@chromium.org,brianosman@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I6a36b4c087a52e54f4d591ded40e6a202fb77068
Reviewed-on: https://skia-review.googlesource.com/6760
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Mike Klein 2017-01-07 22:04:51 +00:00 committed by Skia Commit-Bot
parent c3063e54cb
commit 86d55b312a
6 changed files with 6 additions and 32 deletions

View File

@ -34,11 +34,6 @@ public:
fPath.quadTo(250, 0, 0, 500);
fPixmap.alloc(SkImageInfo::MakeA8(500, 500));
if (!drawCoverage) {
// drawPathCoverage() goes out of its way to work fine with an uninitialized
// dst buffer, even in "SrcOver" mode, but ordinary drawing sure doesn't.
fPixmap.erase(0);
}
fIdentity.setIdentity();
fRC.setRect(fPath.getBounds().round());

View File

@ -857,12 +857,6 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device,
p->setColor(0);
}
if (kAlpha_8_SkColorType == device.colorType() && drawCoverage) {
SkASSERT(nullptr == shader);
SkASSERT(paint->isSrcOver());
return allocator->createT<SkA8_Coverage_Blitter>(device, *paint);
}
if (SkBlitter* blitter = SkCreateRasterPipelineBlitter(device, *paint, matrix, allocator)) {
return blitter;
}
@ -919,8 +913,11 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device,
SkBlitter* blitter = nullptr;
switch (device.colorType()) {
case kAlpha_8_SkColorType:
SkASSERT(!drawCoverage); // Handled above.
if (shader) {
if (drawCoverage) {
SkASSERT(nullptr == shader);
SkASSERT(paint->isSrcOver());
blitter = allocator->createT<SkA8_Coverage_Blitter>(device, *paint);
} else if (shader) {
blitter = allocator->createT<SkA8_Shader_Blitter>(device, *paint, shaderContext);
} else {
blitter = allocator->createT<SkA8_Blitter>(device, *paint);

View File

@ -65,7 +65,6 @@
M(from_srgb) M(to_srgb) \
M(from_2dot2) M(to_2dot2) \
M(constant_color) M(store_f32) \
M(load_a8) M(store_a8) \
M(load_565) M(store_565) \
M(load_f16) M(store_f16) \
M(load_8888) M(store_8888) \

View File

@ -79,10 +79,9 @@ SkBlitter* SkCreateRasterPipelineBlitter(const SkPixmap& dst,
static bool supported(const SkImageInfo& info) {
switch (info.colorType()) {
case kAlpha_8_SkColorType: return true;
case kRGB_565_SkColorType: return true;
case kN32_SkColorType: return info.gammaCloseToSRGB();
case kRGBA_F16_SkColorType: return true;
case kRGB_565_SkColorType: return true;
default: return false;
}
}
@ -189,7 +188,6 @@ void SkRasterPipelineBlitter::append_load_d(SkRasterPipeline* p) const {
p->append(SkRasterPipeline::move_src_dst);
switch (fDst.info().colorType()) {
case kAlpha_8_SkColorType: p->append(SkRasterPipeline::load_a8, &fDstPtr); break;
case kRGB_565_SkColorType: p->append(SkRasterPipeline::load_565, &fDstPtr); break;
case kBGRA_8888_SkColorType:
case kRGBA_8888_SkColorType: p->append(SkRasterPipeline::load_8888, &fDstPtr); break;
@ -215,7 +213,6 @@ void SkRasterPipelineBlitter::append_store(SkRasterPipeline* p) const {
SkASSERT(supported(fDst.info()));
switch (fDst.info().colorType()) {
case kAlpha_8_SkColorType: p->append(SkRasterPipeline::store_a8, &fDstPtr); break;
case kRGB_565_SkColorType: p->append(SkRasterPipeline::store_565, &fDstPtr); break;
case kBGRA_8888_SkColorType:
case kRGBA_8888_SkColorType: p->append(SkRasterPipeline::store_8888, &fDstPtr); break;

View File

@ -650,10 +650,6 @@ public:
hi = _mm256_extractf128_si256(src.fVec, 1);
return _mm_packus_epi32(lo, hi);
}
template<> AI /*static*/ Sk8b SkNx_cast<uint8_t>(const Sk8i& src) {
auto _16 = SkNx_cast<uint16_t>(src);
return _mm_packus_epi16(_16.fVec, _16.fVec);
}
#endif

View File

@ -497,16 +497,6 @@ STAGE_CTX(lerp_565, const uint16_t**) {
a = 1.0f;
}
STAGE_CTX(load_a8, const uint8_t**) {
auto ptr = *ctx + x;
r = g = b = 0.0f;
a = SkNf_from_byte(load(tail, ptr));
}
STAGE_CTX(store_a8, uint8_t**) {
auto ptr = *ctx + x;
store(tail, SkNx_cast<uint8_t>(SkNf_round(255.0f, a)), ptr);
}
STAGE_CTX(load_565, const uint16_t**) {
auto ptr = *ctx + x;
from_565(load(tail, ptr), &r,&g,&b);