disable 32A->565 + alpha for now, until it handles src-alpha==0 as a noop

git-svn-id: http://skia.googlecode.com/svn/trunk@525 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@android.com 2010-03-09 15:21:28 +00:00
parent 1db89dc9a5
commit 8e4c93b04c
3 changed files with 16 additions and 36 deletions

View File

@ -63,27 +63,16 @@ static void S32A_D565_Blend(uint16_t* SK_RESTRICT dst,
SkASSERT(255 > alpha);
if (count > 0) {
int src_scale = SkAlpha255To256(alpha);
do {
SkPMColor sc = *src++;
SkPMColorAssert(sc);
if (sc)
{
if (sc) {
uint16_t dc = *dst;
unsigned sa = SkGetPackedA32(sc);
unsigned dr, dg, db;
if (sa == 255) {
dr = SkAlphaBlend(SkPacked32ToR16(sc), SkGetPackedR16(dc), src_scale);
dg = SkAlphaBlend(SkPacked32ToG16(sc), SkGetPackedG16(dc), src_scale);
db = SkAlphaBlend(SkPacked32ToB16(sc), SkGetPackedB16(dc), src_scale);
} else {
unsigned dst_scale = 255 - SkAlphaMul(sa, src_scale);
dr = (SkPacked32ToR16(sc) * src_scale + SkGetPackedR16(dc) * dst_scale) >> 8;
dg = (SkPacked32ToG16(sc) * src_scale + SkGetPackedG16(dc) * dst_scale) >> 8;
db = (SkPacked32ToB16(sc) * src_scale + SkGetPackedB16(dc) * dst_scale) >> 8;
}
*dst = SkPackRGB16(dr, dg, db);
unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
unsigned dr = SkMulS16(SkPacked32ToR16(sc), alpha) + SkMulS16(SkGetPackedR16(dc), dst_scale);
unsigned dg = SkMulS16(SkPacked32ToG16(sc), alpha) + SkMulS16(SkGetPackedG16(dc), dst_scale);
unsigned db = SkMulS16(SkPacked32ToB16(sc), alpha) + SkMulS16(SkGetPackedB16(dc), dst_scale);
*dst = SkPackRGB16(SkDiv255Round(dr), SkDiv255Round(dg), SkDiv255Round(db));
}
dst += 1;
} while (--count != 0);

View File

@ -281,23 +281,13 @@ static void S32A_D565_Blend_neon(uint16_t* SK_RESTRICT dst,
if (count > 0) {
do {
SkPMColor sc = *src++;
if (sc)
{
if (sc) {
uint16_t dc = *dst;
unsigned sa = SkGetPackedA32(sc);
unsigned dr, dg, db;
if (sa == 255) {
dr = SkAlphaBlend(SkPacked32ToR16(sc), SkGetPackedR16(dc), alpha);
dg = SkAlphaBlend(SkPacked32ToG16(sc), SkGetPackedG16(dc), alpha);
db = SkAlphaBlend(SkPacked32ToB16(sc), SkGetPackedB16(dc), alpha);
} else {
unsigned dst_scale = 255 - SkAlphaMul(sa, alpha);
dr = (SkPacked32ToR16(sc) * alpha + SkGetPackedR16(dc) * dst_scale) >> 8;
dg = (SkPacked32ToG16(sc) * alpha + SkGetPackedG16(dc) * dst_scale) >> 8;
db = (SkPacked32ToB16(sc) * alpha + SkGetPackedB16(dc) * dst_scale) >> 8;
}
*dst = SkPackRGB16(dr, dg, db);
unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
unsigned dr = SkMulS16(SkPacked32ToR16(sc), alpha) + SkMulS16(SkGetPackedR16(dc), dst_scale);
unsigned dg = SkMulS16(SkPacked32ToG16(sc), alpha) + SkMulS16(SkGetPackedG16(dc), dst_scale);
unsigned db = SkMulS16(SkPacked32ToB16(sc), alpha) + SkMulS16(SkGetPackedB16(dc), dst_scale);
*dst = SkPackRGB16(SkDiv255Round(dr), SkDiv255Round(dg), SkDiv255Round(db));
}
dst += 1;
} while (--count != 0);
@ -988,7 +978,8 @@ static const SkBlitRow::Proc platform_565_procs[] = {
S32_D565_Opaque_PROC,
S32_D565_Blend_PROC,
S32A_D565_Opaque_PROC,
S32A_D565_Blend_PROC,
// fails to treat src==0 as a no-op. see BlitRowTest.cpp
NULL, // S32A_D565_Blend_PROC,
// dither
S32_D565_Opaque_Dither_PROC,

View File

@ -100,7 +100,7 @@ static void TestBlitRow(skiatest::Reporter* reporter) {
static const SkBitmap::Config gDstConfig[] = {
SkBitmap::kARGB_8888_Config,
SkBitmap::kRGB_565_Config,
SkBitmap::kARGB_4444_Config,
// SkBitmap::kARGB_4444_Config,
// SkBitmap::kA8_Config,
};
@ -140,7 +140,7 @@ static void TestBlitRow(skiatest::Reporter* reporter) {
if (gSrcRec[j].fSrc != 0 && blend) {
// can't make a numerical promise about blending anything
// but 0
continue;
// continue;
}
paint.setDither(dither);
paint.setAlpha(blend ? 0x80 : 0xFF);