haikuwebkit/LayoutTests/svg/custom/resources-css-scaled-expect...

49 lines
1.2 KiB
HTML
Raw Permalink Normal View History

SVG Pattern pixelated on inline SVG with CSS transforms https://bugs.webkit.org/show_bug.cgi?id=111587 Reviewed by Dirk Schulze. Source/WebCore: When calculating the resolution for resource image buffers, we need to also consider CSS transforms. This patch updates calculateTransformationToOutermostSVGCoordinateSystem() (renamed to calculateTransformationToOutermostCoordinateSystem) to include the affine component from CSS transforms by walking the parent layer tree. Test: svg/custom/resources-css-scaled.html * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::applyClippingToContext): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::applyResource): * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::createMaskAndSwapContextForTextGradient): (WebCore::clipToTextMask): * rendering/svg/RenderSVGResourceMasker.cpp: (WebCore::RenderSVGResourceMasker::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::buildPattern): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::calculateScreenFontSizeScalingFactor): (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem): * rendering/svg/SVGRenderingContext.h: (SVGRenderingContext): LayoutTests: * svg/custom/resources-css-scaled-expected.html: Added. * svg/custom/resources-css-scaled.html: Added. Canonical link: https://commits.webkit.org/130467@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-03-12 14:38:48 +00:00
<!DOCTYPE html>
<html>
<body>
<div style="position: relative; left: 27px; width: 100px;">
<div style="width: 50px;">
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="pattern" width="100" height="100" patternUnits="userSpaceOnUse">
<circle cx="50" cy="50" r="50" fill="green"/>
</pattern>
<mask id="mask">
<circle cx="50" cy="50" r="50" fill="white"/>
</mask>
<clipPath id="clip">
<circle cx="50" cy="50" r="50"/>
<circle cx="50" cy="50" r="50"/>
</clipPath>
<filter id="filter">
<feOffset dx="0" dy="0"/>
</filter>
</defs>
<circle cx="50" cy="50" r="50" fill="green"/>
<g transform="translate(300)">
<rect width="100" height="100" fill="url(#pattern)"></rect>
</g>
<g transform="translate(150 150)">
<rect width="100" height="100" fill="green" mask="url(#mask)"/>
</g>
<g transform="translate(0 300)">
<rect width="100" height="100" fill="green" clip-path="url(#clip)"/>
</g>
<g transform="translate(300 300)">
<circle cx="50" cy="50" r="50" fill="green" filter="url(#filter)"/>
</g>
</svg>
</div>
</div>
</body>
</html>