Skip to content

Commit

Permalink
Build fix when LAYER_BASED_SVG_ENGINE is off
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270213

Reviewed by Fujii Hironori.

Build fix by checking LAYER_BASED_SVG_ENGINE option.

* Source/WebCore/rendering/svg/RenderSVGResourceMarker.h:
* Source/WebCore/rendering/svg/RenderSVGResourceMasker.h:
* Source/WebCore/svg/SVGClipPathElement.cpp:
* Source/WebCore/svg/SVGMaskElement.cpp:

Canonical link: https://commits.webkit.org/275668@main
  • Loading branch information
tKnmori committed Mar 5, 2024
1 parent 9fc59f1 commit 5651f99
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WebCore/rendering/svg/RenderSVGResourceMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "RenderSVGResourceContainer.h"
#include "SVGMarkerTypes.h"

#if ENABLE(LAYER_BASED_SVG_ENGINE)

namespace WebCore {

class GraphicsContext;
Expand Down Expand Up @@ -76,3 +78,5 @@ class RenderSVGResourceMarker final : public RenderSVGResourceContainer {
}

SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGResourceMarker, isRenderSVGResourceMarker())

#endif // ENABLE(LAYER_BASED_SVG_ENGINE)
4 changes: 4 additions & 0 deletions Source/WebCore/rendering/svg/RenderSVGResourceMasker.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include <wtf/HashMap.h>

#if ENABLE(LAYER_BASED_SVG_ENGINE)

namespace WebCore {

class GraphicsContext;
Expand Down Expand Up @@ -54,3 +56,5 @@ class RenderSVGResourceMasker final : public RenderSVGResourceContainer {
}

SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGResourceMasker, isRenderSVGResourceMasker())

#endif // ENABLE(LAYER_BASED_SVG_ENGINE)
2 changes: 2 additions & 0 deletions Source/WebCore/svg/SVGClipPathElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ RefPtr<SVGGraphicsElement> SVGClipPathElement::shouldApplyPathClipping() const
FloatRect SVGClipPathElement::calculateClipContentRepaintRect(RepaintRectCalculation repaintRectCalculation)
{
ASSERT(renderer());
#if ENABLE(LAYER_BASED_SVG_ENGINE)
auto transformationMatrixFromChild = [&](const RenderLayerModelObject& child) -> std::optional<AffineTransform> {
if (!document().settings().layerBasedSVGEngineEnabled())
return std::nullopt;
Expand All @@ -182,6 +183,7 @@ FloatRect SVGClipPathElement::calculateClipContentRepaintRect(RepaintRectCalcula
auto transform = SVGLayerTransformComputation(child).computeAccumulatedTransform(downcast<RenderLayerModelObject>(renderer()), TransformState::TrackSVGCTMMatrix);
return transform.isIdentity() ? std::nullopt : std::make_optional(WTFMove(transform));
};
#endif

FloatRect clipContentRepaintRect;
// This is a rough heuristic to appraise the clip size and doesn't consider clip on clip.
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/svg/SVGMaskElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ RenderPtr<RenderElement> SVGMaskElement::createElementRenderer(RenderStyle&& sty
FloatRect SVGMaskElement::calculateMaskContentRepaintRect(RepaintRectCalculation repaintRectCalculation)
{
ASSERT(renderer());
#if ENABLE(LAYER_BASED_SVG_ENGINE)
auto transformationMatrixFromChild = [&](const RenderLayerModelObject& child) -> std::optional<AffineTransform> {
if (!document().settings().layerBasedSVGEngineEnabled())
return std::nullopt;
Expand All @@ -172,6 +173,7 @@ FloatRect SVGMaskElement::calculateMaskContentRepaintRect(RepaintRectCalculation
auto transform = SVGLayerTransformComputation(child).computeAccumulatedTransform(downcast<RenderLayerModelObject>(renderer()), TransformState::TrackSVGCTMMatrix);
return transform.isIdentity() ? std::nullopt : std::make_optional(WTFMove(transform));
};
#endif
FloatRect maskRepaintRect;
for (auto* childNode = firstChild(); childNode; childNode = childNode->nextSibling()) {
CheckedPtr renderer = childNode->renderer();
Expand Down

0 comments on commit 5651f99

Please sign in to comment.