зеркало из https://github.com/mozilla/gecko-dev.git
Bug 630657 - masks should respect color-interpolation. r=jwatt
This commit is contained in:
Родитель
1309a8a8fa
Коммит
4dab21f0ab
|
@ -157,6 +157,7 @@ nsSVGMaskElement::IsAttributeMapped(const nsIAtom* name) const
|
||||||
sFiltersMap,
|
sFiltersMap,
|
||||||
sFontSpecificationMap,
|
sFontSpecificationMap,
|
||||||
sGradientStopMap,
|
sGradientStopMap,
|
||||||
|
sGraphicsMap,
|
||||||
sMarkersMap,
|
sMarkersMap,
|
||||||
sTextContentElementsMap,
|
sTextContentElementsMap,
|
||||||
sViewportsMap
|
sViewportsMap
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!--
|
||||||
|
Any copyright is dedicated to the Public Domain.
|
||||||
|
http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
-->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
|
||||||
|
<title>Reference that mask defaults to sRGB</title>
|
||||||
|
|
||||||
|
<rect width="100" height="100" x="100" y="100" fill="#FFC0C0"/>
|
||||||
|
|
||||||
|
</svg>
|
После Ширина: | Высота: | Размер: 290 B |
|
@ -0,0 +1,17 @@
|
||||||
|
<!--
|
||||||
|
Any copyright is dedicated to the Public Domain.
|
||||||
|
http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
-->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
|
||||||
|
<title>Testcase that mask defaults to sRGB</title>
|
||||||
|
|
||||||
|
<defs>
|
||||||
|
<mask id="mask" maskContentUnits="objectBoundingBox">
|
||||||
|
<rect width="1" height="1" fill="#3f3f3f" />
|
||||||
|
</mask>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<rect width="100" height="100" x="100" y="100" mask="url(#mask)" fill="#FF0000"/>
|
||||||
|
|
||||||
|
</svg>
|
После Ширина: | Высота: | Размер: 492 B |
|
@ -145,6 +145,7 @@ fails == inline-in-xul-basic-01.xul pass.svg
|
||||||
== marker-attribute-01.svg pass.svg
|
== marker-attribute-01.svg pass.svg
|
||||||
== marker-viewBox-01.svg marker-viewBox-01-ref.svg
|
== marker-viewBox-01.svg marker-viewBox-01-ref.svg
|
||||||
== mask-basic-01.svg pass.svg
|
== mask-basic-01.svg pass.svg
|
||||||
|
== mask-basic-02.svg mask-basic-02-ref.svg
|
||||||
== mask-containing-masked-content-01.svg pass.svg
|
== mask-containing-masked-content-01.svg pass.svg
|
||||||
== mask-transformed-01.svg mask-transformed-01-ref.svg
|
== mask-transformed-01.svg mask-transformed-01-ref.svg
|
||||||
== nested-viewBox-01.svg pass.svg
|
== nested-viewBox-01.svg pass.svg
|
||||||
|
|
|
@ -138,7 +138,10 @@ nsSVGMaskFrame::ComputeMaskAlpha(nsSVGRenderState *aContext,
|
||||||
|
|
||||||
nsIntRect rect(0, 0, surfaceSize.width, surfaceSize.height);
|
nsIntRect rect(0, 0, surfaceSize.width, surfaceSize.height);
|
||||||
nsSVGUtils::UnPremultiplyImageDataAlpha(data, stride, rect);
|
nsSVGUtils::UnPremultiplyImageDataAlpha(data, stride, rect);
|
||||||
nsSVGUtils::ConvertImageDataToLinearRGB(data, stride, rect);
|
if (GetStyleSVG()->mColorInterpolation ==
|
||||||
|
NS_STYLE_COLOR_INTERPOLATION_LINEARRGB) {
|
||||||
|
nsSVGUtils::ConvertImageDataToLinearRGB(data, stride, rect);
|
||||||
|
}
|
||||||
|
|
||||||
for (PRInt32 y = 0; y < surfaceSize.height; y++)
|
for (PRInt32 y = 0; y < surfaceSize.height; y++)
|
||||||
for (PRInt32 x = 0; x < surfaceSize.width; x++) {
|
for (PRInt32 x = 0; x < surfaceSize.width; x++) {
|
||||||
|
@ -160,6 +163,13 @@ nsSVGMaskFrame::ComputeMaskAlpha(nsSVGRenderState *aContext,
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* virtual */ void
|
||||||
|
nsSVGMaskFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||||
|
{
|
||||||
|
nsSVGEffects::InvalidateRenderingObservers(this);
|
||||||
|
nsSVGMaskFrameBase::DidSetStyleContext(aOldStyleContext);
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsSVGMaskFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
nsSVGMaskFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||||
nsIAtom* aAttribute,
|
nsIAtom* aAttribute,
|
||||||
|
|
|
@ -63,6 +63,8 @@ public:
|
||||||
const gfxMatrix &aMatrix,
|
const gfxMatrix &aMatrix,
|
||||||
float aOpacity = 1.0f);
|
float aOpacity = 1.0f);
|
||||||
|
|
||||||
|
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext);
|
||||||
|
|
||||||
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
|
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
|
||||||
nsIAtom* aAttribute,
|
nsIAtom* aAttribute,
|
||||||
PRInt32 aModType);
|
PRInt32 aModType);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче