Bug 1296665: gfxBlur should attempt to create a box shadow for the correct type of DrawTarget. r=mchang

MozReview-Commit-ID: 5J3GwKya83w
This commit is contained in:
Bas Schouten 2016-09-15 13:53:12 +02:00
Родитель 2f144c36e0
Коммит 8f48ecccca
1 изменённых файлов: 4 добавлений и 5 удалений

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

@ -491,12 +491,11 @@ CreateBlurMask(const IntSize& aMinSize,
}
static already_AddRefed<SourceSurface>
CreateBoxShadow(SourceSurface* aBlurMask, const Color& aShadowColor)
CreateBoxShadow(DrawTarget& aDestDT, SourceSurface* aBlurMask, const Color& aShadowColor)
{
IntSize blurredSize = aBlurMask->GetSize();
gfxPlatform* platform = gfxPlatform::GetPlatform();
RefPtr<DrawTarget> boxShadowDT =
platform->CreateOffscreenContentDrawTarget(blurredSize, SurfaceFormat::B8G8R8A8);
Factory::CreateDrawTarget(aDestDT.GetBackendType(), blurredSize, SurfaceFormat::B8G8R8A8);
if (!boxShadowDT) {
return nullptr;
@ -553,7 +552,7 @@ GetBlur(gfxContext* aDestinationCtx,
return nullptr;
}
RefPtr<SourceSurface> boxShadow = CreateBoxShadow(blurMask, aShadowColor);
RefPtr<SourceSurface> boxShadow = CreateBoxShadow(destDT, blurMask, aShadowColor);
if (!boxShadow) {
return nullptr;
}
@ -913,7 +912,7 @@ gfxAlphaBoxBlur::GetInsetBlur(const mozilla::gfx::Rect aOuterRect,
}
// Fill in with the color we actually wanted
RefPtr<SourceSurface> minInsetBlur = CreateBoxShadow(minMask, aShadowColor);
RefPtr<SourceSurface> minInsetBlur = CreateBoxShadow(*aDestDrawTarget, minMask, aShadowColor);
if (!minInsetBlur) {
return nullptr;
}