зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
1ed34d5233
Коммит
7db7c28ba4
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче