Bug 1011062. Add a fast path to DrawTargetSkia::MaskSurface(). r=gw280

This should speed things up significantly by avoid a bunch
of unneeded work.

--HG--
extra : rebase_source : 1194a825a5a9e5e86a94ba6c6c67f959051f1da3
This commit is contained in:
Jeff Muizelaar 2014-05-16 21:31:43 -04:00
Родитель 1ed34d5233
Коммит 7db7c28ba4
1 изменённых файлов: 17 добавлений и 12 удалений

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

@ -552,6 +552,10 @@ DrawTargetSkia::MaskSurface(const Pattern &aSource,
MarkChanged();
AutoPaintSetup paint(mCanvas.get(), aOptions, aSource);
TempBitmap bitmap = GetBitmapForSurface(aMask);
if (bitmap.mBitmap.colorType() == kAlpha_8_SkColorType) {
mCanvas->drawBitmap(bitmap.mBitmap, aOffset.x, aOffset.y, &paint.mPaint);
} else {
SkPaint maskPaint;
TempBitmap tmpBitmap;
SetPaintPattern(maskPaint, SurfacePattern(aMask, ExtendMode::CLAMP), tmpBitmap);
@ -568,6 +572,7 @@ DrawTargetSkia::MaskSurface(const Pattern &aSource,
Rect rect = Rect(aOffset.x, aOffset.y, size.width, size.height);
mCanvas->drawRect(RectToSkRect(rect), paint.mPaint);
}
}
TemporaryRef<SourceSurface>
DrawTargetSkia::CreateSourceSurfaceFromData(unsigned char *aData,