a22d21e447
When both filter and opacity attributes are set on a leaf node, the opacity must be applied as a separate layer so that the results of the filter are modified by the opacity. Previously in this circumstance we were incorrectly applying the opacity to the paints only (without a layer). To illustrate: <svg viewBox="0 0 1000 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="Green" x="0%" y="0%" width="100%" height="100%"> <feFlood flood-color="lime" flood-opacity="1" /> </filter> </defs> <rect x="30" y="20" width="400" height="100" fill="red" opacity="0.1" filter="url(#Green)"/> <g filter="url(#Green)"> <rect x="30" y="200" width="400" height="100" fill="red" opacity="0.1"/> </g> </svg> The two rects should render differently. In the <g> case, the filter output (opaque green) overrides the translucent red pixels of the rect. In the <rect> case, the filter output overrides the translucent red pixels with opaque green, but then is modified by the opacity on the <rect>. Relevant W3C test is filters-blend-01-b (and possibly others). Change-Id: I165eed36c546f1f99457865cee58ee2b3bffe6f1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354879 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Tyler Denniston <tdenniston@google.com> |
||
---|---|---|
.. | ||
SkSVGAttribute.h | ||
SkSVGAttributeParser.h | ||
SkSVGCircle.h | ||
SkSVGClipPath.h | ||
SkSVGContainer.h | ||
SkSVGDefs.h | ||
SkSVGDOM.h | ||
SkSVGEllipse.h | ||
SkSVGFe.h | ||
SkSVGFeColorMatrix.h | ||
SkSVGFeComposite.h | ||
SkSVGFeFlood.h | ||
SkSVGFeGaussianBlur.h | ||
SkSVGFeOffset.h | ||
SkSVGFeTurbulence.h | ||
SkSVGFilter.h | ||
SkSVGFilterContext.h | ||
SkSVGG.h | ||
SkSVGGradient.h | ||
SkSVGHiddenContainer.h | ||
SkSVGIDMapper.h | ||
SkSVGLine.h | ||
SkSVGLinearGradient.h | ||
SkSVGMask.h | ||
SkSVGNode.h | ||
SkSVGPath.h | ||
SkSVGPattern.h | ||
SkSVGPoly.h | ||
SkSVGRadialGradient.h | ||
SkSVGRect.h | ||
SkSVGRenderContext.h | ||
SkSVGShape.h | ||
SkSVGStop.h | ||
SkSVGSVG.h | ||
SkSVGText.h | ||
SkSVGTransformableNode.h | ||
SkSVGTypes.h | ||
SkSVGUse.h | ||
SkSVGValue.h |