re-enable SSE2 blitmask procs, only excluding if we're black (in which case

the protable version is still faster)



git-svn-id: http://skia.googlecode.com/svn/trunk@1819 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-07-07 19:12:50 +00:00
Родитель 5b69ddafa4
Коммит e6ea606fb9
3 изменённых файлов: 10 добавлений и 27 удалений

Просмотреть файл

@ -230,7 +230,6 @@ static void D32_Mask_Black(void* dst, size_t dstRB, SkBitmap::Config,
SkBlitMask::Proc SkBlitMask::Factory(SkBitmap::Config config, SkColor color) {
SkBlitMask::Proc proc = PlatformProcs(config, color);
proc = NULL;
if (NULL == proc) {
switch (config) {
case SkBitmap::kARGB_8888_Config:

Просмотреть файл

@ -409,26 +409,11 @@ void SkARGB32_Black_Blitter::blitMask(const SkMask& mask, const SkIRect& clip) {
} else if (SkMask::kLCD32_Format == mask.fFormat) {
blitmask_lcd32(fDevice, mask, clip, fPMColor);
} else {
unsigned width = clip.width();
unsigned height = clip.height();
SkASSERT((int)height > 0);
SkASSERT((int)width > 0);
uint32_t* device = fDevice.getAddr32(clip.fLeft, clip.fTop);
unsigned maskRB = mask.fRowBytes - width;
unsigned deviceRB = fDevice.rowBytes() - (width << 2);
const uint8_t* alpha = mask.getAddr(clip.fLeft, clip.fTop);
do {
unsigned w = width;
do {
unsigned aa = *alpha++;
*device = (aa << SK_A32_SHIFT) + SkAlphaMulQ(*device, SkAlpha255To256(255 - aa));
device += 1;
} while (--w != 0);
device = (uint32_t*)((char*)device + deviceRB);
alpha += maskRB;
} while (--height != 0);
fBlitMaskProc(fDevice.getAddr32(clip.fLeft, clip.fTop),
fDevice.rowBytes(),
SkBitmap::kARGB_8888_Config,
mask.getAddr(clip.fLeft, clip.fTop), mask.fRowBytes,
0xFF000000, clip.width(), clip.height());
}
}

Просмотреть файл

@ -107,17 +107,16 @@ SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) {
SkBlitMask::Proc SkBlitMask::PlatformProcs(SkBitmap::Config dstConfig,
SkColor color)
{
SkColor color) {
SkBlitMask::Proc proc = NULL;
if (hasSSE2()) {
switch (dstConfig) {
case SkBitmap::kARGB_8888_Config:
// TODO: is our current SSE2 faster than the portable, even in
// the case of black or opaque? If so, no need for this check.
if ( SK_ColorBLACK != color && 0xFF != SkColorGetA(color))
// The SSE2 version is not (yet) faster for black, so we check
// for that.
if (SK_ColorBLACK != color) {
proc = SkARGB32_BlitMask_SSE2;
}
break;
default:
break;