Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LBSE] Implement support for patterns #22427

Conversation

rwlbuis
Copy link
Contributor

@rwlbuis rwlbuis commented Jan 5, 2024

db4c995

[LBSE] Implement support for patterns
https://bugs.webkit.org/show_bug.cgi?id=267041

Reviewed by Nikolas Zimmermann.

Implement pattern support using a different approach to legacy including the
use of RenderLayer::paintSVGLayer ro paint the pattern contents. Right now
there is no caching of pattern tiles (unlike in legacy) at all to keep things simple.

Note that there are still various pattern test failures due to problems with hidpi.

Adding convenient pattern API for stroke painting in GraphicsContext is left for later (see SVGInlineTextBox.cpp).

* LayoutTests/platform/mac-sonoma-wk2-lbse-text/TestExpectations:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/W3C-SVG-1.1/pservers-grad-03-b-expected.txt:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/batik/paints/patternRegionA-expected.txt:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/absolute-root-position-masking-expected.txt:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/absolute-sized-content-with-resources-expected.png:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/js-update-pattern-child-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/js-update-pattern-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/oversized-pattern-scale-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-cycle-detection-expected.png: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-cycle-detection-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-excessive-malloc-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-in-defs-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-no-pixelation-expected.png: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-no-pixelation-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-rotate-gaps-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-size-bigger-than-target-size-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-userSpaceOnUse-userToBaseTransform-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-y-offset-expected.png: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-y-offset-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pending-resource-after-removal-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/recursive-pattern-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/repaint/pattern-object-bounding-box-update-pattern-content-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/repaint/pattern-user-space-on-use-update-pattern-content-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-pixel/svg/custom/pattern-no-pixelation-expected.png:
* LayoutTests/platform/mac-sonoma-wk2-pixel/svg/custom/pattern-skew-transformed-expected.png: Removed.
* LayoutTests/platform/mac-sonoma-wk2-pixel/svg/custom/pattern-y-offset-expected.png:
* LayoutTests/platform/mac-sonoma-wk2-pixel/svg/custom/recursive-pattern-expected.png:
* LayoutTests/svg/repaint/pattern-object-bounding-box-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box-transformed-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box-transformed.html: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box-update-pattern-content-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box-update-pattern-content.html: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box.html: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-transformed-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-transformed.html: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-update-pattern-content-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-update-pattern-content.html: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use.html: Added.
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/rendering/ReferencedSVGResources.cpp:
(WebCore::ReferencedSVGResources::referencedSVGResourceIDs):
(WebCore::ReferencedSVGResources::referencedPaintServerElement):
* Source/WebCore/rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::svgFillPaintServerResourceFromStyle const):
(WebCore::RenderLayerModelObject::svgStrokePaintServerResourceFromStyle const):
* Source/WebCore/rendering/RenderObject.h:
(WebCore::RenderObject::isRenderSVGResourcePaintServer const):
(WebCore::RenderObject::isRenderSVGResourcePattern const):
* Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp: Added.
(WebCore::RenderSVGResourcePattern::RenderSVGResourcePattern):
(WebCore::RenderSVGResourcePattern::collectPatternAttributesIfNeeded):
(WebCore::clear2DRotation):
(WebCore::RenderSVGResourcePattern::buildPattern):
(WebCore::RenderSVGResourcePattern::prepareFillOperation):
(WebCore::RenderSVGResourcePattern::prepareStrokeOperation):
(WebCore::RenderSVGResourcePattern::buildTileImageTransform const):
(WebCore::RenderSVGResourcePattern::createTileImage const):
* Source/WebCore/rendering/svg/RenderSVGResourcePattern.h: Added.
(WebCore::RenderSVGResourcePattern::invalidatePattern):
* Source/WebCore/rendering/svg/RenderSVGResourcePatternInlines.h: Added.
(WebCore::RenderSVGResourcePattern::patternElement const):
(WebCore::calculatePatternBoundaries):
* Source/WebCore/rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::acquirePaintingResource):
(WebCore::SVGInlineTextBox::releasePaintingResource):
(WebCore::SVGInlineTextBox::paintTextWithShadows):
* Source/WebCore/rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGHitTestCycleDetectionScope::SVGHitTestCycleDetectionScope):
(WebCore::SVGHitTestCycleDetectionScope::~SVGHitTestCycleDetectionScope):
* Source/WebCore/rendering/svg/SVGRenderSupport.h:
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourcePattern.cpp:
(WebCore::LegacyRenderSVGResourcePattern::LegacyRenderSVGResourcePattern):
* Source/WebCore/svg/SVGElement.cpp:
(WebCore::isSVGLayerAwareElement):
* Source/WebCore/svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::svgAttributeChanged):
(WebCore::SVGPatternElement::createElementRenderer):

Canonical link: https://commits.webkit.org/273757@main

f20df52

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@rwlbuis rwlbuis self-assigned this Jan 5, 2024
@rwlbuis rwlbuis added the SVG For bugs in the SVG implementation. label Jan 5, 2024
@rwlbuis
Copy link
Contributor Author

rwlbuis commented Jan 5, 2024

This mostly follows the legacy pattern code.
Note:

  • currently support for pattern stroke on text is a quick hack.
  • it seems needed to check for cycles by hand
  • transform and pattern may need to be separated. But the biggest question at the moment is, why does x/y > 0 not have a visual effect on first rect in W3C-SVG-1.1/pservers-pattern-01-b.svg?

Copy link
Contributor

@nikolaszimmermann nikolaszimmermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start! Needs to move away from some pre-LBSE idioms that involve SVGRenderingContext.

Source/WebCore/WebCore.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
if (!buildTileImageTransform(renderer, *m_attributes, patternElement(), tileBoundaries, tileImageTransform))
return nullptr;

auto absoluteTransform = SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(renderer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beware, this is legacy code. In LBSE this won't give correct answers. You probably need to use SVGLayerTransformComputation directly:

auto transform = SVGLayerTransformComputation(child).computeAccumulatedTransform(&renderer, TransformState::TrackSVGCTMMatrix);

since you do need access to the CTM, to extract the xScale/yScale.

The float calculateScreenFontSizeScalingFactor() const helper function in SVGLayerTransformComputation has the same purpose (it just returns sqrt((xScale^2+yScale^2)/2). You could add a helper to return a FloatSize with xScale, yScale, or a std::tuple<float, float>, so one could use structured-binding and use something like "auto [xScale, yScale] = SVGLayerTransformComputation(..).calculateXYCTMScaleForRenderer(..)".

Whatever you prefer :-)

return true;
}

static inline FloatRect calculatePatternBoundaries(const PatternAttributes& attributes, const FloatRect& objectBoundingBox, const SVGPatternElement& patternElement)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be moved into RenderSVGResourcePatternInlines.h


auto tileSize = roundedUnscaledImageBufferSize(size, scale);

// FIXME: Use createImageBuffer(rect, scale), delete the above calculations and fix 'tileImageTransform'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that yours?

for (auto& child : childrenOfType<SVGElement>(*attributes.patternContentElement())) {
if (!child.renderer())
continue;
SVGRenderingContext::renderSubtreeToContext(tileImageContext, *child.renderer(), contentTransformation);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is all legacy stuff, SVGRenderingContext does not work for LBSE. Transformations would be broken, rendering at wrong spots -- you need to paint/hit-test via layers, not using the render tree.

Excerpt from downstream RenderSVGResourcePattern:

    auto* patternRenderer = static_cast<RenderSVGResourcePattern*>(attributes.patternContentElement()->renderer());
    ASSERT(patternRenderer);
    ASSERT(patternRenderer->hasLayer());
    
    // Draw the content into the ImageBuffer.
    patternRenderer->layer()->paintSVGResourceLayer(tileImageContext, LayoutRect::infiniteRect(), tileImageTransform);

usedContext->setCompositeOperation(CompositeOperator::DestinationIn);
usedContext->beginTransparencyLayer(1);
} else if (usedContext->strokePattern()) {
usedContext->setFillPattern(*usedContext->strokePattern());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also want to extend GraphicsContext :-) a fillRect(const FloatRect&, Pattern&) variant, would allow you to avoid the state mutation here. (Note: you also need to assure it's reset correctly, the current restore() time is too lat probably)

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 5, 2024
@rwlbuis rwlbuis removed the merging-blocked Applied to prevent a change from being merged label Jan 5, 2024
@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from ada1fd7 to c09ba71 Compare January 5, 2024 18:35
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 5, 2024
@rwlbuis rwlbuis removed the merging-blocked Applied to prevent a change from being merged label Jan 8, 2024
@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from c09ba71 to 6e3983a Compare January 8, 2024 16:13
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 8, 2024
@rwlbuis rwlbuis removed the merging-blocked Applied to prevent a change from being merged label Jan 11, 2024
@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from 6e3983a to 71ef40c Compare January 11, 2024 10:37
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 11, 2024
@rwlbuis rwlbuis removed the merging-blocked Applied to prevent a change from being merged label Jan 11, 2024
@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from 71ef40c to cddb8c0 Compare January 11, 2024 19:09
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 11, 2024
@rwlbuis rwlbuis removed the merging-blocked Applied to prevent a change from being merged label Jan 15, 2024
@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from cddb8c0 to 72bb42b Compare January 15, 2024 15:59
Copy link
Contributor

@nikolaszimmermann nikolaszimmermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great patch, almost r+. New repaint tests would be great too

@@ -2839,6 +2839,8 @@ void RenderLayer::paintSVGResourceLayer(GraphicsContext& context, GraphicsContex
auto localPaintDirtyRect = LayoutRect::infiniteRect();

auto* rootPaintingLayer = enclosingSVGRootLayer();
if (is<RenderSVGHiddenContainer>(parent()->renderer()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is tricky. It fixes custom/pattern-userSpaceOnUse-userToBaseTransform.xhtml.
The outer svg's have a 1px border which is mistakenly taken into account (before that change) and offsets the pattern contents by 1x1, showing the red rectangle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it deserves a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think I'll leave out this part, it breaks recursive-mask.svg and maybe some others. We'll have to visit this 1px border problem later...

Source/WebCore/rendering/RenderLayer.cpp Outdated Show resolved Hide resolved
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp Outdated Show resolved Hide resolved

bool RenderSVGResourcePattern::buildPatternIfNeeded(GraphicsContext& context, const RenderLayerModelObject& targetRenderer)
{
collectPatternAttributesIfNeeded();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for gradients this returns a bool, false indicating early exit due to empty bbox- why not mirror it 1:1 here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made collectPatternAttributesIfNeeded do more checks.

Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp Outdated Show resolved Hide resolved
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp Outdated Show resolved Hide resolved
if (gradient)
usedContext->fillRect(textRootBlock->repaintRectInLocalCoordinates(), *gradient, gradientSpaceTransform);
else {
GraphicsContextStateSaver stateSaver(*usedContext);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would then check if a fillRect(FloatRect,Pattern&) exists to avoid that state swap

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you plan to take this in a separated PR?

Source/WebCore/rendering/svg/SVGRenderingContext.h Outdated Show resolved Hide resolved
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 15, 2024
@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from 9d98f15 to 36271bc Compare January 22, 2024 16:44
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 22, 2024
@rwlbuis rwlbuis removed the merging-blocked Applied to prevent a change from being merged label Jan 29, 2024
@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from 36271bc to 7e5a8d8 Compare January 29, 2024 17:08
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 29, 2024
@rwlbuis rwlbuis removed the merging-blocked Applied to prevent a change from being merged label Jan 29, 2024
@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from 7e5a8d8 to 9c241b9 Compare January 29, 2024 19:34
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 29, 2024
@rwlbuis rwlbuis removed the merging-blocked Applied to prevent a change from being merged label Jan 29, 2024
@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from 9c241b9 to da9ee70 Compare January 29, 2024 21:43
Copy link
Contributor

@nikolaszimmermann nikolaszimmermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, r=me with a few comments left:

Source/WebCore/WebCore.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp Outdated Show resolved Hide resolved

auto patternTransform = m_attributes->patternTransform();
if (!patternTransform.isIdentity())
patternSpaceTransform = patternTransform * patternSpaceTransform;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we usually call multiply instead of invoking operators, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have not used these APIs in a long time :-) Fixed.

Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp Outdated Show resolved Hide resolved
context.setAlpha(svgStyle.strokeOpacity());
SVGRenderSupport::applyStrokeStyleToContext(context, style, targetRenderer);
if (svgStyle.vectorEffect() == VectorEffect::NonScalingStroke) {
if (is<RenderSVGShape>(targetRenderer))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two if conditions should be unified into one to make this slightly better readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that does not really work:
if (auto* shape = dynamicDowncast(targetRenderer) ; svgStyle.vectorEffect() == VectorEffect::NonScalingStroke) {

Then we may set shape without using it.

@rwlbuis rwlbuis force-pushed the eng/LBSE-Implement-support-for-patterns branch from da9ee70 to f20df52 Compare January 30, 2024 12:48
Copy link
Contributor

@nikolaszimmermann nikolaszimmermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@rwlbuis rwlbuis added the merge-queue Applied to send a pull request to merge-queue label Jan 30, 2024
@webkit-ews-buildbot webkit-ews-buildbot added merging-blocked Applied to prevent a change from being merged and removed merge-queue Applied to send a pull request to merge-queue labels Jan 30, 2024
@rwlbuis rwlbuis added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Jan 30, 2024
https://bugs.webkit.org/show_bug.cgi?id=267041

Reviewed by Nikolas Zimmermann.

Implement pattern support using a different approach to legacy including the
use of RenderLayer::paintSVGLayer ro paint the pattern contents. Right now
there is no caching of pattern tiles (unlike in legacy) at all to keep things simple.

Note that there are still various pattern test failures due to problems with hidpi.

Adding convenient pattern API for stroke painting in GraphicsContext is left for later (see SVGInlineTextBox.cpp).

* LayoutTests/platform/mac-sonoma-wk2-lbse-text/TestExpectations:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/W3C-SVG-1.1/pservers-grad-03-b-expected.txt:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/batik/paints/patternRegionA-expected.txt:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/absolute-root-position-masking-expected.txt:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/absolute-sized-content-with-resources-expected.png:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/js-update-pattern-child-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/js-update-pattern-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/oversized-pattern-scale-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-cycle-detection-expected.png: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-cycle-detection-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-excessive-malloc-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-in-defs-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-no-pixelation-expected.png: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-no-pixelation-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-rotate-gaps-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-size-bigger-than-target-size-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-userSpaceOnUse-userToBaseTransform-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-y-offset-expected.png: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pattern-y-offset-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/pending-resource-after-removal-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/custom/recursive-pattern-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/repaint/pattern-object-bounding-box-update-pattern-content-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/repaint/pattern-user-space-on-use-update-pattern-content-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-pixel/svg/custom/pattern-no-pixelation-expected.png:
* LayoutTests/platform/mac-sonoma-wk2-pixel/svg/custom/pattern-skew-transformed-expected.png: Removed.
* LayoutTests/platform/mac-sonoma-wk2-pixel/svg/custom/pattern-y-offset-expected.png:
* LayoutTests/platform/mac-sonoma-wk2-pixel/svg/custom/recursive-pattern-expected.png:
* LayoutTests/svg/repaint/pattern-object-bounding-box-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box-transformed-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box-transformed.html: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box-update-pattern-content-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box-update-pattern-content.html: Added.
* LayoutTests/svg/repaint/pattern-object-bounding-box.html: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-transformed-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-transformed.html: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-update-pattern-content-expected.txt: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use-update-pattern-content.html: Added.
* LayoutTests/svg/repaint/pattern-user-space-on-use.html: Added.
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/rendering/ReferencedSVGResources.cpp:
(WebCore::ReferencedSVGResources::referencedSVGResourceIDs):
(WebCore::ReferencedSVGResources::referencedPaintServerElement):
* Source/WebCore/rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::svgFillPaintServerResourceFromStyle const):
(WebCore::RenderLayerModelObject::svgStrokePaintServerResourceFromStyle const):
* Source/WebCore/rendering/RenderObject.h:
(WebCore::RenderObject::isRenderSVGResourcePaintServer const):
(WebCore::RenderObject::isRenderSVGResourcePattern const):
* Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp: Added.
(WebCore::RenderSVGResourcePattern::RenderSVGResourcePattern):
(WebCore::RenderSVGResourcePattern::collectPatternAttributesIfNeeded):
(WebCore::clear2DRotation):
(WebCore::RenderSVGResourcePattern::buildPattern):
(WebCore::RenderSVGResourcePattern::prepareFillOperation):
(WebCore::RenderSVGResourcePattern::prepareStrokeOperation):
(WebCore::RenderSVGResourcePattern::buildTileImageTransform const):
(WebCore::RenderSVGResourcePattern::createTileImage const):
* Source/WebCore/rendering/svg/RenderSVGResourcePattern.h: Added.
(WebCore::RenderSVGResourcePattern::invalidatePattern):
* Source/WebCore/rendering/svg/RenderSVGResourcePatternInlines.h: Added.
(WebCore::RenderSVGResourcePattern::patternElement const):
(WebCore::calculatePatternBoundaries):
* Source/WebCore/rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::acquirePaintingResource):
(WebCore::SVGInlineTextBox::releasePaintingResource):
(WebCore::SVGInlineTextBox::paintTextWithShadows):
* Source/WebCore/rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGHitTestCycleDetectionScope::SVGHitTestCycleDetectionScope):
(WebCore::SVGHitTestCycleDetectionScope::~SVGHitTestCycleDetectionScope):
* Source/WebCore/rendering/svg/SVGRenderSupport.h:
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourcePattern.cpp:
(WebCore::LegacyRenderSVGResourcePattern::LegacyRenderSVGResourcePattern):
* Source/WebCore/svg/SVGElement.cpp:
(WebCore::isSVGLayerAwareElement):
* Source/WebCore/svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::svgAttributeChanged):
(WebCore::SVGPatternElement::createElementRenderer):

Canonical link: https://commits.webkit.org/273757@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/LBSE-Implement-support-for-patterns branch from f20df52 to db4c995 Compare January 30, 2024 16:14
@webkit-commit-queue
Copy link
Collaborator

Committed 273757@main (db4c995): https://commits.webkit.org/273757@main

Reviewed commits have been landed. Closing PR #22427 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jan 30, 2024
@webkit-commit-queue webkit-commit-queue merged commit db4c995 into WebKit:main Jan 30, 2024
@rwlbuis rwlbuis deleted the eng/LBSE-Implement-support-for-patterns branch January 31, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SVG For bugs in the SVG implementation.
Projects
None yet
5 participants