зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
62e1981ac7
Коммит
b452c90e96
|
@ -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);
|
||||
aDestDT.CreateSimilarDrawTarget(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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче