Bug 761201 - Trigger Skia's RGB565 blitter fast path by using SrcOver instead of Src. r=jrmuizel

This commit is contained in:
George Wright 2012-05-31 14:56:33 -04:00
Родитель 155a08f022
Коммит 6d009115f5
1 изменённых файлов: 11 добавлений и 1 удалений

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

@ -630,7 +630,17 @@ DrawTargetSkia::CopySurface(SourceSurface *aSurface,
SkIRect source = IntRectToSkIRect(aSourceRect);
mCanvas->clipRect(dest, SkRegion::kReplace_Op);
SkPaint paint;
paint.setXfermodeMode(GfxOpToSkiaOp(OP_SOURCE));
if (mBitmap.config() == SkBitmap::kRGB_565_Config &&
mCanvas->getDevice()->config() == SkBitmap::kRGB_565_Config) {
// Set the xfermode to SOURCE_OVER to workaround
// http://code.google.com/p/skia/issues/detail?id=628
// RGB565 is opaque so they're equivalent anyway
paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
} else {
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
}
mCanvas->drawBitmapRect(bitmap, &source, dest, &paint);
mCanvas->restore();
}