mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 743444 - Lighting Filter clipped when kernelUnitLength specified. r=roc
This commit is contained in:
parent
827586c908
commit
611dcd8782
@ -100,6 +100,16 @@ CopyRect(const nsSVGFE::Image* aDest, const nsSVGFE::Image* aSrc, const nsIntRec
|
|||||||
aSrc->mImage->Stride(), aDataRect);
|
aSrc->mImage->Stride(), aDataRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
CopyAndScaleDeviceOffset(const gfxImageSurface *aImage, gfxImageSurface *aResult,
|
||||||
|
gfxFloat kernelX, gfxFloat kernelY)
|
||||||
|
{
|
||||||
|
gfxPoint deviceOffset = aImage->GetDeviceOffset();
|
||||||
|
deviceOffset.x /= kernelX;
|
||||||
|
deviceOffset.y /= kernelY;
|
||||||
|
aResult->SetDeviceOffset(deviceOffset);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------Filter Element Base Class-----------------------
|
//--------------------Filter Element Base Class-----------------------
|
||||||
|
|
||||||
nsSVGElement::LengthInfo nsSVGFE::sLengthInfo[4] =
|
nsSVGElement::LengthInfo nsSVGFE::sLengthInfo[4] =
|
||||||
@ -181,6 +191,10 @@ nsSVGFE::SetupScalingFilter(nsSVGFilterInstance *aInstance,
|
|||||||
result.mTarget = nsnull;
|
result.mTarget = nsnull;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CopyAndScaleDeviceOffset(aSource->mImage, result.mSource, kernelX, kernelY);
|
||||||
|
CopyAndScaleDeviceOffset(aTarget->mImage, result.mTarget, kernelX, kernelY);
|
||||||
|
|
||||||
result.mRealTarget = aTarget->mImage;
|
result.mRealTarget = aTarget->mImage;
|
||||||
|
|
||||||
gfxContext ctx(result.mSource);
|
gfxContext ctx(result.mSource);
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<defs>
|
||||||
|
<filter id="emboss">
|
||||||
|
<feGaussianBlur in="SourceAlpha" stdDeviation="3" result="blur"/>
|
||||||
|
<!-- without kernelUnitLength attribute -->
|
||||||
|
<feSpecularLighting in="blur" result="spec" surfaceScale="-3"
|
||||||
|
specularConstant="2" specularExponent="16"
|
||||||
|
lighting-color="#ffb155">
|
||||||
|
<feDistantLight azimuth="45" elevation="45"/>
|
||||||
|
</feSpecularLighting>
|
||||||
|
<feComposite in="spec" in2="SourceGraphic" operator="in" result="specOut"/>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
<path filter="url(#emboss)" d="M 44.408917,5.7095287 C 535.13945,101.91182 534.01725,101.52506 532.53904,101.52499 C 531.36871,101.52506 530.17420,101.85117 528.96683,102.49024 z "/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 809 B |
15
layout/reftests/svg/filters/filter-kernelUnitLength-01.svg
Normal file
15
layout/reftests/svg/filters/filter-kernelUnitLength-01.svg
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<defs>
|
||||||
|
<filter id="emboss">
|
||||||
|
<feGaussianBlur in="SourceAlpha" stdDeviation="3" result="blur"/>
|
||||||
|
<!-- with kernelUnitLength attribute -->
|
||||||
|
<feSpecularLighting in="blur" result="spec" surfaceScale="-3"
|
||||||
|
specularConstant="2" specularExponent="16"
|
||||||
|
lighting-color="#ffb155" kernelUnitLength="1">
|
||||||
|
<feDistantLight azimuth="45" elevation="45"/>
|
||||||
|
</feSpecularLighting>
|
||||||
|
<feComposite in="spec" in2="SourceGraphic" operator="in" result="specOut"/>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
<path filter="url(#emboss)" d="M 44.408917,5.7095287 C 535.13945,101.91182 534.01725,101.52506 532.53904,101.52499 C 531.36871,101.52506 530.17420,101.85117 528.96683,102.49024 z "/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 827 B |
@ -54,6 +54,7 @@ random-if(d2d) == filter-filterRes-low-01.svg pass.svg
|
|||||||
== filter-inner-svg-02.svg pass.svg
|
== filter-inner-svg-02.svg pass.svg
|
||||||
== filter-inner-svg-03.svg pass.svg
|
== filter-inner-svg-03.svg pass.svg
|
||||||
fails == filter-marked-line-01.svg pass.svg # bug 477704
|
fails == filter-marked-line-01.svg pass.svg # bug 477704
|
||||||
|
== filter-kernelUnitLength-01.svg filter-kernelUnitLength-01-ref.svg
|
||||||
== filter-marked-line-02.svg pass.svg
|
== filter-marked-line-02.svg pass.svg
|
||||||
== filter-marked-line-03.svg pass.svg
|
== filter-marked-line-03.svg pass.svg
|
||||||
== filter-marked-line-04.svg pass.svg
|
== filter-marked-line-04.svg pass.svg
|
||||||
|
Loading…
Reference in New Issue
Block a user