Bug 1287492 - WIP
MozReview-Commit-ID: AXNUZvPT91k
--- a/layout/svg/nsFilterInstance.cpp
+++ b/layout/svg/nsFilterInstance.cpp
@@ -354,16 +354,17 @@ nsFilterInstance::ComputeNeededBoxes()
mStrokePaint.mNeededBounds = strokePaintNeededRegion.GetBounds();
}
DrawResult
nsFilterInstance::BuildSourcePaint(SourceInfo *aSource)
{
MOZ_ASSERT(mTargetFrame);
nsIntRect neededRect = aSource->mNeededBounds;
+ neededRect = neededRect.Intersect(mTargetBBoxInFilterSpace);
RefPtr<DrawTarget> offscreenDT =
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
neededRect.Size(), SurfaceFormat::B8G8R8A8);
if (!offscreenDT || !offscreenDT->IsValid()) {
return DrawResult::TEMPORARY_ERROR;
}
@@ -416,16 +417,18 @@ nsFilterInstance::BuildSourceImage()
{
MOZ_ASSERT(mTargetFrame);
nsIntRect neededRect = mSourceGraphic.mNeededBounds;
if (neededRect.IsEmpty()) {
return DrawResult::SUCCESS;
}
+ neededRect = neededRect.Intersect(mTargetBBoxInFilterSpace);
+
RefPtr<DrawTarget> offscreenDT =
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
neededRect.Size(), SurfaceFormat::B8G8R8A8);
if (!offscreenDT || !offscreenDT->IsValid()) {
return DrawResult::TEMPORARY_ERROR;
}
gfxRect r = FilterSpaceToUserSpace(ThebesRect(neededRect));
@@ -547,19 +550,19 @@ nsFilterInstance::OutputFilterSpaceBound
{
uint32_t numPrimitives = mPrimitiveDescriptions.Length();
if (numPrimitives <= 0)
return nsIntRect();
nsIntRect bounds =
mPrimitiveDescriptions[numPrimitives - 1].PrimitiveSubregion();
bool overflow;
- IntSize surfaceSize =
- nsSVGUtils::ConvertToSurfaceSize(bounds.Size(), &overflow);
- bounds.SizeTo(surfaceSize);
+ //IntSize surfaceSize =
+ // nsSVGUtils::ConvertToSurfaceSize(bounds.Size(), &overflow);
+ //bounds.SizeTo(surfaceSize);
return bounds;
}
nsIntRect
nsFilterInstance::FrameSpaceToFilterSpace(const nsRect* aRect) const
{
nsIntRect rect = OutputFilterSpaceBounds();
if (aRect) {